matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.61k stars 2.62k forks source link

Extend multi_server_environment #13074

Open daylicron opened 6 years ago

daylicron commented 6 years ago

We're running a cluster of four Matomo Servers for Load Balancing and Backup. It's running smooth and fine, managed via Puppet.

We're using multi_server_environment=1 in the configs, which works for the marketplace as intended. But someone who needs to work as a admin in Matomo performed a Matomo upgrade via the webinterface, which got us into trouble.

I would like multi_server_environment=1 to disable the Matomo webinterface upgrade as well as plugin installation via marketplace. Actually when you're hovering over the update information, it says that you cannot perform the upgrade. But when you click the information button, the update page says that the upgrade can be performed and allows you to do it.

I tried to get into the code and implement it myself but I didn't even find where multi_server_environment=1 disables the plugin installation...

daylicron commented 6 years ago

Could anyone take a look at this or give me a hint where to take a look?

mattab commented 6 years ago

Hi @daylicron Thanks for reporting the issue. Respecting the setting is indeed important. It would be great if you could create a Pull Request :+1:

The code may be around these methods: https://github.com/matomo-org/matomo/blob/82a9b1b0a01dc20928d50134233e167f0116472d/core/SettingsPiwik.php#L273-L285 then you'd need to block access to the screens in plugins/CoreUpdater/Controller.php at least oneClickUpdate,oneClickResults, index, runUpdaterAndExit when !isAutoUpdatePossible

daylicron commented 6 years ago

Hi @mattab we worked out a fix for this: https://github.com/matomo-org/matomo/pull/13201