From 1263d86314fc0760d9be8eea415ccecbc047a5eb Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 15 May 2026 22:27:14 +0530 Subject: Phase 2 WIP: Cashu payment endpoints, session tracking, updated checklist - Add cashu.c/h: Cashu token decode (cashuA/base64url), proof state check via mint API, allotment calculator - Add session.c/h: time-based session management with allotment/expiry, spent secret tracking - Add tollgate_api.c/h: HTTP server on :2121 with GET / (kind=10021 discovery), POST / (payment processing), /usage, /whoami - Update captive portal HTML: replace Grant Free Access with Cashu token paste form + Pay & Connect button - Update tollgate_main.c: wire in session manager, TollGate API, 1s session tick loop - Add tests/phase2.mjs: Phase 2 test suite (discovery, invalid token, wrong mint, valid payment) - Update CHECKLIST.md: reflect Phase 1 complete, Phase 2 in progress with known bugs Known issues (not yet flashed): - Stack overflow crash in httpd POST handler (need stack_size=16384 + heap allocations) - cashu_decode_token uses 2KB stack buffer (needs heap alloc) - Mint URL should be testnut.cashu.space (nofee.testnut has API compat issues) --- main/captive_portal.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) (limited to 'main/captive_portal.c') diff --git a/main/captive_portal.c b/main/captive_portal.c index acff9c2..17f672f 100644 --- a/main/captive_portal.c +++ b/main/captive_portal.c @@ -38,6 +38,8 @@ static const char PORTAL_HTML[] = \ "font-size:16px;font-weight:bold;cursor:pointer;width:100%;margin-top:8px}" ".btn:hover{background:#e8850f}" ".btn:disabled{background:#333;color:#666;cursor:not-allowed}" +"textarea{width:100%;height:80px;background:#252525;border:1px solid #333;border-radius:8px;" +"color:#fff;padding:12px;font-family:monospace;font-size:12px;margin-top:8px;resize:none}" "" "" "
" @@ -47,25 +49,32 @@ static const char PORTAL_HTML[] = \ "
Loading...
" "
sats per minute
" "
" -"" +"" +"" "
" "" "" ""; -- cgit v1.2.3