Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Integrity check warning should be skipped when installing from Git #15913

Closed
stucki opened this issue May 5, 2020 · 3 comments
Closed
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@stucki
Copy link

stucki commented May 5, 2020

The system check module reports a problem in the file integrity check:

File integrity check could not be performed due to missing manifest.inc.php.
If you are deploying Matomo from Git, this message is normal.

When running the diagnostics:run command on the CLI, then the warning is a big more verbose:

$ php console diagnostics:run 
File integrity: WARNING File integrity check failed and reported some errors. You should fix this issue and then refresh this page until it shows no error.

File integrity check could not be performed due to missing manifest.inc.php.
If you are deploying Matomo from Git, this message is normal.
1 warnings detected

I'm using Git by intention, therefore I would like to turn off this warning either via config option or automatically when a .git/ folder exists.

@stucki
Copy link
Author

stucki commented May 5, 2020

The following patch works for me:

diff --git a/core/FileIntegrity.php b/core/FileIntegrity.php
index 49762eb60e..ea40d53b00 100644
--- a/core/FileIntegrity.php
+++ b/core/FileIntegrity.php
@@ -29,6 +29,12 @@ class FileIntegrity
 
         if (file_exists($manifest)) {
             require_once $manifest;
+        } elseif (is_dir(PIWIK_INCLUDE_PATH . '/.git')) {
+            // Skip file integrity check when Matomo is installed with Git
+            return array(
+                $success = true,
+                $messages
+            );
         }
 
         if (!class_exists('Piwik\\Manifest')) {

@sgiehl
Copy link
Member

sgiehl commented May 5, 2020

Hi @stucki. Thanks for your suggestion. very appreciated. The warning is on purpose, as we don't recommend to install/update Matomo using git.
Nevertheless, there is also a better way to disable that check without manipulating some core code.
You can create a file config\config.php with this content to disable the check:

<?php

return [
    'diagnostics.disabled' => [
        DI\get('Piwik\Plugins\Diagnostics\Diagnostic\FileIntegrityCheck')
    ]
];

@stucki
Copy link
Author

stucki commented May 5, 2020

Perfect, thank you!

@stucki stucki closed this as completed May 5, 2020
@sgiehl sgiehl added the answered For when a question was asked and we referred to forum or answered it. label May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

2 participants