git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/matomo: point path.geoip2 outside of the nix store.

path.geoip2 pointed to the nix store which is read-only. Matomo was failing to download a geoip2 database. See #64759.

commit7852ea15964f685bd73eaa7e11279668ec5c0d40 authorOlivier Marty <omarty@google.com> dateWed 14 Oct 2020, 23:25 (6 years ago) parent04af405
3 files changed+25−8
nixos/modules/services/web-apps/matomo.nix+1 pkgs/servers/web-apps/matomo/change-path-geoip2.patch+10 pkgs/servers/web-apps/matomo/default.nix+14−8
nixos/modules/services/web-apps/matomo.nix+1
@@ -192,6 +192,7 @@ in {
192192 # Copy config folder
193193 chmod g+s "${dataDir}"
194194 cp -r "${cfg.package}/share/config" "${dataDir}/"
195+ mkdir -p "${dataDir}/misc"
195196 chmod -R u+rwX,g+rwX,o-rwx "${dataDir}"
196197
197198 # check whether user setup has already been done
pkgs/servers/web-apps/matomo/change-path-geoip2.patchnew file+10
@@ -0,0 +1,10 @@
1+--- a/plugins/GeoIp2/config/config.php
2++++ b/plugins/GeoIp2/config/config.php
3+@@ -1,5 +1,5 @@
4+ <?php
5+
6+ return [
7+- 'path.geoip2' => DI\string('{path.root}/misc/'),
8++ 'path.geoip2' => PIWIK_USER_PATH . '/misc/',
9+ ];
10+\ Pas de fin de ligne à la fin du fichier
pkgs/servers/web-apps/matomo/default.nix+14−8
@@ -32,14 +32,19 @@ let
3232
3333 nativeBuildInputs = [ makeWrapper ];
3434
35− # make-localhost-default-database-server.patch:
36− # This changes the default value of the database server field
37− # from 127.0.0.1 to localhost.
38− # unix socket authentication only works with localhost,
39− # but password-based SQL authentication works with both.
40− # TODO: is upstream interested in this?
41− # -> discussion at https://github.com/matomo-org/matomo/issues/12646
42− patches = [ ./make-localhost-default-database-host.patch ];
35+ patches = [
36+ # This changes the default value of the database server field
37+ # from 127.0.0.1 to localhost.
38+ # unix socket authentication only works with localhost,
39+ # but password-based SQL authentication works with both.
40+ # TODO: is upstream interested in this?
41+ # -> discussion at https://github.com/matomo-org/matomo/issues/12646
42+ ./make-localhost-default-database-host.patch
43+
44+ # This changes the default config for path.geoip2 so that it doesn't point
45+ # to the nix store.
46+ ./change-path-geoip2.patch
47+ ];
4348
4449 # this bootstrap.php adds support for getting PIWIK_USER_PATH
4550 # from an environment variable. Point it to a mutable location
@@ -73,6 +78,7 @@ let
7378 "misc/composer/build-xhprof.sh"
7479 "misc/composer/clean-xhprof.sh"
7580 "misc/cron/archive.sh"
81+ "plugins/GeoIp2/config/config.php"
7682 "plugins/Installation/FormDatabaseSetup.php"
7783 "vendor/pear/archive_tar/sync-php4"
7884 "vendor/szymach/c-pchart/coverage.sh"