about summary refs log tree commit diff
path: root/pkgs/servers/web-apps
diff options
context:
space:
mode:
authorFlorian Jacob <projects+git@florianjacob.de>2018-01-16 17:24:49 +0100
committerFlorian Jacob <projects+git@florianjacob.de>2018-02-22 19:58:24 +0100
commitd431aed997ee41cbe31a7a000c0f97d679a981b7 (patch)
tree360596ef5196a49a08d4fe2cc6e7473a5da247a0 /pkgs/servers/web-apps
parenta892bd8ebfe796beb67db4b143d912df394aef80 (diff)
downloadnixlib-d431aed997ee41cbe31a7a000c0f97d679a981b7.tar
nixlib-d431aed997ee41cbe31a7a000c0f97d679a981b7.tar.gz
nixlib-d431aed997ee41cbe31a7a000c0f97d679a981b7.tar.bz2
nixlib-d431aed997ee41cbe31a7a000c0f97d679a981b7.tar.lz
nixlib-d431aed997ee41cbe31a7a000c0f97d679a981b7.tar.xz
nixlib-d431aed997ee41cbe31a7a000c0f97d679a981b7.tar.zst
nixlib-d431aed997ee41cbe31a7a000c0f97d679a981b7.zip
matomo: make the substituteInPlace a proper patch,
improve description
Diffstat (limited to 'pkgs/servers/web-apps')
-rw-r--r--pkgs/servers/web-apps/matomo/default.nix13
-rw-r--r--pkgs/servers/web-apps/matomo/make-localhost-default-database-host.patch13
2 files changed, 22 insertions, 4 deletions
diff --git a/pkgs/servers/web-apps/matomo/default.nix b/pkgs/servers/web-apps/matomo/default.nix
index 591e11ca8202..c99b20a46bd5 100644
--- a/pkgs/servers/web-apps/matomo/default.nix
+++ b/pkgs/servers/web-apps/matomo/default.nix
@@ -13,13 +13,18 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ makeWrapper ];
 
-  # regarding the 127.0.0.1 substitute:
-  #   This replaces the default value of the database server field.
+  # 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?
+  patches = [ ./make-localhost-default-database-host.patch ];
+
+  # this bootstrap.php adds support for getting PIWIK_USER_PATH
+  # from an environment variable. Point it to a mutable location
+  # to be able to use matomo read-only from the nix store
   postPatch = ''
-    substituteInPlace plugins/Installation/FormDatabaseSetup.php \
-      --replace "=> '127.0.0.1'," "=> 'localhost',"
     cp ${./bootstrap.php} bootstrap.php
   '';
 
diff --git a/pkgs/servers/web-apps/matomo/make-localhost-default-database-host.patch b/pkgs/servers/web-apps/matomo/make-localhost-default-database-host.patch
new file mode 100644
index 000000000000..48808ac2ccca
--- /dev/null
+++ b/pkgs/servers/web-apps/matomo/make-localhost-default-database-host.patch
@@ -0,0 +1,13 @@
+diff --git a/plugins/Installation/FormDatabaseSetup.php b/plugins/Installation/FormDatabaseSetup.php
+index 9364f49870..2625cbb91b 100644
+--- a/plugins/Installation/FormDatabaseSetup.php
++++ b/plugins/Installation/FormDatabaseSetup.php
+@@ -82,7 +82,7 @@ class FormDatabaseSetup extends QuickForm2
+ 
+         // default values
+         $this->addDataSource(new HTML_QuickForm2_DataSource_Array(array(
+-                                                                       'host'          => '127.0.0.1',
++                                                                       'host'          => 'localhost',
+                                                                        'type'          => $defaultDatabaseType,
+                                                                        'tables_prefix' => 'matomo_',
+                                                                   )));