{ "$schema": "node_modules/wrangler/config-schema.json", "name": "church4christ", "main": "./src/worker.ts", "compatibility_date": "2026-06-01", "compatibility_flags": ["nodejs_compat"], "assets": { "directory": "./dist", "binding": "ASSETS" }, // Keep these cron strings in sync with the switch in src/worker.ts. "triggers": { "crons": ["0 13 * * *", "0 14 * * 4", "0 9 * * *", "0 * * * *", "15,45 * * * *"] }, "send_email": [{ "name": "EMAIL", "allowed_sender_addresses": ["serve@church.yunfei-song.com"] }], "vars": { "APP_ORIGIN": "https://church.yunfei-song.com", "EMAIL_FROM": "serve@church.yunfei-song.com", // Database backend: "d1" (default) or "supabase". With "supabase" the worker // reads/writes Postgres over the HYPERDRIVE binding below; see the commented // hyperdrive block and docs/supabase-setup.md. "DB_BACKEND": "d1" // Optional Google Classroom real-time bindings: uncomment and set all // three together, or leave all three absent for polling-only operation. // "GOOGLE_CLASSROOM_PUBSUB_TOPIC": "projects/PROJECT/topics/TOPIC", // "GOOGLE_PUBSUB_SERVICE_ACCOUNT_EMAIL": "push@PROJECT.iam.gserviceaccount.com", // "GOOGLE_PUBSUB_SUBSCRIPTION_NAME": "projects/PROJECT/subscriptions/SUBSCRIPTION", // Nightly D1→R2 backup (src/lib/backup.ts): uncomment and fill both vars // below, then run `wrangler secret put D1_EXPORT_TOKEN`. All three must be // set together; if any is missing the backup cron logs "backup skipped: not // configured" and no-ops, so the demo deploy runs fine without them. // "CF_ACCOUNT_ID": "your-cloudflare-account-id", // "D1_DATABASE_ID": "your-d1-database-id" }, "d1_databases": [ { "binding": "DB", "database_name": "church4christ-db", "database_id": "YOUR_D1_DATABASE_ID", "migrations_dir": "migrations" } ], // Supabase backend (docs/supabase-setup.md): set DB_BACKEND to "supabase", // uncomment, and paste the id from `wrangler hyperdrive create`. // "hyperdrive": [{ "binding": "HYPERDRIVE", "id": "YOUR_HYPERDRIVE_ID" }], "r2_buckets": [ { "binding": "MEDIA", "bucket_name": "church4christ-media" } ], "observability": { "enabled": true } }