godns icon indicating copy to clipboard operation
godns copied to clipboard

Config compatibility issue: "ip_url" in old config vs. "ip_urls" in new config

Open adam-ah opened this issue 2 years ago • 0 comments

Describe the bug
In older configs ip_url was a single item. In newer configs, it is now an array and called ip_urls. When upgrading go_dns to a new version, the ip_url seems to be ignored, leading to guessing the public ip, and not updating anything. Even the debug log does not contain any information about silently failing (log from v2.8.9)

INFO[0000] GoDNS started, entering main loop...
INFO[0000] Creating DNS handler with provider: Cloudflare
DEBU[0000] IP () matches cached IP (), skipping

The frequency of this issue

  • [*] This issue is easy to reproduce.

Steps to Reproduce
Get v2.7.1 and v2.8.9

Create a config.json with the following line:

...
  "ip_url": "https://api.ipify.org",
...

The old version will work as expected, producing a log something like this:

INFO[0000] GoDNS started, entering main loop...
INFO[0000] Creating DNS handler with provider:Cloudflare
INFO[0000] Checking IP for domain x.com
INFO[0001] Querying records with type:A
 NFO[0001] IP mismatch: Current(xxx) vs Cloudflare(xxx)
INFO[0001] Record updated: x.com - xxx

The new version will ignore ip_url and will produce the log as above.

Expected behavior
The new version should either

  • [PREFERRED] work as expected and be backward compatible
  • [NOT PREFERRED] fail, saying it is now called ip_urls and should be an array

Environment (please complete the following information):

  • DNS Provider: Cloudflare
  • OS: linux

adam-ah avatar Sep 21 '22 00:09 adam-ah