Skip to content

Files up to 5 GB, no file limit (free account); pay-as-you-go storage - #43

Merged
ralyodio merged 2 commits into
mainfrom
feat/5gb-files-unlimited
Oct 19, 2026
Merged

ralyodio merged 2 commits into
mainfrom
feat/5gb-files-unlimited

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Anthony: "we got a readm3.com file size limitation error please fix max filesize is 5gb and unlimited files", then "on free tier but account is required. pay as you go for more data storage".

Signed out Free account Pay as you go
Largest file 4 MB 5 GB 5 GB
Files 1,000 / 20 MB no limit no limit
Synced storage none 5 GB $0.05/GB-month over 5 GB

How: files over 4 MB become stored files (src/blob-store.ts): kept as a Blob in IndexedDB on the device, and on the account as 8 MiB AES-256-GCM chunks under a per-file random key that only lives inside the sealed (E2E) workspace. server/blobs.ts serves /api/v1/blobs (chunk PUT/GET, complete, delete, usage), refuses uploads past the free allowance with a 402 when the balance is not positive, charges storage hourly (idempotent ledger ref), and drops abandoned uploads after two days. Autosync uploads stored files before the snapshot, spills small text past a 16 MB snapshot budget (digest-preserving, so no merge churn) and garbage-collects unreferenced blobs after an hour. Desktop: no 1,000-file cap; large files are read in ranges.

Free allowance, price and blob dir are env-configurable: READM3_FREE_STORAGE_BYTES, READM3_STORAGE_MICROS_PER_GB_MONTH, READM3_BLOB_DIR (default blobs/ beside the DB, i.e. /data/blobs on the volume).

Tests: typecheck; bun test ./server/test 72 pass (new blobs.test.ts: round trip, isolation, chunk sizes, 402 + top-up, hourly charge once, abandoned cleanup); npm test 198 pass (new blob-store.test.ts); Playwright site 37 pass (new: signed-in 9 MB file opens read-only, uploads encrypted, name absent from snapshot, downloads exact size; signed-out asks for an account) and accounts 4 pass.

🤖 Generated with Claude Code

ralyodio and others added 2 commits October 19, 2026 17:53
…orage

Signed in, the free tier has no file count and files of up to 5 GB, with 5 GB of
end-to-end encrypted storage. More is pay as you go ($0.05 per GB a month over
5 GB) from the CoinPay prepaid balance, charged hourly. Signed out keeps the
local 4 MB / 20 MB / 1,000-file limits and says an account lifts them.

- src/blob-store.ts: stored files. Per-file random AES-256 key, 8 MiB chunks,
  AES-GCM with the chunk index as IV. The key travels only inside the sealed
  workspace, so the server holds chunks it cannot read or name.
- server/blobs.ts: /api/v1/blobs chunk API, usage per account, 402 past the free
  allowance without a balance, hourly idempotent storage charge, abandoned
  uploads dropped after two days. Blobs live beside the DB on the volume.
- Workspace documents may carry a blob ref; files over 4 MB open read-only (PDF
  and images whole, text as the first 1 MB) and download exactly.
- Autosync uploads stored files before the sealed snapshot, spills small text
  past a 16 MB snapshot budget to blobs (same digest, so no merge churn) and
  collects unreferenced blobs after an hour.
- Desktop: no 1,000-file walk cap; files over 4 MB are read in ranges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ralyodio
ralyodio merged commit 8831132 into main Oct 19, 2026
2 checks passed
ralyodio added a commit that referenced this pull request Oct 19, 2026
The spec waited for "Synced" on the second device, which was already on screen from
the first pass, so the first device could poll before the edit was uploaded. Wait for
the account revision to advance instead. Failed once on main CI after #43.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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