diff options
-rw-r--r-- | nixos/modules/services/web-apps/matomo.nix | 1 | ||||
-rw-r--r-- | pkgs/servers/web-apps/matomo/change-path-geoip2.patch | 10 | ||||
-rw-r--r-- | pkgs/servers/web-apps/matomo/default.nix | 22 |
3 files changed, 25 insertions, 8 deletions
diff --git a/nixos/modules/services/web-apps/matomo.nix b/nixos/modules/services/web-apps/matomo.nix index 8a0ca33b51f..c6d4ed6d39d 100644 --- a/nixos/modules/services/web-apps/matomo.nix +++ b/nixos/modules/services/web-apps/matomo.nix @@ -192,6 +192,7 @@ in { # Copy config folder chmod g+s "${dataDir}" cp -r "${cfg.package}/share/config" "${dataDir}/" + mkdir -p "${dataDir}/misc" chmod -R u+rwX,g+rwX,o-rwx "${dataDir}" # check whether user setup has already been done diff --git a/pkgs/servers/web-apps/matomo/change-path-geoip2.patch b/pkgs/servers/web-apps/matomo/change-path-geoip2.patch new file mode 100644 index 00000000000..c8840db42e7 --- /dev/null +++ b/pkgs/servers/web-apps/matomo/change-path-geoip2.patch @@ -0,0 +1,10 @@ +--- a/plugins/GeoIp2/config/config.php ++++ b/plugins/GeoIp2/config/config.php +@@ -1,5 +1,5 @@ + <?php + + return [ +- 'path.geoip2' => DI\string('{path.root}/misc/'), ++ 'path.geoip2' => PIWIK_USER_PATH . '/misc/', + ]; +\ Pas de fin de ligne à la fin du fichier diff --git a/pkgs/servers/web-apps/matomo/default.nix b/pkgs/servers/web-apps/matomo/default.nix index ad8dc85f70f..aa371223cf0 100644 --- a/pkgs/servers/web-apps/matomo/default.nix +++ b/pkgs/servers/web-apps/matomo/default.nix @@ -32,14 +32,19 @@ let nativeBuildInputs = [ makeWrapper ]; - # make-localhost-default-database-server.patch: - # This changes the default value of the database server field - # from 127.0.0.1 to localhost. - # unix socket authentication only works with localhost, - # but password-based SQL authentication works with both. - # TODO: is upstream interested in this? - # -> discussion at https://github.com/matomo-org/matomo/issues/12646 - patches = [ ./make-localhost-default-database-host.patch ]; + patches = [ + # This changes the default value of the database server field + # from 127.0.0.1 to localhost. + # unix socket authentication only works with localhost, + # but password-based SQL authentication works with both. + # TODO: is upstream interested in this? + # -> discussion at https://github.com/matomo-org/matomo/issues/12646 + ./make-localhost-default-database-host.patch + + # This changes the default config for path.geoip2 so that it doesn't point + # to the nix store. + ./change-path-geoip2.patch + ]; # this bootstrap.php adds support for getting PIWIK_USER_PATH # from an environment variable. Point it to a mutable location @@ -73,6 +78,7 @@ let "misc/composer/build-xhprof.sh" "misc/composer/clean-xhprof.sh" "misc/cron/archive.sh" + "plugins/GeoIp2/config/config.php" "plugins/Installation/FormDatabaseSetup.php" "vendor/pear/archive_tar/sync-php4" "vendor/szymach/c-pchart/coverage.sh" |