Skip to main content
apps/infrastructure has native TanStack Start + Vite+ + Void source beside its Next build, generated by the start-bridge codemod. The Next build and vercel.json are untouched, so the current deployment keeps serving until the route is flipped. vercel-production-infrastructure.yaml still deploys the Next app.

Worker

  • Staging candidate: the staging Worker name (workers_dev off, TUTURUUU_NOINDEX=1). A production Worker (tuturuuu-infrastructure, workers_dev and preview_urls off, TUTURUUU_NOINDEX=0) is created by the cutover PR; nothing here attaches a route.
  • Entry: apps/infrastructure/cloudflare/worker.ts; Wrangler config is emitted by void into dist.
  • Host: infrastructure.tuturuuu.com. Root-only: mountHosts is empty and unknownHost is reject, so tuturuuu.com/infrastructure and any other host answer 404 before app code runs.
  • Binding: ASSETS (static output, run_worker_first).
  • Variables (names): TUTURUUU_NOINDEX, optional INTERNAL_WEB_API_ORIGIN (default https://tuturuuu.com).
  • Secrets (names, set in the Worker, never in the repo): NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY, SUPABASE_SECRET_KEY, TUTURUUU_APP_COORDINATION_SECRET, TUTURUUU_AZURE_TENANT_ID, ENCRYPTION_MASTER_KEY, CRON_SECRET, OPS_HUB_GATEWAY_SECRET, OPS_HUB_WORKER_URL, CHAT_REALTIME_TOKEN_SECRET, AUTH_RECOVERY_HASH_SECRET, GITHUB_TOKEN. Compare with the Vercel project environment list before the flip.
  • Other names the source reads (verify each against the Vercel project list before the flip; set only the ones that project defines): FIREBASE_PROJECT_ID, FIREBASE_CLIENT_EMAIL, FIREBASE_PRIVATE_KEY, MODAL_TOKEN_ID, MODAL_TOKEN_SECRET, EMAIL_UNSUBSCRIBE_SECRET, INVENTORY_SIMULATED_ORDER_SECRET, OPS_HUB_ALLOWED_USER_IDS, REQUIRED_MFA_POLICY_ENABLED.
  • Known gap: vite.config.mts aliases playwright to a stub that always fails, so only the Zalo web sync reports the browser as unavailable on Workers; every other route is unaffected. The Docker, blue-green, cron-control and stress-test panels read PLATFORM_* host paths and tokens that do not exist on Workers; they report unavailable there. Do not rerun the start-bridge codemod on this app without restoring the playwright alias in vite.config.mts.

Build and qualification

infrastructure-cloudflare.yaml runs the same steps in CI. test:runtime starts the emitted Worker in workerd with synthetic secrets and no network egress: build identity, root host, apex rejection, unknown paths, and the signed-out redirect through the app-owned cloudflare/auth-redirect.runtime.mjs fixture (8 checks). The app proxy admits anonymous GET/HEAD /api/build-info without an app-session refresh, so deployment verification gets 200 instead of 401.

Smoke checks after the route is attached

Every page redirects signed-out users to login, so a signed-in check needs a test session and belongs to the release owner. No smoke request may return 5xx.

Rollback

  1. Before the flip, record the current production Vercel deployment id for the app (the repo does not store it) and the DNS records and TTLs for infrastructure.tuturuuu.com in the release record.
  2. Roll back by detaching the Worker route or restoring the captured DNS records to the recorded deployment. vercel-production-infrastructure.yaml still deploys the Next app.
  3. Rerun the smoke checks against the previous origin.
Rolling back touches no database rows and no migrations. Route, DNS and deployment changes belong to the release owner.