opnsense / plugins

OPNsense plugin collection
https://opnsense.org/
BSD 2-Clause "Simplified" License
810 stars 593 forks source link

Caddy: Allow Dynamic DNS to use a TTL shorter than `3600` (`1h`) for Caddy-managed DNS records #4037

Closed no-usernames-left closed 2 weeks ago

no-usernames-left commented 3 weeks ago

Important notices

Is your feature request related to a problem? Please describe. With a TTL of 3600, outages of almost an hour could occur between when the IP changes and the network reconverges when the TTL of the stale record times out.

Many DNS providers support TTLs as low as 300 seconds (and indeed this is the value I'd rather use); perhaps this should be the minimum value acceptable here.

Describe the solution you'd like In Caddy Web Server - General Settings, change DynDns TTL to take a number of seconds instead of a number of hours (and label the input field with seconds for safety).

Also, add a migration from existing installs which multiplies that value by 3600 and re-saves the settings.

Monviech commented 3 weeks ago

I'll evaluate this. Sounds like a good idea to change it to seconds.

Monviech commented 3 weeks ago

You can test it by changing h to s here:

https://github.com/opnsense/plugins/blob/508864dd891a8f618fa3e8ec0a8db6627fdec08f/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile#L339

File is here on the opnsense:

/usr/local/opnsense/service/templates/OPNsense/Caddy/Caddyfile

Please only change that one thing, don't copy the whole file in there.

no-usernames-left commented 3 weeks ago

Please only change that one thing, don't copy the whole file in there.

Thank you for the hotfix, but since I see the PR I will wait. In the meantime I have a different solution for Dynamic DNS which will get me by until the package is bumped.