From 2f059806ef77b87e49590048a6f46a4e3fc16514 Mon Sep 17 00:00:00 2001 From: Florian Jacob Date: Sun, 10 Feb 2019 23:28:42 +0100 Subject: [PATCH 1/2] matomo: 3.7.0 -> 3.8.1 security update --- pkgs/servers/web-apps/matomo/default.nix | 4 ++-- .../make-localhost-default-database-host.patch | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pkgs/servers/web-apps/matomo/default.nix b/pkgs/servers/web-apps/matomo/default.nix index 9c1180ffb49..89de2500811 100644 --- a/pkgs/servers/web-apps/matomo/default.nix +++ b/pkgs/servers/web-apps/matomo/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { name = "matomo-${version}"; - version = "3.7.0"; + version = "3.8.1"; src = fetchurl { # TODO: As soon as the tarballs are renamed as well on future releases, this should be enabled again # url = "https://builds.matomo.org/${name}.tar.gz"; url = "https://builds.matomo.org/piwik-${version}.tar.gz"; - sha256 = "17ihsmwdfrx1c1v8cp5pc3swx3h0i0l9pjrc8jyww08kavfbfly6"; + sha256 = "0ca4fkg2jpkfg0r9hxl45ad5xzz0gxhf404i96j059bn3c41kfi0"; }; nativeBuildInputs = [ makeWrapper ]; 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 index 48808ac2ccc..5af8ef860b2 100644 --- a/pkgs/servers/web-apps/matomo/make-localhost-default-database-host.patch +++ b/pkgs/servers/web-apps/matomo/make-localhost-default-database-host.patch @@ -1,13 +1,13 @@ diff --git a/plugins/Installation/FormDatabaseSetup.php b/plugins/Installation/FormDatabaseSetup.php -index 9364f49870..2625cbb91b 100644 +index 74de2535b4..bc172ad0eb 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_', - ))); + + $defaults = array( +- 'host' => '127.0.0.1', ++ 'host' => 'localhost', + 'type' => $defaultDatabaseType, + 'tables_prefix' => 'matomo_', + ); From faac33bc77d4f6c2c010991302954ee6638a10d9 Mon Sep 17 00:00:00 2001 From: Florian Jacob Date: Sun, 10 Feb 2019 23:29:48 +0100 Subject: [PATCH 2/2] nixos/matomo: 3.8.0 introduces matomo.{php,js} files --- nixos/modules/services/web-apps/matomo.nix | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/nixos/modules/services/web-apps/matomo.nix b/nixos/modules/services/web-apps/matomo.nix index 9fddf832074..2415880b62a 100644 --- a/nixos/modules/services/web-apps/matomo.nix +++ b/nixos/modules/services/web-apps/matomo.nix @@ -45,12 +45,11 @@ in { type = types.nullOr types.str; default = null; example = "lighttpd"; - # TODO: piwik.php might get renamed to matomo.php in future releases description = '' Name of the web server user that forwards requests to the ${phpSocket} fastcgi socket for matomo if the nginx option is not used. Either this option or the nginx option is mandatory. If you want to use another webserver than nginx, you need to set this to that server's user - and pass fastcgi requests to `index.php` and `piwik.php` to this socket. + and pass fastcgi requests to `index.php`, `matomo.php` and `piwik.php` (legacy name) to this socket. ''; }; @@ -215,8 +214,11 @@ in { locations."= /index.php".extraConfig = '' fastcgi_pass unix:${phpSocket}; ''; - # TODO: might get renamed to matomo.php in future versions - # allow piwik.php for tracking + # allow matomo.php for tracking + locations."= /matomo.php".extraConfig = '' + fastcgi_pass unix:${phpSocket}; + ''; + # allow piwik.php for tracking (deprecated name) locations."= /piwik.php".extraConfig = '' fastcgi_pass unix:${phpSocket}; ''; @@ -237,8 +239,11 @@ in { locations."= /robots.txt".extraConfig = '' return 200 "User-agent: *\nDisallow: /\n"; ''; - # TODO: might get renamed to matomo.js in future versions - # let browsers cache piwik.js + # let browsers cache matomo.js + locations."= /matomo.js".extraConfig = '' + expires 1M; + ''; + # let browsers cache piwik.js (deprecated name) locations."= /piwik.js".extraConfig = '' expires 1M; '';