Skip to content

Commit

Permalink
Use 1st level domain for CF zone request
Browse files Browse the repository at this point in the history
Fixes 7sDream#2
  • Loading branch information
pjrobertson committed May 15, 2020
1 parent 56d688f commit 080d874
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ CLOUDFLARE_EMAIL=<input-your-email-here>

CHALLENGE_PREFIX="_acme-challenge"
CHALLENGE_DOMAIN="${CHALLENGE_PREFIX}.${CERTBOT_DOMAIN}"
PARENT_DOMAIN=$(sed 's/.*\.\(.*\..*\)/\1/' <<< "${CERTBOT_DOMAIN}")

CLOUDFLARE_ZONE=$(curl -X GET "https://api.cloudflare.com/client/v4/zones?name=${CERTBOT_DOMAIN}" \
CLOUDFLARE_ZONE=$(curl -X GET "https://api.cloudflare.com/client/v4/zones?name=${PARENT_DOMAIN}" \
-H "X-Auth-Email: ${CLOUDFLARE_EMAIL}" \
-H "X-Auth-Key: ${CLOUDFLARE_KEY}" \
-H "Content-Type: application/json" -s | jq -r '.result[0].id')

0 comments on commit 080d874

Please sign in to comment.