1
0
Fork 0
mirror of https://github.com/fernwerker/ownDynDNS.git synced 2025-07-13 07:05:43 +02:00

refactored again

This commit is contained in:
niiwiicamo 2024-10-24 13:22:01 +02:00
parent 2820892ef1
commit 744cdf22e8
5 changed files with 4 additions and 1 deletions

View file

@ -0,0 +1 @@
oneshot

View file

@ -0,0 +1,2 @@
foreground { echo "copying hooks to volume /hooks for use by certbot..." }
cp /data/hooks/* /hooks/

19
data/hooks/auth-hook.sh Executable file
View file

@ -0,0 +1,19 @@
# ownDynDNS auth script for certbot dns-01 challenge
# install curl
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"
# echo ${PAYLOAD}
curl -sSL -X POST --data "${PAYLOAD}" ${DDNS_SCRIPT} \
&& sleep 300