Commit 10f670ab authored by Oliver Schmidt's avatar Oliver Schmidt
Browse files

nixos/matomo: better check for database being set up

Since matomo-5.2.0, the config.php.ini is already created when first
accessing the installer page without completing it. This breaks our
discovery of whether to run database migrations.

Attempting to run DB migrations without provided database credentials
causes a crash -> causing matomo-setup-update.service to fail -> causing
phpfpm-matomo.service to fail.
parent 9a69b735
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -183,7 +183,10 @@ in {
            chmod -R u+rwX,g+rwX,o-rwx "${dataDir}"

            # check whether user setup has already been done
            if test -f "${dataDir}/config/config.ini.php"; then
            if test -f "${dataDir}/config/config.ini.php" &&
              # since matomo-5.2.0, the config.ini.php is already created at first
              # installer page access https://github.com/matomo-org/matomo/issues/22932
              grep -q -F "[database]" "${dataDir}/config/config.ini.php"; then
              # then execute possibly pending database upgrade
              matomo-console core:update --yes
            fi