From 42245eaa3efaca0d7a8ffeb2abb88c125bd45f7b Mon Sep 17 00:00:00 2001 From: niiwiicamo Date: Wed, 2 Oct 2024 16:16:05 +0200 Subject: [PATCH] fix wildcard handling --- auth-hook.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/auth-hook.sh b/auth-hook.sh index 4574403..c16b3c8 100755 --- a/auth-hook.sh +++ b/auth-hook.sh @@ -5,6 +5,10 @@ apk --no-cache add curl ACME_PREFIX="_acme-challenge" +# check if wildcard cert is requested, as that needs to be stripped +if [[ "${DDNS_HOST}" == '*.'* ]]; then DDNS_HOST=${DDNS_HOST#\*\.}; fi + +# prepend acme prefix to host part if [ -z "${DDNS_HOST}" ]; then DDNS_HOST=${ACME_PREFIX}; else DDNS_HOST=${ACME_PREFIX}.${DDNS_HOST}; fi PAYLOAD="force=true&user=${DDNS_USER}&password=${DDNS_PASS}&txt=${CERTBOT_VALIDATION}&domain=${DDNS_DOMAIN}&host=${DDNS_HOST}&create=true"