diff --git a/.gitignore b/.gitignore index b4bfa3d64..3794cfc91 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules/ *.env.* *.log +is-a-dev-cert/ diff --git a/scripts/certbot-auth.sh b/scripts/certbot-auth.sh index fd0245777..6b4ee8bc7 100755 --- a/scripts/certbot-auth.sh +++ b/scripts/certbot-auth.sh @@ -6,10 +6,12 @@ echo "AUTH ::[$CERTBOT_VALIDATION]::[$CERTBOT_TOKEN]::[$CERTBOT_REMAINING_CHALLE echo "[$CERTBOT_DOMAIN]"; sleep 1; - ./scripts/certbot.sh acme_txt "$CERTBOT_VALIDATION"; -sleep $((5*60)); +echo "Going to sleep for a few minutes..."; + +# TODO: Check if $CERTBOT_VALIDATION == $(./scripts/certbot.sh get-acme)? +sleep $((3*60)); ./scripts/certbot.sh check; diff --git a/scripts/certbot.sh b/scripts/certbot.sh index 451df74b6..2ab0447ae 100755 --- a/scripts/certbot.sh +++ b/scripts/certbot.sh @@ -18,7 +18,6 @@ generate_certificate() { -m 'phenax5@gmail.com' \ -d '*.is-a.dev,is-a.dev' \ --agree-tos \ - --dry-run \ $(if_dry_run "--dry-run" ""); echo "+-----------------------------------------------+"; @@ -68,10 +67,14 @@ update_acme_txt_record() { reset_acme() { sleep 1; update_record remove TXT '_acme-challenge' ''; + update_record remove TXT '_acme-challenge' ''; } +get_acme() { dig +noall +answer _acme-challenge.is-a.dev TXT | awk '{print $5}'; } + case "$1" in - check) echo "TXT record:: $(dig +noall +answer _acme-challenge.is-a.dev TXT | awk '{print $5}')" ;; + check) echo "TXT record:: $(get_acme)" ;; + get-acme) get_acme ;; cert) generate_certificate ;; acme_txt) update_acme_txt_record "$2" ;; reset) reset_acme ;;