nextcloud / richdocuments

📑 Collabora Online for Nextcloud
https://nextcloud.com/collaboraonline
349 stars 115 forks source link

Insert images from Nextcloud file picker is broken #3312

Closed juliushaertl closed 9 months ago

juliushaertl commented 10 months ago

Insert images from Nextcloud doesn't seem to work currently.

https://sdk.collaboraonline.com/docs/advanced_integration.html#enableinsertremoteimage https://sdk.collaboraonline.com/docs/postmessage_api.html#ui-insertgraphic

Nextcloud master / richdocuments main 
COOLWSD version: 23.05.5.4 (git hash: fc0de5b (E))
LOKit version: Collabora Office 23.05.5.4 (git hash: 1681200)
Served by: Debian GNU/Linux 12 (bookworm)
Server ID: deae1ec0
dsisysteme commented 9 months ago

Same problem for us. Impossible to insert an image from Nextcloud (v27.1.4 and Richdocument 8.2.3) but it works from a local location. After the rollback of our Collabora instance to 22.05, it works again, with the same Nextcloud and Richdocument versions.

juliushaertl commented 9 months ago

@pedropintosilva This would be good to check on the online side. As far as I see the URL is properly handed over to Collabora.

pedropintosilva commented 9 months ago

I can reproduce this

13:34:12.781 [viewer] Received post message UI_InsertGraphic 
Object {  }
 false Office.vue:300
13:34:22.134 PostMessageService.sendPostMessage FRAME_DOCUMENT {"MessageId":"Action_InsertGraphic","SendTime":1702989262134,"Values":{"filename":"nb-mode-inverted.png","url":"https://share.collabora.com/index.php/apps/richdocuments/assets/QqeuBHjdtJzCW4lLnBNfYoJsFxsvDpsqdsOYA7jvJ0DSRIQmODtNPh6erBZsHSrN"}} postMessage.tsx:42:8

Could you take a look @eszkadev ?

eszkadev commented 9 months ago

I think it might be related to new coolwsd.xml setting: net.lok_allow where you need to specify allowed hosts for external communication. List automatically includes directly allowed wopi hosts, but I guess you don't configured that but use default setting: "first wopi host is allowed".

Could you check if adding nextcloud.local to net.lok_allow fixes the problem?

juliushaertl commented 9 months ago

I've also seen this on our tech-preview instance where a wopi allow list is configured but will do some tests around that.

eszkadev commented 9 months ago

@juliushaertl you reported version: 23.05.5.4 , but feature I mentioned is since: 23.05.6.2, so it is not a source of a problem, sorry for noise

eszkadev commented 9 months ago

I'm working on better warning presentation for net.lok_allow: https://github.com/CollaboraOnline/online/pull/7863 Also I can confirm the bug in 23.05.5.4 (it fails in core to fetch the image), but when testing with newer versions it works as expected for me.

juliushaertl commented 9 months ago

I can confirm this works as expected on the latest release 25.05.6.4