feat(self-host): configurable status page base domain, no Vercel when self-hosted

TU
1h ago
+1170-152

Problem

Self-hosted status pages cannot use slug routing on the instance's own domain, and custom domains cannot be removed:

  • getValidSubdomain reads the slug only for hosts under openstatus.dev / stpg.dev. Any other host, e.g. acme.status.example.com behind a wildcard record, is looked up as a custom domain, so the page with slug acme is not found.
  • The dashboard and the status page hard-code {slug}.openstatus.dev (slug field suffix, onboarding, page links, canonical/alternate links, feed links).
  • Saving a custom domain always calls the Vercel API. Without Vercel the call fails, so a custom domain can be set through the API but never cleared from the dashboard. The "Domain cannot contain 'openstatus'" check also blocks e.g. status.openstatus.example.com, and the custom-domain form shows Vercel DNS/SSL instructions that do not apply.

Change

  • New runtime env STATUS_PAGE_BASE_DOMAIN (server-side, default openstatus.dev, so hosted behaviour is unchanged).
    • status-page: {slug}.{base} resolves by slug like {slug}.openstatus.dev; base URL, canonical/alternates and feed links use it (client components get it from the [domain] layout via a small context).
    • dashboard: slug suffix, onboarding summary, page links, list column and chat summaries use it, passed from the root server layout through a DeploymentConfigProvider. Read at runtime, not NEXT_PUBLIC_*, so prebuilt images can be configured.
    • api: subscriber verification links use it.
  • When SELF_HOST=true:
    • Vercel add/remove helpers are no-ops, so setting and clearing a custom domain only updates the row.
    • The "openstatus" substring check is skipped.
    • The domain status/verify/certificate endpoints return a neutral verified result without calling Vercel; the custom-domain form hides the DNS/SSL panel and shows a one-line reverse-proxy hint.
  • .env.docker.example / .env.docker-lightweight.example document the variable.

Not in this PR: apps/server (REST/RPC page routes still reject "openstatus" and build {slug}.openstatus.dev links), packages/emails, packages/subscriptions, packages/services/agent-tools, packages/react widget. Happy to follow up if the approach is fine.

Tests

New/extended unit tests in apps/status-page (base-domain, domain, resolve-route, base-url, alternates, resolve-default-rewrite), apps/dashboard (deployment-config, status-pages.client, chat tool-renderer registry) and packages/api (deployment, page.custom-domain.self-host, hosted "openstatus" rejection kept).

Local run: status-page 546 passed, dashboard 451 passed, api 448 passed; pnpm format:check clean; tsc --noEmit clean for dashboard and api.