# Uptime Guard — deployable config. Works with the "Deploy to Cloudflare" button # and with `npx wrangler deploy`. The [build] step builds the dashboard first, so # a single command deploys everything. name = "uptime-guard" main = "src/index.ts" compatibility_date = "2024-11-01" # Bundle schema.sql as text so the Worker can create tables on first run. rules = [{ type = "Text", globs = ["**/*.sql"], fallthrough = true }] # Build the React dashboard before deploying (its output is served by the Worker). [build] command = "cd ../dashboard && npm install && npm run build" [triggers] # Every minute: run due checks. Daily 03:00 UTC: roll up stats + prune old data. crons = ["* * * * *", "0 3 * * *"] [assets] directory = "../dashboard/dist" binding = "ASSETS" not_found_handling = "single-page-application" [[d1_databases]] binding = "DB" database_name = "uptime-guard" # The Deploy-to-Cloudflare button provisions this automatically. For a manual # deploy, run `npx wrangler d1 create uptime-guard` and paste the id here. database_id = "PLACEHOLDER_RUN_D1_CREATE" # Optional: serve on your own domain (must be on this Cloudflare account). # routes = [{ pattern = "status.example.com", custom_domain = true }] # Secrets — set after deploy with `wrangler secret put NAME` (or in the dashboard): # PASSWORD TOTP_SECRET SESSION_SECRET (run `npm run auth:setup` for the last two) # Optional: TELEGRAM_BOT_TOKEN TELEGRAM_CHAT_ID VAPID_PUBLIC VAPID_PRIVATE VAPID_SUBJECT