web: stop advertising retired hosted subrouter

Merged
TE
19d ago
+45-18

The CLI config endpoint advertised sr.cmux.com even when the hosted Subrouter URL was unset. That retired origin has no DNS, so new sr login clients attempted a dead exchange path. Make hosted Subrouter opt-in: when SUBROUTER_HOSTED_URL is absent, omit the subrouter block from public CLI config instead of publishing a dead default.

Validation:

  • heavy --mem 4G bun test web/tests/cli-config-route.test.ts
  • 7 tests passed

The released CLI fallback in subrouter recognizes the omitted block and directs users to the legacy/team-server path.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Stops the CLI config endpoint from advertising the retired hosted Subrouter origin, which has no DNS and previously sent new sr login clients down a dead exchange path. Hosted Subrouter is now opt-in.

  • When SUBROUTER_HOSTED_URL is unset, the public CLI config omits the subrouter block instead of publishing the dead default.
  • When the env var is set to an invalid URL, the route returns 503.
  • The released CLI fallback recognizes the omitted block and directs users to the legacy/team-server path.

Validation: heavy --mem 4G bun test web/tests/cli-config-route.test.ts — 7 tests passed.

Summary by CodeRabbit

  • Bug Fixes
    • CLI configuration now includes Subrouter URLs only when a hosted URL is configured, rather than using a default URL when none is set. When no hosted URL is configured, the Subrouter field is omitted. Invalid hosted URLs, including URLs using HTTP, return an unavailable response.