about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAaron Andersen <aaron@fosslib.net>2019-11-27 18:07:20 -0500
committerGitHub <noreply@github.com>2019-11-27 18:07:20 -0500
commit5988940ca739baac728e2331214bdbdb8b462674 (patch)
tree7fa0b648000110bd48e83c92684f780d9bf675cd
parenta568a03674b8a82d16ff3e91da9b089727d3a0d6 (diff)
parent08b9cac6d5311513d6a8f72523be127c8035833c (diff)
downloadnixlib-5988940ca739baac728e2331214bdbdb8b462674.tar
nixlib-5988940ca739baac728e2331214bdbdb8b462674.tar.gz
nixlib-5988940ca739baac728e2331214bdbdb8b462674.tar.bz2
nixlib-5988940ca739baac728e2331214bdbdb8b462674.tar.lz
nixlib-5988940ca739baac728e2331214bdbdb8b462674.tar.xz
nixlib-5988940ca739baac728e2331214bdbdb8b462674.tar.zst
nixlib-5988940ca739baac728e2331214bdbdb8b462674.zip
Merge pull request #73577 from helsinki-systems/matomo-consistency
matomo: Fix consistency check
-rw-r--r--nixos/modules/services/web-apps/matomo-doc.xml6
-rw-r--r--pkgs/servers/web-apps/matomo/default.nix23
2 files changed, 22 insertions, 7 deletions
diff --git a/nixos/modules/services/web-apps/matomo-doc.xml b/nixos/modules/services/web-apps/matomo-doc.xml
index 79cece551d34..69d1170e4523 100644
--- a/nixos/modules/services/web-apps/matomo-doc.xml
+++ b/nixos/modules/services/web-apps/matomo-doc.xml
@@ -86,12 +86,6 @@ GRANT ALL PRIVILEGES ON matomo.* TO 'matomo'@'localhost';
   <itemizedlist>
    <listitem>
     <para>
-     Matomo's file integrity check will warn you. This is due to the patches
-     necessary for NixOS, you can safely ignore this.
-    </para>
-   </listitem>
-   <listitem>
-    <para>
      Matomo will warn you that the JavaScript tracker is not writable. This is
      because it's located in the read-only nix store. You can safely ignore
      this, unless you need a plugin that needs JavaScript tracker access.
diff --git a/pkgs/servers/web-apps/matomo/default.nix b/pkgs/servers/web-apps/matomo/default.nix
index e990a16c0384..98c532d5ddce 100644
--- a/pkgs/servers/web-apps/matomo/default.nix
+++ b/pkgs/servers/web-apps/matomo/default.nix
@@ -52,7 +52,7 @@ stdenv.mkDerivation rec {
   installPhase = ''
     runHook preInstall
 
-    # copy evertything to share/, used as webroot folder, and then remove what's known to be not needed
+    # copy everything to share/, used as webroot folder, and then remove what's known to be not needed
     mkdir -p $out/share
     cp -ra * $out/share/
     # tmp/ is created by matomo in PIWIK_USER_PATH
@@ -66,6 +66,27 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
+  filesToFix = [
+    "misc/composer/build-xhprof.sh"
+    "misc/composer/clean-xhprof.sh"
+    "misc/cron/archive.sh"
+    "plugins/Installation/FormDatabaseSetup.php"
+    "vendor/leafo/lessphp/package.sh"
+    "vendor/pear/archive_tar/sync-php4"
+    "vendor/szymach/c-pchart/coverage.sh"
+  ];
+
+  # This fixes the consistency check in the admin interface
+  postFixup = ''
+    pushd $out/share > /dev/null
+    for f in $filesToFix; do
+      length="$(wc -c "$f" | cut -d' ' -f1)"
+      hash="$(md5sum "$f" | cut -d' ' -f1)"
+      sed -i "s:\\(\"$f\"[^(]*(\\).*:\\1\"$length\", \"$hash\"),:g" config/manifest.inc.php
+    done
+    popd > /dev/null
+  '';
+
   meta = with stdenv.lib; {
     description = "A real-time web analytics application";
     license = licenses.gpl3Plus;