Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Just an example #2

Open
xeviff opened this issue Aug 20, 2021 · 7 comments · May be fixed by #3
Open

Just an example #2

xeviff opened this issue Aug 20, 2021 · 7 comments · May be fixed by #3
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@xeviff
Copy link

xeviff commented Aug 20, 2021

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

@Akarys42
Copy link
Owner

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.yaml to dev-docker-compose.yaml
  • Maybe add an example docker-compose.yaml file?

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.

@Akarys42 Akarys42 added documentation Improvements or additions to documentation enhancement New feature or request labels Aug 20, 2021
@xeviff
Copy link
Author

xeviff commented Aug 21, 2021

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

@Akarys42
Copy link
Owner

Akarys42 commented Aug 21, 2021 via email

@Akarys42 Akarys42 linked a pull request Sep 23, 2021 that will close this issue
@jt196
Copy link

jt196 commented Oct 20, 2023

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:

  1. 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!
  2. 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...
  3. 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.

@xeviff
Copy link
Author

xeviff commented Oct 27, 2023

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

@neurosurgeon
Copy link

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]"

@neurosurgeon
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants