From 754f6cc28a16a023bcf499f43b7394c04e2af5a5 Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Mon, 3 Jul 2023 18:41:44 +0200 Subject: [PATCH 1/2] Add uppy companion to wopi example --- deployments/examples/ocis_wopi/.env | 5 ++++ .../examples/ocis_wopi/docker-compose.yml | 28 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/deployments/examples/ocis_wopi/.env b/deployments/examples/ocis_wopi/.env index 2a93d76da8b..8ce2f94c3c1 100644 --- a/deployments/examples/ocis_wopi/.env +++ b/deployments/examples/ocis_wopi/.env @@ -55,3 +55,8 @@ TIKA_IMAGE= # 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 +COMPANION_DOMAIN= +COMPANION_ONEDRIVE_KEY= +COMPANION_ONEDRIVE_SECRET= diff --git a/deployments/examples/ocis_wopi/docker-compose.yml b/deployments/examples/ocis_wopi/docker-compose.yml index f4ebf314066..8d540504978 100644 --- a/deployments/examples/ocis_wopi/docker-compose.yml +++ b/deployments/examples/ocis_wopi/docker-compose.yml @@ -11,6 +11,7 @@ services: - ${WOPISERVER_DOMAIN:-wopiserver.owncloud.test} - ${COLLABORA_DOMAIN:-collabora.owncloud.test} - ${ONLYOFFICE_DOMAIN:-onlyoffice.owncloud.test} + - ${COMPANION_DOMAIN:-companion.owncloud.test} command: - "--log.level=${TRAEFIK_LOG_LEVEL:-ERROR}" # letsencrypt configuration @@ -245,6 +246,32 @@ services: ocis-net: restart: always + companion: + image: ${COMPANION_IMAGE:-transloadit/companion:4.5.1} + networks: + ocis-net: + environment: + NODE_ENV: production + NODE_TLS_REJECT_UNAUTHORIZED: 0 + COMPANION_DATADIR: /tmp/companion/ + COMPANION_DOMAIN: ${COMPANION_DOMAIN:-companion.owncloud.test} + COMPANION_PROTOCOL: https + COMPANION_UPLOAD_URLS: ${OCIS_DOMAIN:-ocis.owncloud.test} + COMPANION_ONEDRIVE_KEY: "${COMPANION_ONEDRIVE_KEY}" + COMPANION_ONEDRIVE_SECRET: "${COMPANION_ONEDRIVE_SECRET}" + volumes: + - companion-data:/tmp/companion/ + labels: + - "traefik.enable=true" + - "traefik.http.routers.companion.entrypoints=https" + - "traefik.http.routers.companion.rule=Host(`${COMPANION_DOMAIN:-companion.owncloud.test}`)" + - "traefik.http.routers.companion.tls.certresolver=http" + - "traefik.http.routers.companion.service=companion" + - "traefik.http.services.companion.loadbalancer.server.port=3020" + logging: + driver: "local" + restart: always + inbucket: image: inbucket/inbucket networks: @@ -273,6 +300,7 @@ volumes: ocis-config: ocis-data: wopi-recovery: + companion-data: networks: ocis-net: From 3860ed442bfc3677775702a94e595bedc2f47b49 Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Mon, 3 Jul 2023 20:41:46 +0200 Subject: [PATCH 2/2] Add comments to .env file --- .../ocis_wopi/daily.yml | 3 +++ .../ocis_wopi/latest.yml | 3 +++ .../ocis_wopi/released.yml | 3 +++ deployments/examples/ocis_wopi/.env | 8 ++++++-- .../ocis_wopi/config/ocis/web-daily.yaml | 18 ++++++++++++++++++ .../ocis_wopi/config/ocis/web-latest.yaml | 18 ++++++++++++++++++ .../ocis_wopi/config/ocis/web-released.yaml | 18 ++++++++++++++++++ .../examples/ocis_wopi/docker-compose.yml | 3 ++- 8 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 deployments/examples/ocis_wopi/config/ocis/web-daily.yaml create mode 100644 deployments/examples/ocis_wopi/config/ocis/web-latest.yaml create mode 100644 deployments/examples/ocis_wopi/config/ocis/web-released.yaml diff --git a/deployments/continuous-deployment-config/ocis_wopi/daily.yml b/deployments/continuous-deployment-config/ocis_wopi/daily.yml index 1ddcf9e1135..85c43d21ac2 100644 --- a/deployments/continuous-deployment-config/ocis_wopi/daily.yml +++ b/deployments/continuous-deployment-config/ocis_wopi/daily.yml @@ -34,6 +34,9 @@ TRAEFIK_ACME_MAIL: wkloucek@owncloud.com OCIS_DOCKER_TAG: latest OCIS_DOMAIN: ocis.ocis-wopi.daily.owncloud.works + COMPANION_DOMAIN: companion.ocis-wopi.daily.owncloud.works + COMPANION_WEB_CONFIG_FILE_NAME: web-daily.yaml + COMPANION_IMAGE: owncloud/uppy-companion:3.12.13-owncloud WOPISERVER_DOMAIN: wopiserver.ocis-wopi.daily.owncloud.works COLLABORA_DOMAIN: collabora.ocis-wopi.daily.owncloud.works ONLYOFFICE_DOMAIN: onlyoffice.ocis-wopi.daily.owncloud.works diff --git a/deployments/continuous-deployment-config/ocis_wopi/latest.yml b/deployments/continuous-deployment-config/ocis_wopi/latest.yml index c9879631908..a806c0a4ef3 100644 --- a/deployments/continuous-deployment-config/ocis_wopi/latest.yml +++ b/deployments/continuous-deployment-config/ocis_wopi/latest.yml @@ -34,6 +34,9 @@ TRAEFIK_ACME_MAIL: wkloucek@owncloud.com OCIS_DOCKER_TAG: latest OCIS_DOMAIN: ocis.ocis-wopi.latest.owncloud.works + COMPANION_DOMAIN: companion.ocis-wopi.latest.owncloud.works + COMPANION_WEB_CONFIG_FILE_NAME: web-latest.yaml + COMPANION_IMAGE: owncloud/uppy-companion:3.12.13-owncloud WOPISERVER_DOMAIN: wopiserver.ocis-wopi.latest.owncloud.works COLLABORA_DOMAIN: collabora.ocis-wopi.latest.owncloud.works ONLYOFFICE_DOMAIN: onlyoffice.ocis-wopi.latest.owncloud.works diff --git a/deployments/continuous-deployment-config/ocis_wopi/released.yml b/deployments/continuous-deployment-config/ocis_wopi/released.yml index 0e8f9355ac6..c8521d34009 100644 --- a/deployments/continuous-deployment-config/ocis_wopi/released.yml +++ b/deployments/continuous-deployment-config/ocis_wopi/released.yml @@ -34,6 +34,9 @@ TRAEFIK_ACME_MAIL: wkloucek@owncloud.com OCIS_DOCKER_TAG: 4.0.0 OCIS_DOMAIN: ocis.ocis-wopi.released.owncloud.works + COMPANION_DOMAIN: companion.ocis-wopi.released.owncloud.works + COMPANION_IMAGE: owncloud/uppy-companion:3.12.13-owncloud + COMPANION_WEB_CONFIG_FILE_NAME: web-released.yaml WOPISERVER_DOMAIN: wopiserver.ocis-wopi.released.owncloud.works COLLABORA_DOMAIN: collabora.ocis-wopi.released.owncloud.works ONLYOFFICE_DOMAIN: onlyoffice.ocis-wopi.released.owncloud.works diff --git a/deployments/examples/ocis_wopi/.env b/deployments/examples/ocis_wopi/.env index 8ce2f94c3c1..2fa5355238d 100644 --- a/deployments/examples/ocis_wopi/.env +++ b/deployments/examples/ocis_wopi/.env @@ -47,7 +47,7 @@ ONLYOFFICE_DOMAIN= # Inbucket / Mail domain. Defaults to "mail.owncloud.test" INBUCKET_DOMAIN= -### Apache Tika Content analysis toolkit +### Apache Tika Content analysis toolkit ### # Set the desired docker image tag or digest, defaults to "latest" TIKA_IMAGE= @@ -56,7 +56,11 @@ TIKA_IMAGE= # https://owncloud.dev/ocis/deployment/monitoring-tracing/ #COMPOSE_FILE=docker-compose.yml:monitoring_tracing/docker-compose-additions.yml -### Uppy Companion +### Uppy Companion settings ### +# Domain of Uppy Companion. Defaults to "companion.owncloud.test" +COMPANION_IMAGE= COMPANION_DOMAIN= +COMPANION_WEB_CONFIG_FILE_NAME= +# Provider settings, see https://uppy.io/docs/companion/#provideroptions for reference. Empty by default, which disables providers. COMPANION_ONEDRIVE_KEY= COMPANION_ONEDRIVE_SECRET= diff --git a/deployments/examples/ocis_wopi/config/ocis/web-daily.yaml b/deployments/examples/ocis_wopi/config/ocis/web-daily.yaml new file mode 100644 index 00000000000..b8890ac320b --- /dev/null +++ b/deployments/examples/ocis_wopi/config/ocis/web-daily.yaml @@ -0,0 +1,18 @@ +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.daily.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-latest.yaml b/deployments/examples/ocis_wopi/config/ocis/web-latest.yaml new file mode 100644 index 00000000000..54c7b1b130f --- /dev/null +++ b/deployments/examples/ocis_wopi/config/ocis/web-latest.yaml @@ -0,0 +1,18 @@ +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 new file mode 100644 index 00000000000..1a208841ff8 --- /dev/null +++ b/deployments/examples/ocis_wopi/config/ocis/web-released.yaml @@ -0,0 +1,18 @@ +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/docker-compose.yml b/deployments/examples/ocis_wopi/docker-compose.yml index 8d540504978..ce8137a3edb 100644 --- a/deployments/examples/ocis_wopi/docker-compose.yml +++ b/deployments/examples/ocis_wopi/docker-compose.yml @@ -90,6 +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 - ocis-config:/etc/ocis - ocis-data:/var/lib/ocis labels: @@ -256,7 +257,7 @@ services: COMPANION_DATADIR: /tmp/companion/ COMPANION_DOMAIN: ${COMPANION_DOMAIN:-companion.owncloud.test} COMPANION_PROTOCOL: https - COMPANION_UPLOAD_URLS: ${OCIS_DOMAIN:-ocis.owncloud.test} + COMPANION_UPLOAD_URLS: "^https://${OCIS_DOMAIN:-ocis.owncloud.test}/" COMPANION_ONEDRIVE_KEY: "${COMPANION_ONEDRIVE_KEY}" COMPANION_ONEDRIVE_SECRET: "${COMPANION_ONEDRIVE_SECRET}" volumes: