From c764b15a2bf3e1ad698780da933ddf2f2f91b22b Mon Sep 17 00:00:00 2001 From: Rocco Augusto Date: Sat, 21 Jan 2023 10:28:18 -0800 Subject: [PATCH] feat: Update Web UI so it's accessible on both ipv4 and ipv6 Signed-off-by: Rocco Augusto --- pwnagotchi/defaults.toml | 2 +- pwnagotchi/ui/web/server.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pwnagotchi/defaults.toml b/pwnagotchi/defaults.toml index c554968d7..fdb8c53f7 100644 --- a/pwnagotchi/defaults.toml +++ b/pwnagotchi/defaults.toml @@ -192,7 +192,7 @@ ui.faces.upload1 = "(1__1)" ui.faces.upload2 = "(0__1)" ui.web.enabled = true -ui.web.address = "0.0.0.0" +ui.web.address = "::" # listening on both ipv4 and ipv6 - switch to 0.0.0.0 to listen on just ipv4 ui.web.username = "changeme" ui.web.password = "changeme" ui.web.origin = "" diff --git a/pwnagotchi/ui/web/server.py b/pwnagotchi/ui/web/server.py index 1b109037f..a8e64d90b 100644 --- a/pwnagotchi/ui/web/server.py +++ b/pwnagotchi/ui/web/server.py @@ -44,7 +44,8 @@ def _http_serve(self): CSRFProtect(app) Handler(self._config, self._agent, app) - logging.info("web ui available at http://%s:%d/" % (self._address, self._port)) + formatServerIpAddress = '[::]' if self._address == '::' else self._address; + logging.info("web ui available at http://%s:%d/" % (formatServerIpAddress, self._port)) app.run(host=self._address, port=self._port, debug=False) else: