Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For the downloaded FBX format 3D model package, it cannot be previewed directly in Nextcloud after decompression. #13

Open
MiloGeimer opened this issue May 11, 2023 · 15 comments
Assignees
Labels
bug Something isn't working question Further information is requested upstream The answer lies upstream

Comments

@MiloGeimer
Copy link

MiloGeimer commented May 11, 2023

Describe the bug

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

I have checked that the files are not corrupted

Yes, file is working when I open it in...

Screenshots

Browser log

How to access your browser console (Click to expand)

Chrome

  1. Press either CTRL + SHIFT + I / CMD + ALT + I or F12 to open the Developer Tools.
  2. Click the “console” tab.

Safari

  1. Press CMD + ALT + I to open the Web Inspector.
  2. See Chrome’s step 2. (Chrome and Safari have pretty much identical dev tools.)

IE

  1. Press F12 to open the developer tools.
  2. Click the “console” tab.

Firefox

  1. Press CTRL + SHIFT + K to open the Web console (COMMAND + SHIFT + K on Macs).
  2. or, if Firebug is installed (recommended):
    1. Press F12 to open Firebug.
    2. Click on the “console” tab.

Opera

  1. Press CTRL + SHIFT + I to open Dragonfly.
  2. Click on the “console” tab.

Installation and configuration

How the app was installed?

  • Via app store.
  • Manually. Downloading files_3dmodelviewer.tar.gz from releases and unzipping the directory.
  • Manually. Cloning and building.

App server configuration Parameters

  • apps_path parameter is not explicitly configured/customised in config/config.php

Versions

3D Model Viewer

  • Version:

Nextcloud

  • Installation type:
  • Version:
  • Webserver:

Desktop

  • OS:
  • Browser and version:

Handheld

  • Device:
  • OS:
  • Browser and version:

Additional context

@MiloGeimer
Copy link
Author

"Failed to import model.(TypeError: Failed to fetch)"

@kroko
Copy link
Member

kroko commented May 12, 2023

pleas use one of three templates for issues. i just filled in bug template in your initial comment, please edit it to fill it out.

@kroko kroko added the question Further information is requested label May 12, 2023
@ghost
Copy link

ghost commented Jun 6, 2023

Same problem is happening to me,im at Nextcloud 26.0.0
I installed the app via App Store

Just wont load any FBX

@kroko
Copy link
Member

kroko commented Jun 6, 2023

well, the bugreport quality... I have no idea about any of the required info that OP @MiloGeimer failed to fill, except

  • fbx
  • via App Store

anyways, I just checked some models. i can replicate issues with FBX, that has embedded textures. for example this fbx works (no textures). does the FBX in the link work for @MiloGeimer and @Altair1231?

it seems that it is upstream issu that I will attend at some point.

@kroko kroko added bug Something isn't working upstream The answer lies upstream labels Jun 6, 2023
@kroko kroko self-assigned this Jun 6, 2023
@DevinWinata
Copy link

Hi, I have the same issue and using the mentioned FBX file still can't be previewed.
From browser console logs, it seems CSP is blocking blob: when previewing the FBX file.

Refused to connect to 'blob:https://example.com/acda3f2d-c3ab-4855-b334-95ebc0af36fa' because it violates the following Content Security Policy directive: "connect-src 'self'".

image
Instance info:
Nextcloud 27 docker (nextcloud with apache built-in docker image nextcloud:latest with Caddy as reverse proxy)
Via app store

@kroko
Copy link
Member

kroko commented Jun 25, 2023

@MiloGeimer, @Altair1231 can you please try 0.0.11.
if it fails, please provide link to exact FBX file that it fails for.
@DevinWinata Refused to connect to 'blob:https://example.com/acda3f2d-c3ab-4855-b334-95ebc0af36fa' because it violates the following Content Security Policy directive: "connect-src 'self'". is unrelated, IMHO the issue lies somewhere else in your case.

@ivan4os
Copy link

ivan4os commented Oct 25, 2023

failed to import model typeerror: failed to fetch (3D Model Viewer app)
files_3dmodelviewer.js?v=13e99c0e-57:1 Refused to connect to 'blob:https://????????/cffe6d08-6aab-48ea-a13c-6bac1da49555' because it violates the following Content Security Policy directive: "connect-src 'self'".
Help me!!!

@DerLeole
Copy link

I have encountered the same issue and it seems like the csp is actually to blame, since other models load just fine. when they aren't loaded via blob.

@smarinier
Copy link
Contributor

@DerLeole @DevinWinata @MiloGeimer @ivan4os
Could you use the "Developer Tools" from your browser (Google Chrome ?), load the NexCloud page, go in "network" tab, and give the whole content of "Content-Security-policy" ?

DevTools_-_home_smarinier_net_nc28-dev_index_php_apps_files_files_1437_dir___openfile_true

@DevinWinata
Copy link

@smarinier here's CSP from my nextcloud instance

default-src 'none';base-uri 'none';manifest-src 'self';script-src 'nonce-RkU3OVZiR0t5aWpYZ0tJa3E5bm9pRE5PZmM2Y2RVZWRMalJWTTFZSTNkWT06ZlNQSU9Ndk1uMStGNmZaOW5PNkV6SDhoUEpuTU9pLzRWRkFpZVNaaTlvND0=' 'self' drive.example.com 'unsafe-eval';script-src-elem 'strict-dynamic' 'nonce-RkU3OVZiR0t5aWpYZ0tJa3E5bm9pRE5PZmM2Y2RVZWRMalJWTTFZSTNkWT06ZlNQSU9Ndk1uMStGNmZaOW5PNkV6SDhoUEpuTU9pLzRWRkFpZVNaaTlvND0=' 'self' drive.example.com 'unsafe-eval';style-src 'self' 'unsafe-inline';img-src 'self' data: blob: * https://*.tile.openstreetmap.org https://office.example.com;font-src 'self' data:;connect-src 'self';media-src 'self';frame-src 'self' nc: https://office.example.com;frame-ancestors 'self' https://office.example.com;worker-src 'self';form-action 'self' https://office.example.com

@smarinier
Copy link
Contributor

@DevinWinata could you try to (temporarily) install and active the "Talk" application in NextCloud. And tell me if it's ok now for the FBX preview ?

@DevinWinata
Copy link

@smarinier hi, it's now able to preview FBX files.

@smarinier
Copy link
Contributor

Ok. I see what the fix could be.

@smarinier
Copy link
Contributor

Hi @kroko,

Could you have a look on the very simple PR #26 ?

Thanks

@kroko
Copy link
Member

kroko commented May 22, 2024

@smarinier merged and pushed as a new release v0.0.14 in NC appstore, thanks! wait till it lands and test it out.
while first getting this plugin up and running CSP was headache, especially because for some file type loaders it has to lazyload extra js and wasm however based on what plugins user has installed (i specially installed A LOT in the dev instance) the whole CSP policy goes haywire.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested upstream The answer lies upstream
Projects
None yet
Development

No branches or pull requests

6 participants