Repository navigation
Serve a Moshpit name from a c0mpute site - #600
Merged
Merged
Conversation
A name may now point at a static site on the c0mpute network:
moshcode name c0mpute blue.eggs <site_id>
PUT /api/moshpit/tlds/:tld/names/c0mpute { label, site }
Registry: new moshpit_names.c0mpute_site (migration 028, both dialects).
When MOSHPIT_C0MPUTE_EDGE names the edge's hostname, /api/moshpit/resolve
answers that hostname as the name's target (and the site id as `c0mpute`),
so the bridge, dns.moshcode.sh and TronBrowser reach the edge with no
change. With it unset nothing resolves differently. Setting a target
clears the site; a sale or a lapsed lease clears it too.
CA: an account in MOSHPIT_C0MPUTE_EDGE_USERS may be issued a leaf for a
name only while its holder has it pointed at c0mpute; the pin is published
under the holder. The edge itself is profullstack/moshpit-proxy
bin/moshpit-c0mpute-edge.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ThreatCrush Security Scan50 finding(s) in the 13 file(s) this pull request changes. MEDIUM: 50
64 pre-existing finding(s) elsewhere in the repository — **HIGH/CRITICAL**: 8 | **MEDIUM**: 37 | **LOW**: 19Not introduced by this pull request. The full set is in the Security tab.
…and 44 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.
What
A Moshpit name can now point at a static site on c0mpute (p2p hosting, three self-healing copies, served by every gateway at
/s/<site_id>/):API:
PUT /api/moshpit/tlds/:tld/names/c0mpute { label, site }(bearer key, holder or tenant).How it reaches a browser
c0mpute gateways speak plain HTTP on :7777 and hold no Moshpit certificate, so answering A/AAAA with gateway addresses would give
https://blue.eggsa refused connection. Instead the name resolves to a c0mpute edge (profullstack/moshpit-proxy#31,bin/moshpit-c0mpute-edge.ts) that holds a Moshpit CA leaf for the name and fetches/s/<site_id>/from any healthy gateway with failover.moshpit_names.c0mpute_site(migration 028, sqlite + pg).MOSHPIT_C0MPUTE_EDGE(a hostname) is set,/api/moshpit/resolveanswers it as the name'starget, plusc0mpute: <site_id>. Every resolver already deployed (bridge, dns.moshcode.sh DoH, TronBrowser) follows a hostname target, so no resolver change. Unset = nothing resolves differently (safe to merge before an edge exists).handOverName) or a lapsed lease clears it too, and a lapsed-but-unswept lease never serves it.MOSHPIT_C0MPUTE_EDGE_USERSmay get a leaf for a name only while its holder has it pointed at c0mpute. The pin is published under the holder. Unset = only holders, as before.apps/pwa/docs/moshpit-ca.md, CLI help/README table regenerated.No DNS on any user machine is touched; the CLI is one registry write.
Tests
apps/pwa/test/moshpit-c0mpute.test.mjs(real libSQL + in-memory CA): validation, holder-only, resolve with/without edge, target clears site, edge issuance allowed only while the site is set and only for edge accounts.test/name-c0mpute.test.mjs: CLI request shape, off, bad input never sent, auth and registry errors,namedispatch +--json.node --test3702 tests, 3698 pass, 0 fail (rest skipped);apps/pwa828/828.🤖 Generated with Claude Code