Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using "My Domain" instead of predefined domains at dynv6.com: (workaround required in case of subdomain) #2

Open
spblinux opened this issue Dec 13, 2023 · 0 comments

Comments

@spblinux
Copy link

Dyndns provider dynv6.com provides predefined domains like dynv6.net. Additionally it is possible to use any domain or subdomain where you are authorized to set NS records pointing to the dns servers of dynv6.com. This is called "My Domain".

domains.txt: a.mydomain.tld *.a.mydomain.tld (applying for a wildcard certificate for a.mydomain.tld and its subdomains)

Bug: hook.sh, create_acme_challenge_host(), sets in this case the variable
acme_challenge_hostname="_acme-challenge.a"
And this results that the nameserver at dynv6.com creates a TXT record
_acme-challenge.a.a.mydomain.tld

So letsencrypt fails because it cannot fetch TXT record
_acme-challenge.a.mydomain.tld


Workaround:
Edit ".env" file and add
DYNV6_IS_MYDOMAIN=true

and apply the patch below to hook.sh:

--- hook.sh.orig<------>2023-12-13 16:29:08.544354245 +0100
+++ hook.sh<--->2023-12-13 16:56:36.490748269 +0100
@@ -2,6 +2,8 @@
 DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)".
 DOMAIN=${2}
 TOKEN_VALUE=${4}
+# "My Domains" of dynv6.com in use? (default: false)
+DYNV6_IS_MYDOMAIN=${DYNV6_IS_MYDOMAIN:-false}
 DYNV6_DOMAINS=(dns.army dns.navy dynv6.net v6.army v6.navy v6.rocks) # TODO: Make this dynamic
 DYNV6_APIBASE="https://dynv6.com/api/v2/zones"
 DYNV6_TOKEN=${DYNV6_TOKEN}
@@ -97,7 +99,11 @@
     break
   fi
   done
-  acme_challenge_hostname="${acme_challenge_hostname_with_dot: :-1}"  # remove last dot
+  if [ $DYNV6_IS_MYDOMAIN == "false" ]; then
+   acme_challenge_hostname="${acme_challenge_hostname_with_dot: :-1}"  # remove last dot
+  else
+   acme_challenge_hostname="_acme-challenge"
+  fi
   _test_echo "${acme_challenge_hostname}"
 }

hook_sh_diff.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant