/ workers / auditandfix-api / wrangler.toml
wrangler.toml
 1  name = "auditandfix-api"
 2  main = "src/index.js"
 3  compatibility_date = "2024-01-01"
 4  
 5  # ─── Production (default) ────────────────────────────────────────────────────
 6  # Deployed as: auditandfix-api.auditandfix.workers.dev
 7  # Used by: auditandfix.com PHP sales page (live PayPal payments + free scans)
 8  # Auth secret: set via `wrangler secret put AUTH_SECRET`
 9  #   same value as AUDITANDFIX_WORKER_SECRET on the PHP server
10  # AUDITANDFIX_WORKER_URL in .env.secrets must point to this URL
11  #
12  # Setup (first time):
13  #   wrangler kv namespace create PURCHASES
14  #   wrangler kv namespace create PRICING
15  #   wrangler kv namespace create SCANS
16  #   wrangler secret put AUTH_SECRET
17  #   wrangler deploy
18  #
19  # SCANS KV namespace stores free scan results:
20  #   scan_{uuid}    → full scan record (7-day TTL), used by GET /scan/:id and NixOS poll daemon
21  #   cache_{domain} → cached scan for 24h dedup
22  #   rl_{ip}        → rate limit counter (1h TTL)
23  
24  [vars]
25  ENVIRONMENT = "production"
26  
27  [[kv_namespaces]]
28  binding = "PURCHASES"
29  id = "c031909b56f4417aa2dd59fa7bf48e9b"
30  
31  [[kv_namespaces]]
32  binding = "PRICING"
33  id = "e967348bebee46fd8a01e4decade7e3d"
34  
35  [[kv_namespaces]]
36  binding = "SCANS"
37  id = "cb65d9dbf8d14b459c7175fee569578a"
38  
39  # VIDEO-DEMOS KV namespace stores self-serve video demo requests:
40  #   demo_{uuid}    → full demo record (30-day TTL)
41  #   rl_demo_{ip}   → rate limit counter (1h TTL)
42  #
43  # Setup:
44  #   wrangler kv namespace create VIDEO-DEMOS
45  #   wrangler kv namespace create VIDEO-DEMOS --env test
46  #   Then fill in the IDs below.
47  
48  [[kv_namespaces]]
49  binding = "VIDEO_DEMOS"
50  id = "495d4eeaa2ef4ff3b708d36f3f3e65f0"
51  
52  # ─── Test environment ─────────────────────────────────────────────────────────
53  # Deployed as: auditandfix-api-test.auditandfix.workers.dev
54  # Used by: E2E tests with PayPal sandbox (?sandbox=1)
55  # KV namespaces are isolated — test data never touches prod KV
56  # AUDITANDFIX_WORKER_SANDBOX_URL on the PHP server must point to this URL
57  #
58  # Deploy:  wrangler deploy --env test
59  # Secrets: wrangler secret put AUTH_SECRET --env test
60  #   (can use the same value as prod AUTH_SECRET)
61  
62  [env.test]
63  name = "auditandfix-api-test"
64  
65  [env.test.vars]
66  ENVIRONMENT = "test"
67  
68  [[env.test.kv_namespaces]]
69  binding = "PURCHASES"
70  id = "f95e7ecbdbb54ab8b3870de075f4f66a"
71  
72  [[env.test.kv_namespaces]]
73  binding = "PRICING"
74  id = "1cab1672b96b4841b6a27e94991cc77c"
75  
76  [[env.test.kv_namespaces]]
77  binding = "SCANS"
78  id = "ef868d189d9241b8adb11b1e92b9e0b3"
79  
80  [[env.test.kv_namespaces]]
81  binding = "VIDEO_DEMOS"
82  id = "7f2c9346279e4ccea383a0e9d799d78a"