wiki/nextcloud-collabora.md

2.8 KiB

title description published date tags
Nextcloud & Collabora How to configure a properly working setup using Traefik true 2019-07-01T15:03:47.592Z

Requirements

Our setup relies heavily on traefik and won't work without it. See our traefik configuration page on how to prepare your system to accept this configuration.

docker-compose.yml

version: '3.7'

services:

  nextcloud:
    image: nextcloud:16
    depends_on:
      - postgres
      - collabora
      - redis
    volumes:
      - ./nextcloud:/var/www/html
    restart: unless-stopped
    environment:
      - NEXTCLOUD_TRUSTED_DOMAINS=cloud.fosc.space
      - POSTGRES_HOST=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=aaaaaaaaaaaaa
      - POSTGRES_DB=nextcloud
      - REDIS_HOST=redis
    labels:
      - "traefik.frontend.rule=Host:cloud.fosc.space"
      - "traefik.frontend.headers.STSSeconds=15552000"
      - "traefik.frontend.redirect.regex=https://(.*)/.well-known/(card|cal)dav"
      - "traefik.frontend.redirect.replacement=https://$$1/remote.php/dav/"
      - "traefik.frontend.redirect.permanent=true"

  postgres:
    image: postgres:alpine
    restart: unless-stopped
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=aaaaaaaaaaaaa
    volumes:
      - ./db:/var/lib/postgresql/data
    labels:
      - traefik.enable=false

  collabora:
    image: collabora/code
    restart: unless-stopped
    environment:
      - username=admin
      - password=eeeeeeeeeeeee
      - DONT_GEN_SSL_CERT=true
      - "domain=cloud\\.fosc\\.space"
      - "extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:storage.wopi.host[0]=::ffff:[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+ --o:net.post_allow.host[0]=::ffff:[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+ --o:storage.wopi.host[1]=[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+ --o:net.post_allow.host[1]=[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+ --o:storage.wopi.host[2]=cloud.fosc.space"
    labels:
      - "traefik.frontend.rule=Host:collabora.fosc.space"
      - "traefik.port=9980"

  redis:
    image: redis
    restart: unless-stopped
    labels:
      - traefik.enable=false

Nextcloud configuration

Once everything is up and running, install the Collabora plugin for Nextcloud and configure the following in its settings page:

URL (and Port) of Collabora Online-server: https://collabora.fosc.space:443 {.is-info}

Quirks

Due to issues within Nextcloud 16, the installer cannot initialize its database properly in postgres. This setup requires a workaround for a first start, a pre existing database, or another database engine.

The Collabora container is extremely slow to start and seems to work about only half the time. If stuff isn't working, just restart it once or twice. Eventually it will work.

This configuration is 100% working and any attempt at touching it will just make it worse. {.is-warning}