Easiest way to allow multiple hosts using Collabora

I had Collabora COOL running smoothly together with Sync-in, without doing much nifty configuration. (And written it down in a tutorial.)
Then I discovered NextExplorer that should also be able to open files using Collabora, but its WOPI connections were refused.

I’ve searched and found that one way to overcome this is to edit the ‘storage’ section in coolwsd.xml with groups. This appears a bit overwhelming to me, because - to my understanding - I now need to configure each possible WOPI host, i.e. https://sync-in.mydomain.tld and its local equivalent http://192.168.2.211 and https://nextexplorer.mydomain.tld and its local equivalent http://192.168.2.211 and possibly other ones in the future. Or should those be localhost 127.0.0.0? I don’t know about this stuff.

Is there an easier way to allowing Collabora COOL accepting different hosts?

Good question; you can use a regexp - but it matches just the hostname - so nextexplorere.mydomain.tld should match ‘.*\.mydomain\.tld’

The complexity of groups is to handle the world of single servers being mapped to multiple domain-names in interesting ways IIRC.

Hope that helps; and glad you got up & running fast :slight_smile:

Thanks for this @mmeeks.
What’s that with the extra slashes?

And how can I arrange that the internal instances of sync-in and nextexplorer are accepted as wopi hosts? Because, since I’ve edited the coolwsd.xml with mode=groups they’re refused.

The extra slashes are just regex escaping: a dot has to be written as \. so it matches a literal dot instead of any character. For the internal instances, I’d add their hostnames or IPs as separate host entries in the same group (for example 192\.168\.2\.211 alongside the public hostname), since the match is done against the host part only and not the port. After editing coolwsd.xml, restart the container and check the log to confirm which hosts it accepted.

That’s possible with aliasgroup1, aliasgroup2, aliasgroup3, and so on.

https://sdk.collaboraonline.com/docs/installation/CODE_Docker_image.html#setting-the-application-configuration-dynamically-via-environment-variables

Something like this, untested:

services:
  collabora:
    image: collabora/code:<version>
    environment:
      - aliasgroup1=https://example.com:443
      - aliasgroup2=https://example.net:443
  (..)