Add ControlURL
This PR adds the functionality to select the controlURL via env variable.
The small addition was driven by the desire to use caddy-tailscale with headscale.
EDIT: Just saw #18 and will try to apply the mentioned config option to this PR.
I have not found any documentation for config options for network listeners, hence the hijacking of the address field.
If there are any better config options for network listeners, feel free to point them out and I will update this PR accordingly.
I definitely want to pivot to using caddy configuration for any future options like this. I kinda wish I had done it for auth keys as well, but that's already done.
I think adding config options for a network listener should work the same as any other caddy directive? I haven't looked closely myself, but it tends to all be pretty consistent. I don't mind doing the initial change to establish the config, which will make future additions like this much simpler. I just probably won't be able to get to it until later in the week
Sounds good.
From my understanding there are no config options for simple listeners/networks. Simple means if you register with caddy.RegisterNetwork(...). If "real" config options for the network part is needed/wanted, it should be a module and not just a network. This could probably look something like caddy-ngrok-listener. Happy to be corrected, but this is my understanding of Caddy docs
I agree having proper config support is beneficial. I will wait with further implementation for your general direction where you want to go with config options.
If the general structure is established the authkey could also be integrated but still overridden from env var for backwards compatibility.