koying/ha-addons

Do not update address if response from wtfismyip.com is blank

Closed this issue · 1 comments

Hi

Thanks for your efforts and a great add-on - works perfectly for me aside from occasionally I have Dynu return an NXDOMAIN and my HA instance is not reachable.

On further investiagtion (I enabled bashio::log.level "debug" ) in run.sh to investigate further - it appears that several times a day (reason unknown to me at this stage) wtfismyip.com is returning a blank _ I noticed the duckdns add-on does not use this.

A request to perhaps not update Dynu if this is the case and to log an error and/or retry to fetch external IP Address.

In my opinion, Dynu should be updated only if the change is a real IP address - see redacted logs when debugging enabled:

[17:09:57] DEBUG: ipv4: redacted
[17:09:57] DEBUG: ipv6:
[17:09:57] DEBUG: dns/getroot/redacted.dynu.net
[17:09:57] DEBUG: GET https://api.dynu.com/v2/dns/getroot/**redacted**.dynu.net
[17:09:59] DEBUG: response {"statusCode":200,"id":redacted,"domainName":"redacted.dynu.net","hostname":"redacted.dynu.net","node":""}
[17:09:59] DEBUG: dnsname.dynu.net {"statusCode":200,"id":redacted,"domainName":"redacted.dynu.net","hostname":"redacted.dynu.net","node":""}
[17:09:59] DEBUG: DynuDnsId: redacted
[17:10:00] DEBUG: {"statusCode":200}
[17:15:01] DEBUG: ipv4: redacted
[17:15:01] DEBUG: ipv6:
[17:15:01] DEBUG: dns/getroot/redacted.dynu.net
[17:15:01] DEBUG: GET https://api.dynu.com/v2/dns/getroot/**redacted**.dynu.net
[17:15:18] DEBUG: response {"statusCode":200,"id":redacted,"domainName":"dnsname.dynu.net","hostname":"redacted.dynu.net","node":""}
[17:15:18] DEBUG: redacted.dynu.net {"statusCode":200,"id":redacted,"domainName":"dnsname.dynu.net","hostname":"redacted.dynu.net","node":""}
[17:15:18] DEBUG: DynuDnsId: redacted
[17:15:23] DEBUG: {"statusCode":200}
[17:20:33] DEBUG: ipv4:
[17:20:33] DEBUG: ipv6:
[17:20:33] DEBUG: dns/getroot/redacted.dynu.net
[17:20:33] DEBUG: GET https://api.dynu.com/v2/dns/getroot/**redacted**.dynu.net
[17:20:35] DEBUG: response {"statusCode":200,"id":redacted,"domainName":"dnsname.dynu.net","hostname":"redacted.dynu.net","node":""}
[17:20:35] DEBUG: redacted.dynu.net {"statusCode":200,"id":redacted,"domainName":"dnsname.dynu.net","hostname":"redacted.dynu.net","node":""}
[17:20:35] DEBUG: DynuDnsId: redacted
[17:20:36] DEBUG: {"statusCode":200}

koying commented

Should be fixed by #14