Files
CatoandClaude 88b06e8adc Public pictures straight from R2; the box stops resizing them (#1861)
Public pictures still passed through the app box: storage-api answered
every supabase.orangecat.ch/storage/v1/object/public/... request, and
next/image fetched, resized and cached them there. orangecat-media holds
private files too, so it never gets a public domain; public pictures go
to the separate public bucket fleet-media under orangecat/<bucket>/<path>,
served from MEDIA_PUBLIC_BASE.

- src/lib/media/public-url.ts: the one URL helper. Direct address only
  for objects known to be copied (listing every 10 min + own writes),
  otherwise the Supabase address. Unset base: unchanged.
- New uploads: server-side ones are written to fleet-media as stored;
  browser uploads ask POST /api/media/mirror. Stored URL is the direct one
  or, on any failure, the Supabase one.
- Background copy from instrumentation: idempotent, throttled
  (MEDIA_BACKFILL_KBPS, 512), one process at a time under a lease taken
  with a Postgres advisory lock (new migration). Only buckets declared
  public in code AND marked public in storage.buckets. Removes copies of
  deleted originals after a complete scan, capped at a tenth per run.
- next/image: with the base set at build, a custom loader draws R2
  pictures unoptimized and sends Supabase public pictures to
  /api/media/object, which redirects to R2 once copied, else to the
  optimizer as before.
- Docs: STORAGE_R2_BACKEND.md (how, switch-on, rollback, the pre-move
  disk copy an operator may remove), .env.example; three docs that named
  the removed auto-merge.yml now name the forge merge check.


Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-26 20:49:44 +01:00

1.7 KiB

CI/CD Pipeline

Deploys are automated. A green, non-draft PR is squash-merged by .github/workflows/auto-merge.yml (the fleet sweep in bitbaum/fleet, scripts/ci/auto-merge-sweep.sh); CI on main then hands off to CD. See docs/operations/deployment/DEPLOYMENT_PROCESS.md and "Deploy path" in the root AGENTS.md.

Workflows

  • .github/workflows/ci.yml — the gate:
    • Setup Node 24 + pnpm, pnpm install --frozen-lockfile
    • pnpm run verify — the one pre-build gate; scripts/verify.mjs lists what it runs (type-check, lint, audit:routes, unit tests, check:* guards)
    • Build, then the P0 E2E matrix against the built app (skipped if E2E secrets absent)
    • gitleaks secret scan
    • post-main (on main only): files/closes the red-main issue, then dispatches cd.yml with this run's ID and SHA
  • .github/workflows/cd.yml — workflow_dispatch only: ships the exact CI artifact to the box via scripts/deploy-selfhost.sh (applies pending migrations, atomic swap, rollback)
  • No merge workflow: the fleet forge merge check (forge/verify) verifies each PR on its merge result and merges it (the auto-merge.yml sweep was removed in #1851)
  • .github/workflows/main-red-alert.yml, migration-replay.yml, codeql.yml, uptime.yml
  • .github/workflows/e2e-auth.yml — Playwright login smoke against production (https://www.orangecat.ch); also runnable via workflow_dispatch.

Standards

  • Node: 24.x everywhere (workflow steps install Node 24; the runner actions themselves are on Node 24-ready majors since 2026-06-13)
  • Do not commit .env.local; CI uses dummy env values for the build
  • Protect main: require status checks, disallow direct pushes