YunoHost-Apps / matomo_ynh

Matomo package for YunoHost
https://matomo.org/
GNU General Public License v3.0
18 stars 6 forks source link

Matomo installed on yunohost 4.1.7.3 returns matomo.js as text/html #41

Open czen opened 3 years ago

czen commented 3 years ago

I've installed matomo on yunohost 4.1.7.3 a couple of days ago from yunohost web ui. If I insert tracking code into my website, on page load an error occures

Refused to execute script from 'https://my domain name here/yunohost/sso/?r==' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

Looking at chrome's network requests timeline, I see matomo.js request was with content-type: text/html header. However, if I just paste https://my domain name here/matomo/matomo.js into address bar, it loads with content-type: application/javascript.

Is the inserted code behaving in unpexpected way or nginx from yunohsot server doing something weird?

alfredo87 commented 2 years ago

Hiya, a newbie issue: on the database setup page the following is returned:

Error while trying to connect to the database server: Database access denied Do I have to create the user ,etc. from the terminal command line or is the webpage for creation of user and database? Thanks if somebody can help with this

inkskull commented 2 years ago

Hello, Still got what seems to be the same issue with version 4.6.2 :  matomo-tracking.min.…cc00d517f6177b.js:2 Cross-Origin Read Blocking (CORB) blocked cross-origin response https://monserveurencarton.eu/yunohost/sso/?r=aHR0cHM6L...Lmpz with MIME type text/html.

Tried it on Firefox : get the same answer.

krlvo commented 2 years ago

I had the same thing. Disabled my adblocker (uBlock Origin), and things turned to normal.

amanahuja commented 2 years ago

I've encountered this same issue and posted about it here (if you'd like details). As yet unresolved, I'll update this comment with an outcome if I get anywhere. https://forum.yunohost.org/t/matomo-tracker-redirects-fail/

Updated: Resolved this issue -- for me, this MIME type mismatch was actually an indication that the resources (matomo.js and matomo.php) were being redirected to the yunohost SSO login page. I solved the problem in the end by moving matomo to it's own domain (analytics.mycustomdomain.com) instead of a subdirectory.