# traks.dev home worker - deploy-wizard backend ONLY. Physically separate # from the platform api that ships to customer instances: different worker, # different secrets, and no database of its own. The marketing site + wizard # UI is the traks-site static-assets worker; this worker claims the dynamic # paths on traks.dev via zone routes (which beat custom domains). name = "traks-home-api-dev" main = "src/index.ts" compatibility_date = "2026-06-01" compatibility_flags = ["nodejs_compat"] # The only state: one Durable Object per wizard session (progress replay) and # per instance (run lock), each wiping itself 24 hours after its first write. # Nothing about anyone's instance is kept beyond that. [[migrations]] tag = "v1" new_sqlite_classes = ["DeploySession"] # --- Dev (wrangler dev, port 5014): Durable Objects run locally (remote dev # does not support them); the releases bucket is the real one so the wizard # and changelog pages see published releases. --- [[durable_objects.bindings]] name = "SESSIONS" class_name = "DeploySession" # Release artifacts consumed by the /deploy web installer (shared with prod: # releases are immutable, hash-addressed uploads). [[r2_buckets]] binding = "RELEASES" bucket_name = "traks-releases" remote = true # Abuse guards for the public, unauthenticated wizard API. Namespaces are # per-limiter; both are keyed by client IP. # 1002 - token-verification endpoints (accounts/zones/verify-catalog): these # relay caller-supplied credentials to Cloudflare, so without a cap # traks.dev would be a free credential-validation oracle. # 1003 - session creation (POST /instance). [[ratelimits]] name = "VERIFY_LIMIT" namespace_id = "1002" simple = { limit = 30, period = 60 } [[ratelimits]] name = "SESSION_LIMIT" namespace_id = "1003" simple = { limit = 10, period = 60 } [vars] ENVIRONMENT = "development" # --- Production: wrangler deploy --env production --- [env.production] name = "traks-home-api" [[env.production.durable_objects.bindings]] name = "SESSIONS" class_name = "DeploySession" [[env.production.r2_buckets]] binding = "RELEASES" bucket_name = "traks-releases" # Abuse guards for the public, unauthenticated wizard API. Namespaces are # per-limiter; both are keyed by client IP. # 1002 - token-verification endpoints (accounts/zones/verify-catalog): these # relay caller-supplied credentials to Cloudflare, so without a cap # traks.dev would be a free credential-validation oracle. # 1003 - session creation (POST /instance). [[env.production.ratelimits]] name = "VERIFY_LIMIT" namespace_id = "1002" simple = { limit = 30, period = 60 } [[env.production.ratelimits]] name = "SESSION_LIMIT" namespace_id = "1003" simple = { limit = 10, period = 60 } [env.production.vars] ENVIRONMENT = "production" # traks.dev is owned by the traks-site worker (marketing + wizard UI); this # worker takes only the wizard's backend paths there. [[env.production.routes]] pattern = "traks.dev/api/*" zone_name = "traks.dev" # OAuth redirect URI registered on the "Traks Deploy" client. [[env.production.routes]] pattern = "traks.dev/deploy/callback*" zone_name = "traks.dev" # Secrets (Doppler project traks-home, config prd - synced via # `yarn secrets:prod:sync`): # CF_OAUTH_CLIENT_ID, CF_OAUTH_CLIENT_SECRET