Skip to content

STE-57: serve the landing page at sterish.xyz, not the dashboard - #67

Closed
Lin1er wants to merge 3 commits into
mainfrom
feat/ste-57-apex-landing-host-rewrite
Closed

Lin1er wants to merge 3 commits into
mainfrom
feat/ste-57-apex-landing-host-rewrite

Conversation

@Lin1er

@Lin1er Lin1er commented Sep 28, 2026

Copy link
Copy Markdown
Owner

sterish.xyz has been attached to the dashboard's Vercel project since STE-26, but nothing routed the apex host anywhere. Checked this morning, both hosts returned byte-identical HTML for / (146,999 bytes, <title>Registry · Sterish</title>), so the brand URL printed in the Instawards report, the video script and the X bio served the registry dashboard instead of the landing page from STE-23.

What changed

One host-based rewrite, / → /landing, for sterish.xyz and www.sterish.xyz. Everything else is untouched:

Host / renders
sterish.xyz, www.sterish.xyz the landing page
app.sterish.xyz the registry dashboard
preview URLs, localhost the registry dashboard

/landing keeps answering on every host, because shared links and the report point at it, and every other route resolves identically on every host.

No second repo and no second Vercel project: the landing is 13 lines of page plus one module, and it shares the design tokens and /brand page from STE-7 and the API config with the dashboard. Splitting it would duplicate both for no gain at this stage.

Two things that cost an iteration, both written down next to the code

  • The rule must sit in beforeFiles. The plain array form becomes afterFiles, which Next only consults once nothing else matched — and / is a real route. The first version built cleanly, appeared in the routes manifest, and did nothing.
  • Next matches has: host against ^value$ on the lowercased hostname with the port stripped, so the dots are escaped. Unescaped, sterishaxyz would match sterish.xyz.

The host list is a tested module (frontend/src/lib/landingHosts.ts) rather than a literal in next.config.ts, because rewrites are compiled into the routes manifest at build time: a mistake there is invisible until it is deployed. LANDING_HOSTS overrides it at build time, which is also how this was verified locally.

Verification

Against a production build with the production defaults, by Host header:

Host / Result
sterish.xyz 200 landing (60,860 bytes)
www.sterish.xyz 200 landing
STERISH.XYZ 200 landing (case-insensitive)
app.sterish.xyz 200 dashboard (146,643 bytes)
localhost 200 dashboard
not-sterish.xyz 200 dashboard
sterish.xyz.attacker.example 200 dashboard

/landing, /check, /activity, /brand, /licences, /licences/{address} and /skills/{id} unchanged on every host; an unknown path still 404s.

10 new tests, 186 green in frontend. pnpm typecheck, pnpm lint, pnpm test, pnpm build all green. No coverage gate on the frontend (that gate is the contracts' cargo llvm-cov).

Scope note

frontend/ belongs to @AncungAulia and @sharkzneverending. This change is confined to routing config, its tests and docs — no landing markup and no dashboard page is touched.

Follow-up, deliberately not done here: a canonical URL for the landing page, which now answers on two paths (/ on the apex, /landing everywhere). That belongs with the polish pass in STE-24. The apex → www 308 is a Vercel domain setting, not in this repo; both hosts are matched so the rewrite holds whichever way it points.

Linear: STE-57 · docs: docs/deployments.md "One deployment, two front doors", frontend/README.md "Which host serves what"

cc @axel @fable for review

@vercel

vercel Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sterish Ready Ready Preview Sep 28, 2026 1:06pm UTC

sterish.xyz has been attached to the dashboard's Vercel project since STE-26,
but nothing routed the apex host anywhere: both hosts returned byte-identical
HTML for "/", so the brand URL printed in the report, the video script and the X
bio served the registry dashboard instead of the landing page from STE-23.

One host-based rewrite fixes it. On sterish.xyz and www.sterish.xyz, "/" renders
/landing; on app.sterish.xyz, preview URLs and localhost it stays the dashboard.
/landing keeps answering everywhere, because links already shared point at it,
and every other route resolves identically on every host.

Two things this cost an iteration to learn, both now written down next to the
code:

- The rule must sit in `beforeFiles`. The plain array form becomes `afterFiles`,
  which Next only consults once nothing else matched, and "/" is a real route —
  so the first version built cleanly, appeared in the routes manifest, and did
  nothing.
- Next matches `has: host` against `^value$` on the lowercased hostname with the
  port stripped, so the dots are escaped: unescaped, `sterishaxyz` would match.

The host list is a module with unit tests rather than a literal in next.config,
because rewrites are compiled into the routes manifest at build time: a mistake
there is invisible until it is deployed. `LANDING_HOSTS` overrides it at build
time, which is also how this was verified.

Verified against a production build with the production defaults, by Host
header: sterish.xyz, www.sterish.xyz and STERISH.XYZ render the landing page at
"/"; app.sterish.xyz, localhost, not-sterish.xyz and sterish.xyz.attacker.example
render the dashboard; /landing, /check, /activity, /brand, /licences,
/licences/{address} and /skills/{id} are unchanged on every host, and an unknown
path still 404s.

10 new tests, 186 green in frontend. typecheck, lint and build green.
docs/deployments.md claimed sterish.xyz was a 404 reserved for the landing page.
It has not been a 404 since STE-26; until this ticket it served the dashboard.
The table now records what each hostname actually returns, checked today, and
adds the direct /landing URL that shared links and the Instawards report use.

The frontend README gains the host table and the LANDING_HOSTS recipe for seeing
the landing page at "/" on a local build, since rewrites are baked in at build
time and `pnpm dev` alone will not show it.
A repository ruleset appeared on the default branch today at 19:20 (+07):
no direct push, PR required, and `required_signatures`. `bypass_actors` is empty
and `current_user_can_bypass` is "never", so `gh pr merge --admin` does not help
either — unsigned commits simply cannot reach main.

Writes down what this worktree is now configured with (SSH signing with the
existing key), the one step that config cannot do for itself — registering the
same public key as a Signing Key on the GitHub account, which is why GitHub
still answers `reason: "unknown_key"` — and the command to tell the two failure
modes apart.
@Lin1er

Lin1er commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

Blocked on one account setting, not on the code.

A repository ruleset named master appeared on the default branch today at 19:20 (+07): PR required, no direct push, and required_signatures. Its bypass_actors list is empty and current_user_can_bypass is never, so --admin does not help — this has to be satisfied, not bypassed.

The commits on this branch are now SSH-signed, but GitHub answers:

{"sha":"89e4c349","verified":false,"reason":"unknown_key"}
{"sha":"73ff6136","verified":false,"reason":"unknown_key"}

unknown_key means the signature is fine but the public key is not registered as a Signing Key on the account — an authentication key does not count. Registering it at https://github.com/settings/ssh/new (type: Signing Key) makes both commits verify, and then this PR can merge.

The last commit writes the whole thing down in CLAUDE.md, including how to tell unknown_key (key not registered) from unsigned (commit made without signing), so the next PR does not rediscover it.

CI is green: install + lint + build success, Vercel preview deployed.

@Lin1er

Lin1er commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

Closing this in favour of #66. @Nabil-Aufa had already done it, five minutes earlier and one layer deeper: this PR routed a host, his splits the landing into its own deployable app.

His version is the better one, and not only because it came first:

  • The wallet button. Serving both from one app meant the landing inherited the product nav and a "Connect wallet" button above the fold. A host rewrite does not fix that — it just changes which URL shows it.
  • No logo, bare ending. The lockup and footer came from the dashboard's layout, so the landing only looked complete because it was borrowing chrome it had no claim to. This PR would have shipped that as the front door.
  • Weight. 3 runtime dependencies against 14, a 2-request API client against 391 lines, and a 10s timeout instead of 30s on a page a stranger reads first.
  • The token copy is guarded. The duplication I argued against is real, and tokens.drift.test.ts fails the build when the two globals.css disagree — verified by breaking it on purpose. That is the part I assumed would be left to memory, and it is not.

One consequence of #66 worth stating out loud, because it is not in its description: it deletes frontend/app/landing/, so https://app.sterish.xyz/landing will 404 after it merges. That URL is cited in the Instawards report and in links already shared. Between the merge and the new Vercel project being pointed at sterish.xyz with root directory landing/, the landing page is reachable at no URL at all — so those two steps belong together, and the report needs its URL updated afterwards. I will handle the report.

Kept out of the bin: the CLAUDE.md note about the ruleset on main, moved to #68. It turns out to be what is blocking #66 and #63 as well.

Branch feat/ste-57-apex-landing-host-rewrite is left on the remote rather than deleted, so the host-rewrite approach stays readable if the two apps are ever folded back into one.

@Lin1er Lin1er closed this Sep 28, 2026

This branch was successfully deployed

1 active deployment
Preview — 9b27337a Deployed Sep 28, 2026 by vercel[bot]
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