WARP-LAB / files_3dmodelviewer

3D Model Viewer for Nextcloud
GNU Affero General Public License v3.0
38 stars 6 forks source link

IFC not working on nextcloud 24.0.6 #5

Closed immomagic closed 1 year ago

immomagic commented 1 year ago

Describe the bug

ifc fles, even small ones like 2MB, do not load. other formats do load but they take quite long. Im connected via LAN directly to the server where our nextcloud instance is running

To Reproduce

Steps to reproduce the behavior:

Take a ifc file and try to look at it in the 3DModel Viewer

Expected behavior

The ifc file should load an

I have checked that the files are not corrupted

Yes, using BIM VISION.

Screenshots

Browser log

ConsoleLogger.js:33 [INFO] viewer: Opening viewer for file  {app: 'viewer', uid: 'm.burgert', path: '/BKK Cloud/AVA/haus.ifc'}
ConsoleLogger.js:29 [DEBUG] viewer: Fetching additional files... {app: 'viewer', uid: 'm.burgert'}
web-ifc-api-browser.js:1 

       Uncaught (in promise) EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".

    at new Function (<anonymous>)
    at createNamedFunction (web-ifc-api-browser.js:1:213972)
    at extendError (web-ifc-api-browser.js:1:214156)
    at WebIFCWasm2 (web-ifc-api-browser.js:1:243576)
    at IfcAPI2.<anonymous> (web-ifc-api-browser.js:1:1379921)
    at Generator.next (<anonymous>)
    at web-ifc-api-browser.js:1:1162
    at new Promise (<anonymous>)
    at __async (web-ifc-api-browser.js:1:849)
    at IfcAPI2.Init (web-ifc-api-browser.js:1:1379712)
createNamedFunction @ web-ifc-api-browser.js:1
extendError @ web-ifc-api-browser.js:1
WebIFCWasm2 @ web-ifc-api-browser.js:1
(anonym) @ web-ifc-api-browser.js:1
(anonym) @ web-ifc-api-browser.js:1
__async @ web-ifc-api-browser.js:1
Init @ web-ifc-api-browser.js:1
(anonym) @ files_3dmodelviewer.js?v=570800e1-40:1
Promise.then (asynchron)
(anonym) @ files_3dmodelviewer.js?v=570800e1-40:1
Promise.then (asynchron)
ImportContent @ files_3dmodelviewer.js?v=570800e1-40:1
Import @ files_3dmodelviewer.js?v=570800e1-40:1
ImportLoadedMainFile @ files_3dmodelviewer.js?v=570800e1-40:1
ImportLoadedFiles @ files_3dmodelviewer.js?v=570800e1-40:1
(anonym) @ files_3dmodelviewer.js?v=570800e1-40:1
DecompressArchives @ files_3dmodelviewer.js?v=570800e1-40:1
(anonym) @ files_3dmodelviewer.js?v=570800e1-40:1
(anonym) @ files_3dmodelviewer.js?v=570800e1-40:1
setTimeout (asynchron)
RunTaskAsync @ files_3dmodelviewer.js?v=570800e1-40:1
onReady @ files_3dmodelviewer.js?v=570800e1-40:1
TaskReady @ files_3dmodelviewer.js?v=570800e1-40:1
(anonym) @ files_3dmodelviewer.js?v=570800e1-40:1
Promise.finally (asynchron)
GetFileContent @ files_3dmodelviewer.js?v=570800e1-40:1
runTask @ files_3dmodelviewer.js?v=570800e1-40:1
(anonym) @ files_3dmodelviewer.js?v=570800e1-40:1
setTimeout (asynchron)
RunOnce @ files_3dmodelviewer.js?v=570800e1-40:1
Run @ files_3dmodelviewer.js?v=570800e1-40:1
(anonym) @ files_3dmodelviewer.js?v=570800e1-40:1
GetContent @ files_3dmodelviewer.js?v=570800e1-40:1
LoadFiles @ files_3dmodelviewer.js?v=570800e1-40:1
ImportFiles @ files_3dmodelviewer.js?v=570800e1-40:1
LoadModel @ files_3dmodelviewer.js?v=570800e1-40:1
LoadModelFromInputFiles @ files_3dmodelviewer.js?v=570800e1-40:1
LoadModelFromFileList @ files_3dmodelviewer.js?v=570800e1-40:1
Init3DViewerFromFileList @ files_3dmodelviewer.js?v=570800e1-40:1
(anonym) @ files_3dmodelviewer.js?v=570800e1-40:1
tryCatch @ files_3dmodelviewer.js?v=570800e1-40:1
(anonym) @ files_3dmodelviewer.js?v=570800e1-40:1
(anonym) @ files_3dmodelviewer.js?v=570800e1-40:1
Appvue_type_script_lang_js_asyncGeneratorStep @ files_3dmodelviewer.js?v=570800e1-40:1
_next @ files_3dmodelviewer.js?v=570800e1-40:1
Promise.then (asynchron)
Appvue_type_script_lang_js_asyncGeneratorStep @ files_3dmodelviewer.js?v=570800e1-40:1
_next @ files_3dmodelviewer.js?v=570800e1-40:1
(anonym) @ files_3dmodelviewer.js?v=570800e1-40:1
(anonym) @ files_3dmodelviewer.js?v=570800e1-40:1
construct @ files_3dmodelviewer.js?v=570800e1-40:1
(anonym) @ files_3dmodelviewer.js?v=570800e1-40:1
(anonym) @ vue.runtime.esm.js:1989
et @ vue.runtime.esm.js:1915
Promise.then (asynchron)
Ke @ vue.runtime.esm.js:1942
at @ vue.runtime.esm.js:1999
e.$nextTick @ vue.runtime.esm.js:3542
mounted @ files_3dmodelviewer.js?v=570800e1-40:1
We @ vue.runtime.esm.js:1863
ln @ vue.runtime.esm.js:4235
insert @ vue.runtime.esm.js:3158
_ @ vue.runtime.esm.js:6390
bo.nodeOps @ vue.runtime.esm.js:6609
e._update @ vue.runtime.esm.js:3963
r @ vue.runtime.esm.js:4081
bn.get @ vue.runtime.esm.js:4495
bn.run @ vue.runtime.esm.js:4570
yn @ vue.runtime.esm.js:4326
(anonym) @ vue.runtime.esm.js:1989
et @ vue.runtime.esm.js:1915
Promise.then (asynchron)
Ke @ vue.runtime.esm.js:1942
at @ vue.runtime.esm.js:1999
(anonym) @ vue.runtime.esm.js:4418
bn.update @ vue.runtime.esm.js:4560
de.notify @ vue.runtime.esm.js:730
set @ vue.runtime.esm.js:1055
Cn.set @ vue.runtime.esm.js:4644
(anonym) @ Viewer.vue:431
u @ runtime.js:63
(anonym) @ runtime.js:294
(anonym) @ runtime.js:119
Vm @ Download.vue?b226:19
i @ Download.vue?b226:19
Promise.then (asynchron)
Vm @ Download.vue?b226:19
i @ Download.vue?b226:19
Promise.then (asynchron)
Vm @ Download.vue?b226:19
i @ Download.vue?b226:19
(anonym) @ Download.vue?b226:19
(anonym) @ Download.vue?b226:19
openFile @ Viewer.vue:345
file @ Viewer.vue:256
We @ vue.runtime.esm.js:1863
bn.run @ vue.runtime.esm.js:4584
yn @ vue.runtime.esm.js:4326
(anonym) @ vue.runtime.esm.js:1989
et @ vue.runtime.esm.js:1915
Promise.then (asynchron)
Ke @ vue.runtime.esm.js:1942
at @ vue.runtime.esm.js:1999
(anonym) @ vue.runtime.esm.js:4418
bn.update @ vue.runtime.esm.js:4560
de.notify @ vue.runtime.esm.js:730
set @ vue.runtime.esm.js:1055
value @ Viewer.js:193
gm @ FilesActionHandler.js:40
action @ merged-index.js?v=570800e1-40:3025
_onClickFile @ merged-index.js?v=570800e1-40:4986
be @ _executeBound.js:8
(anonym) @ bind.js:10
(anonym) @ restArguments.js:16
dispatch @ jquery.js:5430
m.handle @ jquery.js:5234
App.vue:323 No new notification data received
App.vue:355 Polling interval updated to 30000
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?

App server configuration Parameters

Versions

Nextcloud

Desktop

Handheld

Additional context

The IFC test files I used: ifcs.zip

**Enabled:

_Disabled:

kroko commented 1 year ago

Perfect bug report ❤️

Yeah, it is related to this line where this app informs NC that we want 'unsafe-eval' to be true and thus your error would not happen

Uncaught (in promise) EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".

but it is affected what and how CSP policies other apps load. I quite haven't yet figured out how CSP works in NC yet, till then drastic fix incoming.

kroko commented 1 year ago

Please try version 0.0.7 and report back. Just uploaded the new version in NC app store, it will take a bit time to propagate. After update clear PHP opcache as changes in app are within backend.

kroko commented 1 year ago

@immomagic ping

immomagic commented 1 year ago

Sorry, it is not working on our nextcloud instance 24 - on 25 it works with a bit latency.

Für eventuelle Fragen stehe ich Ihnen jederzeit gern zur Verfügung und verbleibe

mit freundlichen Grüßen

gez. M.A. Martin Burgert

IMMO-MAGIC GmbH D-99084 Erfurt, Pergamentergasse 9

D-99084 Erfurt, Augustinerstrasse 27

Tel.: +49 (361) 60250-117 Mobil: +49 (151) 58253-117 Fax: +49 (361) 60250-20 Mail: @.*** Web: www.immo-magic.dehttp://www.immo-magic.de/


Von: kroko @.> Gesendet: Friday, March 24, 2023 4:38:33 PM An: WARP-LAB/files_3dmodelviewer @.> Cc: immomagic @.>; Mention @.> Betreff: Re: [WARP-LAB/files_3dmodelviewer] IFC not working on nextcloud 24.0.6 (Issue #5)

@immomagichttps://github.com/immomagic ping

— Reply to this email directly, view it on GitHubhttps://github.com/WARP-LAB/files_3dmodelviewer/issues/5#issuecomment-1483010385, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2I5GFEUTNI3IVZERO7RE5TW5W5XTANCNFSM6AAAAAAVOYUFHU. You are receiving this because you were mentioned.Message ID: @.***>

kroko commented 1 year ago

Sorry, it is not working on our nextcloud instance 24

Unfortunately I will not try to make it work in 24 as it will be EOL 2023-05 (in 2 months) anyways

on 25 it works with a bit latency

Expected. IFC is decoded on the fly using JS + WASM web-ifc and that takes time. On desktop duration of double clicking IFC file and BIM VISION showing the contents is not instant, too, isn't it 😉, in browser it will take longer.