From f9e0a95c5e196a748d964077a686146743250cb7 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Tue, 18 Mar 2025 22:15:22 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E9=BB=98=E8=AE=A4=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E6=94=B9=E5=9B=9E=200.0.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/config/default.py | 2 +- astrbot/dashboard/server.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/astrbot/core/config/default.py b/astrbot/core/config/default.py index 20a943d19..3a2b7f07a 100644 --- a/astrbot/core/config/default.py +++ b/astrbot/core/config/default.py @@ -85,7 +85,7 @@ DEFAULT_CONFIG = { "enable": True, "username": "astrbot", "password": "77b90590a8945a7d36c963981a307dc9", - "host": "127.0.0.1", + "host": "0.0.0.0", "port": 6185, }, "platform": [], diff --git a/astrbot/dashboard/server.py b/astrbot/dashboard/server.py index 072ded4ae..932c2ed4e 100644 --- a/astrbot/dashboard/server.py +++ b/astrbot/dashboard/server.py @@ -122,7 +122,10 @@ class AstrBotDashboard: def run(self): ip_addr = [] port = self.core_lifecycle.astrbot_config["dashboard"].get("port", 6185) - host = self.core_lifecycle.astrbot_config["dashboard"].get("host", "127.0.0.1") + host = self.core_lifecycle.astrbot_config["dashboard"].get("host", "0.0.0.0") + + logger.info(f"正在启动 WebUI, 监听地址: http://{host}:{port}") + if host not in ["localhost", "127.0.0.1"]: try: ip_addr = get_local_ip_addresses() @@ -144,7 +147,7 @@ class AstrBotDashboard: raise Exception(f"端口 {port} 已被占用") - display = f"\n ✨✨✨\n AstrBot v{VERSION} 管理面板已启动,可访问\n\n" + display = f"\n ✨✨✨\n AstrBot v{VERSION} WebUI 已启动,可访问\n\n" display += f" ➜ 本地: http://localhost:{port}\n" for ip in ip_addr: display += f" ➜ 网络: http://{ip}:{port}\n"