Ask for password instead of defaulting to root in bootstrap script#173
Ask for password instead of defaulting to root in bootstrap script#173Phocacius wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the starter’s Composer-driven bootstrap workflow to avoid silently resetting the root account to a known default password, aiming to make initial installs safer and more aligned with interactive/non-interactive setups.
Changes:
- Updates
ComposerBootstrapto pass through selected flags to thefom:user:resetrootconsole command instead of always providing a hardcoded password. - Tightens Composer script handler signatures by type-hinting
Composer\Script\Event. - Adds a changelog entry documenting the new bootstrap password behavior.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| CHANGELOG.md | Documents the updated bootstrap/root-password behavior in the “next major release” section. |
| application/bin/ComposerBootstrap.php | Adjusts composer script handlers to forward flags to root-password reset logic and updates handler signatures. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
I tested.
I created a new installarion and can .bootstrap
- [ x] 1. Was asked for password - works fine
To restest I checked out mapbender work/safe-password
The I deleted
rm application/var/db/demo.sqlite
rm application/.env.local
-
Works fine - uses password
MAPBENDER_ROOT_PASSWORD=verySafePassword ./bootstrap -
ERROR: Still asks for a pasword
./bootstrap --generate-password
should this work too? And generate a password and display it (does not work at the moment)
Same command via bin/console works fine
bin/console fom:user:resetroot --generate-password --no-interaction
|
|
Instead of always defaulting to root:root, the bootstrap script will now ask for the root password when executed by default.
There are also additional ways to set the password (that also work in automated, non-interactive environments):
--generate-passwordto automatically generate a 12-digit passwort with alphanumeric digits/letters and commmon special chars. It will be displayed to stdout.MAPBENDER_ROOT_PASSWORDto set the root password--no-interactionto continue defaulting to root (not recommended)Related PR: mapbender/mapbender#1889