Open iliana opened 1 year ago
I suspect this will interfere with plugins like https://github.com/lucaslorentz/caddy-docker-proxy which dynamically generate config.
I'm not able to reproduce this now, so I'm fairly certain it got fixed in #30, which added proper listener shutdown. Could you try again with the latest version of the plugin, and see if you still run into this behavior?
I don't have anything presently using this plugin so I can only agree with "likely fixed".
I've just run into this myself, using caddy-docker-proxy, as AstraLuma mentioned
After updating the base Caddyfile, it will begin to fail On a fresh restart it does work just fine, similar to what iliana mentioned
I wonder if it could be due to what looks like caddy starting new apps before it stops old ones?: https://github.com/caddyserver/caddy/blob/4ef360745dab1023a7d4c04aebca3d05499dd5e1/caddy.go#L342-L355
So I've tried out a horrible proof of concept, basically just lifting caddy's listenReusable
(the non-unix version) to wrap the Listeners + PacketConns from tsnet and it seems to resolve the issue.
Though I also haven't checked out what run-on impacts there are for that
The usual systemd unit for caddy includes an
ExecReload=
option:When this is run on a caddy service that already connected to Tailscale, we get this error:
loading config: loading new config: http app module: start: listening on tailscale/nitter:80: tsnet: listener already open for tailscale, :80
Restarting the service works fine, as expected.
Full Caddyfile (most of this is boilerplate from my usual template):
``` { admin localhost:2019 email iliana@buttslol.net } (global) { encode zstd gzip handle_errors { respond "{http.error.status_code} {http.error.status_text}" } header cache-control "public, max-age=0, must-revalidate" log { output file /var/log/caddy/access.log } } :80 { bind tailscale/nitter respond / "butts" } ```