-
-
Save prashant-shahi/1ee4d7dfe436bc3cd6867a61254b4e11 to your computer and use it in GitHub Desktop.
Revisions
-
gaoyifan revised this gist
Jul 13, 2018 . 2 changed files with 6 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,12 @@ #!/usr/bin/env bash # require: git version > 2.3 # require: `db/letsencrypt` existed in git repo if [[ -z "$CERTBOT_DOMAIN" ]] || [[ -z "$CERTBOT_VALIDATION" ]]; then echo '$CERTBOT_DOMAIN and $CERTBOT_VALIDATION environment variables required.' fi source /etc/letsencrypt/dns-auth.conf BIND_DB=${BIND_DB:-"db/letsencrypt"} This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ DNSAUTH_SSH_KEY=/etc/letsencrypt/dnsauth-key [email protected]:xxx/xxx.git DNSAUTH_GIT_PATH=/etc/letsencrypt/dnsauth-repo -
gaoyifan created this gist
Jul 13, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ #!/usr/bin/env bash if [[ -z "$CERTBOT_DOMAIN" ]] || [[ -z "$CERTBOT_VALIDATION" ]]; then echo '$CERTBOT_DOMAIN and $CERTBOT_VALIDATION environment variables required.' fi # DNSAUTH_SSH_KEY # DNSAUTH_GIT_UPSTREAM # DNSAUTH_GIT_PATH source /etc/letsencrypt/dns-auth.conf BIND_DB=${BIND_DB:-"db/letsencrypt"} export GIT_SSH_COMMAND="ssh -i $DNSAUTH_SSH_KEY -o StrictHostKeyChecking=no" if [[ ! -d $DNSAUTH_GIT_PATH ]]; then git clone $DNSAUTH_GIT_UPSTREAM $DNSAUTH_GIT_PATH fi cd $DNSAUTH_GIT_PATH git fetch --prune origin master git reset --hard origin/master if [[ -z $CERTBOT_AUTH_OUTPUT ]]; then echo "_acme-challenge.${CERTBOT_DOMAIN}. 60 IN TXT \"${CERTBOT_VALIDATION}\"" >> $BIND_DB git add $BIND_DB git commit -m "Add _acme-challenge.$CERTBOT_DOMAIN" git push origin master || exit 1 sleep 25 else sed -i "/${CERTBOT_DOMAIN}/d" $BIND_DB git add $BIND_DB git commit -m "Drop _acme-challenge.$CERTBOT_DOMAIN" git push origin master || exit 1 fi This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ certbot certonly \ --server https://acme-v02.api.letsencrypt.org/directory \ --preferred-challenges dns \ --email [email protected] \ --manual \ --manual-auth-hook /etc/letsencrypt/certbot-auth-hook.sh \ --manual-cleanup-hook /etc/letsencrypt/certbot-auth-hook.sh \ --manual-public-ip-logging-ok \ --domain example.com \ --domain '*.example.com'