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

4.0 KiB

OrangeCat Documentation

Documentation for the OrangeCat platform. Start with the area you need.

Area What's inside
getting-started/ First-time setup and orientation
architecture/ System design, entity model, the Cat, ADRs (adr/), DB schema (SUPABASE_SCHEMA_GUIDE.md)
development/ Day-to-day dev: standards, contributing, guides, examples, templates, components
operations/ Running prod: deployment, devops/runbooks, self-hosted Supabase
design-system/ Design tokens, UI/UX, navigation, branding
features/ Feature-level docs (posting, messaging, etc.)
security/ Security model and practices
testing/ Test strategy and coverage
business/ Executive, legal, marketing
reference/ API, changelog, content, misc reference material
forward-looking/ Plans, proposals, in-flight ideas
non-public/ Internal-only material
archive/ Frozen historical docs (incl. the retired managed-cloud era)

Ground truth (checked 2026-10)

  • Database — self-hosted Supabase at supabase.orangecat.ch on the Hetzner box (bitbaum). The managed Supabase Cloud was retired 2026-06. Schema = SQL files in ../supabase/migrations/, applied automatically on every deploy by scripts/apply-migrations.sh — never by hand. See operations/supabase/.
  • Deployment — self-hosted on Hetzner behind Caddy. A green PR is merged by the fleet forge merge check (forge/verify), which verifies each PR on its merge result; .github/workflows/cd.yml deploys. See operations/deployment/ and "Deploy path" in ../AGENTS.md.
  • Bitcoin — BTC is the canonical stored unit (NUMERIC(18,8)) and the only Bitcoin unit; SATS is not a currency code.

Conventions

  • Point-in-time reports, audits, and completed runbooks live in archive/ — keep active docs current, not historical.
  • Engineering rules the AI agent follows live in ../.claude/, not here.