Files
ocis/deployments/examples/ocis_full/collabora.yml
Lukas Hirt a3601009ac fix(deployments): support Collabora Online 26.x in ocis_full example (#12794)
* fix(deployments): support Collabora Online 26.x in ocis_full example

collabora/code 26.x dropped the shell (no /bin/bash, no /bin/sh) and the
coolconfig helper the ocis_full example relied on to start the container
and generate its WOPI proof key, so the deployment failed to start and,
once patched to start, would reject every document open with a 500 since
the collaboration service enforces WOPI proof-key verification by default.

Drop the custom bash entrypoint (the image's default entrypoint already
honors extra_params/username/password via --use-env-vars), replace the
bash-based healthcheck with the built-in "coolwsd --probe", and add a
one-shot init container that generates and persists the WOPI proof key
on the host before Collabora starts.

Signed-off-by: Lukas Hirt <info@hirt.cz>

* fix(deployments): self-heal a bad WOPI proof key in ocis_full example

The collabora-proof-key-init container only checked "does /keys/proof_key
exist" before skipping generation. If the collabora service's single-file
bind mount of that path ever won the race against the init container (e.g.
on the very first `docker compose up`, or after an interrupted run), Docker
silently created a directory there instead of a file, which then persisted
across restarts and made coolwsd fail to load the proof key with an
EVPPKey::loadKey DECODER error, breaking WOPI CheckFileInfo for good.

Validate any existing proof_key with `openssl rsa -check` and remove it
before regenerating if it's missing, not a regular file, or invalid, so a
bad state (directory, truncated write, corrupt key) heals itself on the
next start instead of requiring a manual `rm -rf` of the generated config.

Signed-off-by: Lukas Hirt <info@hirt.cz>

---------

Signed-off-by: Lukas Hirt <info@hirt.cz>
2026-08-14 08:42:35 +02:00

104 lines
4.2 KiB
YAML

---
services:
traefik:
networks:
ocis-net:
aliases:
- ${COLLABORA_DOMAIN:-collabora.owncloud.test}
ocis:
environment:
# make collabora the secure view app
FRONTEND_APP_HANDLER_SECURE_VIEW_APP_ADDR: com.owncloud.api.collaboration.CollaboraOnline
GRAPH_AVAILABLE_ROLES: "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5,a8d5fe5e-96e3-418d-825b-534dbdf22b99,fb6c3e19-e378-47e5-b277-9732f9de6e21,58c63c02-1d89-4572-916a-870abc5a1b7d,2d00ce52-1fc2-4dbc-8b95-a73b73395f5a,1c996275-f1c9-4e71-abdf-a42f6495e960,312c0871-5ef7-4b3a-85b6-0e4074c64049,aa97fe03-7980-45ac-9e50-b325749fd7e6"
collaboration:
image: ${OCIS_DOCKER_IMAGE}:${OCIS_DOCKER_TAG}
networks:
ocis-net:
depends_on:
ocis:
condition: service_started
collabora:
condition: service_healthy
command: ["collaboration", "server"]
environment:
COLLABORATION_GRPC_ADDR: 0.0.0.0:9301
COLLABORATION_HTTP_ADDR: 0.0.0.0:9300
MICRO_REGISTRY: "nats-js-kv"
MICRO_REGISTRY_ADDRESS: "ocis:9233"
COLLABORATION_WOPI_SRC: http://collaboration:9300
COLLABORATION_APP_NAME: "CollaboraOnline"
COLLABORATION_APP_PRODUCT: "Collabora"
COLLABORATION_APP_ADDR: https://${COLLABORA_DOMAIN:-collabora.owncloud.test}
COLLABORATION_APP_ICON: https://${COLLABORA_DOMAIN:-collabora.owncloud.test}/favicon.ico
COLLABORATION_APP_INSECURE: "${INSECURE:-true}"
COLLABORATION_CS3API_DATAGATEWAY_INSECURE: "${INSECURE:-true}"
COLLABORATION_LOG_LEVEL: ${LOG_LEVEL:-info}
OCIS_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}
volumes:
# configure the .env file to use own paths instead of docker internal volumes
- ${OCIS_CONFIG_DIR:-ocis-config}:/etc/ocis
labels:
- "traefik.enable=true"
- "traefik.http.routers.collaboration.entrypoints=http"
- "traefik.http.routers.collaboration.rule=Host(`collaboration`)"
- "traefik.http.routers.collaboration.service=collaboration"
- "traefik.http.services.collaboration.loadbalancer.server.port=9300"
logging:
driver: ${LOG_DRIVER:-local}
restart: always
# Since collabora/code 26.x, the image ships without a shell (no /bin/bash, no /bin/sh) and
# without the "coolconfig" helper that used to generate the WOPI proof key on startup.
# This one-shot container generates and persists that key on the host before "collabora" starts.
collabora-proof-key-init:
image: alpine/openssl:latest
user: root
entrypoint: ["/bin/sh", "-c"]
command:
- |
if [ -e /keys/proof_key ] && ! openssl rsa -in /keys/proof_key -check -noout >/dev/null 2>&1; then
echo "/keys/proof_key is missing, not a regular file, or invalid; regenerating" >&2
rm -rf /keys/proof_key
fi
if [ ! -f /keys/proof_key ]; then
openssl genrsa -out /keys/proof_key 2048
chmod 644 /keys/proof_key
fi
volumes:
- ${COLLABORA_CONFIG_DIR:-./config/collabora}:/keys
collabora:
image: collabora/code:${COLLABORA_DOCKER_TAG}
networks:
ocis-net:
depends_on:
collabora-proof-key-init:
condition: service_completed_successfully
environment:
DONT_GEN_SSL_CERT: "YES"
extra_params: |
--o:ssl.enable=${COLLABORA_SSL_ENABLE:-true} \
--o:ssl.ssl_verification=${COLLABORA_SSL_VERIFICATION:-true} \
--o:ssl.termination=true \
--o:welcome.enable=false \
--o:net.frame_ancestors=${OCIS_DOMAIN:-ocis.owncloud.test}
username: ${COLLABORA_ADMIN_USER:-admin}
password: ${COLLABORA_ADMIN_PASSWORD:-admin}
volumes:
- ${COLLABORA_CONFIG_DIR:-./config/collabora}/proof_key:/etc/coolwsd/proof_key:ro
cap_add:
- MKNOD
labels:
- "traefik.enable=true"
- "traefik.http.routers.collabora.entrypoints=https"
- "traefik.http.routers.collabora.rule=Host(`${COLLABORA_DOMAIN:-collabora.owncloud.test}`)"
- "traefik.http.routers.collabora.tls.certresolver=http"
- "traefik.http.routers.collabora.service=collabora"
- "traefik.http.services.collabora.loadbalancer.server.port=9980"
logging:
driver: ${LOG_DRIVER:-local}
restart: always
healthcheck:
test: ["CMD", "/usr/bin/coolwsd", "--probe"]