{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "gitfor",
"compatibility_date": "2026-10-08",
"compatibility_flags": ["nodejs_compat"],
// Sites: one wildcard route, first-level labels only, so Universal SSL covers every site and preview.
"routes": [
{ "pattern": "gitfor.dev", "custom_domain": true },
{ "pattern": "editor.gitfor.dev", "custom_domain": true },
{ "pattern": "gitforusers.dev", "custom_domain": true },
{ "pattern": "*/*", "zone_name": "gitforstatic.dev" }
],
"main": "src/server.ts",
"observability": {
"enabled": true
},
// Optional Stripe billing (docs/billing.md). Leave unset to self-host without billing; nothing requires Stripe.
// Set with `wrangler secret put` (or .dev.vars locally; see .dev.vars.example):
// STRIPE_SECRET_KEY enables billing (sk_test_/sk_live_ or a restricted rk_ key)
// STRIPE_PUBLISHABLE_KEY pk_ key shown to the browser
// STRIPE_WEBHOOK_SECRET signing secret of the endpoint at <PUBLIC_URL>/stripe/webhook
// STRIPE_PRICE_PRO price id of the Pro monthly subscription
// STRIPE_PRICE_CUSTOM_DOMAIN price id of the $5/month per-domain custom domain add-on (quantity = domains)
// STRIPE_TOPUP_PRICES JSON {"<pack id from src/lib/pricing.ts>": "price_..."}
// STRIPE_DEV_REPLAY "true" enables the loopback-only /__dev/stripe/replay route (test keys only)
// STRIPE_WEBHOOK_MODE "test" or "live", the webhook endpoint's mode; refused when it mismatches the keys
// BILLING_CHECKOUT_DISABLED "true" blocks new checkouts and portal plan changes; webhooks keep working
// PAST_DUE_GRACE_DAYS days past_due keeps Pro before usage drops to Free (default 14)
// AI_DAILY_SPEND_CEILING_CENTS platform-wide daily AI cost ceiling in cents (default 10000 with Stripe, else off; "off" disables)
// Operator contact secrets: ABUSE_FORWARD_TO (verified Email Routing destination that receives a copy of every
// abuse@ message). Kept out of the repo.
// Optional PostHog analytics (docs/analytics.md). Off unless POSTHOG_KEY is set:
// POSTHOG_KEY project token (phc_...); VITE_POSTHOG_PROJECT_TOKEN is accepted as an alias
// POSTHOG_HOST ingestion host, default https://us.i.posthog.com (VITE_POSTHOG_HOST alias)
// POSTHOG_PERSON_EMAIL "true" attaches the signed-in user's email to their person (off: no PII)
// This file is the PRODUCTION config (`bun run deploy`). `bun run dev` / `bun run preview` apply the dev
// overrides in vite.config.ts on top of it: PUBLIC_URL=http://localhost:3000, GITFOR_LOCAL=true, and every
// Artifacts namespace and trigger filter renamed to `<namespace>-dev`. A deployed worker refuses to serve
// (503) until PUBLIC_URL, USERCONTENT_ORIGIN and SECRETS_KEY are set correctly; see docs/self-hosting.md "Production setup".
// Required secrets: SECRETS_KEY (>= 32 chars). First admin: set ADMIN_EMAIL (promoted once that address is