kissgyorgy / cloudflare-dyndns Goto Github PK
View Code? Open in Web Editor NEWCloudFlare Dynamic DNS client
License: MIT License
CloudFlare Dynamic DNS client
License: MIT License
with v4.0-beta2:
Traceback (most recent call last):
File "/app/.local/bin/cloudflare-dyndns", line 5, in <module>
main()
File "/app/.local/lib/python3.9/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/app/.local/lib/python3.9/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/app/.local/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/app/.local/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/app/.local/lib/python3.9/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/app/cloudflare_dyndns/cli.py", line 246, in main
exit_codes.remove(0)
KeyError: 0
DNS lookups are orders of magnitudes faster, for example:
$ time dig TXT +short o-o.myaddr.l.google.com @ns1.google.com
"188.6.90.5"
dig TXT +short o-o.myaddr.l.google.com @ns1.google.com 0,01s user 0,01s system 19% cpu 0,081 total
Implement DNS lookups by using the dnslib library. Example client implementation: https://bitbucket.org/paulc/dnslib/src/default/dnslib/client.py
$ pip3 install dnslib
$ python3 -m dnslib.client --short --server ns1.google.com o-o.myaddr.l.google.com TXT
There are multiple DNS providers which will respond with the requester IP address:
https://code.blogs.iiidefix.net/posts/get-public-ip-using-dns/
Note: Only implement DNSSEC-enabled DNS services, otherwise the security of this would be worse than a https call.
curl -X GET "https://api.cloudflare.com/client/v4/user/tokens/verify" \
-H "Authorization: Bearer <bearer-token-from-dashboard>" \
-H "Content-Type:application/json"
I don't want to set the DNS to the machine's address I'm running the script from. For my use case I need to be able to set it manually.
with default to "automatic"
Thanks for the excellent tool, which successfully updated my cloudflare account info.
However, running on macos, certs are missing:
OSError: Could not find a suitable TLS CA certificate bundle, invalid path: /etc/ssl/certs/ca-certificates.crt
Can you add to documentation a summary for this, like the following:
For Macos, please provide a certficate CA file something like this:
sudo port install curl-ca-bundle # use macports to download CA certs
sudo cp /opt/local/share/curl/curl-ca-bundle.crt /etc/ssl/certs/ca-certificates.crt
I have more than one record, but only updates the first one
cloudflare-dyndns --proxied --api-token **************** domain.pt --force
If there is no A or AAAA record, it should be created. It definitely need a switch, but not sure what would be a good default. Opt-in or opt-out?
After pip install cloudflare-dydns in CENT-OS 7.9, and running the program with cloudflare api-token, then I got the error message:
OSError: Could not find a suitable TLS CA certificate bundle, invalid path: /etc/ssl/certs/ca-certificates.crt
A "What's my IP functionality". Useful for debugging problems, especially after IPv6 support.
I tried to use the API Tokens (with DNS edit settings); which failed.
It requires the global API Key to work -- but that gives full access to the account and is not ideal.
Love the project but is it possible to have a variable to toggle between proxied and DNS-only modes?
Currently it defaults to DNS-only mode.
For cache file
It currently only updates A records.
If IPv6 is detected it woud be nice if it updated the AAAA record as well (if IPv6 is not detected and an AAAA record exists, it should be cleared).
Thanks
This is a very nice tool, thank you! I hope to use it to replace my own home-grown version of roughly the same thing.
One thing I noticed is that the cache file ~/.cache/cloudflare-dyndns/ip.cache
gets overwritten on every invocation of the program, even if nothing has changed. It's just a few hundred bytes, yes, but on flash storage this equates to at least a 4kB or more write depending on the hardware and filesystem. In the grand scheme of things, very likely not a big deal, but it would be nice to do the right thing if possible.
I haven't had the time to fully understand the flow of things, but two approaches that I can think of:
One workaround for those who are concerned about unnecessary writes could be to store the cache file on a RAM-backed filesystem, e.g. /dev/shm/ip.cache
.
The release is manual for now, it would be nice to have a GitHub Action to automate it fully.
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.