diff --git a/duckdns/CHANGELOG.md b/duckdns/CHANGELOG.md index 88570dcc9f8..042a702fb8a 100644 --- a/duckdns/CHANGELOG.md +++ b/duckdns/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.12 + +- Add option to specify a service or URL as IPv4 and IPv6 address source + ## 1.11 - Do not skip TLS security checks on Duck DNS API access diff --git a/duckdns/README.md b/duckdns/README.md index 984a5425e02..9ee8a2891d2 100644 --- a/duckdns/README.md +++ b/duckdns/README.md @@ -67,12 +67,20 @@ By default, Duck DNS will auto detect your IPv4 address and use that. This option allows you to override the auto-detection and specify an IPv4 address manually. +If you specify a URL here, contents of the resource it points to will be +fetched and used as the address. This enables getting the address using +a service like https://api4.ipify.org/ or https://ipv4.wtfismyip.com/text + ### Option: `ipv6` (optional) By default, Duck DNS will auto detect your IPv6 address and use that. This option allows you to override the auto-detection and specify an IPv6 address manually. +If you specify a URL here, contents of the resource it points to will be +fetched and used as the address. This enables getting the address using +a service like https://api6.ipify.org/ or https://ipv6.wtfismyip.com/text + ### Option: `token` The DuckDNS authentication token found at the top of the DuckDNS account landing page. The token is required to make any changes to the subdomains registered to your account. @@ -89,6 +97,9 @@ The number of seconds to wait before updating DuckDNS subdomains and renewing Le - To log in, DuckDNS requires a free account from any of the following services: Google, Github, Twitter, Persona or Reddit. - A free DuckDNS account is limited to five subdomains. +- At time of writing, Duck DNS' own IPv6 autodetection + [does not actually work][duckdns-faq], but you can use the URL option + for `ipv6` to get around this, read on. ## Support @@ -112,3 +123,4 @@ In case you've found a bug, please [open an issue on our GitHub][issue]. [issue]: https://github.com/home-assistant/hassio-addons/issues [reddit]: https://reddit.com/r/homeassistant [duckdns]: https://duckdns.org +[duckdns-faq]: https://www.duckdns.org/faqs.jsp diff --git a/duckdns/config.json b/duckdns/config.json index ce2f997a5bc..4b29a212043 100644 --- a/duckdns/config.json +++ b/duckdns/config.json @@ -1,6 +1,6 @@ { "name": "Duck DNS", - "version": "1.10", + "version": "1.11", "slug": "duckdns", "description": "Free Dynamic DNS (DynDNS or DDNS) service with Let's Encrypt support", "url": "https://github.com/home-assistant/hassio-addons/tree/master/duckdns", diff --git a/duckdns/data/run.sh b/duckdns/data/run.sh index 65e2aec1810..c4dc30053c5 100755 --- a/duckdns/data/run.sh +++ b/duckdns/data/run.sh @@ -50,7 +50,11 @@ fi # Run duckdns while true; do - if answer="$(curl -s "https://www.duckdns.org/update?domains=${DOMAINS}&token=${TOKEN}&ip=${IPV4}&ipv6=${IPV6}&verbose=true")"; then + + [[ ${IPV4} != *:/* ]] && ipv4=${IPV4} || ipv4=$(curl -s -m 10 "${IPV4}") + [[ ${IPV6} != *:/* ]] && ipv6=${IPV6} || ipv6=$(curl -s -m 10 "${IPV6}") + + if answer="$(curl -s "https://www.duckdns.org/update?domains=${DOMAINS}&token=${TOKEN}&ip=${ipv4}&ipv6=${ipv6}&verbose=true")"; then bashio::log.info "${answer}" else bashio::log.warning "${answer}"