Repository navigation
feat: read INITIAL_PASSWORD env var during setup - #8439
diegosouzapw merged 2 commits into
Conversation
Allow users to set the admin password via the INITIAL_PASSWORD environment variable instead of requiring the --password CLI flag or interactive prompt. Falls between --password flag and interactive prompt in resolution priority.
|
Thanks for this — nice catch, and a clean minimal fix. I confirmed with a local test that The one thing we need before this can merge is test coverage: the existing
Happy to help if you'd like guidance on the test setup (see the |
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
|
Thanks @linhdmn — merged into |
* feat: read INITIAL_PASSWORD env var during setup Allow users to set the admin password via the INITIAL_PASSWORD environment variable instead of requiring the --password CLI flag or interactive prompt. Falls between --password flag and interactive prompt in resolution priority. * test(cli): cover INITIAL_PASSWORD env var in setup resolvePassword Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --------- Co-authored-by: linh.doan <linh.doan@be.com.vn> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
* feat: read INITIAL_PASSWORD env var during setup Allow users to set the admin password via the INITIAL_PASSWORD environment variable instead of requiring the --password CLI flag or interactive prompt. Falls between --password flag and interactive prompt in resolution priority. * test(cli): cover INITIAL_PASSWORD env var in setup resolvePassword Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --------- Co-authored-by: linh.doan <linh.doan@be.com.vn> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Summary
Allow users to set the admin password via the
INITIAL_PASSWORDenvironment variable duringomniroute setup.Problem
The
resolvePassword()function inbin/cli/commands/setup.mjsonly reads the password from the--passwordCLI flag or interactive prompt. TheINITIAL_PASSWORDenv var (loaded vialoadEnvFile()inomniroute.mjs) is completely ignored.Fix
Add a one-line check for
process.env.INITIAL_PASSWORDinresolvePassword(). The new resolution priority is:--passwordCLI flag (highest)INITIAL_PASSWORDenv varChange
bin/cli/commands/setup.mjs— +1 line