diff --git a/.github/scripts/on-push.sh b/.github/scripts/on-push.sh index 96fff57..1eedd07 100755 --- a/.github/scripts/on-push.sh +++ b/.github/scripts/on-push.sh @@ -7,7 +7,7 @@ if [ ! -z "$TRAVIS_BUILD_DIR" ]; then export GITHUB_REPOSITORY="$TRAVIS_REPO_SLUG" elif [ -z "$GITHUB_WORKSPACE" ]; then export GITHUB_WORKSPACE="$PWD" - export GITHUB_REPOSITORY="me-no-dev/ESPAsyncWebServer" + export GITHUB_REPOSITORY="lorol/ESPAsyncWebServer" fi TARGET_PLATFORM="$1" @@ -34,8 +34,12 @@ if [ "$BUILD_PIO" -eq 0 ]; then cp -rf "$GITHUB_WORKSPACE" "$ARDUINO_USR_PATH/libraries/ESPAsyncWebServer" echo "Installing ArduinoJson ..." git clone https://github.com/bblanchon/ArduinoJson "$ARDUINO_USR_PATH/libraries/ArduinoJson" > /dev/null 2>&1 + echo "Installing DHT sensor library ..." + git clone https://github.com/adafruit/DHT-sensor-library "$ARDUINO_USR_PATH/libraries/DHT-sensor-library" > /dev/null 2>&1 if [[ "$TARGET_PLATFORM" == "esp32" ]]; then + echo "Installing LITTLEFS for ESP32 ..." + git clone https://github.com/lorol/LITTLEFS "$ARDUINO_USR_PATH/libraries/LITTLEFS" > /dev/null 2>&1 echo "Installing AsyncTCP ..." git clone https://github.com/me-no-dev/AsyncTCP "$ARDUINO_USR_PATH/libraries/AsyncTCP" > /dev/null 2>&1 FQBN="espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app" diff --git a/examples/ESP_AsyncFSBrowser/data/acefull.js.gz b/examples/ESP_AsyncFSBrowser/data/acefull.js.gz index 7e65c5f..4a0ae61 100644 Binary files a/examples/ESP_AsyncFSBrowser/data/acefull.js.gz and b/examples/ESP_AsyncFSBrowser/data/acefull.js.gz differ diff --git a/examples/ESP_AsyncFSBrowser/data/worker-css.js.gz b/examples/ESP_AsyncFSBrowser/data/worker-css.js.gz index 23cfa33..dc267b3 100644 Binary files a/examples/ESP_AsyncFSBrowser/data/worker-css.js.gz and b/examples/ESP_AsyncFSBrowser/data/worker-css.js.gz differ diff --git a/examples/ESP_AsyncFSBrowser/data/worker-html.js.gz b/examples/ESP_AsyncFSBrowser/data/worker-html.js.gz index 69a5f29..c551f70 100644 Binary files a/examples/ESP_AsyncFSBrowser/data/worker-html.js.gz and b/examples/ESP_AsyncFSBrowser/data/worker-html.js.gz differ diff --git a/examples/ESP_AsyncFSBrowser/data/worker-javascript.js.gz b/examples/ESP_AsyncFSBrowser/data/worker-javascript.js.gz index 9523daf..08cd150 100644 Binary files a/examples/ESP_AsyncFSBrowser/data/worker-javascript.js.gz and b/examples/ESP_AsyncFSBrowser/data/worker-javascript.js.gz differ diff --git a/examples/SmartSwitch/data/acefull.js.gz b/examples/SmartSwitch/data/acefull.js.gz index 7e65c5f..4a0ae61 100644 Binary files a/examples/SmartSwitch/data/acefull.js.gz and b/examples/SmartSwitch/data/acefull.js.gz differ diff --git a/examples/SmartSwitch/data/worker-css.js.gz b/examples/SmartSwitch/data/worker-css.js.gz index 23cfa33..dc267b3 100644 Binary files a/examples/SmartSwitch/data/worker-css.js.gz and b/examples/SmartSwitch/data/worker-css.js.gz differ diff --git a/examples/SmartSwitch/data/worker-html.js.gz b/examples/SmartSwitch/data/worker-html.js.gz index 69a5f29..c551f70 100644 Binary files a/examples/SmartSwitch/data/worker-html.js.gz and b/examples/SmartSwitch/data/worker-html.js.gz differ diff --git a/examples/SmartSwitch/data/worker-javascript.js.gz b/examples/SmartSwitch/data/worker-javascript.js.gz index 9523daf..08cd150 100644 Binary files a/examples/SmartSwitch/data/worker-javascript.js.gz and b/examples/SmartSwitch/data/worker-javascript.js.gz differ diff --git a/src/SPIFFSEditor.h b/src/SPIFFSEditor.h index 3586429..d3b959f 100644 --- a/src/SPIFFSEditor.h +++ b/src/SPIFFSEditor.h @@ -13,7 +13,8 @@ class SPIFFSEditor: public AsyncWebHandler { #ifdef ESP32 SPIFFSEditor(const fs::FS& fs, const String& username=String(), const String& password=String()); #else - SPIFFSEditor(const String& username=String(), const String& password=String(), const fs::FS& fs=SPIFFS); + //SPIFFSEditor(const String& username=String(), const String& password=String(), const fs::FS& fs=SPIFFS); + SPIFFSEditor(const String& username, const String& password, const fs::FS& fs); // do not show warning that SPIFFS has been deprecated #endif virtual bool canHandle(AsyncWebServerRequest *request) override final; virtual void handleRequest(AsyncWebServerRequest *request) override final; diff --git a/src/WebHandlers.cpp b/src/WebHandlers.cpp index 952d65e..8e87ff1 100644 --- a/src/WebHandlers.cpp +++ b/src/WebHandlers.cpp @@ -146,18 +146,26 @@ bool AsyncStaticWebHandler::_fileExists(AsyncWebServerRequest *request, const St String gzip = path + F(".gz"); if (_gzipFirst) { - request->_tempFile = _fs.open(gzip, fs::FileOpenMode::read); - gzipFound = FILE_IS_REAL(request->_tempFile); + if (_fs.exists(gzip)) { + request->_tempFile = _fs.open(gzip, fs::FileOpenMode::read); + gzipFound = FILE_IS_REAL(request->_tempFile); + } if (!gzipFound){ + if (_fs.exists(path)) { request->_tempFile = _fs.open(path, fs::FileOpenMode::read); fileFound = FILE_IS_REAL(request->_tempFile); + } } } else { - request->_tempFile = _fs.open(path, fs::FileOpenMode::read); - fileFound = FILE_IS_REAL(request->_tempFile); + if (_fs.exists(path)) { + request->_tempFile = _fs.open(path, fs::FileOpenMode::read); + fileFound = FILE_IS_REAL(request->_tempFile); + } if (!fileFound){ + if (_fs.exists(gzip)) { request->_tempFile = _fs.open(gzip, fs::FileOpenMode::read); gzipFound = FILE_IS_REAL(request->_tempFile); + } } } diff --git a/src/edit.htm.gz.h b/src/edit.htm.gz.h index b8b5c02..ae6dcea 100644 --- a/src/edit.htm.gz.h +++ b/src/edit.htm.gz.h @@ -2,7 +2,7 @@ //File: edit.htm.gz, Size: 4503 #define edit_htm_gz_len 4503 const uint8_t edit_htm_gz[] PROGMEM = { -0x1F,0x8B,0x08,0x08,0x9B,0xC8,0x22,0x5F,0x02,0x00,0x65,0x64,0x69,0x74,0x2E,0x68,0x74,0x6D,0x00,0xB5, +0x1F,0x8B,0x08,0x08,0x66,0x6B,0x3D,0x5F,0x02,0x00,0x65,0x64,0x69,0x74,0x2E,0x68,0x74,0x6D,0x00,0xB5, 0x1A,0x0B,0x5B,0xDB,0x36,0xF0,0xAF,0x18,0x6F,0x63,0xF6,0xE2,0x38,0x0E,0x50,0xD6,0x3A,0x18,0x16,0x1E, 0xEB,0xBB,0x50,0x12,0xDA,0xD1,0x8E,0xED,0x53,0x6C,0x25,0x56,0xB1,0x25,0xCF,0x96,0x09,0x34,0xCD,0x7F, 0xDF,0x49,0xF2,0x93,0x84,0xEE,0xF1,0x6D,0xA5,0x60,0x49,0xA7,0x3B,0xDD,0x9D,0xEE,0x25,0xD9,0x7B,0x1B,