opencode/.github/release/targets/data/production/default.json
Dax Raad 7bac5bad02 fix(deploy): run Cloudflare deploys from verified artifacts behind pinned targets
Repository code outside .github/ needs no review, but every deploy job held a
Cloudflare token strong enough to write any Worker on the account (the data
sync Workflow PUT has no per-Worker permission). A dev merge could therefore
overwrite production Workers.

Split each service into a build job with no environment, secrets, or OIDC token
that uploads a SHA256SUMS artifact, and a deploy job in dev|production that
checks out only .github/release/, verifies the artifact against the build job's
digest, installs the cf/wrangler CLI pinned here, and runs only deploy-*.sh.

The deploy scripts treat the artifact as data and refuse it unless its resolved
config equals the pinned target in .github/release/targets/ exactly: Worker
names, routes, custom domains, crons, Workflow names, and bindings. For cf
services the pinned config is what cf reads. That is what makes an account-wide
token safe, and it keeps production out of reach of a dev merge.

Adds the cf 1.0.0-beta.12 and wrangler 4.110.0 lockfiles the deploy jobs
install with npm ci --ignore-scripts.
2026-11-11 04:51:07 -05:00

39 lines
2.2 KiB
JSON

{
"name": "opencode-data-production",
"compatibilityDate": "2026-07-25",
"compatibilityFlags": ["nodejs_compat"],
"triggers": [
{ "type": "fetch", "pattern": "opencode.ai/data*", "zone": "opencode.ai" },
{ "type": "fetch", "pattern": "opencode.ai/en/data*", "zone": "opencode.ai" },
{ "type": "fetch", "pattern": "opencode.ai/zh/data*", "zone": "opencode.ai" },
{ "type": "fetch", "pattern": "opencode.ai/zht/data*", "zone": "opencode.ai" },
{ "type": "fetch", "pattern": "opencode.ai/ko/data*", "zone": "opencode.ai" },
{ "type": "fetch", "pattern": "opencode.ai/de/data*", "zone": "opencode.ai" },
{ "type": "fetch", "pattern": "opencode.ai/es/data*", "zone": "opencode.ai" },
{ "type": "fetch", "pattern": "opencode.ai/fr/data*", "zone": "opencode.ai" },
{ "type": "fetch", "pattern": "opencode.ai/it/data*", "zone": "opencode.ai" },
{ "type": "fetch", "pattern": "opencode.ai/da/data*", "zone": "opencode.ai" },
{ "type": "fetch", "pattern": "opencode.ai/ja/data*", "zone": "opencode.ai" },
{ "type": "fetch", "pattern": "opencode.ai/pl/data*", "zone": "opencode.ai" },
{ "type": "fetch", "pattern": "opencode.ai/ru/data*", "zone": "opencode.ai" },
{ "type": "fetch", "pattern": "opencode.ai/uk/data*", "zone": "opencode.ai" },
{ "type": "fetch", "pattern": "opencode.ai/ar/data*", "zone": "opencode.ai" },
{ "type": "fetch", "pattern": "opencode.ai/no/data*", "zone": "opencode.ai" },
{ "type": "fetch", "pattern": "opencode.ai/br/data*", "zone": "opencode.ai" },
{ "type": "fetch", "pattern": "opencode.ai/th/data*", "zone": "opencode.ai" },
{ "type": "fetch", "pattern": "opencode.ai/tr/data*", "zone": "opencode.ai" }
],
"observability": { "enabled": true },
"workersDev": false,
"previewUrls": false,
"env": {
"ASSETS": { "type": "assets" },
"OG_WORKER": { "type": "worker", "worker": "opencode-data-og-production" },
"STAGE": { "type": "text", "value": "production" },
"PUBLIC_URL": { "type": "text", "value": "https://opencode.ai/data" },
"DATA_DATABASE_HOST": { "type": "secret" },
"DATA_DATABASE_USERNAME": { "type": "secret" },
"DATA_DATABASE_PASSWORD": { "type": "secret" }
},
"manifest": { "type": "partial", "mainModule": "index.mjs", "modules": {} }
}