mirror of
https://github.com/opencloud-eu/opencloud-compose.git
synced 2026-08-07 12:28:43 +08:00
feat: add proof key side car
This commit is contained in:
@@ -23,22 +23,50 @@ services:
|
||||
COLLABORATION_APP_INSECURE: "${INSECURE:-true}"
|
||||
COLLABORATION_CS3API_DATAGATEWAY_INSECURE: "${INSECURE:-true}"
|
||||
|
||||
# One-shot service that generates the WOPI proof key on first start and
|
||||
# keeps it in a named volume, like the proofKeyGeneration feature of the
|
||||
# collabora-online helm chart.
|
||||
# To rotate the key, remove the volume and start again:
|
||||
# docker compose down collabora && docker volume rm <project>_collabora-proof-key
|
||||
collabora-proof-key:
|
||||
image: alpine/openssl:3.5.7
|
||||
entrypoint: ["/bin/sh"]
|
||||
command:
|
||||
- -ec
|
||||
- |
|
||||
if [ ! -s /proof/proof_key ]; then
|
||||
openssl genrsa -traditional -out /proof/proof_key.tmp 4096
|
||||
chown 1001:1001 /proof/proof_key.tmp
|
||||
chmod 400 /proof/proof_key.tmp
|
||||
mv /proof/proof_key.tmp /proof/proof_key
|
||||
echo "WOPI proof key generated"
|
||||
else
|
||||
echo "WOPI proof key already exists"
|
||||
fi
|
||||
volumes:
|
||||
- collabora-proof-key:/proof
|
||||
logging:
|
||||
driver: ${LOG_DRIVER:-local}
|
||||
restart: "no"
|
||||
|
||||
collabora:
|
||||
image: collabora/code:26.04.2.4.1
|
||||
# release notes: https://www.collaboraonline.com/release-notes/
|
||||
networks:
|
||||
opencloud-net:
|
||||
depends_on:
|
||||
collabora-proof-key:
|
||||
condition: service_completed_successfully
|
||||
environment:
|
||||
# WOPI host allowlist; the WOPI endpoint is served by the opencloud proxy on the opencloud domain
|
||||
aliasgroup1: https://${OC_DOMAIN:-cloud.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-}
|
||||
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=${OC_DOMAIN:-cloud.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-}
|
||||
--o:net.lok_allow.host[14]=${OC_DOMAIN:-cloud.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-}
|
||||
--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=${OC_DOMAIN:-cloud.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-}
|
||||
--o:net.lok_allow.host[14]=${OC_DOMAIN:-cloud.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-}
|
||||
--o:home_mode.enable=${COLLABORA_HOME_MODE:-false}
|
||||
username: ${COLLABORA_ADMIN_USER:-admin}
|
||||
password: ${COLLABORA_ADMIN_PASSWORD:-admin}
|
||||
@@ -52,11 +80,24 @@ services:
|
||||
# (e.g. Microsoft fonts like Arial, Calibri, Cambria by installing the `ttf-mscorefonts-installer` package).
|
||||
- /usr/share/fonts/truetype:/usr/share/fonts/truetype/more:ro
|
||||
- /usr/share/fonts/truetype:/opt/cool/systemplate/usr/share/fonts/truetype/more:ro
|
||||
# WOPI proof key generated by the collabora-proof-key service.
|
||||
- type: volume
|
||||
source: collabora-proof-key
|
||||
target: /etc/coolwsd/proof_key
|
||||
read_only: true
|
||||
volume:
|
||||
subpath: proof_key
|
||||
logging:
|
||||
driver: ${LOG_DRIVER:-local}
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD", "/usr/bin/coolwsd", "--probe"]
|
||||
# --use-env-vars makes the probe read extra_params, so it probes with
|
||||
# the same http/https scheme the server actually runs with; without it
|
||||
# the probe falls back to coolwsd.xml where ssl.enable defaults to true
|
||||
test: ["CMD", "/usr/bin/coolwsd", "--probe", "--use-env-vars"]
|
||||
interval: 15s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
collabora-proof-key:
|
||||
|
||||
Reference in New Issue
Block a user