Repository navigation
Expand file tree
/
Copy pathwrangler.jsonc
More file actions
47 lines (42 loc) · 2.14 KB
/
Copy pathwrangler.jsonc
File metadata and controls
47 lines (42 loc) · 2.14 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
// try.cloudhal.com: one Worker; each visitor gets a SQLite-backed Durable Object (RFC-0036 §1).
// `pnpm build` (astro build) bundles src/playground/worker.ts with the site; `wrangler deploy`
// then uses the generated dist/server/wrangler.json.
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "cloudhal-playground",
"main": "./src/playground/worker.ts",
"compatibility_date": "2026-07-01",
"compatibility_flags": ["nodejs_compat"],
"workers_dev": true,
"preview_urls": false,
"observability": { "enabled": true, "redact_query_string": true },
// One SQLite-backed DO per session (idFromName(<session ULID>)), and the daily counter.
"durable_objects": { "bindings": [{ "name": "PLAYGROUND", "class_name": "PlaygroundSite" }] },
"migrations": [{ "tag": "v1", "new_sqlite_classes": ["PlaygroundSite"] }],
// Workers Rate Limiting (RFC-0036 §7). namespace_id is an account-unique integer string.
"ratelimits": [
// New sessions: 5 / min per IP (key = CF-Connecting-IP).
{ "name": "SESSION_LIMIT", "namespace_id": "4101", "simple": { "limit": 5, "period": 60 } },
// Writes: 120 / min per session.
{ "name": "WRITE_LIMIT", "namespace_id": "4102", "simple": { "limit": 120, "period": 60 } }
],
// Landing page, Studio (copied from @cloudhal/cli by `pnpm build`), the site's assets and the
// read-only demo media. No SPA fallback: the Worker serves Studio's index.html for its routes,
// and the session's blob store must see a 404 for files that do not exist.
"assets": {
"directory": "./dist/client",
"binding": "ASSETS",
"run_worker_first": true,
"not_found_handling": "none"
},
"vars": {
// Kill switch: only "true" opens the playground; anything else serves the landing page.
"PLAYGROUND_ENABLED": "true",
// New sessions per UTC day; "" means no cap (RFC-0036 §9).
"PLAYGROUND_DAILY_SESSIONS": "2000"
},
// Secrets (wrangler secret put): PLAYGROUND_SECRET (≥ 32 chars, signs the session cookie),
// TURNSTILE_SECRET. Optional var: TURNSTILE_SITE_KEY.
// Custom domain (RFC-0036 phase 4, ADR-0037).
"routes": [{ "pattern": "try.cloudhal.com", "custom_domain": true }]
}