Skip to content

Store attachments in Postgres and add free hosting on Render - #10

Merged
ayushtiwari163 merged 2 commits into
developfrom
feature/postgres-storage
Dec 1, 2026
Merged

ayushtiwari163 merged 2 commits into
developfrom
feature/postgres-storage

Conversation

@ayushtiwari163

Copy link
Copy Markdown
Collaborator

Why

To run ReproDrop on a free host. Render's free web service wipes its disk on every restart, which would delete every screenshot, so attachments need to live somewhere that survives.

What

  • STORAGE_DRIVER=postgres: attachment bytes go in a new attachment_blobs table (migration 0001_attachment_blobs) behind the existing Storage interface. Missing keys raise ENOENT like the other drivers, unsafe keys are refused, and the health check reads the table.
  • render.yaml: one free Render web service running ghcr.io/patchyard/reprodrop:0.1.3. Render generates APP_SECRET and ENCRYPTION_KEY, storage is Postgres, uploads are capped at 2 MB, and DATABASE_URL is entered at deploy time (Neon's free Postgres).
  • APP_URL falls back to RENDER_EXTERNAL_URL when it isn't set.
  • docs/self-hosting/render.md: a step-by-step guide that states the limits plainly (the server sleeps, 0.5 GB of database, no backups) and what running open sign-up implies.
  • E2E_STORAGE_DRIVER: lets the end-to-end suite run against any storage driver.

The blueprint pins 0.1.3, so a 0.1.3 release follows this PR to publish an image that includes the driver.

Checks run locally

  • pnpm lint, pnpm format:check and pnpm typecheck pass.
  • All unit and integration tests pass, including the new PostgresStorage tests (4) and config tests (2). API: 58 passed.
  • End-to-end with the real extension: 3 passed with the default storage, and 3 passed with E2E_STORAGE_DRIVER=postgres. The recording's screenshots were stored in and served from attachment_blobs.

- STORAGE_DRIVER=postgres keeps attachment bytes in a new attachment_blobs
  table (migration 0001), behind the existing Storage interface. For hosts
  whose disk is wiped on restart, such as free tiers.
- render.yaml deploys the published image as one free Render web service with
  generated secrets, Postgres storage and 2 MB uploads; the database is
  external (Neon's free Postgres). docs/self-hosting/render.md walks through it.
- APP_URL falls back to RENDER_EXTERNAL_URL when unset.
- E2E_STORAGE_DRIVER lets the end-to-end suite run against any driver; it
  passes with postgres.
@ayushtiwari163
ayushtiwari163 requested a review from a team as a code owner December 1, 2026 14:57
Ubuntu's package mirrors time out now and then while playwright installs its
system dependencies, failing runs that have nothing wrong with them. Try up to
three times before giving up.
@ayushtiwari163
ayushtiwari163 merged commit ecc98ec into develop Dec 1, 2026
6 checks passed
@ayushtiwari163
ayushtiwari163 deleted the feature/postgres-storage branch December 1, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant