Skip to content

Collabora Integration

Ralf Becker edited this page Nov 19, 2024 · 13 revisions

Collabora Integration

EGroupware allows to edit office files online via Collabora Online Office directly within EGroupware Filemanager app.

Installation

In a default package installation just add the egroupware-collabora-key package to your system. It installs Collabora Online Office in it's supported version via a Docker container.

After the package installation you have to log into EGroupware and go to Administration >> Application >> Collabora >> Site configuration and save the configuration page once, in order for it to write the correct Collabora configuration to /var/lib/egroupware/default/loolwsd/loolwsd.xml. Collabora container should restart automatically which can take 1-2 minutes!

It shows an Unsupported, the support-key is missing watermark, unless you buy a support-key from Collabora through EGroupware GmbH: https://www.egroupware.org/collabora-office/#order

You can also use Collaboras CODE container for development and testing purpose, by using collabora/code:latest as image name in your /etc/egroupware-collabora-key/docker-compose.yml. There are some restrictions in the number of concurrent users with CODE!

Troubleshooting

Administration >> Application >> Collabora >> Site configuration shows "Unable to load https://your.domain"

Try loading the address https://your.domain/hosting/discovery (replacing your.domain with your actual domain name). If it loads in your browser and shows a xml file, you have a problem with EGroupware server loading the file via it's (external) address from the Collabora container. This is most like a problem of your firewall not allowing your server to access itself via it's external address aka NAT reflection.

There are two ways to solve this:

1.) in Docker by telling it to use the internal IP address when accessing the external URL

There is a commented external_host setting in both EGroupware /etc/egroupware-docker/docker-compose.yml and Collabora /etc/egroupware-collabora-key/docker-compose.yml docker-compose file:

    #extra_hosts:
    #- "my.host.name:ip-address"

modify both to:

    extra_hosts:
    - "<your-domain>:172.17.0.1"

This writes your domain-name with the default IP of the docker0 bridge (172.17.0.1) in the /etc/hosts file of both container. Please verify that you actually use the Default IP (Docker Desktop for MacOS does not!). You can also use whatever internal IP your server uses.

Then restart both Docker container by running

cd /etc/egroupware-docker
docker-compose up -d
cd /etc/egroupware-collabora-key
docker-compose up -d

2.) with the correct configuration on your firewall allowing your server to access itself via it's external address

Out of scope of this article.

3.) Actions to convert editable files to PDF or PNG need some extra Settings - same is valid for the checkbox to merge file as PDF

This function from Collabora SDK API uses a different data access than usual when opening and saving documents from filemanager. Therefore, further configuration settings are usually necessary. However, it always depends on the environment and can be different. Please take care for a backup, before you change configurations! In case you need support, get in touch with us info@egroupware.org

Find out the EGroupware Docker Network:

docker network inspect egroupware-docker_default | grep Subnet
=>
“Subnet”: “172.19.0.0/16”,

In /var/lib/egroupware/loolwsd/loolwsd.xml

add under
<net desc="Network settings">

two lines:

<host desc="The IPv6 loopback (localhost) address.">172\.19\.[0-9]{1,3}\.[0-9]{1,3}</host>
<host desc="The IPv6 loopback (localhost) address.">::ffff:172\.19\.[0-9]{1,3}\.[0-9]{1,3}</host>

Add in /etc/egroupware-docker/docker-egroupware.override.yml

under

   environment:
configure

extra_hosts:
- "sub.domain.tld:172.17.0.1"

Collabora Docker container needs to be restarted.

Adding further fonts

  1. create a directory on the EGroupware host /var/www/html/fonts
  2. create sub-directories for each font-family and copy the font / the *.ttf files there e.g. my-font
  3. create a JSON file /var/www/html/fonts/fonts.json like
{
    "kind": "fontconfiguration",
    "server": "example.egroupware.org", <-- replace with your (fully qualified) hostname
    "fonts": [
        {"uri":"https://example.egroupware.org/fonts/source-sans/TTF/SourceSans3-Black.ttf"},
        {"uri":"https://example.egroupware.org/fonts/source-sans/TTF/SourceSans3-BlackIt.ttf"},
        {"uri":"https://example.egroupware.org/fonts/source-sans/TTF/SourceSans3-Bold.ttf"},
        {"uri":"https://example.egroupware.org/fonts/source-sans/TTF/SourceSans3-BoldIt.ttf"},
        --> more font-files listed here
        {"uri":"https://example.egroupware.org/fonts/source-code-pro/TTF/SourceCodePro-SemiboldIt.ttf"}
    ]
}
  1. check the JSON syntax, e.g. with jq: jq < /var/www/html/fonts/fonts.json
  2. edit your /var/lib/egroupware/default/loolwsd/coolwsd.xml and add the following e.g. before the closing </config>:
    <remote_font_config>
        <url desc="URL of optional JSON file that lists fonts to be included in Online" type="string" default="">https://example.egroupware.org/fonts/fonts.json</url>
    </remote_font_config>

</config>
  1. Collabora container should automatically restart and the new font(s) should be available

for more information see the Collabora Online SDK

Clone this wiki locally