feat(parking): send Moshpit names to the Pit instead of a parked card - #87
Merged
Conversation
A name in our own network was landing on this app's generic parked-domain page — "Scrambled IS COMING" about a name that is one click from being yours in the Pit. That is a dead end, and it is not the network we are selling. /parking?name=<name> now 308s to <pit>/n/<name>. Permanent, not temporary, so crawlers follow it and index the Pit's page for the name rather than holding on to a moshcoding.com URL that only ever bounces. The Pit base is PIT_BASE_URL (default https://pit.moshcode.sh), and the host is fixed in code — safeDomain() validates the name before it is appended, so nothing that survives it can redirect off-site. No usable name falls back to the Pit's front door rather than a 404. Host-header parking for real clearnet domains is untouched: those still render the tenant page at /. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
ralyodio
added a commit
that referenced
this pull request
Aug 1, 2026
#87 moved /parking?name= to the Pit, but that is not how a parked name actually arrives. The DNS resolver points an unpointed name at this app (DEFAULT_PARKING_HOST), so `curl scrambled.eggs` lands here as a Host header and still rendered the "IS COMING" tenant card. A name resolved from the Host now redirects to <pit>/n/<name>, while an ordinary parked clearnet domain renders exactly as before. Which is which is asked of the Pit per name, not by pulling its ending list: that list is capped at 200 and `.eggs` already falls outside it, so matching against it would quietly answer "no" for real names. resolve's `registered` flag has no such ceiling. 307, not 308. The owner can point the name at a real target at any moment; a permanent redirect cached in a browser would keep sending them here long after this app stopped being the answer. /parking keeps its 308 — that URL will always mean "go to the pit". Fails closed: an unreachable Pit answers "not ours", so a registry outage leaves every parked domain rendering as it does today rather than bouncing the whole internet at /n/. Answers are memoised per name behind a 5-minute TTL, with a bounded map because Host is attacker-controlled. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
A name in our own network was landing on this app's generic parked-domain page — "Scrambled IS COMING" about a name that is one click from being yours in the Pit. That's a dead end, and it isn't the network we're selling.
Change
/parking?name=<name>now 308s to<pit>/n/<name>.Permanent rather than temporary on purpose: the name's home really is
/n/<name>, so crawlers should follow the redirect and index the Pit's page for it, instead of holding on to amoshcoding.comURL that only ever bounces./parking?name=hawaiian.chicken308→https://pit.moshcode.sh/n/hawaiian.chicken/parking?name=scrambled.eggs308→https://pit.moshcode.sh/n/scrambled.eggs/parking(no name)308→https://pit.moshcode.sh/pit/parking?name=notaname308→https://pit.moshcode.sh/pitThe Pit base is
PIT_BASE_URL(defaulthttps://pit.moshcode.sh). The host is fixed in code andsafeDomain()validates the name before it's appended, so nothing that survives validation can redirect off-site — there's a test for exactly that.Host-header parking for real clearnet domains is untouched — a genuine parked domain pointed at this service still renders its tenant page at
/. This only changes the/parkingroute.Verification
bun test tests/— 148 pass, 0 fail (6 for this, replacing the previoustoTenantParamstests)bun run buildclean,/parkingstill in the route tableLocationheaders — the table above is measured, not assumed🤖 Generated with Claude Code