matomo: make the substituteInPlace a proper patch, improve description

+22 -4
+9 -4
pkgs/servers/web-apps/matomo/default.nix
··· 13 13 14 14 nativeBuildInputs = [ makeWrapper ]; 15 15 16 - # regarding the 127.0.0.1 substitute: 17 - # This replaces the default value of the database server field. 16 + # make-localhost-default-database-server.patch: 17 + # This changes the default value of the database server field 18 + # from 127.0.0.1 to localhost. 18 19 # unix socket authentication only works with localhost, 19 20 # but password-based SQL authentication works with both. 21 + # TODO: is upstream interested in this? 22 + patches = [ ./make-localhost-default-database-host.patch ]; 23 + 24 + # this bootstrap.php adds support for getting PIWIK_USER_PATH 25 + # from an environment variable. Point it to a mutable location 26 + # to be able to use matomo read-only from the nix store 20 27 postPatch = '' 21 - substituteInPlace plugins/Installation/FormDatabaseSetup.php \ 22 - --replace "=> '127.0.0.1'," "=> 'localhost'," 23 28 cp ${./bootstrap.php} bootstrap.php 24 29 ''; 25 30
+13
pkgs/servers/web-apps/matomo/make-localhost-default-database-host.patch
··· 1 + diff --git a/plugins/Installation/FormDatabaseSetup.php b/plugins/Installation/FormDatabaseSetup.php 2 + index 9364f49870..2625cbb91b 100644 3 + --- a/plugins/Installation/FormDatabaseSetup.php 4 + +++ b/plugins/Installation/FormDatabaseSetup.php 5 + @@ -82,7 +82,7 @@ class FormDatabaseSetup extends QuickForm2 6 + 7 + // default values 8 + $this->addDataSource(new HTML_QuickForm2_DataSource_Array(array( 9 + - 'host' => '127.0.0.1', 10 + + 'host' => 'localhost', 11 + 'type' => $defaultDatabaseType, 12 + 'tables_prefix' => 'matomo_', 13 + )));