aboutsummarylogtreecommitdiffstats
path: root/no-dashboard-password-in-startup-log.patch
blob: 01b29b60e663fb7a773a59fbde7570d0bac1c104 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--- a/astrbot/dashboard/server.py
+++ b/astrbot/dashboard/server.py
@@ -439,13 +439,14 @@
         if not generated_password:
             return f"   ➜  Username: {username}\n ✨✨✨\n"

-        credentials_display = (
+        # A generated password is deliberately never rendered into startup output.
+        # Clear the one-shot value so it cannot reach a later log message either.
+        object.__setattr__(self.config, "_generated_dashboard_password", None)
+        return (
             f"   ➜  Initial username: {username}\n"
-            f"   ➜  Initial password: {generated_password}\n"
+            "   ➜  An initial password was generated during initialization; it is not logged.\n"
             "   ➜  Change it after logging in\n ✨✨✨\n"
         )
-        object.__setattr__(self.config, "_generated_dashboard_password", None)
-        return credentials_display

     @staticmethod
     def _resolve_dashboard_ssl_config(