Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Matomo (Piwik) and CSP error

Open cb3inco opened this issue 3 years ago • 8 comments

Description:

Matomo analytics are being blocked because of a CSP policy blocking the Matomo js file.

Steps to reproduce:

  1. Go to Admin -> Analytics -> Setup Piwik (Matomo)
  2. Save changes
  3. Reload Rocket.Chat in regular user with Inspect open in browser.

Expected behavior:

Send Analytics to Matomo instance

Actual behavior:

SCP blocking of js file on Matomo.

image

See here for more information: https://content-security-policy.com/examples/blocked-csp/ - looks like the header or meta tag needs to be updated. Here is specific information - https://content-security-policy.com/script-src/ it looks like script-src needs to be added to the 'home' header with the matomo url.

Also Piwik should be renamed to Matomo

Server Setup Information:

  • Version of Rocket.Chat Server: 3.16.3
  • Operating System: Ubuntu 18.04
  • Deployment Method: Docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: v12.22.1
  • MongoDB Version: 4.0.17

Client Setup Information

  • Desktop App or Browser Version: Brave, Edge, Firefox
  • Operating System: Ubuntu

cb3inco avatar Aug 18 '21 14:08 cb3inco

Hey there,

Thanks for reporting this.

Can you please test this out on the latest version and let us know? (3.17.1)

Bugs are often fixed on the latest release so please test it there first and see if it still occurs. You can also test on the development version, or try on open.rocket.chat which is usually the latest development code.

yashovardhan avatar Aug 24 '21 14:08 yashovardhan

@yashovardhan thank you, I did try it also on the latest release. It's pointing to analytics.doman.com/js but I think that's wrong as well.

cb3inco avatar Aug 24 '21 14:08 cb3inco

Problem still persists on version 4.0.0

tarator avatar Oct 08 '21 16:10 tarator

Still a problem in 4.3.1

avignat avatar Jan 19 '22 19:01 avignat

If this needs to be addressed by changing the way the tracking script is included, here is the relevant code (I think):

https://github.com/RocketChat/Rocket.Chat/blob/develop/apps/meteor/app/analytics/client/loadScript.js

ApolloLV avatar May 14 '22 15:05 ApolloLV

This is a problem with RocketChat 4.7.2 and Matomo 4.10.0

stephen-cox avatar May 24 '22 07:05 stephen-cox

Problem persists in 4.8.1

AisukoHakumei avatar Jul 05 '22 09:07 AisukoHakumei

Problem persists in v5.0.3

DRLDoom avatar Nov 29 '22 17:11 DRLDoom

Bug still exists in 5.4.1

avignat avatar Dec 23 '22 08:12 avignat

Is this bug still present in rocket chat 6?

wokawoka avatar Mar 23 '23 19:03 wokawoka