From 819cf505f8195a3f5e67739764568fb097545932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Fri, 26 Apr 2024 12:26:58 +0200 Subject: [PATCH 1/3] fix: use docker healthcheck --- .../entrypoint-override.sh | 19 --------- .../examples/ocis_wopi/docker-compose.yml | 39 ++++++++++++------- 2 files changed, 24 insertions(+), 34 deletions(-) delete mode 100755 deployments/examples/ocis_wopi/config/ocis-appprovider-onlyoffice/entrypoint-override.sh diff --git a/deployments/examples/ocis_wopi/config/ocis-appprovider-onlyoffice/entrypoint-override.sh b/deployments/examples/ocis_wopi/config/ocis-appprovider-onlyoffice/entrypoint-override.sh deleted file mode 100755 index 8df12d70c49..00000000000 --- a/deployments/examples/ocis_wopi/config/ocis-appprovider-onlyoffice/entrypoint-override.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -set -e - -apk add curl - -#TODO: app driver itself should try again until OnlyOffice is up... - -retries=10 -while [[ $retries -gt 0 ]]; do - if curl --silent --show-error --fail http://onlyoffice/hosting/discovery > /dev/null; then - ocis app-provider server - else - echo "OnlyOffice is not yet available, trying again in 10 seconds" - sleep 10 - retries=$((retries - 1)) - fi -done -echo 'OnlyOffice was not available after 100 seconds' -exit 1 diff --git a/deployments/examples/ocis_wopi/docker-compose.yml b/deployments/examples/ocis_wopi/docker-compose.yml index ce8137a3edb..253170f242a 100644 --- a/deployments/examples/ocis_wopi/docker-compose.yml +++ b/deployments/examples/ocis_wopi/docker-compose.yml @@ -36,7 +36,7 @@ services: - "80:80" - "443:443" volumes: - - "/var/run/docker.sock:/var/run/docker.sock:ro" + - "${DOCKER_SOCKET_PATH:-/var/run/docker.sock}:/var/run/docker.sock:ro" - "certs:/certs" labels: - "traefik.enable=${TRAEFIK_DASHBOARD:-false}" @@ -47,7 +47,7 @@ services: - "traefik.http.routers.traefik.tls.certresolver=http" - "traefik.http.routers.traefik.service=api@internal" logging: - driver: "local" + driver: ${LOG_DRIVER:-local} restart: always ocis: @@ -101,7 +101,7 @@ services: - "traefik.http.routers.ocis.service=ocis" - "traefik.http.services.ocis.loadbalancer.server.port=9200" logging: - driver: "local" + driver: ${LOG_DRIVER:-local} restart: always ocis-appprovider-collabora: @@ -129,17 +129,18 @@ services: volumes: - ocis-config:/etc/ocis logging: - driver: "local" + driver: ${LOG_DRIVER:-local} restart: always + depends_on: + ocis: + condition: service_started + collabora: + condition: service_healthy ocis-appprovider-onlyoffice: image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest} networks: ocis-net: - user: "0" # needed for apk add in entrypoint script - entrypoint: - - /bin/sh - - /entrypoint-override.sh #command: app-provider server environment: # use the internal service name of the gateway @@ -159,11 +160,15 @@ services: # share the registry with the ocis container MICRO_REGISTRY_ADDRESS: ocis:9233 volumes: - - ./config/ocis-appprovider-onlyoffice/entrypoint-override.sh:/entrypoint-override.sh - ocis-config:/etc/ocis logging: - driver: "local" + driver: ${LOG_DRIVER:-local} restart: always + depends_on: + ocis: + condition: service_started + onlyoffice: + condition: service_healthy wopiserver: image: cs3org/wopiserver:${WOPISERVER_DOCKER_TAG:-v10.3.0} @@ -188,7 +193,7 @@ services: - "traefik.http.routers.wopiserver.service=wopiserver" - "traefik.http.services.wopiserver.loadbalancer.server.port=8880" logging: - driver: "local" + driver: ${LOG_DRIVER:-local} restart: always collabora: @@ -211,8 +216,10 @@ services: - "traefik.http.routers.collabora.service=collabora" - "traefik.http.services.collabora.loadbalancer.server.port=9980" logging: - driver: "local" + driver: ${LOG_DRIVER:-local} restart: always + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9980/hosting/discovery"] onlyoffice: image: onlyoffice/documentserver:7.5.0 @@ -238,8 +245,10 @@ services: - "traefik.http.middlewares.onlyoffice.headers.customrequestheaders.X-Forwarded-Proto=https" - "traefik.http.routers.onlyoffice.middlewares=onlyoffice" logging: - driver: "local" + driver: ${LOG_DRIVER:-local} restart: always + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost/hosting/discovery"] tika: image: ${TIKA_IMAGE:-apache/tika:latest-full} @@ -270,7 +279,7 @@ services: - "traefik.http.routers.companion.service=companion" - "traefik.http.services.companion.loadbalancer.server.port=3020" logging: - driver: "local" + driver: ${LOG_DRIVER:-local} restart: always inbucket: @@ -293,7 +302,7 @@ services: - "traefik.http.routers.inbucket.service=inbucket" - "traefik.http.services.inbucket.loadbalancer.server.port=9000" logging: - driver: "local" + driver: ${LOG_DRIVER:-local} restart: always volumes: From 328579186a768869b6642cd93e4bd789185020f7 Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Fri, 10 May 2024 10:54:27 +0200 Subject: [PATCH 2/3] fix: service startup appprovider onlyoffice --- changelog/unreleased/fix-wopi-example.md | 5 +++++ deployments/examples/ocis_wopi/docker-compose.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/fix-wopi-example.md diff --git a/changelog/unreleased/fix-wopi-example.md b/changelog/unreleased/fix-wopi-example.md new file mode 100644 index 00000000000..de1624a802e --- /dev/null +++ b/changelog/unreleased/fix-wopi-example.md @@ -0,0 +1,5 @@ +Bugfix: Service startup of WOPI example + +We fixed a bug in the service startup of the appprovider-onlyoffice in the ocis_wopi deployment example. + +https://github.com/owncloud/ocis/pull/9127 diff --git a/deployments/examples/ocis_wopi/docker-compose.yml b/deployments/examples/ocis_wopi/docker-compose.yml index 253170f242a..70f4a2421cb 100644 --- a/deployments/examples/ocis_wopi/docker-compose.yml +++ b/deployments/examples/ocis_wopi/docker-compose.yml @@ -141,7 +141,7 @@ services: image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest} networks: ocis-net: - #command: app-provider server + command: app-provider server environment: # use the internal service name of the gateway REVA_GATEWAY: ${REVA_GATEWAY:-com.owncloud.api.gateway} From a4eb34628f28c34993c359258dd5cedff3035ffb Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Fri, 10 May 2024 11:55:42 +0200 Subject: [PATCH 3/3] fix: companion config --- .../ocis_wopi/config/ocis/web-latest.yaml | 18 ----------- .../ocis_wopi/config/ocis/web-released.yaml | 18 ----------- .../config/ocis/{web-daily.yaml => web.yaml} | 2 +- .../examples/ocis_wopi/docker-compose.yml | 4 ++- docs/ocis/deployment/ocis_wopi.md | 30 +++++++++++++++++-- 5 files changed, 32 insertions(+), 40 deletions(-) delete mode 100644 deployments/examples/ocis_wopi/config/ocis/web-latest.yaml delete mode 100644 deployments/examples/ocis_wopi/config/ocis/web-released.yaml rename deployments/examples/ocis_wopi/config/ocis/{web-daily.yaml => web.yaml} (86%) diff --git a/deployments/examples/ocis_wopi/config/ocis/web-latest.yaml b/deployments/examples/ocis_wopi/config/ocis/web-latest.yaml deleted file mode 100644 index 54c7b1b130f..00000000000 --- a/deployments/examples/ocis_wopi/config/ocis/web-latest.yaml +++ /dev/null @@ -1,18 +0,0 @@ -web: - config: - external_apps: - - id: preview - path: web-app-preview - config: - mimeTypes: - - image/tiff - - image/bmp - - image/x-ms-bmp - - id: importer - path: web-app-importer - config: - companionUrl: https://companion.ocis-wopi.latest.owncloud.works - supportedClouds: - - WebdavPublicLink - #- OneDrive # needs a client id and secret - #- GoogleDrive # needs a client id and secret and an addition to the DNS zone diff --git a/deployments/examples/ocis_wopi/config/ocis/web-released.yaml b/deployments/examples/ocis_wopi/config/ocis/web-released.yaml deleted file mode 100644 index 1a208841ff8..00000000000 --- a/deployments/examples/ocis_wopi/config/ocis/web-released.yaml +++ /dev/null @@ -1,18 +0,0 @@ -web: - config: - external_apps: - - id: preview - path: web-app-preview - config: - mimeTypes: - - image/tiff - - image/bmp - - image/x-ms-bmp - - id: importer - path: web-app-importer - config: - companionUrl: https://companion.ocis-wopi.released.owncloud.works - supportedClouds: - - WebdavPublicLink - #- OneDrive # needs a client id and secret - #- GoogleDrive # needs a client id and secret and an addition to the DNS zone diff --git a/deployments/examples/ocis_wopi/config/ocis/web-daily.yaml b/deployments/examples/ocis_wopi/config/ocis/web.yaml similarity index 86% rename from deployments/examples/ocis_wopi/config/ocis/web-daily.yaml rename to deployments/examples/ocis_wopi/config/ocis/web.yaml index b8890ac320b..9ffff94810f 100644 --- a/deployments/examples/ocis_wopi/config/ocis/web-daily.yaml +++ b/deployments/examples/ocis_wopi/config/ocis/web.yaml @@ -11,7 +11,7 @@ web: - id: importer path: web-app-importer config: - companionUrl: https://companion.ocis-wopi.daily.owncloud.works + companionUrl: https://${COMPANION_DOMAIN|companion.owncloud.test} supportedClouds: - WebdavPublicLink #- OneDrive # needs a client id and secret diff --git a/deployments/examples/ocis_wopi/docker-compose.yml b/deployments/examples/ocis_wopi/docker-compose.yml index 70f4a2421cb..bfa17fec2df 100644 --- a/deployments/examples/ocis_wopi/docker-compose.yml +++ b/deployments/examples/ocis_wopi/docker-compose.yml @@ -90,7 +90,7 @@ services: NATS_NATS_PORT: 9233 volumes: - ./config/ocis/app-registry.yaml:/etc/ocis/app-registry.yaml - - ./config/ocis/${COMPANION_WEB_CONFIG_FILE_NAME:-web.yaml}:/etc/ocis/web.yaml + - ./config/ocis/web.yaml:/etc/ocis/web.yaml - ocis-config:/etc/ocis - ocis-data:/var/lib/ocis labels: @@ -110,6 +110,7 @@ services: ocis-net: command: app-provider server environment: + OCIS_LOG_LEVEL: ${OCIS_LOG_LEVEL:-info} # use the internal service name of the gateway REVA_GATEWAY: ${REVA_GATEWAY:-com.owncloud.api.gateway} APP_PROVIDER_GRPC_ADDR: 0.0.0.0:9164 @@ -143,6 +144,7 @@ services: ocis-net: command: app-provider server environment: + OCIS_LOG_LEVEL: ${OCIS_LOG_LEVEL:-info} # use the internal service name of the gateway REVA_GATEWAY: ${REVA_GATEWAY:-com.owncloud.api.gateway} APP_PROVIDER_GRPC_ADDR: 0.0.0.0:9164 diff --git a/docs/ocis/deployment/ocis_wopi.md b/docs/ocis/deployment/ocis_wopi.md index d1becdca082..2ad994877a5 100644 --- a/docs/ocis/deployment/ocis_wopi.md +++ b/docs/ocis/deployment/ocis_wopi.md @@ -41,6 +41,7 @@ The last four containers are the WOPI server, Collabora and OnlyOffice. * onlyoffice.* for serving OnlyOffice * wopiserver.* for serving the WOPI server * traefik.* for serving the Traefik dashboard + * companion.* for serving the uppy companion app See also [example server setup]({{< ref "preparing_server" >}}) @@ -68,7 +69,7 @@ See also [example server setup]({{< ref "preparing_server" >}}) TRAEFIK_DASHBOARD= # Domain of Traefik, where you can find the dashboard. Defaults to "traefik.owncloud.test" TRAEFIK_DOMAIN= - # Basic authentication for the dashboard. Defaults to user "admin" and password "admin" + # Basic authentication for the dashboard. Defaults to user "admin" and password "admin" (written as: "admin:admin"). TRAEFIK_BASIC_AUTH_USERS= # Email address for obtaining LetsEncrypt certificates, needs only be changed if this is a public facing server TRAEFIK_ACME_MAIL= @@ -83,6 +84,8 @@ See also [example server setup]({{< ref "preparing_server" >}}) # The demo users should not be created on a production instance # because their passwords are public. Defaults to "false". DEMO_USERS= + # Log level for oCIS. Defaults to "info". + OCIS_LOG_LEVEL= ### Wopi server settings ### # cs3org wopi server version. Defaults to "v8.3.3" @@ -95,7 +98,7 @@ See also [example server setup]({{< ref "preparing_server" >}}) ### Collabora settings ### # Domain of Collabora, where you can find the frontend. Defaults to "collabora.owncloud.test" COLLABORA_DOMAIN= - # Admin user for Collabora. Defaults to blank, provide one to enable access + # Admin user for Collabora. Defaults to blank, provide one to enable access. Collabora Admin Panel URL: https://{COLLABORA_DOMAIN}/browser/dist/admin/admin.html COLLABORA_ADMIN_USER= # Admin password for Collabora. Defaults to blank, provide one to enable access COLLABORA_ADMIN_PASSWORD= @@ -103,6 +106,27 @@ See also [example server setup]({{< ref "preparing_server" >}}) ### OnlyOffice settings ### # Domain of OnlyOffice, where you can find the frontend. Defaults to "onlyoffice.owncloud.test" ONLYOFFICE_DOMAIN= + + ### Email / Inbucket settings ### + # Inbucket / Mail domain. Defaults to "mail.owncloud.test" + INBUCKET_DOMAIN= + + ### Apache Tika Content analysis toolkit ### + # Set the desired docker image tag or digest, defaults to "latest" + TIKA_IMAGE= + + # If you want to use debugging and tracing with this stack, + # you need uncomment following line. Please see documentation at + # https://owncloud.dev/ocis/deployment/monitoring-tracing/ + #COMPOSE_FILE=docker-compose.yml:monitoring_tracing/docker-compose-additions.yml + + ### Uppy Companion settings ### + # Domain of Uppy Companion. Defaults to "companion.owncloud.test" + COMPANION_IMAGE= + COMPANION_DOMAIN= + # Provider settings, see https://uppy.io/docs/companion/#provideroptions for reference. Empty by default, which disables providers. + COMPANION_ONEDRIVE_KEY= + COMPANION_ONEDRIVE_SECRET= ``` You are installing oCIS on a server and Traefik will obtain valid certificates for you so please remove `INSECURE=true` or set it to `false`. @@ -152,6 +176,8 @@ On Linux and macOS you can add them to your `/etc/hosts` file and on Windows to 127.0.0.1 collabora.owncloud.test 127.0.0.1 onlyoffice.owncloud.test 127.0.0.1 wopiserver.owncloud.test +127.0.0.1 mail.owncloud.test +127.0.0.1 companion.owncloud.test ``` After that you're ready to start the application stack: