leamas / ddupdate

Update DNS Data for Dynamic IP Addresses
MIT License
40 stars 28 forks source link

RFE: Debian package is out of date 0.6.1-2 compared to the latest release 0.6.4 #34

Closed LexiconCode closed 5 years ago

LexiconCode commented 5 years ago

Cloudflare is listed as a plug-in. However it does not show up in ddupdate --list-services

leamas commented 5 years ago

Odd. On current devel I get

$ ./ddupdate  -Sl error | head -5
changeip.com         Updates on http://changeip.com/
cloudflare.com       Updates on https://cloudflare.com
dnsdynamic.org       Updates on http://dnsdynamic.org/
dnsexit.com          Updates on https://www.dnsexit.com
dnspark.com          Updates on https://dnspark.com/

Is something broken in the packaging?

LexiconCode commented 5 years ago

Hmm possibly here's output of ddupdate package version and ddupdate --list-services. Notice 0.6.1-2 is installed and 0.6.4 is the last release on github. Verified on packages.debian.org 0.6.1-2 is considered to be the latest.

apt-cache policy ddupdate
ddupdate:
  Installed: 0.6.1-2
  Candidate: 0.6.1-2
  Version table:
 *** 0.6.1-2 500
        500 https://deb.debian.org/debian buster/main amd64 Packages
        500 https://deb.debian.org/debian buster/main i386 Packages
        100 /var/lib/dpkg/status
ddupdate --list-services
WARNING - Cannot open config file '/etc/ddupdate.conf' for read
INFO - Loglevel: INFO
INFO - Using hostname: host.nowhere.net
INFO - Using ip address plugin: default-if
INFO - Using service plugin: dry-run
INFO - Service options:
INFO - Address options:
changeip.com         Updates on http://changeip.com/
dnsdynamic.org       Updates on http://dnsdynamic.org/
dnsexit.com          Updates on https://www.dnsexit.com
dnspark.com          Updates on https://dnspark.com/
dry-run              Debug dummy update plugin
dtdns.com            Updates on https://www.dtdns.com
duckdns.org          Updates on http://duckdns.org
duiadns.net          Updates on https://www.duiadns.net
dynu.com             Updates on https://www.dynu.com/en-US/DynamicDNS
dynv6.com            Updates on http://dynv6.com
freedns.afraid.org   Updates on https://freedns.afraid.org
freedns.io           Updates on https://freedns.io
hurricane_electric   Updates on https://he.com
myonlineportal.net   Updates on http://myonlineportal.net/
no-ip.com            Updates on http://no-ip.com/
now-dns.com          Updates on http://now-dns.com
system-ns.com        Updates on https://system-ns.com
leamas commented 5 years ago

Right. This is yet another bug in 0.6.1 in buster. 0.6.4 is in bullseye/sid and fedora 29/30.

If you file a bug downstream against the debian package I might be able to push an update also for buster.

leamas commented 5 years ago

With that said, this is upstream, and here the problem is fixed. Closing. Thanks for reporting!

x86txt commented 5 years ago

This is also a problem with the version pulled straight from github. Cloudflare is not listed, although it is present in the plugins folder.

root@nginxrhel8:~/ddupdate# ./ddupdate -V 0.6.4

root@nginxrhel8:~/ddupdate# ./ddupdate -S changeip.com Updates on http://changeip.com/ dnsdynamic.org Updates on http://dnsdynamic.org/ dnsexit.com Updates on https://www.dnsexit.com dnspark.com Updates on https://dnspark.com/ domains.google.com Updates on https://domains.google.com dry-run Debug dummy update plugin dtdns.com Updates on https://www.dtdns.com duckdns.org Updates on http://duckdns.org duiadns.net Updates on https://www.duiadns.net dy.fi Updates on https://www.dy.fi/ dynu.com Updates on https://www.dynu.com/en-US/DynamicDNS dynv6.com Updates on http://dynv6.com freedns.afraid.org Updates on https://freedns.afraid.org freedns.io Updates on https://freedns.io hurricane_electric Updates on https://he.com myonlineportal.net Updates on http://myonlineportal.net/ no-ip.com Updates on http://no-ip.com/ now-dns.com Updates on http://now-dns.com nsupdate Update address via nsupdate system-ns.com Updates on https://system-ns.com

root@nginxrhel8:~/ddupdate# ./ddupdate -s cloudflare ERROR - No such service plugin: cloudflare Fatal error: No such service plugin: cloudflare

root@nginxrhel8:~/ddupdate# ./ddupdate -s cloudflare.com ERROR - No such service plugin: cloudflare.com Fatal error: No such service plugin: cloudflare.com

root@nginxrhel8:~/ddupdate# ls -l plugins/ total 120 -rw-r--r--. 1 root root 1265 Jul 19 19:47 changeip.py -rw-r--r--. 1 root root 7961 Jul 19 19:47 cloudflare.py

leamas commented 5 years ago

Something seems broken when loading the plugins. What does ./ddupdate -S -l debug say?

leamas commented 5 years ago

And... are you really on the release? Does git checkout 0.6.4 change anything?

x86txt commented 5 years ago

And... are you really on the release? Does git checkout 0.6.4 change anything?

This was the first time I cloned the repo, so it's definitely on 0.6.4. I did a checkout and fetch just in case and the output below is unchanged. This is on a fresh RHEL8 OS install and the first time I've tried to run it, so there aren't any remnants of an older version lingering anywhere.

./ddupdate -S -l debug

DEBUG - Using config file: /etc/ddupdate.conf INFO - Loglevel: DEBUG INFO - Using hostname: host1.nowhere.net INFO - Using ip address plugin: default-if INFO - Using service plugin: dry-run INFO - Service options: INFO - Address options: DEBUG - paths :/root/ddupdate:/root/.local/share/ddupdate:/usr/local/share/ddupdate:/usr/share/ddupdate DEBUG - Loaded 7 address and 20 service plugins from /root/ddupdate DEBUG - Loaded 0 address and 0 service plugins from /root/.local/share/ddupdate DEBUG - Loaded 0 address and 0 service plugins from /usr/local/share/ddupdate DEBUG - Loaded 0 address and 0 service plugins from /usr/share/ddupdate changeip.com Updates on http://changeip.com/ dnsdynamic.org Updates on http://dnsdynamic.org/ dnsexit.com Updates on https://www.dnsexit.com dnspark.com Updates on https://dnspark.com/ domains.google.com Updates on https://domains.google.com dry-run Debug dummy update plugin dtdns.com Updates on https://www.dtdns.com duckdns.org Updates on http://duckdns.org duiadns.net Updates on https://www.duiadns.net dy.fi Updates on https://www.dy.fi/ dynu.com Updates on https://www.dynu.com/en-US/DynamicDNS dynv6.com Updates on http://dynv6.com freedns.afraid.org Updates on https://freedns.afraid.org freedns.io Updates on https://freedns.io hurricane_electric Updates on https://he.com myonlineportal.net Updates on http://myonlineportal.net/ no-ip.com Updates on http://no-ip.com/ now-dns.com Updates on http://now-dns.com nsupdate Update address via nsupdate system-ns.com Updates on https://system-ns.com

x86txt commented 5 years ago

I figured it out, the 'requests' python module wasn't installed. A 'pip3 install requests' fixed it.

root@nginxrhel8:~/ddupdate/plugins# python3 cloudflare.py Traceback (most recent call last): File "cloudflare.py", line 8, in from requests import Request, Session ModuleNotFoundError: No module named 'requests'

root@nginxrhel8:~/ddupdate# ./ddupdate -S -l debug WARNING - Cannot open config file '/etc/ddupdate.conf' for read DEBUG - Using config file: None INFO - Loglevel: DEBUG INFO - Using hostname: host.nowhere.net INFO - Using ip address plugin: default-if INFO - Using service plugin: dry-run INFO - Service options: INFO - Address options: DEBUG - paths :/root/ddupdate:/root/.local/share/ddupdate:/usr/local/share/ddupdate:/usr/share/ddupdate DEBUG - Loaded 7 address and 20 service plugins from /root/ddupdate DEBUG - Loaded 0 address and 0 service plugins from /root/.local/share/ddupdate DEBUG - Loaded 0 address and 0 service plugins from /usr/local/share/ddupdate DEBUG - Loaded 0 address and 0 service plugins from /usr/share/ddupdate changeip.com Updates on http://changeip.com/ cloudflare.com Updates on https://cloudflare.com dnsdynamic.org Updates on http://dnsdynamic.org/ dnsexit.com Updates on https://www.dnsexit.com dnspark.com Updates on https://dnspark.com/ dry-run Debug dummy update plugin dtdns.com Updates on https://www.dtdns.com duckdns.org Updates on http://duckdns.org duiadns.net Updates on https://www.duiadns.net dy.fi Updates on https://www.dy.fi/ dynu.com Updates on https://www.dynu.com/en-US/DynamicDNS dynv6.com Updates on http://dynv6.com freedns.afraid.org Updates on https://freedns.afraid.org freedns.io Updates on https://freedns.io hurricane_electric Updates on https://he.com myonlineportal.net Updates on http://myonlineportal.net/ no-ip.com Updates on http://no-ip.com/ now-dns.com Updates on http://now-dns.com nsupdate Update address via nsupdate system-ns.com Updates on https://system-ns.com

Maybe a step should be added to the install docs to add the python requests module?

leamas commented 5 years ago

ah... that's a really good catch! Thanks!

Now, the python-requests is a dependency just of the cloudflare plugin. I'm not inclined to add this as an dependency for the overall tool. The short dependency list is something I'd like to preserve if possible, and that just one plugin needs something does not really justify to expand it.

The minimum would then be to patch the plugin description (and thus help). Packaging wise, it could be resolved with a separate package for this plugin with a specific dependency.

It's also worrying that a plugin fails to load without any error message. Will need to look into this as well, having something that looks like a plugin but cannot be loaded should really be reported.

x86txt commented 5 years ago

FYI - ddupdate-config doesn't configure the plugin correctly either, it doesn't add to ddupdate.conf service-options = zone <my cloudflare zone> and the ddupdate.service file it writes out is broken also, only containing [Unit] and nothing else.

Also, the plugin itself is broken, as it's not pulling the correct values from the Cloudflare API, even after manually configuring it in ddupdate.conf. Even with a valid zone, it fails with 'ERROR - Cannot update DNS data: 'Zone True not found' If I issue a manual API call to Cloudflare using curl as illustrated here (https://api.cloudflare.com/#zone-list-zones) my zones are returned correctly.

At this point, this one plugin seems to be a mess and it might be better if we could somehow get the original author involved? I hate to waste your time with something that you didn't originally write.

leamas commented 5 years ago

hm... could you please submit the ddupdate.conf where you defined a correct zone?

x86txt commented 5 years ago

Sure, here you go. Without the zone added, the plugin correctly throws an error about it being missing.

ddupdate.conf.txt

leamas commented 5 years ago

This dialog uncovers some bad docs, for sure. The options in config file should be written as on the command line, that is like zone=myzone.com. Note: no spaces. With spaces the options are parsed like two independent ones (zone and myzone.com), each of which true.

leamas commented 5 years ago

Ping?

leamas commented 5 years ago

Closing, basically on NEEDINFO. Please reopen if required