From 236b61d619f60d941119d891dc1c6a49b504a880 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 16 May 2026 13:02:23 +0530 Subject: Fix captive portal detection on GrapheneOS + embed mint URL in portal HTML - Add esp_netif_set_dns_info() on AP interface so DHCP advertises AP as DNS server to clients (fixes captive portal on GrapheneOS) - Embed price and mint URL directly in portal HTML via server-side template substitution (no JavaScript fetch to :2121 needed) - Move supported mints section below the token input field - Add Playwright tests: no unresolved placeholders, embedded mint/price, DOM order verification (14/14 passing) --- main/captive_portal.c | 91 ++++++++++++++++++++++++++----------------- main/tollgate_main.c | 6 +++ tests/captive-portal.spec.mjs | 38 +++++++++++++++++- 3 files changed, 97 insertions(+), 38 deletions(-) diff --git a/main/captive_portal.c b/main/captive_portal.c index 1f7340e..7d6c885 100644 --- a/main/captive_portal.c +++ b/main/captive_portal.c @@ -31,56 +31,49 @@ static const char PORTAL_HTML_TEMPLATE[] = \ ".price{background:#252525;border-radius:12px;padding:16px;margin-bottom:16px}" ".price-amount{font-size:36px;font-weight:bold;color:#f7931a}" ".price-unit{color:#888;font-size:14px}" -".mints{background:#252525;border-radius:12px;padding:12px;margin-bottom:16px;text-align:left}" +"textarea{width:100%;height:80px;background:#252525;border:1px solid #333;border-radius:8px;" +"color:#fff;padding:12px;font-family:monospace;font-size:12px;resize:none}" +".btn{background:#f7931a;color:#000;border:none;border-radius:8px;padding:14px 28px;" +"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}" +".mints{background:#252525;border-radius:12px;padding:12px;margin-top:16px;text-align:left}" ".mints-title{color:#888;font-size:12px;margin-bottom:8px}" ".mint-url{font-family:monospace;font-size:11px;color:#f7931a;word-break:break-all;" -"background:#1a1a1a;padding:8px;border-radius:6px;position:relative;cursor:pointer}" +"background:#1a1a1a;padding:8px;border-radius:6px;cursor:pointer}" ".mint-url:active{opacity:0.7}" ".mint-hint{color:#666;font-size:10px;margin-top:4px}" "#status{margin-top:16px;padding:12px;border-radius:8px;display:none;font-size:14px}" "#status.success{display:block;background:#1a472a;color:#4caf50}" "#status.error{display:block;background:#471a1a;color:#f44336}" "#status.processing{display:block;background:#1a3a47;color:#2196f3}" -".btn{background:#f7931a;color:#000;border:none;border-radius:8px;padding:14px 28px;" -"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}" "" "" "
" "

TollGate

" "

Pay for internet access with ecash

" "
" -"
Loading...
" +"
__PRICE__
" "
sats per minute
" "
" +"" +"" "
" "
SUPPORTED MINTS
" -"
Loading...
" +"
__MINT_URL__
" "
Tap to copy • Mint tokens at this URL before paying
" "
" -"" -"" "
" "
" "