diff --git a/ddns_cleanup b/ddns_cleanup new file mode 100644 index 0000000..50e5d40 --- /dev/null +++ b/ddns_cleanup @@ -0,0 +1,7 @@ +server ns1.keybored.co +zone DOMAIN_NAME +origin DOMAIN_NAME +key home_keyboredme:G/nBHnetXDKJrKOboGkNOMyn3tOtq4aBihdMU0eqUU8= +ttl 360 +del SUBDOMAIN 360 txt +send diff --git a/dns_cleanup.template b/ddns_cleanup.template similarity index 86% rename from dns_cleanup.template rename to ddns_cleanup.template index 9b9738c..e1f077e 100644 --- a/dns_cleanup.template +++ b/ddns_cleanup.template @@ -1,6 +1,7 @@ server DNS_SERVER zone DOMAIN_NAME origin DOMAIN_NAME +key KNOTC_KEY ttl 360 del SUBDOMAIN 360 txt send diff --git a/ddns_update b/ddns_update new file mode 100644 index 0000000..d361b32 --- /dev/null +++ b/ddns_update @@ -0,0 +1,7 @@ +server ns1.keybored.co +zone DOMAIN_NAME +origin DOMAIN_NAME +key home_keyboredme:G/nBHnetXDKJrKOboGkNOMyn3tOtq4aBihdMU0eqUU8= +ttl 360 +add SUBDOMAIN 360 txt VALIDATION_STRING +send diff --git a/dns_update.template b/ddns_update.template similarity index 88% rename from dns_update.template rename to ddns_update.template index 44729db..0789902 100644 --- a/dns_update.template +++ b/ddns_update.template @@ -1,5 +1,6 @@ server DNS_SERVER zone DOMAIN_NAME +key KNOTC_KEY origin DOMAIN_NAME ttl 360 add SUBDOMAIN 360 txt VALIDATION_STRING diff --git a/remote-server-authenticator-hook.sh b/remote-server-authenticator-hook.sh new file mode 100755 index 0000000..cb95535 --- /dev/null +++ b/remote-server-authenticator-hook.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -x +export CERTBOT_DOMAIN=${1} +export CERTBOT_VALIDATION=${2} +DOMAIN=$(expr match "$CERTBOT_DOMAIN" '.*\.\(.*\..*\)') +CHALLENGE_DOMAIN="_acme-challenge.${CERTBOT_DOMAIN}" +[[ -z ${DOMAIN} ]] && export DOMAIN=${CERTBOT_DOMAIN} +sed -e "s DOMAIN_NAME ${DOMAIN} g" -e "s SUBDOMAIN ${CERTBOT_DOMAIN} g" -e "s VALIDATION_STRING ${CERTBOT_VALIDATION} g" ddns_update > /tmp/certbot_ddns_update +knsupdate /tmp/certbot_ddns_update +[[ ${?} == 0 ]] && rm -f /tmp/certbot_ddns_update diff --git a/remote-server-cleanup.sh b/remote-server-cleanup.sh new file mode 100755 index 0000000..06a7da8 --- /dev/null +++ b/remote-server-cleanup.sh @@ -0,0 +1,9 @@ +#!/bin/bash +export CERTBOT_DOMAIN=${1} +export CERTBOT_VALIDATION=${2} +DOMAIN=$(expr match "$CERTBOT_DOMAIN" '.*\.\(.*\..*\)') +CHALLENGE_DOMAIN="_acme-challenge.${CERTBOT_DOMAIN}" +[[ -z ${DOMAIN} ]] && export DOMAIN=${CERTBOT_DOMAIN} +sed -e "s DOMAIN_NAME ${DOMAIN} g" -e "s SUBDOMAIN ${CERTBOT_DOMAIN} g" > /tmp/cerbot_ddns_cleanup +knsupdate /tmp/certbot_ddns_cleanup +[[ ${?} == 0 ]] && rm -f /tmp/certbot_ddns_cleanup