\n" + String(foundfile.name()) + " | ";
returnText += " | \n";
returnText += "  ";
returnText += "  \n";
@@ -159,9 +161,9 @@ String processor(const String& var) {
processedHtml.replace("%USEDSD%", humanReadableSize(SD.usedBytes()));
processedHtml.replace("%TOTALSD%", humanReadableSize(SD.totalBytes()));
- processedHtml.replace("%FREESPIFFS%", humanReadableSize(SPIFFS.totalBytes() - SPIFFS.usedBytes()));
- processedHtml.replace("%USEDSPIFFS%", humanReadableSize(SPIFFS.usedBytes()));
- processedHtml.replace("%TOTALSPIFFS%", humanReadableSize(SPIFFS.totalBytes()));
+ processedHtml.replace("%FREELittleFS%", humanReadableSize(LittleFS.totalBytes() - LittleFS.usedBytes()));
+ processedHtml.replace("%USEDLittleFS%", humanReadableSize(LittleFS.usedBytes()));
+ processedHtml.replace("%TOTALLittleFS%", humanReadableSize(LittleFS.totalBytes()));
return processedHtml;
}
@@ -241,9 +243,9 @@ void configureWebServer() {
}, []() {handleFileUpload(SD);});
// Uploadfile handler
- server->on("/uploadSPIFFS", HTTP_POST, []() {
+ server->on("/uploadLittleFS", HTTP_POST, []() {
server->send(200, "text/plain", "Upload iniciado");
- }, []() { handleFileUpload(SPIFFS); });
+ }, []() { handleFileUpload(LittleFS); });
// Index page
server->on("/", HTTP_GET, []() {
@@ -271,7 +273,7 @@ void configureWebServer() {
if (SD.rename(filePath, filePath2)) server->send(200, "text/plain", filePath + " renamed to " + filePath2);
else server->send(200, "text/plain", "Fail renaming file.");
} else {
- if (SPIFFS.rename(filePath, filePath2)) server->send(200, "text/plain", filePath + " renamed to " + filePath2);
+ if (LittleFS.rename(filePath, filePath2)) server->send(200, "text/plain", filePath + " renamed to " + filePath2);
else server->send(200, "text/plain", "Fail renaming file.");
}
@@ -287,7 +289,7 @@ void configureWebServer() {
}
});
- // List files of the SPIFFS
+ // List files of the LittleFS
server->on("/listfiles", HTTP_GET, []() {
if (checkUserWebAuth()) {
String folder = "/";
@@ -297,8 +299,8 @@ void configureWebServer() {
bool useSD = false;
if (strcmp(server->arg("fs").c_str(), "SD") == 0) useSD = true;
- if (useSD) server->send(200, "text/plain", listFiles(SD, true, folder));
- else server->send(200, "text/plain", listFiles(SPIFFS, true, folder));
+ if (useSD) server->send(200, "text/plain", listFiles(SD, true, folder,false));
+ else server->send(200, "text/plain", listFiles(LittleFS, true, folder, true));
} else {
server->requestAuthentication();
@@ -317,7 +319,7 @@ void configureWebServer() {
FS *fs;
if (useSD) fs = &SD;
- else fs = &SPIFFS;
+ else fs = &LittleFS;
log_i("filename: %s", fileName);
log_i("fileAction: %s", fileAction);
diff --git a/src/webInterface.h b/src/webInterface.h
index 592fa15f..212e946a 100644
--- a/src/webInterface.h
+++ b/src/webInterface.h
@@ -4,10 +4,11 @@
#include
#include
#include
+#include
// function defaults
String humanReadableSize(uint64_t bytes);
-String listFiles(FS fs, bool ishtml, String folder);
+String listFiles(FS fs, bool ishtml, String folder, bool isLittleFS);
String processor(const String& var);
String readLineFromFile(File myFile);
@@ -270,7 +271,7 @@ const char index_html[] PROGMEM = R"rawliteral(
Firmware for offensive pranks and pentest studies and analysis. For educational purposes only. Don't use in environments where you are not allowed. All responsibilities for irresponsible usage of this firmware rest on your fin, sharky. Sincerely, Bruce.
Firmware version: %FIRMWARE%
SD Free Storage: %FREESD% | Used: %USEDSD% | Total: %TOTALSD%
- SPIFFS Free Storage: %FREESPIFFS% | Used: %USEDSPIFFS% | Total: %TOTALSPIFFS%
+ LittleFS Free Storage: %FREELittleFS% | Used: %USEDLittleFS% | Total: %TOTALLittleFS%
";
- }
- else {
- document.getElementById("status").innerHTML = "";
- uploadform =
- "SPIFFS don't support folders ";
- }
+ //document.getElementById("updetailsheader").innerHTML = "Create new Folder"
+ document.getElementById("status").innerHTML = "";
+ uploadform =
+ "Creating folder at: " + folders + ""+
+ " ";
document.getElementById("updetails").innerHTML = uploadform;
}
diff --git a/src/wg.h b/src/wg.h
index ae3dab20..ce33cabf 100644
--- a/src/wg.h
+++ b/src/wg.h
@@ -1,4 +1,4 @@
-#include
+#include
#include
extern bool isConnectedWireguard;
From 15fc1d29f73ac436e486a9ba9ae747ae17a5774c Mon Sep 17 00:00:00 2001
From: Pirata
Date: Thu, 30 May 2024 22:12:34 -0300
Subject: [PATCH 2/2] .
---
src/clients.cpp | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/clients.cpp b/src/clients.cpp
index 655fc83b..a76695a1 100644
--- a/src/clients.cpp
+++ b/src/clients.cpp
@@ -63,16 +63,16 @@ void ssh_setup(String host) {
tft.setCursor(0, 0);
if(host != "") ssh_host = host;
else {
- //ssh_host=keyboard("",15,"SSH HOST (IP)");
- ssh_host=keyboard("192.168.3.60",15,"SSH HOST (IP)");
+ ssh_host=keyboard("",15,"SSH HOST (IP)");
+ //ssh_host=keyboard("192.168.3.60",15,"SSH HOST (IP)");
}
ssh_port=keyboard("22",5,"SSH PORT");
- //ssh_user=keyboard("",76,"SSH USER");
- ssh_user=keyboard("ubuntu",76,"SSH USER");
+ ssh_user=keyboard("",76,"SSH USER");
+ //ssh_user=keyboard("ubuntu",76,"SSH USER");
- //ssh_password=keyboard("",76,"SSH PASSWORD");
- ssh_password=keyboard("ubuntu",76,"SSH PASSWORD");
+ ssh_password=keyboard("",76,"SSH PASSWORD");
+ //ssh_password=keyboard("ubuntu",76,"SSH PASSWORD");
// Connect to SSH server
TaskHandle_t sshTaskHandle = NULL;
|