Settings PIN protection.

This commit is contained in:
Blaz Kristan 2022-03-01 23:37:28 +01:00
parent 61a01cb163
commit 9fd26fa574
13 changed files with 954 additions and 815 deletions

View File

@ -365,6 +365,12 @@ writeChunks(
/function GetV().*\<\/script\>/gms,
"</script><script src=\"settings.js?p=8\"></script>"
)
},
{
file: "settings_pin.htm",
name: "PAGE_settings_pin",
method: "gzip",
filter: "html-minify"
}
],
"wled00/html_settings.h"

View File

@ -864,6 +864,9 @@ bool deserializeConfigSec() {
getStringFromJson(hueApiKey, interfaces["hue"][F("key")], 47);
#endif
getStringFromJson(settingsPIN, doc["pin"], 5);
correctPIN = !strlen(settingsPIN);
JsonObject ota = doc["ota"];
getStringFromJson(otaPass, ota[F("pwd")], 33);
CJSON(otaLock, ota[F("lock")]);
@ -903,6 +906,8 @@ void serializeConfigSec() {
if_hue[F("key")] = hueApiKey;
#endif
doc["pin"] = settingsPIN;
JsonObject ota = doc.createNestedObject("ota");
ota[F("pwd")] = otaPass;
ota[F("lock")] = otaLock;

View File

@ -4,27 +4,13 @@
<head>
<meta content='width=device-width' name='viewport'>
<title>WLED Message</title>
<script>function B() { window.history.back() }; function RS() { window.location = "/settings"; } function RP() { top.location.href = "/"; }</script>
<script>
function B() { window.history.back() };
function RS() { window.location = "/settings"; }
function RP() { top.location.href = "/"; }
</script>
<style>
.bt {
background: #333;
color: #fff;
font-family: Verdana, sans-serif;
border: .3ch solid #333;
display: inline-block;
font-size: 20px;
margin: 8px;
margin-top: 12px
}
body {
font-family: Verdana, sans-serif;
text-align: center;
background: #222;
color: #fff;
line-height: 200%%;
margin: 0
}
@import url("style.css");
</style>
</head>

View File

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=500">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/>
<meta charset="utf-8">
<title>Misc Settings</title>
<script>
var d = document;
function H() { window.open("https://kno.wled.ge/features/settings/#security-settings"); }
function B() { window.open("/settings","_self"); }
function gId(s) { return d.getElementById(s); }
function isObj(item) { return (item && typeof item === 'object' && !Array.isArray(item)); }
</script>
<style>
@import url("style.css");
</style>
</head>
<body>
<form id="form_s" name="Sf" method="post">
<div class="toprow">
<div class="helpB"><button type="button" onclick="H()">?</button></div>
<button type="button" onclick="B()">Back</button><button type="submit">Submit</button><hr>
</div>
<h2>Please enter settings PIN code</h2>
<input type="password" name="PIN" size="4" maxlength="4" minlength="4"><br>
<hr>
<button type="button" onclick="B()">Back</button><button type="submit">Submit</button>
</form>
</body>
</html>

View File

@ -60,9 +60,10 @@
<form id="form_s" name="Sf" method="post">
<div class="toprow">
<div class="helpB"><button type="button" onclick="H()">?</button></div>
<button type="button" onclick="B()">Back</button><button type="submit">Save & Reboot</button><hr>
<button type="button" onclick="B()">Back</button><button type="submit">Save</button><hr>
</div>
<h2>Security & Update setup</h2>
Settings PIN: <input type="number" name="PIN" size="4" maxlength="4" minlength="4"><br>
Lock wireless (OTA) software update: <input type="checkbox" name="NO"><br>
Passphrase: <input type="password" name="OP" maxlength="32"><br>
To enable OTA, for security reasons you need to also enter the correct password!<br>
@ -76,7 +77,8 @@
<hr>
<h3>Software Update</h3>
<button type="button" onclick="U()">Manual OTA Update</button><br>
Enable ArduinoOTA: <input type="checkbox" name="AO"><br>
Enable ArduinoOTA: <input type="checkbox" name="AO">
<hr>
<h3>Backup & Restore</h3>
<a class="btn lnk" href="/presets.json?download" target="download-frame">Backup presets</a><br>
<div>Restore presets<br><input type="file" name="data" accept=".json"> <input type="button" value="Upload" onclick="uploadFile(d.Sf.data,'/presets.json');"><br></div><br>
@ -85,6 +87,7 @@
<div style="color: #fa0;">&#9888; Restoring presets/configuration will OVERWRITE your current presets/configuration.<br>
Incorrect configuration may require a factory reset or re-flashing of your ESP.</div>
For security reasons, passwords are not backed up.
<hr>
<h3>About</h3>
<a href="https://github.com/Aircoookie/WLED/" target="_blank">WLED</a> version ##VERSION##<!-- Autoreplaced from package.json --><br><br>
<a href="https://github.com/Aircoookie/WLED/wiki/Contributors-and-credits" target="_blank">Contributors, dependencies and special thanks</a><br>
@ -93,7 +96,7 @@
<i>Licensed under the <a href="https://github.com/Aircoookie/WLED/blob/master/LICENSE" target="_blank">MIT license</a></i><br><br>
Server message: <span class="sip"> Response error! </span><hr>
<div id="toast"></div>
<button type="button" onclick="B()">Back</button><button type="submit">Save & Reboot</button>
<button type="button" onclick="B()">Back</button><button type="submit">Save</button>
</form>
<iframe name=download-frame style='display:none;'></iframe>
</body>

View File

@ -320,6 +320,7 @@ void updateBaudRate(uint32_t rate);
//wled_server.cpp
bool isIp(String str);
void createEditHandler(bool enable);
bool captivePortal(AsyncWebServerRequest *request);
void initServer();
void serveIndexOrWelcome(AsyncWebServerRequest *request);

View File

@ -21,9 +21,7 @@ const uint8_t PAGE_usermod[] PROGMEM = {
const char PAGE_msg[] PROGMEM = R"=====(<!DOCTYPE html><html><head><meta content="width=device-width" name="viewport">
<title>WLED Message</title><script>
function B(){window.history.back()}function RS(){window.location="/settings"}function RP(){top.location.href="/"}
</script><style>
.bt{background:#333;color:#fff;font-family:Verdana,sans-serif;border:.3ch solid #333;display:inline-block;font-size:20px;margin:8px;margin-top:12px}body{font-family:Verdana,sans-serif;text-align:center;background:#222;color:#fff;line-height:200%%;margin:0}
</style></head><body><h2>%MSG%</body></html>)=====";
</script><style>@import url("style.css");</style></head><body><h2>%MSG%</body></html>)=====";
#ifdef WLED_ENABLE_DMX

View File

@ -1275,121 +1275,123 @@ const uint8_t PAGE_settings_time[] PROGMEM = {
// Autogenerated from wled00/data/settings_sec.htm, do not edit!!
const uint16_t PAGE_settings_sec_length = 1802;
const uint16_t PAGE_settings_sec_length = 1830;
const uint8_t PAGE_settings_sec[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0x95, 0x57, 0x6d, 0x6f, 0xdb, 0x38,
0x12, 0xfe, 0xae, 0x5f, 0xc1, 0xb0, 0x40, 0xd7, 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3a, 0x05, 0x83, 0x51, 0x61, 0x18, 0xd6, 0xe2, 0x30,
0x44, 0x66, 0xb5, 0x15, 0x7a, 0xd9, 0x32, 0x82, 0x95, 0x15, 0xa7, 0xce, 0xf5, 0xeb, 0x34, 0xf3,
0x1b, 0x32, 0x0d, 0x54, 0xba, 0xd2, 0x10, 0x2c, 0xb5, 0x0b, 0x6d, 0x89, 0xcd, 0x27, 0xc8, 0x77,
0x6e, 0x6d, 0xc1, 0x57, 0x6b, 0xdb, 0xff, 0xdb, 0xda, 0x22, 0x1a, 0x38, 0x08, 0x99, 0x27, 0x9c,
0x8e, 0xe9, 0x9f, 0xd0, 0x10, 0x6b, 0x3b, 0x17, 0x07, 0x76, 0x55, 0x8a, 0xcd, 0xb1, 0xff, 0x70,
0xa1, 0x70, 0xfd, 0x6b, 0xfc, 0x41, 0xcb, 0x2e, 0x6d, 0xbe, 0xf4, 0xd1, 0xfd, 0x3f, 0x92, 0x88,
0x74, 0xbb, 0x84, 0x0f, 0x00, 0x00
};
@ -1509,3 +1511,44 @@ const uint8_t PAGE_settings_um[] PROGMEM = {
0x6b, 0x43, 0x12, 0x90, 0x0e, 0x00, 0x00
};
// Autogenerated from wled00/data/settings_pin.htm, do not edit!!
const uint16_t PAGE_settings_pin_length = 549;
const uint8_t PAGE_settings_pin[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0x95, 0x53, 0x5d, 0x6f, 0xd3, 0x30,
0x14, 0x7d, 0xcf, 0xaf, 0xf0, 0x8c, 0x34, 0xb5, 0x52, 0xdb, 0x8c, 0x09, 0x24, 0xc4, 0x92, 0x00,
0x85, 0x49, 0xec, 0x01, 0x56, 0xa9, 0xbc, 0xf0, 0x34, 0xb9, 0xf6, 0x4d, 0xe3, 0xd5, 0xb1, 0x23,
0xfb, 0xa6, 0xa1, 0x9b, 0xf8, 0xef, 0x5c, 0x27, 0xfd, 0xd8, 0x26, 0x21, 0xc1, 0x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,
0x3a, 0xfd, 0xc5, 0x67, 0x1e, 0x7d, 0x92, 0xb9, 0x90, 0x9b, 0x93, 0xdf, 0x33, 0x8f, 0xd0, 0xae,
0x6a, 0x4d, 0x35, 0x2e, 0xfb, 0xf3, 0x24, 0xaa, 0xfc, 0x21, 0x41, 0x75, 0x59, 0x24, 0x0b, 0x03,
0x22, 0x00, 0xa3, 0xf9, 0x83, 0x67, 0x87, 0xc5, 0xb1, 0xc5, 0xcd, 0x77, 0xba, 0xfa, 0x0a, 0x68,
0x2e, 0x97, 0x45, 0xa6, 0x6d, 0xd3, 0xe2, 0x3e, 0x6a, 0x43, 0x7d, 0x75, 0xce, 0x2b, 0xbe, 0x7f,
0x2a, 0xa4, 0xe4, 0x2c, 0xe8, 0x07, 0xfa, 0x7d, 0x43, 0x83, 0xa2, 0x7b, 0x6e, 0xc0, 0xae, 0xe9,
0x39, 0x44, 0x58, 0x6b, 0x7b, 0x42, 0x54, 0x9e, 0x1f, 0xb2, 0xff, 0x43, 0x63, 0xb1, 0xaf, 0xe4,
0x3f, 0x1b, 0x4b, 0xe3, 0xba, 0xe8, 0x18, 0x96, 0x98, 0xf6, 0x6f, 0xfd, 0x0f, 0x3e, 0x51, 0x03,
0x3c, 0xfb, 0x03, 0x00, 0x00
};

View File

@ -7,10 +7,19 @@
//called upon POST settings form submit
void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
{
// PIN code request
if (subPage == 252)
{
correctPIN = (strlen(settingsPIN)==0 || strncmp(settingsPIN, request->arg(F("PIN")).c_str(), 4)==0);
lastEditTime = millis();
return;
}
//0: menu 1: wifi 2: leds 3: ui 4: sync 5: time 6: sec 7: DMX 8: usermods
if (subPage <1 || subPage >8) return;
if (correctPIN) lastEditTime = millis();
//WIFI SETTINGS
if (subPage == 1)
{
@ -393,6 +402,14 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
doReboot = true;
}
if (request->hasArg(F("PIN"))) {
const char *pin = request->arg(F("PIN")).c_str();
if (strlen(pin) == 4 || strlen(pin) == 0) {
strlcpy(settingsPIN, pin, 5);
settingsPIN[4] = 0;
}
}
bool pwdCorrect = !otaLock; //always allow access if ota not locked
if (request->hasArg(F("OP")))
{
@ -408,11 +425,14 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
if (pwdCorrect) //allow changes if correct pwd or no ota active
{
bool oldOTALock = otaLock;
otaLock = request->hasArg(F("NO"));
wifiLock = request->hasArg(F("OW"));
aOtaEnabled = request->hasArg(F("AO"));
doReboot = (otaLock ^ oldOTALock);
}
}
#ifdef WLED_ENABLE_DMX // include only if DMX is enabled
if (subPage == 7)
{
@ -526,7 +546,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
releaseJSONBufferLock();
}
if (subPage != 2 && (subPage != 6 || !doReboot)) serializeConfig(); //do not save if factory reset or LED settings (which are saved after LED re-init)
if (subPage == 4) alexaInit();
}

View File

@ -139,6 +139,13 @@ void WLED::loop()
yield();
}
// 15min PIN time-out
if (strlen(settingsPIN)>0 && millis() - lastEditTime > 900000) {
correctPIN = false;
server.removeHandler(editHandler);
createEditHandler(correctPIN);
}
//LED settings have been saved, re-init busses
//This code block causes severe FPS drop on ESP32 with the original "if (busConfigs[0] != nullptr)" conditional. Investigate!
if (doInitBusses) {
@ -723,9 +730,6 @@ void WLED::handleStatusLED()
{
#if defined(STATUSLED)
uint32_t c = 0;
static unsigned long ledStatusLastMillis = 0;
static unsigned short ledStatusType = 0; // current status type - corresponds to number of blinks per second
static bool ledStatusState = false; // the current LED state
#if STATUSLED>=0
if (pinManager.isPinAllocated(STATUSLED)) {

View File

@ -8,7 +8,7 @@
*/
// version code in format yymmddb (b = daily build)
#define VERSION 2202281
#define VERSION 2203011
//uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG
@ -417,6 +417,9 @@ WLED_GLOBAL byte macroDoublePress[WLED_MAX_BUTTONS] _INIT({0});
WLED_GLOBAL bool otaLock _INIT(false); // prevents OTA firmware updates without password. ALWAYS enable if system exposed to any public networks
WLED_GLOBAL bool wifiLock _INIT(false); // prevents access to WiFi settings when OTA lock is enabled
WLED_GLOBAL bool aOtaEnabled _INIT(true); // ArduinoOTA allows easy updates directly from the IDE. Careful, it does not auto-disable when OTA lock is on
WLED_GLOBAL char settingsPIN[5] _INIT(""); // PIN for settings pages
WLED_GLOBAL bool correctPIN _INIT(true);
WLED_GLOBAL unsigned long lastEditTime _INIT(0);
WLED_GLOBAL uint16_t userVar0 _INIT(0), userVar1 _INIT(0); //available for use in usermod
@ -603,6 +606,13 @@ WLED_GLOBAL byte optionType;
WLED_GLOBAL bool doReboot _INIT(false); // flag to initiate reboot from async handlers
WLED_GLOBAL bool doPublishMqtt _INIT(false);
// status led
#if defined(STATUSLED)
WLED_GLOBAL unsigned long ledStatusLastMillis _INIT(0);
WLED_GLOBAL uint8_t ledStatusType _INIT(0); // current status type - corresponds to number of blinks per second
WLED_GLOBAL bool ledStatusState _INIT(false); // the current LED state
#endif
// server library objects
WLED_GLOBAL AsyncWebServer server _INIT_N(((80)));
#ifdef WLED_ENABLE_WEBSOCKETS
@ -610,6 +620,7 @@ WLED_GLOBAL AsyncWebSocket ws _INIT_N((("/ws")));
#endif
WLED_GLOBAL AsyncClient* hueClient _INIT(NULL);
WLED_GLOBAL AsyncMqttClient* mqtt _INIT(NULL);
WLED_GLOBAL AsyncWebHandler *editHandler _INIT(nullptr);
// udp interface objects
WLED_GLOBAL WiFiUDP notifierUdp, rgbUdp, notifier2Udp;

View File

@ -18,8 +18,8 @@ bool isIp(String str) {
return true;
}
void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t index, uint8_t *data, size_t len, bool final){
if (otaLock) {
void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t index, uint8_t *data, size_t len, bool final) {
if (otaLock || !correctPIN) {
if (final) request->send(500, "text/plain", F("Please unlock OTA in security settings!"));
return;
}
@ -27,18 +27,42 @@ void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t
request->_tempFile = WLED_FS.open(filename, "w");
DEBUG_PRINT("Uploading ");
DEBUG_PRINTLN(filename);
if (filename == "/presets.json") presetsModifiedTime = toki.second();
if (filename == F("/presets.json")) presetsModifiedTime = toki.second();
}
if (len) {
request->_tempFile.write(data,len);
}
if (final) {
request->_tempFile.close();
request->send(200, "text/plain", F("File Uploaded!"));
if (filename == F("/cfg.json")) {
doReboot = true;
request->send(200, "text/plain", F("Configuration restore successful.\nRebooting..."));
} else
request->send(200, "text/plain", F("File Uploaded!"));
cacheInvalidate++;
}
}
void createEditHandler(bool enable) {
if (enable) {
#ifdef WLED_ENABLE_FS_EDITOR
#ifdef ARDUINO_ARCH_ESP32
editHandler = &server.addHandler(new SPIFFSEditor(WLED_FS));//http_username,http_password));
#else
editHandler = &server.addHandler(new SPIFFSEditor("","",WLED_FS));//http_username,http_password));
#endif
#else
editHandler = server.on("/edit", HTTP_GET, [](AsyncWebServerRequest *request){
serveMessage(request, 501, "Not implemented", F("The FS editor is disabled in this build."), 254);
});
#endif
} else {
editHandler = &server.on("/edit", HTTP_GET, [](AsyncWebServerRequest *request){
serveMessage(request, 500, "Access Denied", F("Please unlock settings page!"), 254);
});
}
}
bool captivePortal(AsyncWebServerRequest *request)
{
if (ON_STA_FILTER(request)) return false; //only serve captive in AP mode
@ -88,6 +112,14 @@ void initServer()
serveSettings(request);
});
server.on("/style.css", HTTP_GET, [](AsyncWebServerRequest *request){
if (handleIfNoneMatchCacheHeader(request)) return;
AsyncWebServerResponse *response = request->beginResponse_P(200, "text/css", PAGE_settingsCss, PAGE_settingsCss_length);
response->addHeader(F("Content-Encoding"),"gzip");
setStaticContentCacheHeaders(response);
request->send(response);
});
server.on("/favicon.ico", HTTP_GET, [](AsyncWebServerRequest *request){
if(!handleFileRead(request, "/favicon.ico"))
{
@ -212,37 +244,30 @@ void initServer()
request->send(response);
});
createEditHandler(correctPIN);
#ifndef WLED_DISABLE_OTA
//if OTA is allowed
if (!otaLock){
#ifdef WLED_ENABLE_FS_EDITOR
#ifdef ARDUINO_ARCH_ESP32
server.addHandler(new SPIFFSEditor(WLED_FS));//http_username,http_password));
#else
server.addHandler(new SPIFFSEditor("","",WLED_FS));//http_username,http_password));
#endif
#else
server.on("/edit", HTTP_GET, [](AsyncWebServerRequest *request){
serveMessage(request, 501, "Not implemented", F("The FS editor is disabled in this build."), 254);
});
#endif
if (!otaLock) {
//init ota page
#ifndef WLED_DISABLE_OTA
server.on("/update", HTTP_GET, [](AsyncWebServerRequest *request){
AsyncWebServerResponse *response = request->beginResponse_P(200, "text/html", PAGE_update, PAGE_update_length);
AsyncWebServerResponse *response;
if (correctPIN) response = request->beginResponse_P(200, "text/html", PAGE_update, PAGE_update_length);
else response = request->beginResponse_P(200, "text/html", PAGE_settings_pin, PAGE_settings_pin_length);
response->addHeader(F("Content-Encoding"),"gzip");
setStaticContentCacheHeaders(response);
request->send(response);
//request->send_P(200, "text/html", PAGE_update);
});
server.on("/update", HTTP_POST, [](AsyncWebServerRequest *request){
if (Update.hasError())
{
serveMessage(request, 500, F("Update failed!"), F("Please check your file and retry!"), 254); return;
if (Update.hasError() || !correctPIN) {
serveMessage(request, 500, F("Update failed!"), F("Please check your file and retry!"), 254);
} else {
serveMessage(request, 200, F("Update successful!"), F("Rebooting..."), 131);
doReboot = true;
}
serveMessage(request, 200, F("Update successful!"), F("Rebooting..."), 131);
doReboot = true;
},[](AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final){
if (!correctPIN) return;
if(!index){
DEBUG_PRINTLN(F("OTA Update Start"));
#ifdef ESP8266
@ -259,21 +284,16 @@ void initServer()
}
}
});
#else
server.on("/update", HTTP_GET, [](AsyncWebServerRequest *request){
serveMessage(request, 501, "Not implemented", F("OTA updating is disabled in this build."), 254);
});
#endif
} else
{
server.on("/edit", HTTP_GET, [](AsyncWebServerRequest *request){
serveMessage(request, 500, "Access Denied", F("Please unlock OTA in security settings!"), 254);
});
} else {
server.on("/update", HTTP_GET, [](AsyncWebServerRequest *request){
serveMessage(request, 500, "Access Denied", F("Please unlock OTA in security settings!"), 254);
});
}
#else
server.on("/update", HTTP_GET, [](AsyncWebServerRequest *request){
serveMessage(request, 501, "Not implemented", F("OTA updating is disabled in this build."), 254);
});
#endif
#ifdef WLED_ENABLE_DMX
@ -479,6 +499,10 @@ void serveSettings(AsyncWebServerRequest* request, bool post)
else if (url.indexOf("um") > 0) subPage = 8;
} else subPage = 255; //welcome page
if (subPage > 0 && subPage < 9 && strlen(settingsPIN)>0 && !correctPIN) {
subPage = 252; // require PIN
}
if (subPage == 1 && wifiLock && otaLock)
{
serveMessage(request, 500, "Access Denied", F("Please unlock OTA in security settings!"), 254); return;
@ -496,16 +520,21 @@ void serveSettings(AsyncWebServerRequest* request, bool post)
case 3: strcpy_P(s, PSTR("UI")); break;
case 4: strcpy_P(s, PSTR("Sync")); break;
case 5: strcpy_P(s, PSTR("Time")); break;
case 6: strcpy_P(s, PSTR("Security")); strcpy_P(s2, PSTR("Rebooting, please wait ~10 seconds...")); break;
case 6: strcpy_P(s, PSTR("Security")); if (doReboot) strcpy_P(s2, PSTR("Rebooting, please wait ~10 seconds...")); break;
case 7: strcpy_P(s, PSTR("DMX")); break;
case 8: strcpy_P(s, PSTR("Usermods")); break;
case 252: strcpy_P(s, correctPIN ? PSTR("PIN accepted") : PSTR("PIN rejected"));
}
strcat_P(s, PSTR(" settings saved."));
if (subPage != 252) strcat_P(s, PSTR(" settings saved."));
else {
server.removeHandler(editHandler);
createEditHandler(correctPIN);
}
if (!s2[0]) strcpy_P(s2, PSTR("Redirecting..."));
if (!doReboot) serveMessage(request, 200, s, s2, (subPage == 1 || subPage == 6) ? 129 : 1);
if (subPage == 6) doReboot = true;
serveMessage(request, 200, s, s2, (subPage == 1 || (subPage == 6 && doReboot)) ? 129 : (correctPIN ? 1 : 10));
//if (subPage == 6) doReboot = true;
return;
}
@ -527,6 +556,7 @@ void serveSettings(AsyncWebServerRequest* request, bool post)
case 6: response = request->beginResponse_P(200, "text/html", PAGE_settings_sec, PAGE_settings_sec_length); break;
case 7: response = request->beginResponse_P(200, "text/html", PAGE_settings_dmx, PAGE_settings_dmx_length); break;
case 8: response = request->beginResponse_P(200, "text/html", PAGE_settings_um, PAGE_settings_um_length); break;
case 252: response = request->beginResponse_P(200, "text/html", PAGE_settings_pin, PAGE_settings_pin_length); break;
case 253: response = request->beginResponse_P(200, "text/css", PAGE_settingsCss, PAGE_settingsCss_length); break;
case 254: serveSettingsJS(request); return;
case 255: response = request->beginResponse_P(200, "text/html", PAGE_welcome, PAGE_welcome_length); break;

File diff suppressed because it is too large Load Diff