diff --git a/BTPrivacyApp.cpp b/BTPrivacyApp.cpp index 95e3f4b..eef1f08 100644 --- a/BTPrivacyApp.cpp +++ b/BTPrivacyApp.cpp @@ -30,6 +30,7 @@ #include #include #include +#include "esp_netif.h" // ---------------- USER SETTINGS ---------------- @@ -82,6 +83,9 @@ static constexpr char BTPRIVACY_WIFI_HOSTNAME[] = "btprivacy"; static constexpr bool BTPRIVACY_MDNS_ENABLED = true; static constexpr uint16_t BTPRIVACY_WEB_PORT = 80; static constexpr uint32_t BTPRIVACY_WIFI_TIMEOUT_MS = 12000; +static constexpr char BTPRIVACY_WEB_USERNAME[] = "admin"; +static constexpr char BTPRIVACY_WEB_PASSWORD[] = "btprivacy"; +static constexpr char BTPRIVACY_AUTH_COOKIE[] = "BTPrivacyAuth=1"; static constexpr uint8_t BLE_LEGACY_ADV_MAX_LEN = 31; @@ -184,6 +188,7 @@ static bool g_wifiStarted = false; static bool g_webStarted = false; static uint32_t g_wifiConnectMs = 0; static SlotState g_slots[BTPRIVACY_MAX_ADV_SETS]; +static const char *WEB_HEADER_KEYS[] = {"Cookie"}; static void logBegin() { @@ -652,6 +657,55 @@ static String boolJson(bool v) { return v ? "true" : "false"; } +static const char FAVICON_SVG[] PROGMEM = R"rawliteral( + + +BT + +)rawliteral"; + +static const char LOGIN_HTML[] PROGMEM = R"rawliteral( + + + + + + BTPrivacy Login + + + + + + +
+
+

BTPrivacy login

+
Invalid username or password
+
+ + +
+
+ + +
+ +
+
+ + + +)rawliteral"; + static const char INDEX_HTML[] PROGMEM = R"rawliteral( @@ -659,9 +713,13 @@ static const char INDEX_HTML[] PROGMEM = R"rawliteral( BTPrivacy + +