Giter Club home page Giter Club logo

cloudflare-ddns's Issues

Store zone_id cache as a key-value pair

The Zone ID is currently stored in /var/cache as a plain ID, and the executable has no way of knowing what Zone it belongs to. This could create issues when running multiple instances of the tool.

IP v6 / AAAA records are not working

I have a setup similar to this one:

A    test.example.com  <some_ip_v4>
AAAA test2.example.com <some_ip_v6>

Using cloudflare-ddns with test.example.com works just fine, but changing it to test2.example.com results in a SIGABRT:

terminate called after throwing an instance of 'simdjson::simdjson_error'
  what():  The JSON element does not have the requested type.
Aborted

Having IP v6 support for DDNS gets more and more important as providers using DS-Lite.

Support Dual Stack and multiple configurations

Suggestion: Add the possibility to update more than one DNS entry via one call to cloudflare-ddns. The idea here is if you e.g. have a Dual Stack connection (i.e. an IP v4 and an IP v6 address), you will need to call it twice anyway. Ofc you could just do this with another config file and another systemd timer, but this seems a bit bulky. Also, if you want to have an A and AAAA entry for the same domain, this is afaik currently only possible with the library.

I see two feasible options for this:

  • Scan config folders for config files and process all of them (slower but easier to implement)
  • Have a config file that can have more than once section, i.e. each section is it's own call.

I think the second option is better, because we easier fetch the records in parallel while caching the IP addresses. For more parallelization / speed ups, the config could be extended even more to prevent a get_record call at all:

[GENERAL]
cache_ipv4 = true
cache_ipv6 = true

[example.org_ipv4]
api_token = token
zone_id = id
record_name = example.org
ip_version = 4

[example.org_ipv6]
api_token = token
zone_id = id
record_name = example.org
ip_vesion = 6

[example.com]
api_token = token
zone_id = id
record_name = example.com
ip_version = 4 

cloudflare-ddns.service permission warning

Hello,

Great tool! I installed it and it works great, however...
I wanted to see what the service outputs and noticed this warning

Mar 11 11:09:25 proxy (are-ddns)[995]: ConfigurationDirectory 'cloudflare-ddns' already exists but the mode is different. (File system: 755 ConfigurationDirectoryMode: 700)

full log below:

root@proxy:~# systemctl status cloudflare-ddns.service 
* cloudflare-ddns.service - Simple utility to dynamically change a DNS record
     Loaded: loaded (/lib/systemd/system/cloudflare-ddns.service; static)
     Active: inactive (dead) since Mon 2024-03-11 11:09:26 EET; 1min 9s ago
TriggeredBy: * cloudflare-ddns.timer
       Docs: man:cloudflare-ddns(1)
    Process: 995 ExecStart=/usr/bin/cloudflare-ddns (code=exited, status=0/SUCCESS)
   Main PID: 995 (code=exited, status=0/SUCCESS)
        CPU: 130ms

Mar 11 11:09:25 proxy systemd[1]: Starting cloudflare-ddns.service - Simple utility to dynamically change a DNS record...
Mar 11 11:09:25 proxy (are-ddns)[995]: ConfigurationDirectory 'cloudflare-ddns' already exists but the mode is different. (File system: 755 ConfigurationDirectoryMode: 700)
Mar 11 11:09:26 proxy cloudflare-ddns[995]: The A record is up to date
Mar 11 11:09:26 proxy cloudflare-ddns[995]: The AAAA record is up to date
Mar 11 11:09:26 proxy systemd[1]: cloudflare-ddns.service: Deactivated successfully.
Mar 11 11:09:26 proxy systemd[1]: Finished cloudflare-ddns.service - Simple utility to dynamically change a DNS record.

so then I went ahead and did chmod 700 /etc/cloudflare-ddns/ and then restarted systemctl restart cloudflare-ddns.service and it failed with

Job for cloudflare-ddns.service failed because the control process exited with error code.
See "systemctl status cloudflare-ddns.service" and "journalctl -xeu cloudflare-ddns.service" for details.

root@proxy:/etc# systemctl status cloudflare-ddns.service 
x cloudflare-ddns.service - Simple utility to dynamically change a DNS record
     Loaded: loaded (/lib/systemd/system/cloudflare-ddns.service; static)
     Active: failed (Result: exit-code) since Mon 2024-03-11 11:16:29 EET; 16s ago
TriggeredBy: * cloudflare-ddns.timer
       Docs: man:cloudflare-ddns(1)
    Process: 1059 ExecStart=/usr/bin/cloudflare-ddns (code=exited, status=1/FAILURE)
   Main PID: 1059 (code=exited, status=1/FAILURE)
        CPU: 22ms

Mar 11 11:16:29 proxy systemd[1]: Starting cloudflare-ddns.service - Simple utility to dynamically change a DNS record...
Mar 11 11:16:29 proxy cloudflare-ddns[1059]: Unable to open /etc/cloudflare-ddns/config.ini
Mar 11 11:16:29 proxy systemd[1]: cloudflare-ddns.service: Main process exited, code=exited, status=1/FAILURE
Mar 11 11:16:29 proxy systemd[1]: cloudflare-ddns.service: Failed with result 'exit-code'.
Mar 11 11:16:29 proxy systemd[1]: Failed to start cloudflare-ddns.service - Simple utility to dynamically change a DNS record.

๐Ÿคท๐Ÿป

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.