mirror of
https://github.com/acme-dns/acme-dns.git
synced 2026-04-27 04:45:48 +03:00
[PR #229] Use config api.api_domain for API hostname #356
Labels
No labels
Documentation
Documentation
bug
enhancement
feature request
feature request
help wanted
pull-request
question
security
security
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/acme-dns#356
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/acme-dns/acme-dns/pull/229
Author: @DigitalBrains1
Created: 5/24/2020
Status: 🔄 Open
Base:
master← Head:api-domain📝 Commits (1)
9f66a17Use config api.api_domain for API hostname📊 Changes
4 files changed (+20 additions, -12 deletions)
View changed files
📝
config.cfg(+3 -0)📝
dns.go(+7 -2)📝
main.go(+8 -8)📝
main_test.go(+2 -2)📄 Description
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.shbecause the user account doesn't havesudorights and the user'sTMPDIRis 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.orgto an IP address isauth.example.orgitself, 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_dnsever 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.comzone. 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-dnsdaemon.By the way, first I thought that
config.nsnamewould be used in several important places, but upon inspection it turned outconfig.nsnameis 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.domainso there is one less option in the config file.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.