[SYS] Avoid logging sensitive information on serial (#1879)
WiFi Manager log level to Notify Remove MQTT information to serial Remove system information to serial when changing with WebUI
This commit is contained in:
1 parent
a7f43eda87
commit
ef07a339ab
7 files changed
+7
-22
No files matched your search
+2
-2
@@ -130,8 +130,8 @@ const byte mac[] = {0xDE, 0xED, 0xBA, 0xFE, 0x54, 0x95}; //W5100 ethernet shield
|
||||
#ifndef WiFi_TimeOut
|
||||
# define WiFi_TimeOut 30
|
||||
#endif
|
||||
#ifndef WM_DEBUG_LEVEL
|
||||
# define WM_DEBUG_LEVEL 1 // valid values are: DEBUG_ERROR = 0, DEBUG_NOTIFY = 1, DEBUG_VERBOSE = 2, DEBUG_DEV = 3, DEBUG_MAX = 4
|
||||
#ifndef WM_DEBUG // WiFi Manager debug
|
||||
# define WM_DEBUG 1
|
||||
#endif
|
||||
//#define WIFIMNG_HIDE_MQTT_CONFIG //Uncomment so as to hide MQTT setting from Wifi manager page
|
||||
|
||||
|
||||
+1
-1
@@ -443,7 +443,7 @@ void updateDevicesStatus() {
|
||||
}
|
||||
|
||||
void dumpDevices() {
|
||||
# if LOG_LEVEL > 4 // > NOTICE LOG LEVEL
|
||||
# if LOG_LEVEL > LOG_LEVEL_NOTICE
|
||||
for (vector<BLEdevice*>::iterator it = devices.begin(); it != devices.end(); ++it) {
|
||||
BLEdevice* p = *it;
|
||||
Log.trace(F("macAdr %s" CR), p->macAdr);
|
||||
|
||||
@@ -641,9 +641,6 @@ void handleWI() {
|
||||
}
|
||||
if (update) {
|
||||
String topic = String(mqtt_topic) + String(gateway_name) + String(subjectMQTTtoSYSset);
|
||||
String output;
|
||||
serializeJson(WEBtoSYS, output);
|
||||
Log.notice(F("[WebUI] MQTTtoSYS %s" CR), output.c_str());
|
||||
Log.warning(F("[WebUI] Save WiFi and Restart" CR));
|
||||
char jsonChar[100];
|
||||
serializeJson(modules, jsonChar, measureJson(modules) + 1);
|
||||
@@ -785,9 +782,6 @@ void handleMQ() {
|
||||
|
||||
delay(2000); // Wait for web page to be sent before
|
||||
String topic = String(mqtt_topic) + String(gateway_name) + String(subjectMQTTtoSYSset);
|
||||
String output;
|
||||
serializeJson(WEBtoSYS, output);
|
||||
Log.notice(F("[WebUI] MQTTtoSYS %s" CR), output.c_str());
|
||||
MQTTtoSYS((char*)topic.c_str(), WEBtoSYS);
|
||||
return;
|
||||
} else {
|
||||
@@ -860,9 +854,6 @@ void handleCG() {
|
||||
|
||||
delay(2000); // Wait for web page to be sent before
|
||||
String topic = String(mqtt_topic) + String(gateway_name) + String(subjectMQTTtoSYSset);
|
||||
String output;
|
||||
serializeJson(WEBtoSYS, output);
|
||||
Log.notice(F("[WebUI] MQTTtoSYS %s" CR), output.c_str());
|
||||
MQTTtoSYS((char*)topic.c_str(), WEBtoSYS);
|
||||
} else {
|
||||
Log.warning(F("[WebUI] No changes" CR));
|
||||
|
||||
+1
-3
@@ -1683,7 +1683,6 @@ void saveConfig() {
|
||||
Log.error(F("failed to open config file for writing" CR));
|
||||
}
|
||||
|
||||
serializeJsonPretty(json, Serial);
|
||||
serializeJson(json, configFile);
|
||||
configFile.close();
|
||||
}
|
||||
@@ -1711,7 +1710,6 @@ bool loadConfigFromFlash() {
|
||||
if (error) {
|
||||
Log.error(F("deserialize config failed: %s, buffer capacity: %u" CR), error.c_str(), json.capacity());
|
||||
}
|
||||
serializeJsonPretty(json, Serial);
|
||||
if (!json.isNull()) {
|
||||
Log.trace(F("\nparsed json, size: %u" CR), json.memoryUsage());
|
||||
if (json.containsKey("mqtt_server"))
|
||||
@@ -1782,7 +1780,7 @@ void setup_wifimanager(bool reset_settings) {
|
||||
Log.notice(F("OTA Hostname: %s.local" CR), ota_hostname);
|
||||
# endif
|
||||
|
||||
wifiManager.setDebugOutput(WM_DEBUG_LEVEL);
|
||||
wifiManager.setDebugOutput(WM_DEBUG);
|
||||
|
||||
// The extra parameters to be configured (can be either global or just in the setup)
|
||||
// After connecting, parameter.getValue() will get you the configured value
|
||||
|
||||
Reference in new issue
Block a user