Comments (15)
I have cleared all caches in Firefox and reinstalled the app after uninstalling. I also get the same behaviour an different machines. PC, Notebook and Android.
Same error also in Chrome 70
from cloud_piwik.
I'm sorry that you have trouble with the latest release, but I need some more help from you. The 404 is quite unusual for Nextcloud, because normally you get a 302 if you try to access an not existing route. What happens if you try to download /apps/piwik/js/tracking.js
directly? Is the 404 from your webserver or Nextcloud? Do you have any related log entry in your web server or NC log? If you don't use any rewriting the url should be something like index.php/apps/piwik/...
. Do you use rewriting?
from cloud_piwik.
Calling apps/piwik/js/tracking.js directly returns a "file not found" error.
We don't do any fancy stuff on the nextcloud installation. Nextcloud is installed in a subdirectory, that's the only slightly unusual point.
from cloud_piwik.
Interesting is: Viewing the source code of the "page-not-found" error page does show the js code.
view-source:https://path-to-mycloud/apps/piwik/js/tracking.js
*!
- cloud_piwik v0.5.0 - 2018-10-29
- Copyright (c) 2018 Klaus Herberth [email protected]
- Released under the MIT license
- Please see https://github.com/sualko/cloud_piwik
- @author Klaus Herberth [email protected]
- @Version 0.5.0
- @license MIT
*/
/* global OC */
var _paq = _paq || [];
......
from cloud_piwik.
Are you sure that you don't use url rewriting? Because normally the url should look like http://localhost/nextcloud/index.php/apps/piwik/js/tracking.js
. The index.php
is the important part here, but anyway what I meant above was that if you request something like http://localhost/nextcloud/index.php/apps/files404/
you get an 302 and not an 404. A 404 means the Nextcloud is not involved.
My guess is that you messed up your rewrite config. Look overwrite.cli.url
and htaccess.RewriteBase
in your nc config and check your server config.
Btw I tested both setups: With and without url rewriting and I can't reproduce your issue. Sorry.
from cloud_piwik.
I just had a look at the code inside the "cloud_piwik-0.5.0.tar.gz" release, it seems the is no file called "tracking.js" in piwik/js. Only a file called "track.js". Is this correct?
On out live server there is no "tracking.js" file after an online upgrade either.
from cloud_piwik.
That's right. It's using a Nextcloud route and this is also the reason why there should be an index.php
in the path if you don't use rewriting.
from cloud_piwik.
I experienced the exact same behaviour as @brtptrs (Nextcloud v.15.0.2 / cloud_piwik v0.5.0).
I believe it has something to do with which URL are allowed by default in Nextcloud, I recall reading something like this during my investigations. Unfortunately I am unable to find the reference anymore, sorry.
Fiddling with rewrite settings didn't help.
Changing the script's URL from .../js/tracking.js
to .../js/script
fixed the issue for me.
from cloud_piwik.
After further investigations, this has nothing to do with Content Security Policy, as I came to suspect at some point.
This is my .htaccess
freshly generated by occ maintenance:update:htaccess
:
DirectoryIndex index.php index.html
(removed for brevity)
RewriteCond %{REQUEST_FILENAME} !\.(css|js|svg|gif|png|html|ttf|woff2?|ico|jpg|jpeg)$
(removed for brevity)
RewriteRule . index.php [PT,E=PATH_INFO:$1]
RewriteBase /
Any route ending with ".js" (or any extention that appears in the exclusion list) is ignored by the rewrite engine. Changing the route to anything else solves the problem.
Setup:
- Apache 2.4.34
- PHP 7.2.9 (FPM via mod_proxy_fcgi)
- Nextcloud 15.0.4 (yup, updated 2hrs ago)
- cloud_piwik 0.5.0
- config.php:
'overwrite.cli.url' => 'https://example.com',
'htaccess.RewriteBase' => '/',
The weirdest thing of all is that I too receive the JS script in the HTTP response body (tested with curl
, therefore not a browser cache thing), along with the 404 status code:
$ curl -v https://example.com/apps/piwik/js/tracking.js
< HTTP/1.1 404 Not Found
(...)
* cloud_piwik v0.5.0 - 2018-10-29
(...)
Perhaps the 404 response goes through index.php
: I get an empty 404 response if I remove the DirectoryIndex
directive. But I'm stopping my goose chase for now...
from cloud_piwik.
The weirdest thing of all is that I too receive the JS script in the HTTP response body
Therefore I don't believe this is related to the rewrite rule. On an other app, I had a similar issue and it was related to the returned filename. Currently tracking.js
is delivered as script
. Maybe this is the reason why you get a 404, with the body tag, but I'm unsure. The only thing I can say, is that it is working for me with the same rewrite rules. I will update the app and it would be great if you could give me some feedback. It would also be helpful if you could send me your url to [email protected], so I can investigate this further.
from cloud_piwik.
It would be awesome if you could test the latest release.
from cloud_piwik.
v0.5.1 unfortunately does not solve the problem for me.
Upgrade Steps (from NC front end):
- Deactivate
- Remove
- Download and install
I still get a 404 on
apps/piwik/js/tracking.js
from cloud_piwik.
Can you send me your url to [email protected]?
from cloud_piwik.
@sualko done, and thank you for the effort.
from cloud_piwik.
I hope I can release a fix for this bug this weekend. Sorry for the trouble.
from cloud_piwik.
Related Issues (20)
- Call to undefined method OC\Server::getContentSecurityPolicyNonceManager() (Owncloud no longer supported?) HOT 3
- Update for compatibility with nextcloud 16 needed HOT 6
- Undefined index: host at /cloud/apps/piwik/appinfo/app.php#14
- Feature Request : Track Uploads/Downloads (why not ?) HOT 4
- Not compatible with Nexcloud 18 HOT 1
- File download tracking HOT 1
- Add support for Nextcloud 19 HOT 5
- Matomo isn't tracking calls HOT 1
- Mobile Track from nextcloud Module HOT 1
- "Content Security Policy" errors in Nextcloud for calls to Matoma HOT 5
- Is it possible to track media plays? HOT 3
- Nextcloud 22 support HOT 3
- Nextcloud 24 support HOT 7
- numbers downloaded files HOT 1
- Unable to install latest version `0.11.0` HOT 2
- [Feature Request] Tracking sharing download HOT 1
- Support for NC 26 HOT 3
- [Feature Request] Tracking analytics for OnlyOffice / Community Document Server views HOT 3
- Compatibility with Nextcloud 28 and 29 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloud_piwik.