-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrangler.jsonc
More file actions
171 lines (155 loc) · 5.29 KB
/
Copy pathwrangler.jsonc
File metadata and controls
171 lines (155 loc) · 5.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
// Cloudflare Workers configuration for ChittyFinance (System Mode)
// Root-level config for CF Workers Builds integration
//
// Canonical model: 3 explicit environments (dev, staging, production).
// Bindings (KV, R2, DO, tail_consumers) do NOT inherit from top-level
// into env blocks — each env must carry its own explicit bindings.
// Top-level is used by Workers Builds (bare `wrangler deploy` without --env).
//
// Secrets (set per-env with: wrangler secret put SECRET_NAME --env <env>)
// Required:
// DATABASE_URL — Neon PostgreSQL connection string
// CHITTY_AUTH_SERVICE_TOKEN — ChittyAuth service token
// JWT_SECRET — JWT signing secret
// OAUTH_STATE_SECRET — HMAC secret for OAuth CSRF protection
// Integrations (optional):
// OPENAI_API_KEY, STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET,
// WAVE_CLIENT_ID, WAVE_CLIENT_SECRET, CHITTYCONNECT_API_TOKEN
{
"name": "chittyfinance",
"main": "server/worker.ts",
"compatibility_date": "2026-03-01",
"compatibility_flags": ["nodejs_compat"],
"account_id": "0bc21e3a5a9de1a4cc843be9c3e98121",
"workers_dev": false,
"routes": [
{ "pattern": "finance.chitty.cc/*", "zone_name": "chitty.cc" }
],
// Hyperdrive bindings for fractal scope projection.
// CHITTYOS_CORE_DB → ChittyOS-Core aggregation. SERVICE_SCOPE_DB → service's own authoritative scopes.
// Required by chittyschema/identity/scripts/validate-fractal-scopes.ts
"hyperdrive": [
{ "binding": "CHITTYOS_CORE_DB", "id": "1d126444cff1416cb415447e6cc6d15a" },
{ "binding": "SERVICE_SCOPE_DB", "id": "89158b50e55a4d5d9279b5d5c890ea7b" }
],
// Cloudflare Email Service binding
"send_email": [
{ "name": "EMAIL", "allowed_sender_addresses": ["finance@chitty.cc", "noreply@chitty.cc"] }
],
"vars": {
"MODE": "system",
"NODE_ENV": "production",
"APP_VERSION": "2.0.0",
"CHITTYCONNECT_API_BASE": "https://connect.chitty.cc"
},
"observability": { "enabled": true },
"tail_consumers": [{ "service": "chittytrack" }],
"build": {
"command": "pnpm install --frozen-lockfile && pnpm exec vite build --outDir dist/public"
},
"assets": {
"directory": "dist/public",
"binding": "ASSETS"
},
"triggers": {
"crons": ["0 9 * * *"] // Daily at 9:00 AM UTC — lease expiration check
},
"limits": { "cpu_ms": 50 },
"kv_namespaces": [
{
"binding": "FINANCE_KV",
"id": "517b63be4d7144c197b5bdf851f12041",
"preview_id": "89d0b3bc875e49c4a3a9091de6a080aa"
}
],
"r2_buckets": [
{
"binding": "FINANCE_R2",
"bucket_name": "chittyfinance-storage",
"preview_bucket_name": "chittyfinance-storage-preview"
}
],
"durable_objects": {
"bindings": [
{ "name": "CF_AGENT", "class_name": "ChittyAgent" }
]
},
"migrations": [
{ "tag": "v1", "new_sqlite_classes": ["ChittyAgent"] }
],
// ─── env.dev ───
"env": {
"dev": {
"name": "chittyfinance-dev",
"workers_dev": true,
"send_email": [{ "name": "EMAIL" }],
"vars": {
"MODE": "system",
"NODE_ENV": "development",
"APP_VERSION": "2.0.0",
"CHITTYCONNECT_API_BASE": "https://connect.chitty.cc"
},
"triggers": { "crons": ["0 9 * * *"] },
"tail_consumers": [{ "service": "chittytrack" }],
"kv_namespaces": [
{ "binding": "FINANCE_KV", "id": "89d0b3bc875e49c4a3a9091de6a080aa" }
],
"r2_buckets": [
{ "binding": "FINANCE_R2", "bucket_name": "chittyfinance-storage-preview" }
],
"durable_objects": {
"bindings": [{ "name": "CF_AGENT", "class_name": "ChittyAgent" }]
}
},
// ─── env.staging ───
"staging": {
"name": "chittyfinance-staging",
"workers_dev": true,
"vars": {
"MODE": "system",
"NODE_ENV": "staging",
"APP_VERSION": "2.0.0",
"CHITTYCONNECT_API_BASE": "https://connect.chitty.cc"
},
"triggers": { "crons": ["0 9 * * *"] },
"tail_consumers": [{ "service": "chittytrack" }],
"kv_namespaces": [
{ "binding": "FINANCE_KV", "id": "517b63be4d7144c197b5bdf851f12041" }
],
"r2_buckets": [
{ "binding": "FINANCE_R2", "bucket_name": "chittyfinance-storage" }
],
"durable_objects": {
"bindings": [{ "name": "CF_AGENT", "class_name": "ChittyAgent" }]
}
},
// ─── env.production ───
"production": {
"name": "chittyfinance",
"workers_dev": false,
"routes": [
{ "pattern": "finance.chitty.cc/*", "zone_name": "chitty.cc" }
],
"send_email": [
{ "name": "EMAIL", "allowed_sender_addresses": ["finance@chitty.cc", "noreply@chitty.cc"] }
],
"vars": {
"MODE": "system",
"NODE_ENV": "production",
"APP_VERSION": "2.0.0",
"CHITTYCONNECT_API_BASE": "https://connect.chitty.cc"
},
"triggers": { "crons": ["0 9 * * *"] },
"tail_consumers": [{ "service": "chittytrack" }],
"kv_namespaces": [
{ "binding": "FINANCE_KV", "id": "517b63be4d7144c197b5bdf851f12041" }
],
"r2_buckets": [
{ "binding": "FINANCE_R2", "bucket_name": "chittyfinance-storage" }
],
"durable_objects": {
"bindings": [{ "name": "CF_AGENT", "class_name": "ChittyAgent" }]
}
}
}
}