Files
recflare/apps/econ/wrangler.jsonc
T
2026-09-26 11:52:03 -04:00

73 lines
3.0 KiB
JSON

{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "econ",
"main": "src/econ.app.ts",
"compatibility_date": "2026-06-16",
"compatibility_flags": ["nodejs_compat"],
// Storefront catalogs served dynamically by id: `/api/storefronts/v3/giftdropstore/:id`
// fetches `sf{id}.json` from this directory via the ASSETS binding. Drop a new
// `sfN.json` in `static/storefronts` to add a storefront — no code change needed.
"assets": {
"binding": "ASSETS",
"directory": "./static/storefronts"
},
// Shared `recflare` D1. Econ reads/writes the player's avatar column on the accounts
// table (whose schema/migrations the `auth` worker owns) and owns the `balance` table
// itself — hence its own migrations_dir, with a dedicated migrations_table so its
// history doesn't clash with the auth/rooms migrations on the same database. Apply
// with `wrangler d1 migrations apply recflare --remote`. The "local" placeholder is
// replaced with the real id from RECFLARE_D1 at deploy time.
"d1_databases": [
{
"binding": "DB",
"database_name": "recflare",
"database_id": "local",
"migrations_dir": "migrations",
"migrations_table": "d1_migrations_econ"
}
],
"logpush": false,
// Shared Secrets Store holding the HS256 JWT signing key. Every worker binds the
// same store as JWT_SECRET so tokens signed by `auth` verify here. The "local"
// store_id placeholder is replaced with RECFLARE_SECRETS_STORE at deploy time.
"secrets_store_secrets": [
{
"binding": "JWT_SECRET",
"store_id": "local",
"secret_name": "JWT_SECRET"
}
],
// The `notify` worker's NotificationsHub DO — used to push websocket notifications
// to a player (e.g. ConsumableMappingRemoved when a consumable is consumed).
"durable_objects": {
"bindings": [
{
"name": "RECFLARE_NOTIFICATIONS_HUB",
"class_name": "NotificationsHub",
"script_name": "notify"
}
]
},
// The Discord supporter gift (src/discord-role-gift.ts): every account holding a role
// mapped in DISCORD_ROLE_TOKENS is boxed that role's tokens EACH TIME this fires, so this
// line is the cadence — weekly as shipped; `0 5 * * *` makes it daily. Monday 05:00 UTC
// is half an hour after `www`'s daily role sweep (04:30), so it pays against roles
// refreshed that morning. A no-op, logged, until the var maps a role.
"triggers": {
"crons": ["0 5 * * 1"]
},
"upload_source_maps": true,
"observability": {
"enabled": false
},
// The signup token grant (STARTING_TOKENS) is deliberately NOT set here. It's injected
// at deploy time from the gitignored .env (RECFLARE_STARTING_TOKENS, see .env.example),
// so tuning it never means editing a versioned file. Unset — the default — falls back
// to DEFAULT_STARTING_TOKENS in src/balance-db.ts. DISCORD_ROLE_TOKENS (the supporter
// gift's role map) arrives the same way; unset leaves the cron off.
"vars": {
"ENVIRONMENT": "development", // overridden during deployment
"SENTRY_RELEASE": "unknown" // overridden during deployment
}
}