CollaboraOnline / online

Collabora Online is a collaborative online office suite based on LibreOffice technology. This is also the source for the Collabora Office apps for iOS and Android.
https://collaboraonline.com
Other
1.78k stars 681 forks source link

WOPI hosts: Only first domain in each aliasgroup accepted #7508

Open vasyugan opened 11 months ago

vasyugan commented 11 months ago

Describe the Bug

I have yesterday received a bug report from a user complaining that Nextcloud office doesn't open for her. After investigating I found that only the primary domain name in each aliasgroup is now recognized, the others are ignored. This used to work just fine until fairly recently. Downgrading to the last collabora 22 makes it work again.

Steps to Reproduce

  1. Have a collabora start script passing -e 'aliasgroup1=https://cloud.DOMAIN2.org:443,https://cloud.DOMAIN2.org:443,https://cloud.DOMAIN3.org:443' to collabora
  2. Click on 'try to open a document first from DOMAIN1, then from DOMAIN2'
  3. see it succeed from DOMAIN1 but fail from DOMAIN2
  4. See docker container logs -f for the container, you will see the dreaded error message NO accpetable wopi host foud

Expected Behavior

Should open the document as up to Collabora 22

Actual Behavior

Opening the document fails, in the log I see: No acceptable WOPI hosts found matching the target host

Additional Context

Add any other context about the problem here.

Server running Ubuntu 22.04, latest docker community edition.

labiloute commented 8 months ago

Experiencing the same here, unfortunately.

SebastianS90 commented 8 months ago

I probably found the cause: The alias index is missing when storing the setting but present when reading it

labiloute commented 6 months ago

Hi @SebastianS90 Did you find a way to workaround this issue ?

SebastianS90 commented 6 months ago

@labiloute Yes. You can either change the configuration file or use command line parameters like --o:storage.wopi.alias_groups[@mode]=groups --o:storage.wopi.alias_groups.group[0].host=https://example.com:443 --o:storage.wopi.alias_groups.group[0].host[@allow]=true --o:storage.wopi.alias_groups.group[0].alias[0]=https://example.net:443

Rilele commented 5 months ago

I created a fix for this bug at https://github.com/Rilele/collabora-online/commit/4d9309c95bff6ff0d70d2ead0ab3ba9f24eb5a71 . Thanks at SebastianS90 for pointing out the exact error. Feel free to use it, but there won't be a pull request from me since I don't want to disclose my real name.