fix(webui): rotate stale bootstrap password and highlight credentials log
If the operator never completed the forced-change flow, the plaintext bootstrap password was unrecoverable on the next start (only the hash remained on disk, and the prior log line was likely gone). Now we detect a persisted state with mustChangePassword=true at load time and generate a fresh CSPRNG password so the operator can actually log in. The initial-credentials log block is also wrapped with separators and a bilingual notice so it stands out at boot. The 'initial credentials: user=admin password=%s' line is preserved verbatim because third-party launchers parse it.
This commit is contained in:
2 files changed
+18
-1
No files matched your search
@@ -98,8 +98,14 @@ export async function initWebUI(
|
||||
log.warn('dev mode enabled: password=%s', WebuiAuth.devPassword);
|
||||
log.warn('dev mode skips config/webui.json and password rotation');
|
||||
} else if (initialPassword) {
|
||||
log.info('════════════════════════════════════════════════════════════════');
|
||||
log.info(' ★ WebUI 初始登录凭据 / Initial WebUI Credentials ★');
|
||||
log.info(' 请立即登录并修改密码 —— 关闭程序后此密码无法找回。');
|
||||
log.info(' 若跳过初始改密,下次启动将自动生成新的随机密码。');
|
||||
log.info(' Log in and change the password now; it will not be shown again.');
|
||||
log.info('────────────────────────────────────────────────────────────────');
|
||||
log.info('initial credentials: user=admin password=%s', initialPassword);
|
||||
log.info('password change required after first login');
|
||||
log.info('════════════════════════════════════════════════════════════════');
|
||||
} else if (auth.mustChangePassword()) {
|
||||
log.warn('password change is still required');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user