blob: e5f99a99cf79e86d8c083241485d6dca39b51d04 (
plain)
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
|
# TollGate ESP32 — Progress Checklist
## Phase 0: Bootstrap
- [x] Create project directory and git repo
- [x] Create .env, .env.example, .gitignore
- [x] Persist PLAN.md and CHECKLIST.md
- [ ] Create ESP-IDF project skeleton
- [ ] Create Makefile with detect targets
- [ ] Run `make detect-all` — identify ESP32 boards
## Phase 1: Captive Portal + Firewall
- [ ] Implement tollgate_main.c (WiFi AP+STA, event loop)
- [ ] Implement config.c/h (JSON config loading)
- [ ] Implement dns_server.c/h (DNS hijack/forward)
- [ ] Implement captive_portal.c/h (HTTP :80, portal HTML)
- [ ] Implement firewall.c/h (NAPT, per-IP auth)
- [ ] Set up test infrastructure (Playwright, helpers)
- [ ] Test 1: Boot and AP appears
- [ ] Test 2: DHCP lease
- [ ] Test 3: Captive portal serves HTML
- [ ] Test 4: Captive detection URIs work
- [ ] Test 5: DNS hijack before auth
- [ ] Test 6: No internet before auth
- [ ] Test 7: /whoami returns MAC
- [ ] Test 8: /usage returns no session
- [ ] Test 9: Grant access via API
- [ ] Test 10: DNS forward after auth
- [ ] Test 11: Internet after auth
- [ ] Test 12: HTTP browsing works
- [ ] Test 13: Reset auth
- [ ] Test 14: Internet blocked after reset
## Phase 2: E-Cash Payments (Simple Melt)
- [ ] Implement payment.c/h (Cashu token parse + melt)
- [ ] Implement session.c/h (time-based metering)
- [ ] Implement tollgate_api.c/h (:2121 endpoints)
- [ ] Update captive portal HTML with payment form
- [ ] Test 15: Advertisement valid
- [ ] Test 16: Valid payment
- [ ] Test 17: Usage tracking
- [ ] Test 18: Internet after payment
- [ ] Test 19: Invalid token rejected
- [ ] Test 20: Spent token rejected
- [ ] Test 21: Wrong mint rejected
- [ ] Test 22: Session expiry
- [ ] Test 23: Session renewal
- [ ] Test 24: Portal payment form
- [ ] Test 25: Two clients pay independently
- [ ] Test 26: Client isolation
- [ ] Test 27: Full e2e browser flow
## Phase 3: nucula Wallet + Reseller
- [ ] Extract nucula wallet into components/cashu_wallet/
- [ ] Replace simple melt with Wallet::receive()
- [ ] Implement payout.c/h (background melt-to-LN)
- [ ] Implement upstream_client.c/h (reseller mode)
- [ ] Test 28-38: All Phase 3 tests
|