Collabora Online Documentation

repository·main·Indexed 25 days ago

https://github.com/collaboraonline/online

Documentation for Collabora Online, a high-performance online office suite. This resource provides guides on building Docker images from source, deploying to Kubernetes using Helm, and configuring Ingress for HAProxy or Nginx to ensure session affinity via WOPISrc. It includes detailed instructions for OpenShift deployment, integrating with the COOL Controller, setting up remote dynamic configuration, and enabling monitoring with Prometheus and Grafana or logging via the Logging Operator.

Tokens
3.7K
Snippets
9
Records
13
Agent score
35%

What's inside Collabora Online

  1. Overview of Collabora Online repository usage

    main

    This repository serves as a distribution point for Collabora Online artifacts and an issue tracker. It is NOT the primary location for source code development.

    • Issue Tracking: Use this repository to report bugs and request features.
    • Release Artifacts: This repository hosts the nightly container image, the Helm chart, and build assets.
    • Source Code: Active development and code review occur on the Collabora Gerrit instance. Pull requests to this GitHub repository are only accepted for the Helm chart (kubernetes/helm/) and the docker image build (docker/from-source-gh-action/).
    • Code Mirror: A read-only mirror of the source code is available at CollaboraOnline/online.mirror.
  2. Build the Collabora Online Docker image locally from source

    main

    You can build a Docker image from the source code using the Dockerfile provided in this directory. This approach isolates the build process within a Docker container, ensuring the build environment is independent of your host machine. Note that the engine currently uses prebuilt binaries rather than being built entirely from source.

    docker build -t code .
  3. Wire Collabora Online with the COOL Controller

    main

    When using the COOL Controller, you must configure the reverse proxy to hash on RouteToken and split the controller URLs. The client-facing indirection_endpoint.url must go through the proxy, while the monitors.monitor WebSocket should point directly to the controller Service in-cluster to avoid passing through nginx.

    Configuration Pattern:

    1. Set reverseProxy.hashParam to RouteToken.
    2. Enable reverseProxy.controller.enabled.
    3. Set collabora.extra_params with the external host for the indirection endpoint and the internal cluster DNS for the monitor WebSocket.
    reverseProxy:
      enabled: true
      hashParam: RouteToken
      controller:
        enabled: true
        upstream: cool-controller.collabora.svc.cluster.local:9000
      route:
        enabled: true
        host: cool.apps.example.com
    
    collabora:
      extra_params: >-
        --o:ssl.enable=false
        --o:ssl.termination=false
        --o:indirection_endpoint.url=http://cool.apps.example.com/controller/routeToken
        --o:monitors.monitor[0]=ws://cool-controller.collabora.svc.cluster.local:9000/controller/ws
        --o:monitors.monitor[0][@retryInterval]=5
  4. Deploy Collabora Online in Kubernetes using Helm

    main

    To deploy Collabora Online on Kubernetes, you must use Helm and ensure your Ingress Controller supports session affinity based on the WOPISrc parameter. This ensures that all users editing the same document and all clipboard requests are served by the same pod, which is vital for collaborative editing and copy/paste functionality.

    Prerequisites

    1. Install Helm.
    2. Set up an Ingress Controller (Nginx or HAProxy).
      • Note for OpenShift: It is recommended to deploy the HAProxy Kubernetes Ingress in the collabora namespace instead of the default OpenShift Router, as the Router lacks necessary advanced annotations.

    Installation Steps

    1. Create a my_values.yaml file with your specific configuration (see configuration guides below).
    2. Add the Collabora Helm repository:
      helm repo add collabora https://collaboraonline.github.io/online/
    3. Install the chart:
      helm install --create-namespace --namespace collabora collabora-online collabora/collabora-online -f my_values.yaml
    helm repo add collabora https://collaboraonline.github.io/online/
    helm install --create-namespace --namespace collabora collabora-online collabora/collabora-online -f my_values.yaml
  5. Deploy Collabora Online in Kubernetes using Helm

    main

    Deploy Collabora Online using the Helm chart. For production environments, it is recommended to set specific resource limits and use extra_params to pre-spawn child processes to handle new clients efficiently.

    Recommended Production Settings:

    • Pre-spawn children: Append --o:num_prespawn_children=4 to collabora.extra_params.
    • Resource Requests:
      • CPU: 4000m
      • Memory: 6000Mi
    • Resource Limits:
      • CPU: 8000m
      • Memory: 8000Mi
  6. Enable Monitoring and Logging

    main

    Collabora Online supports integration with kube-prometheus-stack for monitoring and the Logging Operator for log management.

    Monitoring with Prometheus and Grafana

    To enable monitoring, ensure your my_values.yaml includes the prometheus and grafana blocks. If using kube-prometheus-stack, use that as the release name so labels match.

    Logging with Logging Operator

    To enable logging, set logging.enabled: true. You can use ecs: true to remap fields to the Elastic Common Schema and additionalFilters to exclude noisy logs (e.g., info/debug/trace levels).

    ### Monitoring Configuration
    ```yaml
    prometheus:
      servicemonitor:
         enabled: true
         labels:
            release: "kube-prometheus-stack"
      rules:
         enabled: true
         additionalLabels:
            release: "kube-prometheus-stack"
    grafana:
      dashboards:
         enabled: true

    Logging Configuration

    logging:
      enabled: true
      ecs: true
      dedot: "-"
      additionalFilters:
        - grep:
            exclude:
              - key: "$['log']['level']"
                pattern: '/(info|debug|trace)/'
      globalOutputRefs:
        - "default"
  7. OpenShift Quickstart Guide

    main

    To serve Collabora through the default OpenShift Router using the in-namespace proxy, use the following Helm configuration. Note that in restricted-v2 environments, the per-document jail is disabled and working paths must be moved to /tmp using extraVolumes and extraVolumeMounts.

    Required extra_params for OpenShift:

    • --o:ssl.enable=false
    • --o:ssl.termination=false
    • --o:security.capabilities=false
    • --o:child_root_path=/tmp/coolwsd-child-roots
    • --o:cache_files.path=/tmp/coolwsd-cache
    helm install collabora-online collabora/collabora-online -n collabora \
      --set replicaCount=3 \
      --set 'collabora.aliasgroups[0].host=https://your-wopi-host' \
      --set 'securityContext.runAsNonRoot=true' \
      --set 'securityContext.seccompProfile.type=RuntimeDefault' \
      --set 'securityContext.capabilities.drop[0]=ALL' \
      --set 'collabora.extra_params=--o:ssl.enable=false --o:ssl.termination=false --o:security.capabilities=false --o:child_root_path=/tmp/coolwsd-child-roots --o:cache_files.path=/tmp/coolwsd-cache' \
      --set reverseProxy.enabled=true \
      --set reverseProxy.route.enabled=true \
      --set reverseProxy.route.host=cool.apps.example.com
  8. Configure Ingress for HAProxy or Nginx

    main

    Collabora Online requires specific Ingress annotations to handle long-lived connections and ensure document affinity via the WOPISrc URL parameter.

    HAProxy Configuration

    Use balance url_param WOPISrc to ensure all URLs containing the same WOPISrc are routed to the same pod. Use hash-type consistent for better distribution.

    Nginx Configuration

    Use the upstream-hash-by annotation with $arg_WOPISrc to achieve document affinity.

    Important: Horizontal Pod Autoscaling (HPA) is currently disabled because scaling events can break collaborative editing and copy/paste. Set replicaCount manually based on your needs.

    ### HAProxy Example
    ```yaml
    ingress:
      enabled: true
      className: "haproxy"
      annotations:
         haproxy.org/timeout-tunnel: "3600s"
         haproxy.org/backend-config-snippet: |
            balance url_param WOPISrc check_post
            hash-type consistent

    Nginx Example

    ingress:
      enabled: true
      className: "nginx"
      annotations:
         nginx.ingress.kubernetes.io/upstream-hash-by: "$arg_WOPISrc"
         nginx.ingress.kubernetes.io/proxy-body-size: "0"
         nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
         nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
  9. Configure In-namespace Reverse Proxy for Session Affinity

    main

    Collabora Online requires session affinity (every request for a document must reach the same pod). If you cannot use an Ingress controller (e.g., in OpenShift), enable the in-namespace nginx reverse proxy using reverseProxy.enabled=true.

    Key Configuration Options:

    • reverseProxy.enabled: Enables the nginx deployment and associated services.
    • reverseProxy.hashParam: Determines the hashing parameter. Use WOPISrc (default) for standalone deployments. Use RouteToken when running with the COOL Controller.
    • reverseProxy.endpointReloader.enabled: Enables a sidecar to reload nginx when pods change. Set to false if your cluster forbids shared process namespaces.
    • reverseProxy.controller.enabled: When true, proxies only the client-facing /controller endpoint.
    • reverseProxy.controller.upstream: The service address for the COOL Controller (e.g., cool-controller.namespace.svc.cluster.local:9000).
  10. Configure Remote/Dynamic Configuration

    main

    To avoid restarting pods when modifying WOPI hosts, you can use Remote/Dynamic Configuration. This allows Collabora to fetch configuration from an external webserver via a JSON file.

    Setup Requirements

    1. Set the remoteconfigurl environment variable in the collabora.env section.
    2. Enable dynamicConfig.enabled: true in your my_values.yaml.
    3. Note: The remoteconfigurl currently only supports HTTPS.

    Example Configuration

    collabora:
       env:
          - name: remoteconfigurl
             value: https://dynconfig.public.example.com/config/config.json
    
    dynamicConfig:
       enabled: true
       ingress:
          enabled: true
          hosts:
          - host: "dynconfig.public.example.com"
       configuration:
          kind: "configuration"
          storage:
             wopi:
             alias_groups:
                groups:
                - host: "https://domain1\\.xyz\\.abc\\.com/"
                   allow: true
    collabora:
       env:
          - name: remoteconfigurl
             value: https://dynconfig.public.example.com/config/config.json
    
    dynamicConfig:
       enabled: true
       ingress:
          enabled: true
          hosts:
          - host: "dynconfig.public.example.com"
       configuration:
          kind: "configuration"
          storage:
             wopi:
             alias_groups:
                groups:
                - host: "https://domain1\\.xyz\\.abc\\.com/"
                   allow: true
  11. Configure Production Resources and Parameters

    main

    For production environments, it is recommended to use higher resource limits and pre-spawn child processes to reduce latency for new clients.

    • Pre-spawning: Append --o:num_prespawn_children=4 to extra_params to keep child processes ready.
    • Resource Limits: Use higher CPU and Memory limits to handle concurrent editing sessions.
    resources:
      limits:
        cpu: "8000m"
        memory: "8000Mi"
      requests:
        cpu: "4000m"
        memory: "6000Mi"
    collabora:
      extra_params: --o:ssl.enable=false --o:ssl.termination=true --o:num_prespawn_children=4
    
    resources:
      limits:
        cpu: "8000m"
        memory: "8000Mi"
      requests:
        cpu: "4000m"
        memory: "6000Mi"
  12. Use `extraObjects` to deploy custom Gateway manifests

    main

    If your cluster uses a gateway not explicitly supported by the chart (e.g., Apache APISIX, Traefik, Istio, Kong), you can deploy custom Kubernetes manifests using the extraObjects field.

    extraObjects accepts a list of arbitrary manifests. Each entry is passed through the tpl function, allowing you to use Helm template syntax (e.g., {{ include "collabora-online.fullname" . }}) to reference release values.

    extraObjects:
      - apiVersion: apisix.apache.org/v2
        kind: ApisixRoute
        metadata:
          name: '{{ include "collabora-online.fullname" . }}'
        spec:
          http:
            - name: collabora
              match:
                hosts: ["office.example.com"]
                paths: ["/*"]
              backends:
                - serviceName: '{{ include "collabora-online.fullname" . }}'
                  servicePort: '{{ .Values.service.port }}'