mirror of
https://github.com/misenhower/splatoon3.ink.git
synced 2026-11-18 16:58:18 -06:00
Production writes data snapshots to the archive Space the Node server used (splatoon3ink-archive) and binds the production compressor for the admin panel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
122 lines
5.7 KiB
JSON
122 lines
5.7 KiB
JSON
{
|
|
"$schema": "../../node_modules/wrangler/config-schema.json",
|
|
"name": "splatoon3-ink-updater",
|
|
"main": "src/index.mjs",
|
|
"compatibility_date": "2026-09-03",
|
|
"compatibility_flags": ["nodejs_compat"],
|
|
// Seasonal avatars are bundled as Data modules (app/social/avatars/index.worker.mjs).
|
|
"rules": [{ "type": "Data", "globs": ["**/*.png"], "fallthrough": true }],
|
|
"workers_dev": true,
|
|
"preview_urls": false,
|
|
// The dev updater Worker from the earlier attempt already applied v1 with Scheduler.
|
|
"migrations": [
|
|
{ "tag": "v1", "new_sqlite_classes": ["Scheduler"] },
|
|
{ "tag": "v2", "new_sqlite_classes": ["RegionAuth"] }
|
|
],
|
|
"limits": { "cpu_ms": 120000 },
|
|
"observability": { "enabled": true, "logs": { "head_sampling_rate": 1 } },
|
|
"dev": { "ip": "127.0.0.1", "port": 8787 },
|
|
|
|
// Select --env dev or --env production explicitly. Automatic scheduling starts off for a
|
|
// new scheduler; POST /schedule?enabled=true turns it on and the setting survives deploys.
|
|
// Secrets: NINTENDO_TOKEN_{US,EU,JP,AP}, NXAPI_CLIENT_ID, NXAPI_SHARED_SECRET, USER_AGENT,
|
|
// RUN_TOKEN, TOKEN_UPLOAD_TOKEN (splat-mitmproxy's iPad bullet token uploads, PUT /bullet-token),
|
|
// ACCESS_TEAM_DOMAIN and ACCESS_AUD (admin panel sign-in), AWS_ACCESS_KEY_ID and
|
|
// AWS_SECRET_ACCESS_KEY (a DigitalOcean Spaces key that can write to the archive bucket),
|
|
// optional SENTRY_DSN, CLOUDFLARE_CACHE_PURGE_ZONE_ID/API_TOKEN, and (production only) the
|
|
// social account credentials.
|
|
"env": {
|
|
"dev": {
|
|
"name": "splatoon3-ink-dev-updater",
|
|
// The admin panel's own hostname, protected by a Cloudflare Access application.
|
|
"routes": [{ "pattern": "admin.dev.splatoon3.ink", "custom_domain": true }],
|
|
// The built admin app (npm run admin:build). Requests reach the Worker first, so
|
|
// nothing is served without Access.
|
|
"assets": {
|
|
"directory": "./admin/dist",
|
|
"binding": "ADMIN_ASSETS",
|
|
"not_found_handling": "single-page-application",
|
|
"run_worker_first": true
|
|
},
|
|
"vars": {
|
|
"ENVIRONMENT": "dev",
|
|
// The region whose account the iPad uploads bullet tokens for (North America).
|
|
"TOKEN_UPLOAD_REGION": "US",
|
|
"ADMIN_HOSTNAME": "admin.dev.splatoon3.ink",
|
|
"SITE_URL": "https://dev.splatoon3.ink",
|
|
// The dev bucket's own custom domain, like assets.splatoon3.ink in production.
|
|
"ASSET_URL": "https://dev-assets.splatoon3.ink",
|
|
"R2_PUBLIC_URL": "https://dev-assets.splatoon3.ink",
|
|
"CLOUDFLARE_CACHE_PURGE_HOSTS": "dev.splatoon3.ink",
|
|
"AUTOMATIC_SCHEDULING_ENABLED": "false",
|
|
// Data snapshots go to a DigitalOcean Space. Dev has its own: both environments write
|
|
// the same object keys, so they must never share a bucket.
|
|
"ARCHIVE_DATA": "true",
|
|
"AWS_S3_ENDPOINT": "https://nyc3.digitaloceanspaces.com",
|
|
"AWS_REGION": "nyc3",
|
|
"AWS_S3_ARCHIVE_BUCKET": "splatoon3ink-archive-test"
|
|
},
|
|
// Watchdog only; it never enables a disabled lane.
|
|
"triggers": { "crons": ["*/5 * * * *"] },
|
|
"durable_objects": {
|
|
"bindings": [
|
|
{ "name": "SCHEDULER", "class_name": "Scheduler" },
|
|
{ "name": "REGION_AUTH", "class_name": "RegionAuth" },
|
|
// The archive compressor Worker (workers/compressor/), for the admin panel.
|
|
{ "name": "COMPRESSOR", "class_name": "Compressor", "script_name": "splatoon3-ink-dev-compressor" }
|
|
]
|
|
},
|
|
"browser": { "binding": "BROWSER", "remote": true },
|
|
"images": { "binding": "IMAGES" },
|
|
"r2_buckets": [
|
|
{ "binding": "ASSETS", "bucket_name": "splatoon3-ink-dev-assets" },
|
|
{ "binding": "PRIVATE", "bucket_name": "splatoon3-ink-dev-private" }
|
|
]
|
|
},
|
|
"production": {
|
|
"name": "splatoon3-ink-updater",
|
|
// The admin panel's own hostname, protected by a Cloudflare Access application.
|
|
"routes": [{ "pattern": "admin.splatoon3.ink", "custom_domain": true }],
|
|
// The built admin app (npm run admin:build). Requests reach the Worker first, so
|
|
// nothing is served without Access.
|
|
"assets": {
|
|
"directory": "./admin/dist",
|
|
"binding": "ADMIN_ASSETS",
|
|
"not_found_handling": "single-page-application",
|
|
"run_worker_first": true
|
|
},
|
|
"vars": {
|
|
"ENVIRONMENT": "production",
|
|
// The region whose account the iPad uploads bullet tokens for (North America).
|
|
"TOKEN_UPLOAD_REGION": "US",
|
|
"ADMIN_HOSTNAME": "admin.splatoon3.ink",
|
|
"SITE_URL": "https://splatoon3.ink",
|
|
"ASSET_URL": "https://assets.splatoon3.ink",
|
|
"R2_PUBLIC_URL": "https://assets.splatoon3.ink",
|
|
"CLOUDFLARE_CACHE_PURGE_HOSTS": "splatoon3.ink,assets.splatoon3.ink",
|
|
"AUTOMATIC_SCHEDULING_ENABLED": "false",
|
|
// The real archive Space, which the Node server wrote to before.
|
|
"ARCHIVE_DATA": "true",
|
|
"AWS_S3_ENDPOINT": "https://nyc3.digitaloceanspaces.com",
|
|
"AWS_REGION": "nyc3",
|
|
"AWS_S3_ARCHIVE_BUCKET": "splatoon3ink-archive"
|
|
},
|
|
"triggers": { "crons": ["*/5 * * * *"] },
|
|
"durable_objects": {
|
|
"bindings": [
|
|
{ "name": "SCHEDULER", "class_name": "Scheduler" },
|
|
{ "name": "REGION_AUTH", "class_name": "RegionAuth" },
|
|
// The archive compressor Worker (workers/compressor/), for the admin panel.
|
|
{ "name": "COMPRESSOR", "class_name": "Compressor", "script_name": "splatoon3-ink-compressor" }
|
|
]
|
|
},
|
|
"browser": { "binding": "BROWSER", "remote": true },
|
|
"images": { "binding": "IMAGES" },
|
|
"r2_buckets": [
|
|
{ "binding": "ASSETS", "bucket_name": "splatoon3-ink-assets" },
|
|
{ "binding": "PRIVATE", "bucket_name": "splatoon3-ink-private" }
|
|
]
|
|
}
|
|
}
|
|
}
|