No description
  • TypeScript 97.4%
  • Dockerfile 2.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-15 00:29:07 +05:30
src feat: share detector results across clients 2026-11-15 00:29:07 +05:30
.env.example feat: share detector results across clients 2026-11-15 00:29:07 +05:30
.gitignore feat: share detector results across clients 2026-11-15 00:29:07 +05:30
bun.lock feat: share detector results across clients 2026-11-15 00:29:07 +05:30
CONTRIBUTING.md feat: share detector results across clients 2026-11-15 00:29:07 +05:30
docker-compose.yml feat: share detector results across clients 2026-11-15 00:29:07 +05:30
Dockerfile feat: share detector results across clients 2026-11-15 00:29:07 +05:30
drizzle.config.ts feat: share detector results across clients 2026-11-15 00:29:07 +05:30
LICENSE feat: share detector results across clients 2026-11-15 00:29:07 +05:30
NOTICE feat: share detector results across clients 2026-11-15 00:29:07 +05:30
package.json feat: share detector results across clients 2026-11-15 00:29:07 +05:30
README.md feat: share detector results across clients 2026-11-15 00:29:07 +05:30
tsconfig.json feat: share detector results across clients 2026-11-15 00:29:07 +05:30

Reseam logo

Reseam Crowdcache

Results that Reseam's patches get from outside services, shared so a result one person paid for is reused by everyone else. Clients compute a result themselves, look it up here first, and submit it after a miss. The server only stores and serves; it never calls the outside services.

  • Namespaces. Each kind of result has its own path and schema: pangram-text and pangram-image.
  • Keys. Clients derive keys from what was checked, such as a post id and a hash of its text.
  • Values. A result is stored whole, as the outside service returned it, including any text it quotes. Each namespace checks the fields clients read and keeps every other field as is.
  • First write wins. A later submission for a key that already has a result is ignored.
Endpoint Body Response
POST /v1/<namespace>/lookup { "keys": [...] }, up to 100 { "entries": { "<key>": <result> } }, missing keys left out
POST /v1/<namespace> { "entries": [{ "key", "value" }] }, up to 50 204
GET /v1/health { "ok", "version" }

OpenAPI docs are served at /openapi.

Configuration

Variable Default
PORT 4200
DB_PATH ./data/crowdcache.db SQLite database
CLIENT_IP_HEADER cf-connecting-ip Header holding the client address, for rate limits
LOOKUP_RATE 600 Lookups per address per minute
WRITE_RATE 120 Writes per address per minute
BACKUP_BUCKET S3-compatible bucket for daily backups; unset turns backups off
BACKUP_ENDPOINT The bucket's S3 endpoint, such as an R2 account endpoint
BACKUP_ACCESS_KEY_ID, BACKUP_SECRET_ACCESS_KEY Credentials that can write to the bucket
BACKUP_PREFIX crowdcache/ Prefix for backup objects

Backups

With BACKUP_BUCKET set, the server takes a snapshot of the database when it starts and every 24 hours after, and uploads it gzipped as <prefix><YYYY-MM-DD>.db.gz. To restore, download the newest one, gunzip it, and point DB_PATH at it. Old backups stay until a bucket lifecycle rule removes them.

Develop

Needs Bun.

bun install
bun run dev          # restarts on changes
bun run typecheck
bun run db:generate  # migration after a schema change

Built with Bun, Elysia, and Drizzle on SQLite.