Skip to content

feat(pit): set and show a name's c0mpute site on the DNS Records page - #604

Merged
ralyodio merged 1 commit into
mainfrom
feat/records-c0mpute-site
Nov 9, 2026
Merged

ralyodio merged 1 commit into
mainfrom
feat/records-c0mpute-site

Conversation

@ralyodio

@ralyodio ralyodio commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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. So cloud.killer, which resolves to edge.c0mpute.com, looked like it skipped DNS entirely.

What changes

/pit/records: every name you hold now has a c0mpute section:

  • When a site is set, it shows c0mpute site: <id> (served by edge.c0mpute.com), linked to https://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.
  • An input with Save/Change. It accepts a bare 20-hex id, site=<id>, or a gateway URL, the same as the CLI.
  • An explanation that matches how addressAnswer in src/dns.mjs works (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 point clears the site.
  • The form posts to the new POST /pit/records/c0mpute (requireAuth + CSRF). That route calls setNameC0mpute, the same write behind PUT /api/moshpit/tlds/:tld/names/c0mpute and the CLI, so no new write path was added.
  • The "publish records from a script" help now includes the curl for the c0mpute PUT.

GET /api/moshpit/records gains c0mpute (the site id or null) and edge (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.mjs gets 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 in herd-routes approve, a timing flake that passes 13/13 when run alone. bun test on the file: 17/17.

🤖 Generated with Claude Code

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>
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

ThreatCrush Security Scan

40 finding(s) in the 3 file(s) this pull request changes.

MEDIUM: 40

Severity Rule Location
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:140
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:154
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:180
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:374
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:378
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:423
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:707
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:909
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:911
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:970
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1016
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1090
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1193
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1216
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1238
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1437
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1587
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1736
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1742
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1789
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1838
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1869
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1969
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:2088
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:2100
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:2112
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:2146
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:2344
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:2357
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:2383
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:2389
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:2393
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:2403
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:2534
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:2686
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:2694
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:2702
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:2732
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:2871
MEDIUM js-unescaped-html-sink apps/pwa/src/routes/moshpit.mjs:3024
85 pre-existing finding(s) elsewhere in the repository — **HIGH/CRITICAL**: 8 | **MEDIUM**: 47 | **LOW**: 30

Not introduced by this pull request. The full set is in the Security tab.

Severity Rule Location
HIGH js-ssrf-outbound-request apps/pwa/public/sw.js:76
HIGH tls-verification-disabled apps/pwa/src/lib/moshpit-gateway.mjs:299
HIGH sh-remote-script-execution install.sh:87
HIGH sh-remote-script-execution install.sh:91
HIGH sh-remote-script-execution install.sh:259
HIGH sh-remote-script-execution install.sh:270
HIGH sh-remote-script-execution install.sh:276
HIGH tls-verification-disabled src/dns.mjs:823
MEDIUM js-unescaped-html-sink apps/pwa/public/herd/herd.js:117
MEDIUM sql-template-interpolation apps/pwa/src/lib/moshpit-certs.mjs:56
MEDIUM sql-template-interpolation apps/pwa/src/lib/moshpit-certs.mjs:117
MEDIUM sql-template-interpolation apps/pwa/src/routes/mcp.mjs:87
MEDIUM js-dynamic-code-execution apps/pwa/test/apikey-mask.test.mjs:129
MEDIUM sql-template-interpolation apps/pwa/test/credits-webhook-event-match.test.mjs:121
MEDIUM sql-template-interpolation apps/pwa/test/credits-webhook-event-match.test.mjs:141
MEDIUM sql-template-interpolation apps/pwa/test/moshpit-terms.test.mjs:207
MEDIUM sql-string-concatenation src/cli-schema.mjs:271
MEDIUM sql-string-concatenation src/cli-schema.mjs:394
MEDIUM sql-string-concatenation src/cli-schema.mjs:843
MEDIUM sql-string-concatenation src/cli-schema.mjs:876

…and 65 more. Full results in the Security tab.

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit 1a78d98 into main Nov 9, 2026
7 checks passed
@ralyodio
ralyodio deleted the feat/records-c0mpute-site branch November 9, 2026 11:58
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