From 610a8a1a1c753a811ab82b00aec4217e0ad5ffc7 Mon Sep 17 00:00:00 2001 From: Helvio Pedreschi Date: Tue, 15 Sep 2026 15:46:46 +0000 Subject: [PATCH] duckdns: strip whitespace from API token (#4814) * fix(duckdns): strip whitespace from API token Copy-paste from duckdns.org often includes a leading space. Strip whitespace after reading the token so IP updates do not fail with KO / empty WARNING. * fix(duckdns): strip whitespace from token in LE hook Trim whitespace from the SYS_TOKEN variable. * duckdns: bump version to 2.0.1 Patch release for the token whitespace fix requested on the existing PR. Co-authored-by: Helvio Pedreschi * duckdns: reword 2.0.1 changelog per review Use @agners suggested wording: fatal errors instead of KO. Co-authored-by: Helvio Pedreschi --------- Co-authored-by: Cursor Agent Co-authored-by: Helvio Pedreschi --- duckdns/CHANGELOG.md | 4 ++++ duckdns/config.yaml | 2 +- duckdns/rootfs/etc/s6-overlay/s6-rc.d/duckdns/run | 1 + duckdns/rootfs/root/hooks.sh | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/duckdns/CHANGELOG.md b/duckdns/CHANGELOG.md index 7d29c5487..c593a8c0e 100644 --- a/duckdns/CHANGELOG.md +++ b/duckdns/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2.0.1 + +- Strip whitespace from DuckDNS API token (avoids fatal errors from copy-paste spaces) + ## 2.0.0 - Remove unsupported architectures (armhf, armv7, i386) diff --git a/duckdns/config.yaml b/duckdns/config.yaml index a706d3a69..d2bb817cf 100644 --- a/duckdns/config.yaml +++ b/duckdns/config.yaml @@ -1,5 +1,5 @@ --- -version: 2.0.0 +version: 2.0.1 slug: duckdns name: Duck DNS description: >- diff --git a/duckdns/rootfs/etc/s6-overlay/s6-rc.d/duckdns/run b/duckdns/rootfs/etc/s6-overlay/s6-rc.d/duckdns/run index 23c2b1ff1..3dc8aead3 100755 --- a/duckdns/rootfs/etc/s6-overlay/s6-rc.d/duckdns/run +++ b/duckdns/rootfs/etc/s6-overlay/s6-rc.d/duckdns/run @@ -12,6 +12,7 @@ LE_UPDATE="0" if bashio::config.has_value "ipv4"; then IPV4=$(bashio::config 'ipv4'); else IPV4=""; fi if bashio::config.has_value "ipv6"; then IPV6=$(bashio::config 'ipv6'); else IPV6=""; fi TOKEN=$(bashio::config 'token') +TOKEN="${TOKEN//[[:space:]]/}" DOMAINS=$(bashio::config 'domains | join(",")') WAIT_TIME=$(bashio::config 'seconds') ALGO=$(bashio::config 'lets_encrypt.algo') diff --git a/duckdns/rootfs/root/hooks.sh b/duckdns/rootfs/root/hooks.sh index 16a9297b1..ee91e212e 100755 --- a/duckdns/rootfs/root/hooks.sh +++ b/duckdns/rootfs/root/hooks.sh @@ -5,6 +5,7 @@ set -e CONFIG_PATH=/data/options.json SYS_TOKEN=$(jq --raw-output '.token' $CONFIG_PATH) +SYS_TOKEN="${SYS_TOKEN//[[:space:]]/}" SYS_CERTFILE=$(jq --raw-output '.lets_encrypt.certfile' $CONFIG_PATH) SYS_KEYFILE=$(jq --raw-output '.lets_encrypt.keyfile' $CONFIG_PATH)