- Add optional Basic Auth with NVS-backed credentials and STA/AP flags; protect status, wifi, history, and download routes - Stop pre-filling WiFi/MQTT/Web UI password fields; keep stored secrets on blank and add clear-password checkboxes - Add HTML escaping + URL encoding helpers and apply to user-controlled strings; add unit test - Harden /sd/download path validation (prefix, length, dotdot, slashes) and log rejections - Enforce protocol version in LoRa receive and release GPIO14 before SD init - Update README security, SD, and GPIO sharing notes
28 lines
624 B
C
28 lines
624 B
C
#pragma once
|
|
|
|
#include <Arduino.h>
|
|
#include <Preferences.h>
|
|
|
|
struct WifiMqttConfig {
|
|
String ssid;
|
|
String password;
|
|
String mqtt_host;
|
|
uint16_t mqtt_port;
|
|
String mqtt_user;
|
|
String mqtt_pass;
|
|
String ntp_server_1;
|
|
String ntp_server_2;
|
|
String web_user;
|
|
String web_pass;
|
|
bool valid;
|
|
};
|
|
|
|
void wifi_manager_init();
|
|
bool wifi_load_config(WifiMqttConfig &config);
|
|
bool wifi_save_config(const WifiMqttConfig &config);
|
|
|
|
bool wifi_connect_sta(const WifiMqttConfig &config, uint32_t timeout_ms = 10000);
|
|
void wifi_start_ap(const char *ap_ssid, const char *ap_pass);
|
|
bool wifi_is_connected();
|
|
String wifi_get_ssid();
|