-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Automatically delete non-expected files from the filesystem #11132
Comments
thanks for opening this issue. imho every file installed by piwik in any version and not needed anymore in newer version of piwik should be automatically deleted when installing/updating to any newer version. Since one can not assume every user updates from every version directly to following version of piwik, but there is a big chance users miss one or several minor or even major versions in-between, Otherwise users may get irritated or even get afraid that their server has been taken over and all the files mentioned here belong to a dangerous virus/malware... Would vote strongly to address this issue in the not to far future. |
the other way around when having a positive list of files, one can of course automatically delete all files not within this positive list. |
or, to keep installation process without any additional check mark: |
That's a nice idea! we'll consider this |
I'm a bit against the full "blind" automated cleaning. Use case : Maybe an admin put a adminer.php or phpinfo.php file for debug and secured them well enough to keep them there... OTOH I really like the simple "Clean up my installation". Maybe a middle ground and flexible way would be to let Admins add some file or folders untouched by whitelisting them in config/config.ini.php
That way it would still be possible to get a clean Piwik installation while having some liberty. |
Hello,
I agree with @gaumondp
Eric |
the fact that HTML entities are displayed in the Update screen file integrity error message will be tackled in #11167 |
A command line option for deleting old, unneeded, files would be good — as far as I'm aware this is the only part of upgrading Matomo which can't be scripted at the moment (please point me in the right direction if it can be). |
I wouldn't delete such files automatically during the update as we in the past often had trouble and falsely reported some files. And with introduction of new features such things may happen again. You could build such a command though.
I'd recommend to make a backup of the files personally before executing the command |
I agree that doing it automatically would be potentially too risky, but having a command line option to get a list of the files that you can access in the web interface would be good enough for me — I could then check the list before deciding to delete the files or not. For what it is worth these are the Ansible tasks I'm using to upgrade multiple Matomo servers at a time and I'd ideally like to not have to subsequently login into each one and then click through to the system check to get a list of files to be deleted. |
After 3.9.0 I stumpled across this again. I propose another solution:
This way, there is absolute controll over what get's deleted. This means that something maybe does not get deleted (false negative) but nothing gets deleted that should not be deleted (false positive). |
in #11096 and #11107 we introduced a new feature where the file integrity checker now also checks for files which are present in the Piwik filesystem, but are not expected.
Often these are files that used to be in previous Piwik versions but were removed afterwards. our automatic updater should automatically delete these files, but it was only introduced during 2.X cycle so many un-expected files will be present for users who used Piwik for a long time.
See an example of such files reported here: #11107 (comment)
Ideas:
vendor/
,libs/
)The text was updated successfully, but these errors were encountered: