diff options
| author | Your Name <you@example.com> | 2026-05-16 13:02:23 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-16 13:02:23 +0530 |
| commit | 236b61d619f60d941119d891dc1c6a49b504a880 (patch) | |
| tree | 3f5faffc36284d8082fe1a468eecdb89c3b9e11a /main/tollgate_main.c | |
| parent | 38aa9ec3801f5895e09866fe92cb8e44fb987cee (diff) | |
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)
Diffstat (limited to 'main/tollgate_main.c')
| -rw-r--r-- | main/tollgate_main.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/main/tollgate_main.c b/main/tollgate_main.c index 30fad8d..9d2c392 100644 --- a/main/tollgate_main.c +++ b/main/tollgate_main.c | |||
| @@ -156,6 +156,12 @@ static void wifi_create_ap_netif(void) | |||
| 156 | ESP_ERROR_CHECK(esp_netif_set_ip_info(s_ap_netif, &ip_info)); | 156 | ESP_ERROR_CHECK(esp_netif_set_ip_info(s_ap_netif, &ip_info)); |
| 157 | ESP_ERROR_CHECK(esp_netif_dhcps_start(s_ap_netif)); | 157 | ESP_ERROR_CHECK(esp_netif_dhcps_start(s_ap_netif)); |
| 158 | 158 | ||
| 159 | esp_netif_dns_info_t dns_info; | ||
| 160 | dns_info.ip.u_addr.ip4.addr = ip_info.ip.addr; | ||
| 161 | dns_info.ip.type = IPADDR_TYPE_V4; | ||
| 162 | esp_netif_set_dns_info(s_ap_netif, ESP_NETIF_DNS_MAIN, &dns_info); | ||
| 163 | ESP_LOGI(TAG, "AP DNS server set to " IPSTR, IP2STR(&ip_info.ip)); | ||
| 164 | |||
| 159 | dhcps_offer_t offer_dns = true; | 165 | dhcps_offer_t offer_dns = true; |
| 160 | esp_netif_dhcps_option(s_ap_netif, ESP_NETIF_OP_SET, ESP_NETIF_DOMAIN_NAME_SERVER, | 166 | esp_netif_dhcps_option(s_ap_netif, ESP_NETIF_OP_SET, ESP_NETIF_DOMAIN_NAME_SERVER, |
| 161 | &offer_dns, sizeof(offer_dns)); | 167 | &offer_dns, sizeof(offer_dns)); |