Use config api.api_domain for API hostname #229
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WARNING: The actual patch in this PR is intended as a suggestion from someone with no experience with the Go language
So I merely grepped the source, made some changes, tried the result and ran
go test -v -race
. (I did not userun_tests.sh
because the user account doesn't havesudo
rights and the user'sTMPDIR
is executable anyway)And finally, thanks for your work! I really like what you've made here, it does exactly what I need.
Well, with that out of the way :-)
As #215 notes, there is some duplication of address data due to the need for DNS glue records. Because the DNS server responsible for resolving
auth.example.org
to an IP address isauth.example.org
itself, there is a catch-22 which DNS solves with glue records in the delegating DNS server that servesexample.org
. Now, whenever an IP address changes, it needs to be changed in two DNS zones.I'd like to avoid the need for glue records. After I implemented something, I stumbled upon a configuration item in the
[api]
section that is there but not used (or used only in a dependency):api_domain
(leading to the objectConfig.API.Domain
). So I re-implemented using that name. And then finally the realisation came that actually, it was all superfluous for the intended purpose. Why? Because nothing inacme_dns
ever checks the hostname used for the HTTPS connection! Still, I spent quite some time on this as I do not know a word of Go and I'm generally fastidious. So this is offered in the hope that it is useful anyway. It offers to configure the hostname for the HTTPS API. At the very least, it makes explicit that actually the HTTPS API does not need to be at the same host name as the DNS zone and/or the DNS server.Now, given this configuration:
we have the HTTPS API server running on
https://api.acme-auth.digitalbrains.com/
and serving the DNS through the following delegation:Note that the IP address for the nameserver now only needs to be listed in the
digitalbrains.com
zone. The IP address for the HTTPS API is only in the subdomain.What I am actually using is this (some stuff elided):
and the following delegation from
digitalbrains.com
:This means the built-in support for getting a certificate through ACME no longer works. I use this instead:
And because the built-in support for the certificate is no longer needed, this configuration actually runs fine with an unchanged, original
acme-dns
daemon.By the way, first I thought that
config.nsname
would be used in several important places, but upon inspection it turned outconfig.nsname
is only used in the SOA record to indicate the MNAME (RFC 1035 section 3.3.13), which I think has little application outside Dynamic DNS. Dynamic DNS is not used here, so it's mostly decorative. You might as well hard-code the SOA MNAME toconfig.domain
so there is one less option in the config file.