oznu / docker-cloudflare-ddns

A small amd64/ARM/ARM64 Docker image that allows you to use CloudFlare as a DDNS / DynDNS Provider.
https://hub.docker.com/r/oznu/cloudflare-ddns/
GNU General Public License v3.0
1.08k stars 219 forks source link

Req: Add env variable to set A Record TTL #23

Closed projx closed 4 years ago

projx commented 4 years ago

Hi

It looks like the TTL is always set to 3hrs, even if I manually set this in the Cloudflare Web UI to 2 minutes, the script resets it to 3hrs each time it updates.

Could you add an environmental variable, so we can specify what the TTL should be set too?

Thanks

JakeWharton commented 4 years ago

This could potentially be mitigated by switching to use HTTP PATCH instead of HTTP POST in the script.

https://api.cloudflare.com/#dns-records-for-a-zone-patch-dns-record

oznu commented 4 years ago

The TTL was being set to 180 after a recent update.

I've made a change so that created records will now have the TTL set to "Auto" and the update record method does not change the TTL from what is set in CloudFlare.