-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrangler.toml
More file actions
158 lines (125 loc) · 5.34 KB
/
Copy pathwrangler.toml
File metadata and controls
158 lines (125 loc) · 5.34 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
name = "paperward-edge"
main = "src/index.ts"
compatibility_date = "2026-05-01"
compatibility_flags = ["nodejs_compat"]
# ─────────────────────────────────────────────────────────────
# Default (production) values. Concrete IDs are filled in at
# deploy time via `wrangler kv:namespace create` etc.
# ─────────────────────────────────────────────────────────────
[vars]
ENV = "production"
ADMIN_HOSTNAME = "admin.paperward.com"
HEALTH_HOSTNAME = "health.paperward.com"
[[kv_namespaces]]
binding = "KV_DOMAINS"
id = "REPLACE_ME_PROD_DOMAINS"
[[kv_namespaces]]
binding = "KV_KEY_CACHE"
id = "REPLACE_ME_PROD_KEY_CACHE"
[[kv_namespaces]]
binding = "KV_AUDIT"
id = "REPLACE_ME_PROD_AUDIT"
[[r2_buckets]]
binding = "R2_LOGS"
bucket_name = "paperward-logs-prod"
[[analytics_engine_datasets]]
binding = "ANALYTICS"
dataset = "paperward_edge_prod"
[[durable_objects.bindings]]
name = "RATE_LIMITER"
class_name = "RateLimiterDO"
[[migrations]]
tag = "v1"
new_sqlite_classes = ["RateLimiterDO"]
# Q_SETTLE_RETRY queue intentionally NOT declared in v0.
# (Adding it later, when the producer call site and consumer
# Worker ship together, per spec §11.1.)
# Optional: emit per-decision events to the Paperward control-plane Queue.
# Leaving this commented disables the feature; OSS forks can ignore it.
# [[queues.producers]]
# binding = "PAPERWARD_EVENTS"
# queue = "paperward-events"
# Optional: emit citation referral events to the Paperward control-plane Queue.
# Leaving this commented disables the feature; OSS forks can ignore it.
# [[queues.producers]]
# binding = "PAPERWARD_REFERRALS"
# queue = "paperward-citation-referrals"
# ─────────────────────────────────────────────────────────────
# dev environment — `wrangler dev --env dev`
# ─────────────────────────────────────────────────────────────
[env.dev]
name = "paperward-edge-dev"
[env.dev.vars]
ENV = "dev"
ADMIN_HOSTNAME = "admin.dev.paperward.local"
HEALTH_HOSTNAME = "health.dev.paperward.local"
[[env.dev.kv_namespaces]]
binding = "KV_DOMAINS"
id = "REPLACE_ME_DEV_DOMAINS"
preview_id = "REPLACE_ME_DEV_DOMAINS_PREVIEW"
[[env.dev.kv_namespaces]]
binding = "KV_KEY_CACHE"
id = "REPLACE_ME_DEV_KEY_CACHE"
preview_id = "REPLACE_ME_DEV_KEY_CACHE_PREVIEW"
[[env.dev.kv_namespaces]]
binding = "KV_AUDIT"
id = "REPLACE_ME_DEV_AUDIT"
preview_id = "REPLACE_ME_DEV_AUDIT_PREVIEW"
[[env.dev.r2_buckets]]
binding = "R2_LOGS"
bucket_name = "paperward-logs-dev"
[[env.dev.analytics_engine_datasets]]
binding = "ANALYTICS"
dataset = "paperward_edge_dev"
[[env.dev.durable_objects.bindings]]
name = "RATE_LIMITER"
class_name = "RateLimiterDO"
# ─────────────────────────────────────────────────────────────
# staging environment — `wrangler deploy --env staging`
# ─────────────────────────────────────────────────────────────
[env.staging]
name = "paperward-edge-staging"
[env.staging.vars]
ENV = "staging"
ADMIN_HOSTNAME = "admin.staging.paperward.com"
HEALTH_HOSTNAME = "health.staging.paperward.com"
# Wildcard route on the paperward.com zone. This is the canonical pattern for
# Cloudflare for SaaS + Workers integration: SaaS-forwarded traffic preserves
# the inbound Host header (e.g. test-blog.ltmd.it), which means neither a
# Workers Custom Domain on cname.staging.paperward.com nor a route pattern
# scoped to that hostname matches the forwarded traffic — both bindings match
# on Host. Only `*/*` catches every URL in the zone regardless of Host.
# More-specific Custom Domains (admin/health/e2e-test) take precedence over
# `*/*` and continue routing as before. Confirmed by Cloudflare support
# 2026-05-07.
[[env.staging.routes]]
pattern = "*/*"
zone_name = "paperward.com"
[[env.staging.kv_namespaces]]
binding = "KV_DOMAINS"
id = "5ad4c3b4a4ad4a6fab601cd954e8553d"
[[env.staging.kv_namespaces]]
binding = "KV_KEY_CACHE"
id = "d23c1be1b3ca46deb6785cbc3978d3fd"
[[env.staging.kv_namespaces]]
binding = "KV_AUDIT"
id = "ee525f69b97c41f5b33a90fdd143c643"
[[env.staging.r2_buckets]]
binding = "R2_LOGS"
bucket_name = "paperward-logs-staging"
[[env.staging.analytics_engine_datasets]]
binding = "ANALYTICS"
dataset = "paperward_edge_staging"
[[env.staging.durable_objects.bindings]]
name = "RATE_LIMITER"
class_name = "RateLimiterDO"
# Optional: emit per-decision events to the Paperward control-plane Queue.
# Leaving this commented disables the feature; OSS forks can ignore it.
[[env.staging.queues.producers]]
binding = "PAPERWARD_EVENTS"
queue = "paperward-events-staging"
# Optional: emit citation referral events to the Paperward control-plane Queue.
# Leaving this commented disables the feature; OSS forks can ignore it.
[[env.staging.queues.producers]]
binding = "PAPERWARD_REFERRALS"
queue = "paperward-citation-referrals-staging"