Skip to content

refactor install.sh with database reconfiguration feature and cleaner update process - #329

Open
landure wants to merge 3 commits into
glpi-project:mainfrom
landure:325-database-credentials-rotation
Open

landure wants to merge 3 commits into
glpi-project:mainfrom
landure:325-database-credentials-rotation

Conversation

@landure

@landure landure commented Oct 7, 2026

Copy link
Copy Markdown
  • Add is_true function to check explicitly that GLPI_SKIP_AUTOUPDATE and GLPI_SKIP_AUTOINSTALL are "true" or 1.
  • Fix GLPI_Installed() to intercept bin/console db:check --no-interaction failing exit code and prevent it from triggering the script exit due to set -e mode.
  • Add support for database credential rotation: in Install_GLPI(), trigger database reconfiguration if ${GLPI_CONFIG_DIR}/config_db.php already exists.
  • Protect the database update process by enabling maintenance mode in Update_GLPI().

Fixes #327, #328
Closes #325, #326

… update process

- Add `is_true` function to check explicitly that `GLPI_SKIP_AUTOUPDATE` and `GLPI_SKIP_AUTOINSTALL` are `"true"` or `1`.
- Fix `GLPI_Installed()` to intercept `bin/console db:check --no-interaction` failing exit code and prevent it from triggering the script exit due to `set -e` mode.
- Add support for database credential rotation: in `Install_GLPI()`, trigger database reconfiguration if `${GLPI_CONFIG_DIR}/config_db.php` already exists.
- Protect the database update process by enabling maintenance mode in `Update_GLPI()`.

Fixes glpi-project#327, glpi-project#328
Closes glpi-project#325, glpi-project#326

@froozeify froozeify left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the db update fail or cache clear fail the glpi will be stuck in maintenance mode. Not sure it's the way to handle that (specially in the case of a cache:clear failure)

After a fresh install I think it will run both condition block line 101 and 109 making an useless update call and greeting call.

- created a Reconfigure_GLPI() function, separate from Install_GLPI(), but sharing the same command.
- moved the reconfiguration logic to GLPI_Installed() function, with a second db:check after reconfiguration.
- only run the database update for existing installations, and not for new installations.
@landure

landure commented Oct 7, 2026

Copy link
Copy Markdown
Author

@froozeify I've updated the script while taking into account your review.

@cedric-anne
cedric-anne requested a review from froozeify October 7, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants