Merge pull request #73577 from helsinki-systems/matomo-consistency

matomo: Fix consistency check
This commit is contained in:
Aaron Andersen 2019-11-27 18:07:20 -05:00 committed by GitHub
commit 5988940ca7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 7 deletions

View file

@ -84,12 +84,6 @@ GRANT ALL PRIVILEGES ON matomo.* TO 'matomo'@'localhost';
<title>Issues</title>
<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

View file

@ -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;