Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/matomo: point path.geoip2 outside of the nix store. #100617

Merged
merged 1 commit into from Feb 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions nixos/modules/services/web-apps/matomo.nix
Expand Up @@ -164,6 +164,7 @@ in {
# Copy config folder
chmod g+s "${dataDir}"
cp -r "${cfg.package}/share/config" "${dataDir}/"
mkdir -p "${dataDir}/misc"
abbradar marked this conversation as resolved.
Show resolved Hide resolved
chmod -R u+rwX,g+rwX,o-rwx "${dataDir}"

# check whether user setup has already been done
Expand Down
10 changes: 10 additions & 0 deletions 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
22 changes: 14 additions & 8 deletions pkgs/servers/web-apps/matomo/default.nix
Expand Up @@ -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
Expand Down Expand Up @@ -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/leafo/lessphp/package.sh"
"vendor/pear/archive_tar/sync-php4"
Expand Down