diff --git a/data/Dockerfiles/acme/docker-entrypoint.sh b/data/Dockerfiles/acme/docker-entrypoint.sh index 3de8d46e..38edcd16 100755 --- a/data/Dockerfiles/acme/docker-entrypoint.sh +++ b/data/Dockerfiles/acme/docker-entrypoint.sh @@ -133,16 +133,16 @@ get_ipv6(){ verify_challenge_path(){ # verify_challenge_path URL 4|6 - RAND_FILE=${RANDOM}${RANDOM}${RANDOM} - touch /var/www/acme/${RAND_FILE} + RANDOM_N=${RANDOM}${RANDOM}${RANDOM} + echo ${RANDOM_N} > /var/www/acme/${RANDOM_N} if [[ ${SKIP_HTTP_VERIFICATION} == "y" ]]; then echo '(skipping check, returning 0)' return 0 - elif [[ "$(curl -${2} http://${1}/.well-known/acme-challenge/${RAND_FILE} --write-out %{http_code} --silent --output /dev/null)" =~ ^(2|3) ]]; then - rm /var/www/acme/${RAND_FILE} + elif [[ "$(curl -${2} -L http://${1}/.well-known/acme-challenge/${RANDOM_N} --silent)" == "${RANDOM_N}" ]]; then + rm /var/www/acme/${RANDOM_N} return 0 else - rm /var/www/acme/${RAND_FILE} + rm /var/www/acme/${RANDOM_N} return 1 fi } diff --git a/docker-compose.yml b/docker-compose.yml index 30192ce8..7d51c37d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -311,7 +311,7 @@ services: acme-mailcow: depends_on: - nginx-mailcow - image: mailcow/acme:1.57 + image: mailcow/acme:1.58 build: ./data/Dockerfiles/acme dns: - ${IPV4_NETWORK:-172.22.1}.254