Repository navigation
Expand file tree
/
Copy pathwrangler.example.toml
More file actions
69 lines (57 loc) · 1.88 KB
/
Copy pathwrangler.example.toml
File metadata and controls
69 lines (57 loc) · 1.88 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
# Legacy Worker service name kept to avoid creating a new production Worker during rename cleanup.
name = "cfchat"
main = "worker/src/index.js"
compatibility_date = "2026-04-05"
compatibility_flags = ["nodejs_compat"]
[build]
command = "npm run schema:generate"
[vars]
ADMIN_USERNAMES = "admin"
MESSAGE_RETENTION_DAYS = "7"
SOFT_DELETE_RETENTION_DAYS = "60"
GC_BATCH_SIZE = "90"
GC_MAX_BATCHES_PER_RUN = "20"
# 单次调用的 D1/R2 内部操作合计保留 100 次平台余量;失败写回也计入同一预算。
GC_INTERNAL_OPERATION_BUDGET = "900"
GC_D1_STATEMENT_BUDGET = "1200"
GC_R2_OPERATION_BUDGET = "300"
# 逗号分隔的本站 origin,用于识别升级前保存的完整 /files/ 图标 URL;自定义域名应全部列出。
SITE_ORIGINS = ""
R2_DELETE_MAX_RETRY = "8"
ORPHAN_UPLOAD_RETENTION_DAYS = "1"
ALLOWED_FILE_TYPES = "image/,video/,audio/,application/pdf,text/"
MAX_FILE_SIZE = "20971520"
[[d1_databases]]
binding = "DB"
# Legacy D1 resource name kept intentionally; do not rename without a data migration plan.
database_name = "cfchat-db"
database_id = "YOUR_D1_DATABASE_ID_HERE"
[[kv_namespaces]]
binding = "SESSIONS"
id = "YOUR_KV_NAMESPACE_ID_HERE"
[[r2_buckets]]
binding = "FILES"
# Legacy R2 bucket name kept intentionally; code/docs use Edgechat branding.
bucket_name = "cfchat-files"
[[durable_objects.bindings]]
name = "CHANNEL_ROOM"
class_name = "ChannelRoom"
[[durable_objects.bindings]]
name = "SCHEDULER"
class_name = "Scheduler"
[[durable_objects.bindings]]
name = "USER_INBOX"
class_name = "UserInbox"
[[migrations]]
tag = "v1"
new_sqlite_classes = ["ChannelRoom", "Scheduler"]
[[migrations]]
tag = "v2"
new_sqlite_classes = ["UserInbox"]
[assets]
directory = "./frontend/dist"
not_found_handling = "single-page-application"
run_worker_first = ["/api/*", "/files/*"]
[triggers]
# Cloudflare Cron 按 UTC 执行;19:00 UTC = 北京时间每天 03:00
crons = ["0 19 * * *"]