Skip to content

Instantly share code, notes, and snippets.

@tjarksaul
Last active November 10, 2020 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjarksaul/1584718a2f9fbd8ed9a65bc336560a8b to your computer and use it in GitHub Desktop.
Save tjarksaul/1584718a2f9fbd8ed9a65bc336560a8b to your computer and use it in GitHub Desktop.
Certbot with DNS validation and tinydns
#!/bin/bash
DOMAIN="example.tld"
certbot certonly -n --preferred-challenges dns --manual --manual-public-ip-logging-ok --manual-auth-hook /usr/local/bin/tinydns-certbot-enable --manual-cleanup-hook /usr/local/bin/tinydns-certbot-disable -d $DOMAIN -d \*.$DOMAIN
#!/bin/bash
# From https://blog.fugue88.ws/archives/2019-03/certbot-and-tinydns
cd /etc/tinydns
sed -ri '/^# BEGIN CERTBOT AUTH$/,/^# END CERTBOT AUTH$/d' data
make
#!/bin/bash
# From https://blog.fugue88.ws/archives/2019-03/certbot-and-tinydns
cd /etc/tinydns
cat <<EOF >> data
# BEGIN CERTBOT AUTH
'_acme-challenge.$CERTBOT_DOMAIN:$CERTBOT_VALIDATION
# END CERTBOT AUTH
EOF
export -n CERTBOT_VALIDATION
make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment