From e3004b84a11548eb5a14dba508b0eabfaa1b3947 Mon Sep 17 00:00:00 2001 From: neil Date: Wed, 21 Oct 2026 17:52:45 +0800 Subject: [PATCH] dns_gandi_livedns: load saved credentials in rm Since 329dab9a (3.1.3) the token/key is saved with _saveaccountconf_mutable, but only _add read it back. rm runs in its own subshell, so on cron renewal it called the API unauthenticated; the 401 body has no "code": 401, so _get_root took the first probe as the zone and the TXT record was never removed. Fixes #7347 --- dnsapi/dns_gandi_livedns.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dnsapi/dns_gandi_livedns.sh b/dnsapi/dns_gandi_livedns.sh index aaef07bf..615667b0 100644 --- a/dnsapi/dns_gandi_livedns.sh +++ b/dnsapi/dns_gandi_livedns.sh @@ -59,6 +59,13 @@ dns_gandi_livedns_rm() { fulldomain=$1 txtvalue=$2 + GANDI_LIVEDNS_KEY="${GANDI_LIVEDNS_KEY:-$(_readaccountconf_mutable GANDI_LIVEDNS_KEY)}" + GANDI_LIVEDNS_TOKEN="${GANDI_LIVEDNS_TOKEN:-$(_readaccountconf_mutable GANDI_LIVEDNS_TOKEN)}" + if [ -z "$GANDI_LIVEDNS_KEY" ] && [ -z "$GANDI_LIVEDNS_TOKEN" ]; then + _err "No Token or API key (deprecated) specified for Gandi LiveDNS." + return 1 + fi + _debug "First detect the root zone" if ! _get_root "$fulldomain"; then _err "invalid domain"