cromefire / fritzbox-cloudflare-dyndns Goto Github PK
View Code? Open in Web Editor NEWSlim WAN IP updater for AVM FRITZ!Box devices, pushing updates towards CloudFlare DNS using push and poll strategies.
License: MIT License
Slim WAN IP updater for AVM FRITZ!Box devices, pushing updates towards CloudFlare DNS using push and poll strategies.
License: MIT License
Hi,
I was trying to set up your container as part of a compose (v 3.7) with the following config:
dyndns:
container_name: propaganda
image: adrianrudnik/fritzbox-cloudflare-dyndns
environment:
- CLOUDFLARE_API_TOKEN=<API_TOKEN Redacted>
- CLOUDFLARE_ZONES_IPV6=redacted.domain.com
- DYNDNS_SERVER_BIND=:8081
- DYNDNS_SERVER_USERNAME=<user>
- DYNDNS_SERVER_PASSWORD=<redacted>
labels:
- traefik.enable=true
- traefik.frontend.rule=Host:<redacted>
networks:
- srv
Running this results in the following error:
propaganda | time="2022-12-06T10:19:52Z" level=panic msg="Failed to parse env FRITZBOX_ENDPOINT_URL" error="parse \"http://fritz.box:49000 FRITZBOX_ENDPOINT_TIMEOUT 30s DYNDNS_SERVER_BIND :8080 DYNDNS_SERVER_USERNAME DYNDNS_SERVER_PASSWORD CLOUDFLARE_API_EMAIL CLOUDFLARE_API_KEY CLOUDFLARE_ZONES_IPV4 CLOUDFLARE_ZONES_IPV6 CLOUDFLARE_LOCAL_ADDRESS_IPV6 \": invalid port \":8080 DYNDNS_SERVER_USERNAME DYNDNS_SERVER_PASSWORD CLOUDFLARE_API_EMAIL CLOUDFLARE_API_KEY CLOUDFLARE_ZONES_IPV4 CLOUDFLARE_ZONES_IPV6 CLOUDFLARE_LOCAL_ADDRESS_IPV6 \" after host"
propaganda | panic: (*logrus.Entry) 0xc000317dc0
propaganda |
propaganda | goroutine 1 [running]:
propaganda | github.com/sirupsen/logrus.Entry.log(0xc000172000, 0xc0003f9650, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
propaganda | /appbuild/vendor/github.com/sirupsen/logrus/entry.go:239 +0x2ea
propaganda | github.com/sirupsen/logrus.(*Entry).Log(0xc000317d50, 0x0, 0xc00019fe40, 0x1, 0x1)
propaganda | /appbuild/vendor/github.com/sirupsen/logrus/entry.go:268 +0xf0
propaganda | github.com/sirupsen/logrus.(*Entry).Panic(0xc000317d50, 0xc00019fe40, 0x1, 0x1)
propaganda | /appbuild/vendor/github.com/sirupsen/logrus/entry.go:306 +0x55
propaganda | main.newFritzBox(0x0)
propaganda | /appbuild/main.go:61 +0x136
propaganda | main.startPollServer(0xc0000662a0, 0xc0002e2860)
propaganda | /appbuild/main.go:158 +0x26
propaganda | main.main()
propaganda | /appbuild/main.go:38 +0x125
propaganda exited with code 2
It seems like the environment variables are not recognized, is there a known workaround?
Hey guys, my service stopped in the last days producing this error message:
cloudflare-dns-update | 2024/07/26 20:21:13 WARN Failed to poll WAN IPv4 from router error="Post "http://fritz.box:49000/igdupnp/control/WANIPConn1\": dial tcp 192.168.178.1:49000: connect: connection refused"
If I try to open the main fritzbox page from the server or from within the docker container (i.e. Login), I get a 404 error message. If I try the very same command from my Laptop, everything works.
I'm pretty sure that I had some similar issue a couple of years ago, when the fritzbox blocked my servers IP address. I just can't find anything on that and especially not how to unblock it.
Any ideas, thanks a lot!
P.S.: Restarted the container and the box, no change
Hey, why aren't there any issues, yet? Nobody using it am I just to stupid? :-(
I think I set the API token successfully, still the log states that the token is missing. Looking at the code this can only happen, when the token is not set.
Further you are writing in the description that the token should be set in the .env file. From what I understand the .env file only sets variables for the compose file, but does not reach the container: environment variables defined in the .env file are not automatically visible inside containers.
So I set the var in the environment: area of the compose-file, see below: no change
updater_1 | time="2020-11-24T19:45:18Z" level=info msg="Env CLOUDFLARE_API_TOKEN not found, disabling CloudFlare updates"
$ docker/cloudflare-dns-update$ docker exec -it cloudflare-dns-update_updater_1 sh -c 'echo $CLOUDFLARE_API_TOKEN'
y......................................_
What did I do wrong?
First of all, great project! This enhancement request should be pretty easy to implement.
For added resiliency, add a health check endpoint to validate that the updater is actually running.
Proposed endpoints could be /health or /alive, with a simple HTTP 200 as the response code. Maybe add an "ok" in the body.
Bonus points: A JSON response which lists if the last communication attempts to the Fritz!Box and Cloudflare were successful. Still keep the 200 response code, even if these connections were not successful.
Hi,
I have a FritzBox and i need to give up my static ip nr, i have my own DNS at a hosting provider, is it possible by using your code on a pi to update the dns with new dynamic ipnrs?
regards
Eelco
Hi,
when I try to run the docker container I get an standard_init_linux.go:219: exec user process caused: exec format error
. I used it one time with the environment variables for polling and one time for pushing but I get immediately this error.
I recently had the problem that when restarting the FritzBox after the new IP was discovered, the API call still failed because the internet still wasn't online. Some retry might be good here or maybe some improvement in the polling / saving the last set IP.
Currently I have Failed to poll WAN IPv4 from router
all over my logs since I only have a public IPv6.
When the service updates the cloudflare dns record it resets the proxy status to false even when it was set to true manually before the update.
It would be great if it keeps the existing value or if it was a configurable setting.
Is there a change within the Fritzbox TR64?
This Script stopped working for me.
I get the 404 Error Message from the Fritzbox but the log say:
time="2023-11-20T14:52:08Z" level=warning msg="Failed to poll WAN IPv4 from router" error="Post \"http://192.168.99.1:49000/igdupnp/control/WANIPConn1\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"
Is it possible to disable e.g. the polling strategy if I only want to use the pushing strategy?
Proxy crashes when calling http://localhost:41010/ip?v4=80.128.62.108&v6=2003:cc:7fff:1026:e228:6dff:fe68:3f04&prefix=2003:cc:7f10:1800::/56 if the DEVICE_LOCAL_ADDRESS_IPV6
is not set.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.