Created
June 13, 2018 05:22
-
-
Save caseyfw/e75575c486a57ff57c2191d030bb6721 to your computer and use it in GitHub Desktop.
Letsencrypt certbot authenticator for Zuver domain registrar - supports wildcard certificates via the DNS challenge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
COOKIE_JAR=$(mktemp) | |
: ${CERTBOT_DOMAIN?"Missing CERTBOT_DOMAIN env var."} | |
: ${CERTBOT_VALIDATION?"Missing CERTBOT_VALIDATION env var."} | |
: ${ZUVER_EMAIL?"Missing ZUVER_EMAIL env var."} | |
: ${ZUVER_PASSWORD?"Missing ZUVER_PASSWORD env var."} | |
: ${ZUVER_DOMAIN_HASH?"Missing ZUVER_DOMAIN_HASH env var."} | |
DOMAIN_PREFIX="_acme-challenge" | |
curl --silent \ | |
--output /dev/null \ | |
--cookie-jar $COOKIE_JAR \ | |
--data-raw "email=$ZUVER_EMAIL&password=$ZUVER_PASSWORD&Login=Let%27s+go%21" \ | |
https://my.zuver.net.au/ | |
[ -s $COOKIE_JAR ] || die "Authentication failed." | |
curl --silent \ | |
--output /dev/null \ | |
--cookie $COOKIE_JAR \ | |
--data "dnshostname=$DOMAIN_PREFIX&dnsdest=$CERTBOT_VALIDATION&dnsttl=3600&dnsaddtxt=dnsaddtxt" \ | |
https://my.zuver.net.au/home/domain/$ZUVER_DOMAIN_HASH/service | |
echo "Added TXT record '$CERTBOT_VALIDATION' to $DOMAIN_PREFIX.$CERTBOT_DOMAIN" | |
die() { | |
echo $1; exit 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example usage:
This will login as you to Zuver, add the necessary TXT record to your domain, validate it, then issue you a wildcard certificate. Add it to your monthly cron!
Note: The big ugly
ZUVER_DOMAIN_HASH
can be found in the URL when you visit https://my.zuver.net.au/home/domain/ and click on "Manage DNS" under the desired domain. If anyone knows how Zuver generates these base64 encoded hashes (they're probably just UUIDs) I'm all ears.Note 2: The
-E
in the sudo is important, because it preserves the env vars.