From e0ed92ec380301930e696655592c7480ffc94740 Mon Sep 17 00:00:00 2001 From: Spacehuhn Date: Mon, 11 Jan 2021 16:10:15 +0100 Subject: [PATCH] Made web interface URL and IP customisable --- esp8266_deauther/A_config.h | 25 +++++++++++++++++++++---- esp8266_deauther/wifi.cpp | 6 +++--- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/esp8266_deauther/A_config.h b/esp8266_deauther/A_config.h index b6390bb..363503d 100644 --- a/esp8266_deauther/A_config.h +++ b/esp8266_deauther/A_config.h @@ -120,6 +120,10 @@ #define LED_DOTSTAR_DATA 13 #define LED_MODE_BRIGHTNESS 255 +// ===== Web ===== // +#define WEB_IP_ADDR (192, 168, 4, 2) +#define WEB_URL "deauther.tools" + #elif defined(DSTIKE_D_DUINO_B_V5_LED_RING) // ===== LED ===== // @@ -565,6 +569,15 @@ #endif // if BUTTON_UP != 0 && BUTTON_DOWN != 0 && BUTTON_A != 0 && BUTTON_B != 0 #endif // ifndef RESET_BUTTON +// ===== Web ===== // +#ifndef WEB_IP_ADDR + #define WEB_IP_ADDR (192, 168, 4, 1) +#endif // ifndef WEB_IP_ADDR + +#ifndef WEB_URL + #define WEB_URL "deauth.me" +#endif // ifndef WEB_URL + // ======== CONSTANTS ========== // // Do not change these values unless you know what you're doing! #define DEAUTHER_VERSION "2.5.0" @@ -580,10 +593,6 @@ /* - - // ===== Reset ====== // - #define RESET_BUTTON 5 - // ===== ATTACK ===== // #define ATTACK_ALL_CH false #define RANDOM_TX false @@ -677,6 +686,14 @@ #define BUTTON_A 255 #define BUTTON_B 255 + // ===== Reset ====== // + #define RESET_BUTTON 5 + + + // ===== Web ===== // + #define WEB_IP_ADDR (192, 168, 4, 1) + #define WEB_URL "deauth.me" + */ // ========== ERROR CHECKS ========== // diff --git a/esp8266_deauther/wifi.cpp b/esp8266_deauther/wifi.cpp index 1464b10..8c703f5 100644 --- a/esp8266_deauther/wifi.cpp +++ b/esp8266_deauther/wifi.cpp @@ -55,8 +55,8 @@ namespace wifi { // Server and other global objects ESP8266WebServer server(80); DNSServer dns; - IPAddress ip(192, 168, 4, 1); - IPAddress netmask(255, 255, 255, 0); + IPAddress ip WEB_IP_ADDR; + IPAddress netmask(255, 255, 255, 0); void setPath(String path) { if (path.charAt(0) != '/') { @@ -265,7 +265,7 @@ namespace wifi { dns.setErrorReplyCode(DNSReplyCode::NoError); dns.start(53, "*", ip); - MDNS.begin("deauth.me"); + MDNS.begin(WEB_URL); server.on("/list", HTTP_GET, handleFileList); // list directory