v1r0x / files_3d

GNU Affero General Public License v3.0
33 stars 9 forks source link

CSP issues, doesn't load #53

Closed PVince81 closed 2 years ago

PVince81 commented 2 years ago

Steps

  1. Setup Nextcloud 23.0.2
  2. occ app:enable files_3d
  3. Upload a GLTF file
  4. Try opening it

Expected result

3d model appears

Actual result

The viewer app appears and the JS console shows CSP errors about WebGL:

image

Versions

Tested with the app store version and also with the master branch after compiling.

PVince81 commented 2 years ago

you might need to adjust the CSP policies, see https://github.com/nextcloud/spreed/blob/v12.0.0/lib/Controller/PageController.php#L262 for an example how to set some

v1r0x commented 2 years ago

Thanks for your issue!

I can not reproduce that error on my instance. But from what I see on your screenshot, this should be fixed by adding CSP policy for the connect domain with $csp->addAllowedConnectDomain("'self'");. But as I don't have a controller set up, I'm not sure how this can be done in my viewer plugin? cc @skjnldsv can you help me out again? :sweat_smile:

skjnldsv commented 2 years ago

No idea really, I guess you can adjust the connect-src csp policy the same way? Really not my expertise :see_no_evil:

PVince81 commented 2 years ago

PR here: https://github.com/v1r0x/files_3d/pull/57

PVince81 commented 2 years ago

the CSP issue I had was due to a conflict of policies from other apps this general issue will be resolved in Nextcloud 25: https://github.com/nextcloud/server/pull/32113

now with https://github.com/v1r0x/files_3d/pull/57 in place the issue will not appear any more for this app