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

getZoneId is always using the ZONE environment variable, even when ZONE_FILE is set. #90

Open devantler opened 2 years ago

devantler commented 2 years ago

I am currently setting up a repo for easily setting up a fully managed cluster with Portainer and Docker Swarm. Right now I am using this service to update DDNS on Cloudflare as it is very helpful in avoiding dependency on scripts or router-based DDNS updates.

Because my repo is planned to be public I want to ensure all sensitive information is added with Docker Secrets. Right now the ZONE_FILE and SUBDOMAIN_FILE are not working with Docker Secrets which requires me to write the values in the compose file using ZONE and SUBDOMAIN environment variables.

The API_KEY_FILE works just fine, so i think it is an easy fix :-)

devantler commented 2 years ago

The fix should enable Docker Secret users to only have to add the ***_KEY_FILE variables as they overwrite the non KEY_FILE variables, and as such the non KEY_FILE variables are not required.

devantler commented 2 years ago

To fix this I believe getZoneId should have a parameter so that the correctly populated ZONE value in 30-cloudflare-setup.sh can be passed along, when ZONE is set from ZONE_FILE.

djkenne commented 2 years ago

Yes I found the same thing. API_KEY_FILE works just fine with a Docker secret via CLI or Compose while ZONE_FILE and SUBDOMAIN_FILE do not work. The README suggests that the latter two are supported while the docs on Docker Hub do not mention them.

Thanks for this project by the way - very handy!

djkenne commented 2 years ago

Looks like this was fixed and merged already: https://github.com/oznu/docker-cloudflare-ddns/commit/a96b637d72f025a4d50dbcd4e0321d0300339858

Maybe just need to cut a release?