Moving additional sensitive settings to USER_SECRETS.h

This commit is contained in:
No-Signal 2024-12-22 10:46:54 +00:00
parent 4f53a3b358
commit b4474e504d
3 changed files with 9 additions and 6 deletions

View file

@ -1,8 +1,13 @@
#define WIFI_SSID "REPLACE_WITH_YOUR_SSID" // Maximum of 63 characters #define WIFI_SSID "REPLACE_WITH_YOUR_SSID" // Maximum of 63 characters
#define WIFI_PASSWORD "REPLACE_WITH_YOUR_PASSWORD" // Minimum of 8 characters #define WIFI_PASSWORD "REPLACE_WITH_YOUR_PASSWORD" // Minimum of 8 characters
#define AP_PASSWORD "123456789" // Minimum of 8 characters; set to blank if you want the access point to be open #define AP_PASSWORD "123456789" // Minimum of 8 characters; set to blank if you want the access point to be open
#define HTTP_USERNAME "admin" // username to webserver authentication;
#define HTTP_PASSWORD "admin" // password to webserver authentication; #define WEBSERVER_AUTH_REQUIRED \
false //Set this line to true to activate webserver authentication (this line must not be commented).
#define HTTP_USERNAME "admin" // username to webserver authentication;
#define HTTP_PASSWORD "admin" // password to webserver authentication;
#define MQTT_SERVER "192.168.xxx.yyy" // mqtt server address #define MQTT_SERVER "192.168.xxx.yyy" // mqtt server address
#define MQTT_PORT 1883 // mqtt server port
#define MQTT_USER NULL // mqtt username, leave blank for no authentication #define MQTT_USER NULL // mqtt username, leave blank for no authentication
#define MQTT_PASSWORD NULL // mqtt password, leave blank for no authentication #define MQTT_PASSWORD NULL // mqtt password, leave blank for no authentication

View file

@ -82,8 +82,6 @@
#define WIFI #define WIFI
//#define WIFICONFIG //Enable this line to set a static IP address / gateway /subnet mask for the device. see USER_SETTINGS.cpp for the settings //#define WIFICONFIG //Enable this line to set a static IP address / gateway /subnet mask for the device. see USER_SETTINGS.cpp for the settings
#define WEBSERVER //Enable this line to enable WiFi, and to run the webserver. See USER_SETTINGS.cpp for the Wifi settings. #define WEBSERVER //Enable this line to enable WiFi, and to run the webserver. See USER_SETTINGS.cpp for the Wifi settings.
#define WEBSERVER_AUTH_REQUIRED \
false //Set this line to true to activate webserver authentication (this line must not be commented). Refer to USER_SETTINGS.cpp for setting the credentials.
#define WIFIAP //Disable this line to permanently disable WIFI AP mode (make sure to hardcode ssid and password of you home wifi network). When enabled WIFI AP can still be disabled by a setting in the future. #define WIFIAP //Disable this line to permanently disable WIFI AP mode (make sure to hardcode ssid and password of you home wifi network). When enabled WIFI AP can still be disabled by a setting in the future.
#define MDNSRESPONDER //Enable this line to enable MDNS, allows battery monitor te be found by .local address. Requires WEBSERVER to be enabled. #define MDNSRESPONDER //Enable this line to enable MDNS, allows battery monitor te be found by .local address. Requires WEBSERVER to be enabled.
#define LOAD_SAVED_SETTINGS_ON_BOOT //Enable this line to read settings stored via the webserver on boot (overrides Wifi/battery settings set below) #define LOAD_SAVED_SETTINGS_ON_BOOT //Enable this line to read settings stored via the webserver on boot (overrides Wifi/battery settings set below)
@ -92,7 +90,6 @@
/* MQTT options */ /* MQTT options */
// #define MQTT // Enable this line to enable MQTT // #define MQTT // Enable this line to enable MQTT
#define MQTT_PORT 1883
#define MQTT_MANUAL_TOPIC_OBJECT_NAME // Enable this to use custom MQTT topic, object ID prefix, and device name. \ #define MQTT_MANUAL_TOPIC_OBJECT_NAME // Enable this to use custom MQTT topic, object ID prefix, and device name. \
// WARNING: If this is not defined, the previous default naming format \ // WARNING: If this is not defined, the previous default naming format \
// 'battery-emulator_esp32-XXXXXX' (based on hardware ID) will be used. \ // 'battery-emulator_esp32-XXXXXX' (based on hardware ID) will be used. \

View file

@ -1,6 +1,7 @@
#include "webserver.h" #include "webserver.h"
#include <Preferences.h> #include <Preferences.h>
#include <ctime> #include <ctime>
#include "../../../USER_SECRETS.h"
#include "../../datalayer/datalayer.h" #include "../../datalayer/datalayer.h"
#include "../../datalayer/datalayer_extended.h" #include "../../datalayer/datalayer_extended.h"
#include "../../lib/bblanchon-ArduinoJson/ArduinoJson.h" #include "../../lib/bblanchon-ArduinoJson/ArduinoJson.h"