Configuring Collabora Online
This guide helps to install and configure CODE (Collabora Online Development Edition) with OpenKM.
CODE is WOPI compliant. Read the specification at https://wopi.readthedocs.io/projects/wopirest/en/latest/index.html.
Once you have installed Collabora Online, you must enable the online editor extension in the user profile. More information at Enable extensions .
Code installation
First, find out the IP address of the computer, e.g. 192.168.1.38 henceforth, we will use this IP for this guide.
Run the following commands:
- Get the CODE image from the Docker image
$ docker pull collabora/code
- Run the Docker container
$ docker run --name collabora -p 9980:9980 -e "username=admin" -e "password=********" -e "extra_params=--o:ssl.enable=false" collabora/code
- Logs
$ docker logs <docker container name>
Code access
For more information about docker image https://sdk.collaboraonline.com/docs/installation/CODE_Docker_image.html
Test it, run this command or put the url in your web browser; you should get the OK string if everything is in order:
$ curl -k http://192.168.1.38:9980
Administration UI (user = admin, password =********):
For 21.11.2.4.1 and before versions, open your web browser and run the following url: http://192.168.1.38:9980/loleaflet/dist/admin/admin.html
- Open your web browser and run the following url: http://192.168.1.38:9980/browser/dist/admin/admin.html
Discovery:
- Open your web browser and run the following url: http://192.168.1.38:9980/hosting/discovery
Capabilities:
- Open your web browser and run the following url: http://192.168.1.38:9980/hosting/capabilities
Code configuration
- Copy out the config file:
$ docker cp <docker container name>:/etc/loolwsd/loolwsd.xml loolwsd.xml
- Edit the config file with your favorite editor, then save and copy it back to the container:
$ docker cp loolwsd.xml <docker container name>:/etc/loolwsd/loolwsd.xml
The configuration by default is enough.
WOPI validator
This is for validating the REST endpoints of the WOPI host (OpenKM)
- Install it:
docker pull tylerbutler/wopi-validator
- Run it:
docker run -it --rm tylerbutler/wopi-validator -- -w http://localhost:8080/openkm/wopi/files/80ffd1eb-a6b8-4ec2-adc1-a58b23815eaf -t <openkm token> -l 36000000
80ffd1eb-a6b8-4ec2-adc1-a58b23815eaf is the uuid of a document in OpenKM.
OpenKM configuration
Edit the following configuration parameters from OpenKM administration:
Collabora source IP is in a Docker network range, usually like 172.17.x.x, so this IP should be configured at collabora.ip configuration parameter The authentication token used between collabora and OpenKM is restricted by IP, which means only the IP of Collabora will be able to use it.
If unsure about Collabora IP, look into the log file for an error message like "Error validating token IP where {} != {}", or enter within the docker container (docker exec -it name_container bash) and see the IP: cat /etc/hosts
# value samples
online.office.action.url = http://192.168.1.38:8080/openkm/wopi/files
online.office.url = http://192.168.1.38:9980/hosting/discovery
online.office.ip = 172.17.0.2
Parameters
- online.office.action.url: URL used by Collabora Docker container to connect to OpenKM WOPI REST endpoint.
- online.office.url: URL used by OpenKM to connect to Collabora Docker container.
- online.office.ip: Source IP used by Collabora to authenticate to OpenKM.
Sample URLs
- http://localhost:8080/openkm/onlineOffice/collabora?uuid=3101021e-d38c-47eb-8ad7-c8e51578b6d9
- http://192.168.1.38:8080/openkm/onlineOffice/collabora?uuid=3101021e-d38c-47eb-8ad7-c8e51578b6d9
- http://192.168.1.38:8080/openkm/onlineOffice/collabora?uuid=3101021e-d38c-47eb-8ad7-c8e51578b6d9&lang=en-gb
Other sample configuration
In this scenario, Collabora also runs on Docker (172.17.0.2) and OpenKM on the host server (172.17.0.1).
- online.office.action.url: http://172.17.0.1:8080/openkm/wopi/files
- online.office.url: 172.17.0.2
- online.office.ip: http://172.17.0.2:9980/hosting/discovery
You should access OpenKM using http://172.17.0.1:8080/openkm/.