docs: name the dashboard host/port environment variables and their precedence (#10095)

This commit is contained in:
xizhuomengcontin
2026-09-19 13:09:51 +08:00
committed by GitHub
parent b13338dbda
commit 774cc9498f
+8
View File
@@ -621,6 +621,14 @@ class AstrBotDashboard:
def run(self):
ip_addr = []
dashboard_config = self.core_lifecycle.astrbot_config.get("dashboard", {})
# Environment beats config for both. Each accepts two names -- the unprefixed one first,
# then the ASTRBOT_-prefixed one -- so DASHBOARD_HOST wins over ASTRBOT_DASHBOARD_HOST if
# both are set. Unset everywhere, the dashboard binds 0.0.0.0:6185, i.e. every interface.
#
# The host chain is also read by AuthService.can_skip_default_password_auth, which only
# allows that skip when the resolved host is 127.0.0.1, localhost or ::1. So these
# variables decide where the dashboard listens and, indirectly, whether the default
# password gate can be waived.
port = (
os.environ.get("DASHBOARD_PORT")
or os.environ.get("ASTRBOT_DASHBOARD_PORT")