Skip to content

feat(dns): move the apex to the platform and restore external-dns ownership of www - #78

Merged
devantler merged 4 commits into
mainfrom
claude/dns-www-reown
Nov 15, 2026
Merged

devantler merged 4 commits into
mainfrom
claude/dns-www-reown

Conversation

@devantler

@devantler devantler commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Why

devantler.tech should be served by the platform, like www now is, and keep following the gateway if its address ever changes. www also needs its external-dns ownership back: right after external-dns took over www, its two ownership records for the new addresses disappeared. www still works, but it would not follow a gateway change.

What

  • Points the apex at www, proxied, as an in-place edit of the one existing record. The site is never without an address.
  • Recreates external-dns's two ownership records for www, with its exact content. external-dns then owns www again without changing any address.
  • Adds a short reviewed list naming the records that may be handed to external-dns this way: www A and AAAA. Without it the safety check refuses to hand over any record this repository doesn't manage. Mail and every other record stay protected, and the gateway's origin addresses never have to be written into this public repository.
  • Stops tracking the one-time www handover record, which external-dns already removed.
  • Keeps the encrypted state from the www apply (feat(dns): hand www to the platform's external-dns without a gap #76, run 43675268687) as the retained recovery copy.

Replaces #77. The rollback plans are in the comments: the apex goes back with an in-place edit to devantler.github.io with proxying off, and there is a separate plan for the two ownership records. The platform cutover verifies the apex live and watches the ownership records for five minutes after the apply.

Part of #21

🤖 Generated with Claude Code

devantler and others added 2 commits November 15, 2026 05:13
Run 43675268687 (source 81ab7a9) created the www ownership record and
forgot the www CNAME, moving the state from serial 4 to 5 on the same
lineage with the configuration unchanged. The `after` and fresh-runner
`recovered` packages authenticate with the independent identity and carry
the same state digest. The fresh runner's plan wanted to recreate the
ownership record only because external-dns had already taken it over;
this pull request forgets it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
external-dns took over www at 04:06:52Z and wrote its ownership records
for the new A and AAAA addresses, but both were gone within a minute.
www still points at the gateway, but nothing owns it now.

- Create `_externaldns.a-www` and `_externaldns.aaaa-www` with exactly
  external-dns's content, so it re-owns the existing records without
  changing them, and forget the one-time cname-www marker.
- Add a reviewed handover list, .github/dns-handover.json. A marker may
  claim a live record nothing here manages only when that list names it;
  every other claim still has to be a record the same plan forgets. This
  avoids adopting the www addresses here, which would publish the
  gateway's origin addresses.

Part of #21.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devantler

Copy link
Copy Markdown
Contributor Author

Rollback plan, written before the apply

What this apply does: it creates two TXT records, _externaldns.a-www and _externaldns.aaaa-www, with external-dns's own content. No address record changes. external-dns already wants www A and AAAA to point at the gateway, and they already do. So it simply reads these records as ownership, and logs "up to date".

What to check: both records still exist five minutes later. external-dns logs no change to www. www keeps answering with a 301 to the apex.

If something goes wrong:

  • The records disappear again: stop. Do not recreate them. Read the Cloudflare audit log for those two names to find what deletes them. www keeps working on its current addresses either way.
  • external-dns unexpectedly changes or deletes www: the platform takes www.devantler.tech out of the business-site-public route. This repository then forgets the two records in a follow-up change. www stays on the gateway addresses it has now, unmanaged, until the cause is fixed.

🤖 Generated with Claude Code

Edit the existing apex CNAME in place from devantler.github.io (DNS only)
to www.devantler.tech (proxied). One record changes its target, so the
site is never without an address, and the apex then follows www and the
gateway. This replaces #77, which carried the same edit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devantler devantler changed the title fix(dns): restore external-dns ownership of www feat(dns): move the apex to the platform and restore external-dns ownership of www Nov 15, 2026
@devantler

Copy link
Copy Markdown
Contributor Author

Rollback plan, written before the apply

What this apply does: it edits the apex CNAME in place, from devantler.github.io (DNS only) to www.devantler.tech (proxied). One record changes its target, so devantler.tech always resolves. The apex then follows www, which external-dns points at the gateway. This repository also forgets the one-time www ownership record.

How to check it worked: devantler.tech resolves to Cloudflare and serves the platform's business site. The platform cutover session verifies this, including the parity crawl.

Rollback, with no gap:

  1. Open a pull request that reverts the apex record to content = "devantler.github.io", proxied = false, comment = "GitHub Pages Personal".
  2. Merge it, then run the DNS workflow: plan first, then apply. It is again an in-place update of one record, so the boundary admits it and there is no gap.

Keep GitHub Pages and its devantler.tech custom domain configured until the new site has been stable for a while, so this rollback stays available. The ownership record this change forgets belongs to external-dns, so it is never restored here.

🤖 Generated with Claude Code

From the local review of the handover list:
- A listed record may only be claimed by its own typed marker
  (`_externaldns.<type>-<name>`), never by a wider typeless one.
- Listed names use hostname characters without `_`, so the list can
  never name a DKIM or other service record.
- Test a listed name with an unlisted type, a typeless marker, an extra
  top-level key, the 20-entry cap, an underscore name, and the
  repository's own .github/dns-handover.json; each rule fails a test when
  removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@devantler devantler left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Local review of #78. A fresh reviewer read the handover list at 511b820, then the head moved to add the apex edit. I reviewed the apex edit and the fixes myself, up to 7cfd080. CodeRabbit is out of its hourly allowance, and Codex and Bugbot are at their usage limits.

What the fresh review confirmed, with no critical or major findings:

  • Every malformed list fails closed: missing, empty, not an object, a lowercase type, an extra key, an array where a name belongs.
  • Names are normalised the same way on both sides.
  • Claims on records declared here are still refused, and so is the typeless apex, even if it is listed. MX and TXT records can never be listed.
  • apply-dns.sh validates the file before the check. The intended plan passes on jq 1.8.1.

Three minor findings, fixed in 7cfd080:

  • A typeless _externaldns.www could pass, and it claims more than the list names. A listed record may now be claimed only by its own typed marker.
  • List names allowed _, so the list could name a DKIM record. Underscores are no longer allowed.
  • Tests were missing for a listed name with an unlisted type, an extra top-level key, the 20-entry cap, an underscore name, and the repository's own list file. They are added, and each rule fails a test when removed.

The apex edit is the same in-place change reviewed on #77. The CNAME's content goes from devantler.github.io to www.devantler.tech, and proxying is turned on. The guard admits it, because no external-dns marker owns the apex before or after the change. The rollback plan is in the comments.

scripts/test.sh passes (21 suites), and the DNS tests pass on jq 1.7.1 and 1.8.1. Clean at 7cfd080.

🤖 Generated with Claude Code

@devantler

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 1b84c189-746c-4c94-8db8-f1d37594d944
Commits

Reviewing files that changed from the base of the PR and between 81ab7a9 and 7cfd080.

Files selected for processing: 9

  • .github/dns-handover.json
  • dns.tf
  • docs/runbooks/bootstrap-and-recovery.md
  • recovery/backend-source/configuration.json.age
  • recovery/backend-source/manifest.json
  • recovery/backend-source/state.json.age
  • scripts/apply-dns.sh
  • scripts/check-dns-plan.jq
  • scripts/tests/test-dns-apply.sh

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Recent review details

Context from checks skipped due to timeout: 1

  • GitHub Check: CodeRabbit
Additional context used

Learnings: 1

Common learnings

Learnt from: CR
Repo: devantler-tech/cloudflare

Timestamp: 2026-11-15T04:30:04.202Z
Learning: Applicability reference:
AGENTS.md: # AGENTS.md — devantler-tech/cloudflare
## What this repo is
CI checks links in `README.md` and this file against the repository-owned retired
catalogue list in `.github/retired-repo-links.json`. The required guard verifies
clean documentation, rejected retired links, and missing configuration. Run
`bash scripts/test-retired-repo-links.sh <released-validator-binary>` to repeat
the clean and disposable failure fixtures locally.

Source excerpt:
# cloudflare

## Safety state

DNS records are declared in [`dns.tf`](dns.tf) and change only through the
manual **DNS plan and guarded apply** workflow: plan first, then apply the same
reviewed revision. It imports declared records that already exist, never
deletes or replaces anything, and keeps an encrypted state copy from before and
after every apply. Other resources still have no general apply path.
LanguageTool

docs/runbooks/bootstrap-and-recovery.md

[style] ~375-~375: ‘by accident’ might be wordy. Consider a shorter alternative.
Context: ...ail record, or any record nobody chose, by accident. The public log shows DNS_PLAN and `D...

(EN_WORDINESS_PREMIUM_BY_ACCIDENT)

Additional comments: 1

dns.tf: 1

23-23: Functional Correctness

The apex CNAME change in dns.tf does not, by itself, show that devantler.tech fails to reach the business site. The concern depends on gateway routing and origin Host handling outside the supplied configuration. The cited Cloudflare excerpt describes Host overrides but does not establish a required override for this record. No material defect in the reviewed change is established from the supplied evidence.

Walkthrough

The www DNS route now points to www.devantler.tech and is proxied. Separate A and AAAA ownership records replace the former CNAME ownership record, which is retained without destruction. The apply path validates .github/dns-handover.json and passes it to the plan check. The check permits listed records only when their type and ownership marker match. Tests and runbook text cover these rules. The recovery manifest records an updated capture.

Possibly related issues

Possibly related PRs

Merge Risk: Minimal · up to 7cfd0

This change moves the apex to the proxied www hostname and restores external-dns ownership of www. It adds a reviewed handover list that the DNS plan check validates. No concrete defect was found in the changed code. The platform cutover should still verify live that the apex serves the business site, as the author plans.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the apex moves to the platform, and external-dns ownership of www is restored. The summary covers the apex CNAME edit in dns.tf, the replacement of the ownership TXT r…
Description check Passed The description explains the why and the what. It covers the apex move to proxied www, the recreated external-dns ownership TXT records, the reviewed handover list limited to www A and AAAA, the remov…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the apex moves to the platform, and external-dns ownership of www is restored. The summary covers the apex CNAME edit in dns.tf, the replacement of the ownership TXT records, and the handover list. The title is specific and accurate, though it is long and includes a second change.

Full details: Description check

Explanation

The description explains the why and the what. It covers the apex move to proxied www, the recreated external-dns ownership TXT records, the reviewed handover list limited to www A and AAAA, the removal of the one-time handover tracking, and the retained encrypted state. It also gives rollback plans and the cutover verification. This matches the changeset in dns.tf, the handover JSON, and the check-dns-plan.jq and apply-dns.sh changes.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@devantler
devantler marked this pull request as ready for review November 15, 2026 04:50
@devantler
devantler merged commit 9005e2a into main Nov 15, 2026
16 checks passed
@devantler
devantler deleted the claude/dns-www-reown branch November 15, 2026 04:50
devantler added a commit that referenced this pull request Nov 15, 2026
external-dns's `_externaldns.a-www` and `_externaldns.aaaa-www` records
are back in the zone with its own content, so the plan for #78 refused to
create or adopt them (external-dns-owned) and applied nothing. Drop the
two record resources and empty the handover list; the apex edit and the
forget of the old cname-www marker remain.

Part of #21.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant