Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions astrbot/dashboard/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,14 @@ def _resolve_dashboard_ssl_config(
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: The comment implies that all four bind-address variables can indirectly determine whether the default-password gate is waived, but AuthService reads only DASHBOARD_HOST and ASTRBOT_DASHBOARD_HOST; changing either port variable cannot affect that authentication decision.

Suggested fix: Say that the host variables, rather than all four variables, also influence the default-password gate.

Suggested change
# variables decide where the dashboard listens and, indirectly, whether the default
# host 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")
Expand Down