Repository navigation
feat(pit): set and show a name's c0mpute site on the DNS Records page - #604
Merged
Merged
Conversation
Each name on /pit/records now shows the c0mpute site it points at (linked to gateway.c0mpute.com/s/<id>/, served by the configured edge), with a field to set it and a Clear button. The form writes through setNameC0mpute, the same function behind PUT /api/moshpit/tlds/:tld/names/c0mpute and `moshcode name c0mpute`. The card explains that Moshpit resolvers answer an address question from published A/AAAA/CNAME records before following the edge, and flags a name that publishes both. GET /api/moshpit/records now carries `c0mpute` and `edge`, so an empty zone on a c0mpute-served name no longer reads as parked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ThreatCrush Security Scan40 finding(s) in the 3 file(s) this pull request changes. MEDIUM: 40
85 pre-existing finding(s) elsewhere in the repository — **HIGH/CRITICAL**: 8 | **MEDIUM**: 47 | **LOW**: 30Not introduced by this pull request. The full set is in the Security tab.
…and 65 more. Full results in the Security tab. Snippets are redacted; ThreatCrush never prints matched credential material. |
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.
Pointing a Moshpit name at a c0mpute site was CLI-only (
moshcode name c0mpute <name> <site_id>), and the DNS Records page showed nothing for those names. Socloud.killer, which resolves toedge.c0mpute.com, looked like it skipped DNS entirely.What changes
/pit/records: every name you hold now has a c0mpute section:
c0mpute site: <id> (served by edge.c0mpute.com), linked tohttps://gateway.c0mpute.com/s/<id>/, plus a Clear c0mpute site button. The card's "resolves to" line now shows the effective target (the edge), not the stored column.site=<id>, or a gateway URL, the same as the CLI.addressAnswerinsrc/dns.mjsworks (used by both the bridge and the DoH server). An address question is answered from published A/AAAA, then CNAME records, and only after that does it follow the target, which is the edge. Those records therefore override the c0mpute site, and the card shows a warning when a name has both. MX and TXT keep working.moshcode name pointclears the site.POST /pit/records/c0mpute(requireAuth + CSRF). That route callssetNameC0mpute, the same write behindPUT /api/moshpit/tlds/:tld/names/c0mputeand the CLI, so no new write path was added.GET /api/moshpit/records gains
c0mpute(the site id or null) andedge(the serving host, or null while no edge is configured). Status codes are unchanged: an empty record set is still a 404, but its body now says the name is served from c0mpute.d1sks needs no field: it is just where c0mpute keeps the site's copies, and any gateway serves any site id.
Tests
apps/pwa/test/moshpit-records-page.test.mjsgets 6 new cases: the field is drawn; save shows the link, edge and effective target and shows up in resolve and in the records API; without an edge the site is stored and labelled unserved; an A/AAAA beside a site gets the warning; clear; a bad id and someone else's name are refused. Results: node 17/17 + c0mpute 10/10. Full PWA suite: 832 pass. The only failures were inherd-routesapprove, a timing flake that passes 13/13 when run alone.bun teston the file: 17/17.🤖 Generated with Claude Code