> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tuturuuu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Admin app

> Information architecture, migration map and delivery path for the platform admin app served at tuturuuu.com/admin.

The platform admin surface is served at `https://tuturuuu.com/admin` by the
`tuturuuu-infrastructure` Cloudflare Worker behind the apex gateway (binding
`MOUNT_ADMIN`). The source lives in `apps/admin` (package `@tuturuuu/admin`);
the app key, Worker name and legacy host keep `infrastructure`, and
`scripts/app-directories.json` maps that key to the directory for CI tooling.
`infrastructure.tuturuuu.com` answers page navigations with a 301 to
`tuturuuu.com/admin`.

A checkout that existed before the move can keep an ignored
`apps/infrastructure/` directory (usually only `node_modules`). Delete it with
`rm -rf apps/infrastructure` before running tests or generators; the docs
inventory generator skips such build-output-only directories, but other tools
may still treat it as an app.

## Access

Every page and API keeps the existing gate: the root workspace plus a root
admin check (`enforceInfrastructureRootWorkspace` →
`enforceRootWorkspaceAdmin`). Pages that need a narrower permission keep that
check as well. The rebuild reuses these checks unchanged and never adds a
fallback page for denied members (they get 404).

## Information architecture

| Section | Routes (under `/admin/<wsId>`) |
| - | - |
| Overview | `/` |
| Users and accounts | `/users`, `/internal-accounts`, `/account-benefits`, `/auth-recovery`, `/parley` |
| Workspaces | `/workspaces`, `/entity-creation-limits` |
| Rate limits and abuse protection | `/rate-limits`, `/rate-limit-appeals`, `/blocked-ips`, `/abuse-events`, `/abuse-intelligence`, `/otp-limits`, `/email-blacklist` |
| Deployments | `/deployments` (deploy coordinator at `deploy.tuturuuu.com`), `/desktop-deployment`, `/mobile-deployment`, `/mobile-versions`, `/feature-flags`, `/migrations` |
| Costs | `/costs` |
| Monitoring and observability | `/monitoring` and its children (`analytics`, `observability`, `resources`, `deployments`, `rollouts`, `requests`, `logs`, `cron`, `projects`, `stress-tests`, `watcher-logs`), `/realtime` |
| Push and notifications | `/push-notifications`, `/email-audit`, `/email-templates`, `/post-email-queue` |
| Fleet and Mastermind | `/fleet`, `/fleet/jobs`, `/fleet/machines/*`, `/devboxes`, `/github-bot` |
| AI operations | `/ai-agents`, `/ai-credits`, `/ai/studio`, `/ai/whitelist/*` |
| Integrations | `/external-apps`, `/external-chat-lab`, `/app-coordination`, `/calendar-sync`, `/cron/whitelist/domains` |
| Settings and audit log | `/timezones`, `/translations`, `/holidays`, `/changelog`, `/secrets` |

Every route keeps its path, so links into `infrastructure.tuturuuu.com/<path>`
map one to one onto `tuturuuu.com/admin/<path>`. Navigation entries live in
`src/app/[locale]/(dashboard)/[wsId]/navigation.tsx` with aliases, icons and
permissions.

## Delivery order

1. **Mount.** Activate the Worker at `/admin`: provision its secrets (below),
   publish the sealed artifact with `void-cf-publisher.mjs publish --strict`,
   assign it with `--expect-current`, then add `/admin,/admin/*` to the
   gateway's `GATEWAY_MOUNTED_PATHS` and the `MOUNT_ADMIN →
   tuturuuu-infrastructure` service binding. Build the gateway version from the
   deployed one and keep every other mount. Web needs
   `NEXT_PUBLIC_TUTURUUU_ACTIVE_APP_MOUNTS=infra` for direct login returns.
2. **Protection controls.** Rate limits and kill switches are rebuilt first, with
   success and error feedback on every write and end-to-end tests.
3. **Sections.** The remaining sections are rebuilt on the shared `Structure`
   shell and `@tuturuuu/ui` in the order of the table above. Old code is removed
   only after the rebuilt section reaches parity.
4. **Redirect.** `infrastructure.tuturuuu.com` is a Workers Custom Domain of
   `tuturuuu-infrastructure`. The production Worker
   (`TUTURUUU_LEGACY_HOST_REDIRECT=1`, set by the production config rewrite)
   answers GET/HEAD page requests with a 301 to
   `https://tuturuuu.com/admin<path><query>`, with the raw query kept and
   `Cache-Control: private, no-store`. Machine traffic keeps answering on the
   subdomain: every `/api` path (Cron Control, mobile and desktop deployment
   bundles, devbox and SDK callers authenticate with bearer credentials that
   HTTP clients drop on a cross-host redirect) and every other method. Staging
   artifacts never redirect.

Admin binds the shared abuse guard (`ABUSE_GUARD` → `tuturuuu-abuse-guard`,
entrypoint `AbuseGuardEntrypoint`) with `ABUSE_GUARD_FAMILIES=proxy,ratelimit,integrity`
and the Web `ABUSE_GUARD_KEY_PEPPER`. The guard covers Admin's `proxy` traffic
(`src/proxy.ts` → `guardApiProxyRequest`), so stopping or resuming the `proxy`
family applies to Admin as it does to Web; while the family is stopped, Admin
keeps per-instance proxy windows rather than no limit. `ratelimit` and
`integrity` are assigned for the shared names only: Admin's own session and API
limiter (`src/lib/rate-limit.ts`) stays on Upstash with its in-memory fallback,
and the rate-limit pages read Upstash with `SCAN`, which the guard store does
not implement. The Protection controls card (Route rate limits, IP blocking) reads and writes
the shared `proxy` controls through the guard's `proxy` view. Web's API proxy
(`/api` and `/native-integrity/turnstile`) reads the same controls, so a switch
changes Web's API protection as well as Admin's; document routes and apps that
do not assign the `proxy` family do not read them.

Mounted apps follow the apex isolation rules: app-owned cookies use
`Path=/admin`, and no service worker is registered over `/`.

## Worker secrets

Names only. Values are copied from the Vercel `infrastructure` project (project
and team-shared variables) or minted for the Worker; nothing is printed or
committed.

| Name | Source |
| - | - |
| `NEXT_PUBLIC_SUPABASE_URL`, `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY` | Vercel (shared) |
| `SUPABASE_SECRET_KEY` | A dedicated Supabase secret key for the Worker |
| `ENCRYPTION_MASTER_KEY` | Vercel (shared); must equal the Web value |
| `CRON_SECRET`, `TUTURUUU_AZURE_TENANT_ID` | Vercel (project) |
| `CLOUDFLARE_COORDINATION_URL`, `CLOUDFLARE_COORDINATION_TOKEN` | Vercel (project; the token is sensitive and comes from custody) |
| `DEPLOY_COORDINATOR_ORIGIN`, `DEPLOY_COORDINATOR_OPERATOR_TOKEN` | Vercel (project; the token is sensitive and comes from custody) |
| `ABUSE_GUARD_KEY_PEPPER` | The Web Worker secret; must equal the Web value |

Revealing Vercel values can require a step-up `vercel login`; a human runs it.
A missing optional secret degrades only its own page (for example, Deployments
reports the coordinator as unavailable).

## Smoke checks

```bash theme={null}
curl -sI https://tuturuuu.com/admin                    # 307 to /admin/login?next=%2F
curl -sI https://tuturuuu.com/admin/login              # 307 to Web /login with the /admin verify-token return
curl -sI https://tuturuuu.com/admin/api/build-info     # 401 JSON when anonymous (protected route)
```

Every `/admin` response carries the enforced policy
`script-src 'self' 'nonce-…' 'strict-dynamic'; object-src 'none'; base-uri 'self'; require-trusted-types-for 'script'; trusted-types default; frame-ancestors 'none'`.
The only cookie Admin sets on the mount is `NEXT_LOCALE` with `Path=/admin`.
Setting `TTR_CSP_ADMIN=report` on the Worker moves Trusted Types to a
report-only policy without a rebuild.

## Cutover receipt (2026-11-21)

| Worker | Version | Source | Rollback version |
| - | - | - | - |
| `tuturuuu-infrastructure` | `5ed24f1d-6c45-4f12-ac1b-d41624282368` | `36411ab8fb1c66b9bc43a231f7addafdfd4d61d6` | `6b451924-fb31-450d-b188-d960c8c790be` |
| `tuturuuu-gateway` | `57f12582-206d-4196-b6ab-2b463726a04d` | serving module of `fc59b682` plus `MOUNT_ADMIN` and `/admin,/admin/*` | `fc59b682-2a15-48c7-939e-c9cbc05cd4cb` |

Later Admin versions on 2026-11-21, each assigned with `--expect-current` on
the one before it:

| Version | Source | Change |
| - | - | - |
| `cea83e5b-0dd8-46b1-b5c2-205e28b86fce` | `36411ab8fb` | Secret-only version: `TTR_CSP_ADMIN=report` while client navigation broke under enforced Trusted Types |
| `0aed07f7-9be0-4a44-8aea-b93362e944db` | `4e4b70bff7` | `publish --strict` with the `TUTURUUU_LEGACY_HOST_REDIRECT` override; includes the Trusted Types allowlist policy and sandboxed email previews (`6f0d79df04`) and the legacy-host redirect |
| `681800e7-f1ae-428c-9db9-2f2a29122d6f` | `4e4b70bff7` | Secret-only version removing `TTR_CSP_ADMIN`, so Trusted Types is enforced |
| `5de03f57-99fc-40f1-8b10-c3b2c92616bb` | `47885230b3` | Shared abuse-guard binding; published without `--strict` because strict accepts only variable overrides, gated by a binding diff that allowed only `ABUSE_GUARD` and `ABUSE_GUARD_FAMILIES` to appear |

The code versions were built on a workstation with the cutover job's steps: a
clean checkout of the exact SHA, the production Wrangler config rewrite from
the workflow, then seal and pack.

## Rollback

* Admin Worker: `void-cf-publisher.mjs assign --version <previous> --expect-current <new>`.
  From `5de03f57` the chain is `681800e7` (no guard binding), `0aed07f7`
  (Trusted Types report-only) and `cea83e5b` (code before the Trusted Types
  fix).
* Gateway: redeploy the previous gateway version; removing `/admin` entries
  returns the path to Web.
* Redirect: assign the previous Worker version, which serves the app on the
  subdomain. The custom domain stays on the Worker; it never points back at
  Vercel.

Rollback always targets the previous Cloudflare version, never a Vercel
deployment. See [Infrastructure on Start + Void](https://docs.tuturuuu.com/build/devops/infrastructure-start-void.md)
and [Gateway Worker](https://docs.tuturuuu.com/build/devops/gateway-worker.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.