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.6 KiB

created_date, last_modified_date, last_modified_summary
created_date last_modified_date last_modified_summary
2025-06-05 2025-06-05 Added documentation standards including creation and modification dates

📖 Contributing Guidelines

Thank you for your interest in contributing to OrangeCat! This document provides guidelines and instructions for contributing to our project.

Code of Conduct

Please read and follow our Code of Conduct.

Getting Started

  1. Fork the repository
  2. Clone your fork: git clone https://github.com/your-username/orangecat.git
  3. Create a new branch: git checkout -b feature/your-feature-name
  4. Make your changes
  5. Push to your fork: git push origin feature/your-feature-name
  6. Create a Pull Request

Development Setup

  1. Install dependencies: pnpm install
  2. Create a .env.local file based on .env.example
  3. Start the development server: pnpm run dev

Pull Request Process

  1. Run pnpm run verify (the same gate CI runs) and make sure it passes
  2. Update the docs your change makes untrue, in the same pull request (and add a line to the root CHANGELOG.md when the change is visible to people)
  3. Open a non-draft pull request when the work is ready to ship. Nobody merges by hand: the forge merge check (forge/verify) verifies it on its merge result and merges it, and CD deploys it (see "Deploy path" in the root AGENTS.md). Open a draft, or add a hold label, if it is not ready

Style Guide

  • Follow the existing code style
  • Use TypeScript for all new code
  • Write tests for new features
  • Document your code
  • Keep commits focused and atomic

Questions?

Feel free to open an issue if you have any questions!