cloudflare-ddns-docker
cloudflare-ddns-docker copied to clipboard
Just an example
Hi!. Just wanted to do more easy work for people that face this: A command example
docker run --name ddns_client --rm \
-e CF_DDNS_DOMAINS="mydomain.cat *.mydomain.cat mail.mydomain.cat" \
-d ghcr.io/akarys42/cloudflare-ddns-docker -k [REDACTED]
I tried to translate into a docker-compose without success. Maybe someone wanted to do this next step? Regards
Hello @xeviff! Thank you for opening an issue.
This would indeed be a correct way to start the project. I would recommend you to either supply all your parameters using env vars or command line arguments. For example:
docker run --name ddns_client --rm \
-e CF_DDNS_DOMAINS="mydomain.cat *.mydomain.cat mail.mydomain.cat" \
-e CF_DDNS_TOKEN="[REDACTED]" \
-d ghcr.io/akarys42/cloudflare-ddns-docker
or
docker run --name ddns_client --rm \
-d ghcr.io/akarys42/cloudflare-ddns-docker \
-k [REDACTED] \
mydomain.cat *.mydomain.cat mail.mydomain.cat
In a docker-compose, you should be able to a similar thing:
version: "3.7"
services:
cloudflare-ddns:
image: ghcr.io/akarys42/cloudflare-ddns-docker
container_name: ddns_client
enviroment:
CF_DDNS_DOMAINS: "mydomain.cat *.mydomain.cat mail.mydomain.cat"
CF_DDNS_TOKEN: "[REDACTED]"
That said, I 100% agree that this project is lacking proper setup instructions. So here is what I'm thinking:
- [ ] Add the three examples above to the README
- [ ] Rename
docker-compose.yamltodev-docker-compose.yaml - [ ] Maybe add an example
docker-compose.yamlfile?
Would you be interested in making those changes?
Also it seemed like you passed an actual token in your original comment. I took the liberty to redact it just in case, but if it was valid please do roll it right now.
Hello @Akarys42 !! Thank you very much for your response. I apreciate your concern about my token but I changed some characters in order to not provide a real token.
You proposed interesting changes and if I have some free time I'll put them into a pull request. Regards
Awesome, thank you!
I can see this hasn't been updated for a while, but I thought I'd give some feedback here. I've just set this up using docker compose, and as far as I can see it's working, so thanks for taking the time to write the script.
Here's my working docker-compose file:
## Development docker-compose
version: "3.7"
services:
cloudflare-ddns:
image: ghcr.io/akarys42/cloudflare-ddns-docker
container_name: cloudflare-ddns
environment:
- CF_DDNS_TOKEN=<my_token>
- CF_DDNS_DELAY=1 hour
- CF_DDNS_DOMAINS=<my_domain>.com
A little feedback here:
- Some documentation on the delay would be useful, perhaps include in an example. I had to dig around into the utils.py file, and needed to not use quotation marks around the string for it to work!
- Some user feedback in the logs would also be useful. e.g. "IP Address: 82.22.12.131, updating DNS records!" I don't know if they check if it's the same or not...
- I'm assuming that wildcard records formatting is something like this:
- CF_DDNS_DOMAINS=*.<my_domain>.com, this seems to be working correctly and not erroring out.
Nice! Thank you so much to give this update. I tried and it works.
Also for many domains, the space works without quotation marks
- CF_DDNS_DOMAINS=domain1.cat *.domain1.cat mail.domain1.cat domain2.tv *.domain2.tv
I'm getting this error with the above docker compose: services.cloudflare-ddns Additional property enviroment is not allowed
version: "3.7" services: cloudflare-ddns: image: ghcr.io/akarys42/cloudflare-ddns-docker container_name: ddns_client enviroment: CF_DDNS_DOMAINS: "mydomain.cat *.mydomain.cat mail.mydomain.cat" CF_DDNS_TOKEN: "[REDACTED]"
I'm getting this error with the above docker compose: services.cloudflare-ddns Additional property enviroment is not allowed
version: "3.7" services: cloudflare-ddns: image: ghcr.io/akarys42/cloudflare-ddns-docker container_name: ddns_client enviroment: CF_DDNS_DOMAINS: "mydomain.cat *.mydomain.cat mail.mydomain.cat" CF_DDNS_TOKEN: "[REDACTED]"
Figured it out: environment was misspelled. This was from one of the above posts and I copied it without double checking.