Repository navigation
Conversation
Adds POST /records/present and /records/cleanup taking JSON fqdn, type and value for A, AAAA, TXT, CNAME and SRV records. CNAME/SRV targets are validated and made absolute. SRV records are added to an existing RRSet instead of replacing it, so several targets can share one name. The endpoint group is not enabled by default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: xhess <github@die-hessens.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a new, opt-in endpoint group
recordswith two endpoints:POST /records/presentPOST /records/cleanupBoth take a JSON body with
fqdn,typeandvalue. Supported types areA, AAAA, TXT, CNAME and SRV, so CNAME and SRV records can now be managed
through the proxy. The existing endpoints are unchanged and still only
accept A, AAAA and TXT.
The group is not enabled by default. It has to be listed explicitly via
endpointsin the config file orENDPOINTSin the environment, soexisting setups are not affected.
Behaviour
absolute (
target.example.com->target.example.com.). A CNAME at thezone apex is rejected.
presentreplaces an existing CNAME, since onlyone CNAME per name is allowed.
priority weight port target. Priority, weight andport must be 0-65535 and are normalized (
05060->5060); the targetis validated and made absolute, and
.is accepted as "service not available".
presentadds the record toan existing RRSet instead of replacing it, so several targets can share
one name (e.g. a primary and a backup server). Adding a record that
already exists is a no-op.
cleanupremoves only the matching record.endpoints.
Example:
Tests
pkg/middleware/bind_test.go.ENDPOINTSparsing and forrecordsbeing off bydefault in
pkg/config/config_test.go.tests/records_test.gofor creating, replacing(CNAME), adding (SRV, with and without a TTL change), skipping an
existing SRV record, cleanup of CNAME and SRV records, invalid input,
denied access (401) and the endpoint being disabled (404).
make lint,make testandmake functestpass.and an SRV record, adding a second SRV record to the same name,
re-sending an existing record (no-op, also with leading zeros), and
cleaning up single SRV and CNAME records. All results were verified on
the Hetzner nameservers.
🤖 Generated with Claude Code