opencode/services/data/README.md
Dax Raad 36f559b0c6 chore: move the data site off sst
the stats site, its og worker and the sync workflow deploy from services/data with cf as
opencode-data-<stage>, opencode-data-og-<stage> and opencode-data-sync-<stage>. the beta
web app and the whole sst setup (sst.config.ts, infra/, sst-env.d.ts, the sst dependency)
are gone, so nothing deploys through sst anymore (security finding #920).
2026-11-10 22:46:25 -05:00

1.5 KiB

Data

Deploys the opencode.ai/data site from packages/stats as three Workers with cf:

Worker Config What it is
opencode-data-<stage> cloudflare.config.ts The SolidStart site, on /data* and /<locale>/data* of the stage's host
opencode-data-og-<stage> og.config.ts Open Graph images, reached only through the site's OG_WORKER binding
opencode-data-sync-<stage> sync.config.ts The opencode-data-sync-<stage> Workflow and the cron handler that starts it

script/build.ts builds all three into one Build Output tree and script/deploy.ts deploys them with cf deploy --prebuilt, the OG Worker first. The data job in .github/workflows/deploy.yml runs deploy:dev or deploy:production and passes the Worker secrets from AWS Secrets Manager (opencode/<stage>/DATA_DATABASE_HOST, DATA_DATABASE_USERNAME, DATA_DATABASE_PASSWORD, R2_SQL_AUTH_TOKEN, DATA_HIDDEN_MODELS) with --secrets-file. Each Worker gets only the secrets its config declares.

The database is the opencode-stats PlanetScale database: the dev branch for dev and production for production, through the data-worker-<stage> password. It is not managed as code.

bun run build --mode dev
bun run typecheck