Skip to content

Commit 10f670a

Browse files
committed
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.
1 parent 9a69b73 commit 10f670a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nixos/modules/services/web-apps/matomo.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,10 @@ in {
183183
chmod -R u+rwX,g+rwX,o-rwx "${dataDir}"
184184
185185
# check whether user setup has already been done
186-
if test -f "${dataDir}/config/config.ini.php"; then
186+
if test -f "${dataDir}/config/config.ini.php" &&
187+
# since matomo-5.2.0, the config.ini.php is already created at first
188+
# installer page access https://github.com/matomo-org/matomo/issues/22932
189+
grep -q -F "[database]" "${dataDir}/config/config.ini.php"; then
187190
# then execute possibly pending database upgrade
188191
matomo-console core:update --yes
189192
fi

0 commit comments

Comments
 (0)