| 1 | import { bindings, defineConfig, exports, triggers } from "cf/config"; |
| 2 | |
| 3 | export default defineConfig({ |
| 4 | worker: { |
| 5 | name: "codewhale-web", |
| 6 | compatibilityDate: "2025-04-01", |
| 7 | compatibilityFlags: [ |
| 8 | "nodejs_compat", |
| 9 | "global_fetch_strictly_public", |
| 10 | ], |
| 11 | entrypoint: "worker.ts", |
| 12 | observability: { |
| 13 | enabled: true, |
| 14 | }, |
| 15 | domains: [ |
| 16 | "codewhale.net", |
| 17 | "www.codewhale.net", |
| 18 | ], |
| 19 | triggers: [ |
| 20 | triggers.scheduled({ |
| 21 | schedule: "0 */6 * * *", |
| 22 | }), |
| 23 | triggers.scheduled({ |
| 24 | schedule: "0 0 * * *", |
| 25 | }), |
| 26 | ], |
| 27 | env: { |
| 28 | GITHUB_REPO: bindings.text("codewhale-hq/CodeWhale"), |
| 29 | DEEPSEEK_MODEL: bindings.text("deepseek-flash"), |
| 30 | DEEPSEEK_BASE_URL: bindings.text("https://gateway.ai.cloudflare.com/v1/cf50f793171d7cb3b2ce23368b69cdcb/codewhale-web/deepseek"), |
| 31 | SUPABASE_URL: bindings.text("https://mungbvkvpkxbkjzspehg.supabase.co"), |
| 32 | CURATED_KV: bindings.kv({ |
| 33 | id: "abaa6a753c9d45bfa5c0afaf26dc67b3", |
| 34 | }), |
| 35 | NEXT_INC_CACHE_KV: bindings.kv({ |
| 36 | id: "a2e6f324db9b4b03bbc940a4ba246985", |
| 37 | }), |
| 38 | WORKER_SELF_REFERENCE: bindings.worker({ |
| 39 | worker: "codewhale-web", |
| 40 | }), |
| 41 | DRAFT_CLAIM_LOCK: bindings.durableObject({ |
| 42 | worker: "codewhale-web", |
| 43 | exportName: "DraftClaimLock", |
| 44 | }), |
| 45 | ADMIN_LOGIN_LIMITER: bindings.rateLimit({ |
| 46 | namespace: "913001", |
| 47 | simple: { |
| 48 | limit: 5, |
| 49 | period: 60, |
| 50 | }, |
| 51 | }), |
| 52 | MERCH_INTEREST_LIMITER: bindings.rateLimit({ |
| 53 | namespace: "913002", |
| 54 | simple: { |
| 55 | limit: 5, |
| 56 | period: 60, |
| 57 | }, |
| 58 | }), |
| 59 | ASSETS: bindings.assets(), |
| 60 | }, |
| 61 | // Same live class and SQLite storage as the former v1 migration. |
| 62 | exports: { DraftClaimLock: exports.durableObject({ storage: "sqlite" }) }, |
| 63 | }, |
| 64 | }); |
| 65 |