Skip to content

fix(cli): preserve existing admin password during setup unless explicitly overridden (#11494) - #11516

Closed
HouMinXi wants to merge 1 commit into
diegosouzapw:release/v3.8.51from
HouMinXi:fix/11494-cli-setup-password-reset
Closed

HouMinXi wants to merge 1 commit into
diegosouzapw:release/v3.8.51from
HouMinXi:fix/11494-cli-setup-password-reset

Conversation

@HouMinXi

Copy link
Copy Markdown
Contributor

Summary

Fixes #11494: Running omniroute setup (e.g. --add-provider) on an existing installation silently reset the admin password to CHANGEME via the fallback INITIAL_PASSWORD in .env.

Changes

  • In bin/cli/commands/setup.mjs::setupPassword, checks whether getSettings(db).password already exists.
  • If an existing password is present and the caller did not explicitly pass --password, setup preserves the existing password and prints Using existing admin password without re-hashing or overwriting.
  • If --password is explicitly provided, it updates as expected.

Test Plan

  • Added tests/unit/cli-setup-password-preservation.test.ts (2 integration-style CLI tests with real SQLite instances).
  • npm run typecheck:core clean.

Closes #11494

@HouMinXi
HouMinXi requested a review from diegosouzapw as a code owner August 25, 2026 13:48
…itly overridden (diegosouzapw#11494)

- Prevents CLI setup from silently overwriting an existing admin password with INITIAL_PASSWORD fallback
- Forces requireLogin: true when preserving an existing password to prevent partial/corrupted setup states
- Preserves password when no --password flag is provided

Signed-off-by: Minxi Hou <[EMAIL_REDACTED]>
@HouMinXi
HouMinXi force-pushed the fix/11494-cli-setup-password-reset branch from ff7d2ae to df4854f Compare August 25, 2026 14:30
@diegosouzapw

Copy link
Copy Markdown
Owner

Thanks for catching this — closing in favor of #11522, which already landed the same fix and merged earlier today: resolvePassword() in bin/cli/commands/setup.mjs now falls back to INITIAL_PASSWORD only when !settings.password, so an existing admin password survives subsequent omniroute setup runs unless --password is explicitly passed. Confirmed on the current release/v3.8.51 tip.

No distinct value remains to carry forward — same root cause, same fix shape. Appreciate the independent catch.

@HouMinXi
HouMinXi deleted the fix/11494-cli-setup-password-reset branch September 16, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] CLI: any omniroute setup run silently resets the dashboard admin password to CHANGEME

2 participants