diff --git a/deployments/continuous-deployment-config/ocis_wopi/latest.yml b/deployments/continuous-deployment-config/ocis_wopi/latest.yml index dcee49563c5..006c1160a4b 100644 --- a/deployments/continuous-deployment-config/ocis_wopi/latest.yml +++ b/deployments/continuous-deployment-config/ocis_wopi/latest.yml @@ -37,10 +37,10 @@ TRAEFIK_ACME_MAIL: wkloucek@owncloud.com OCIS_DOCKER_TAG: latest OCIS_DOMAIN: ocis.ocis-wopi.latest.owncloud.works - OCIS_WOPISERVER_DOCKER_TAG: latest - CS3ORG_WOPISERVER_DOCKER_TAG: latest WOPISERVER_DOMAIN: wopiserver.ocis-wopi.latest.owncloud.works COLLABORA_DOMAIN: collabora.ocis-wopi.latest.owncloud.works + ONLYOFFICE_DOMAIN: onlyoffice.ocis-wopi.latest.owncloud.works + CODIMD_DOMAIN: codimd.ocis-wopi.latest.owncloud.works COMPOSE_FILE: docker-compose.yml:monitoring_tracing/docker-compose-additions.yml - name: monitoring git_url: https://github.com/owncloud-devops/monitoring-tracing-client.git diff --git a/deployments/continuous-deployment-config/ocis_wopi/released.yml b/deployments/continuous-deployment-config/ocis_wopi/released.yml index a6e17e98499..6dd9a23e509 100644 --- a/deployments/continuous-deployment-config/ocis_wopi/released.yml +++ b/deployments/continuous-deployment-config/ocis_wopi/released.yml @@ -37,10 +37,10 @@ TRAEFIK_ACME_MAIL: wkloucek@owncloud.com OCIS_DOCKER_TAG: 1 OCIS_DOMAIN: ocis.ocis-wopi.released.owncloud.works - OCIS_WOPISERVER_DOCKER_TAG: latest - CS3ORG_WOPISERVER_DOCKER_TAG: latest WOPISERVER_DOMAIN: wopiserver.ocis-wopi.released.owncloud.works COLLABORA_DOMAIN: collabora.ocis-wopi.released.owncloud.works + ONLYOFFICE_DOMAIN: onlyoffice.ocis-wopi.released.owncloud.works + CODIMD_DOMAIN: codimd.ocis-wopi.released.owncloud.works COMPOSE_FILE: docker-compose.yml:monitoring_tracing/docker-compose-additions.yml - name: monitoring git_url: https://github.com/owncloud-devops/monitoring-tracing-client.git diff --git a/deployments/examples/ocis_wopi/.env b/deployments/examples/ocis_wopi/.env index 72c75988e50..b61977b073a 100644 --- a/deployments/examples/ocis_wopi/.env +++ b/deployments/examples/ocis_wopi/.env @@ -29,10 +29,8 @@ STORAGE_TRANSFER_SECRET= OCIS_MACHINE_AUTH_API_KEY= ### Wopi server settings ### -# oCIS Wopi server version. Defaults to "latest" -OCIS_WOPISERVER_DOCKER_TAG= # cs3org wopi server version. Defaults to "latest" -CS3ORG_WOPISERVER_DOCKER_TAG= +WOPISERVER_DOCKER_TAG= # cs3org wopi server domain. Defaults to "wopiserver.owncloud.test" WOPISERVER_DOMAIN= # JWT secret which is used for the documents to be request by the Wopi client from the cs3org Wopi server. Must be change in order to have a secure Wopi server. Defaults to "LoremIpsum567" @@ -45,9 +43,19 @@ WOPI_IOP_SECRET= COLLABORA_DOMAIN= # Admin user for Collabora. Defaults to blank, provide one to enable access COLLABORA_ADMIN_USER= -# Admin password for COllabora. Defaults to blank, provide one to enable access +# Admin password for Collabora. Defaults to blank, provide one to enable access COLLABORA_ADMIN_PASSWORD= +### OnlyOffice settings ### +# Domain of OnlyOffice, where you can find the frontend. Defaults to "onlyoffice.owncloud.test" +ONLYOFFICE_DOMAIN= + +### CodiMD settings ### +# Domain of Collabora, where you can find the frontend. Defaults to "codimd.owncloud.test" +CODIMD_DOMAIN= +# Secret which is used for the communication with the WOPI server. Must be changed in order to have a secure CodiMD. Defaults to "LoremIpsum456" +CODIMD_SECRET= + # If you want to use debugging and tracing with this stack, # you need uncomment following line. Please see documentation at diff --git a/deployments/examples/ocis_wopi/config/ocis-appdriver-codimd/entrypoint-override.sh b/deployments/examples/ocis_wopi/config/ocis-appdriver-codimd/entrypoint-override.sh new file mode 100755 index 00000000000..d0454fc4d29 --- /dev/null +++ b/deployments/examples/ocis_wopi/config/ocis-appdriver-codimd/entrypoint-override.sh @@ -0,0 +1,19 @@ +#!/bin/sh +set -e + +apk add curl + +#TODO: app driver itself should try again until CodiMD is up... + +retries=10 +while [[ $retries -gt 0 ]]; do + if curl --silent --show-error --fail http://codimd:3000 > /dev/null; then + ocis storage-app-provider server + else + echo "CodiMD is not yet available, trying again in 10 seconds" + sleep 10 + retries=$((retries - 1)) + fi +done +echo 'CodiMD was not available after 100 seconds' +exit 1 diff --git a/deployments/examples/ocis_wopi/config/ocis-appdriver-onlyoffice/entrypoint-override.sh b/deployments/examples/ocis_wopi/config/ocis-appdriver-onlyoffice/entrypoint-override.sh new file mode 100755 index 00000000000..c1d271f312f --- /dev/null +++ b/deployments/examples/ocis_wopi/config/ocis-appdriver-onlyoffice/entrypoint-override.sh @@ -0,0 +1,19 @@ +#!/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 storage-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/config/ocis/entrypoint-override.sh b/deployments/examples/ocis_wopi/config/ocis/entrypoint-override.sh index d90e287a947..c1f96fae4ef 100644 --- a/deployments/examples/ocis_wopi/config/ocis/entrypoint-override.sh +++ b/deployments/examples/ocis_wopi/config/ocis/entrypoint-override.sh @@ -2,11 +2,6 @@ set -e -mkdir -p /var/tmp/ocis/.config/ -cp /config/proxy-config.json /var/tmp/ocis/.config/proxy-config.json -cp /config/web-config.dist.json /var/tmp/ocis/.config/web-config.json -sed -i 's/ocis.owncloud.test/'${OCIS_DOMAIN:-ocis.owncloud.test}'/g' /var/tmp/ocis/.config/web-config.json - ocis server& sleep 10 @@ -26,8 +21,4 @@ ocis accounts update --password $STORAGE_LDAP_BIND_PASSWORD $REVA_USER_UUID echo "default secrets changed" echo "##################################################" -ocis kill proxy -sleep 10 -ocis proxy server # workaround for loading proxy configuration - wait # wait for oCIS to exit diff --git a/deployments/examples/ocis_wopi/config/ocis/mimetypes.json b/deployments/examples/ocis_wopi/config/ocis/mimetypes.json new file mode 100644 index 00000000000..3b6e5ccd155 --- /dev/null +++ b/deployments/examples/ocis_wopi/config/ocis/mimetypes.json @@ -0,0 +1,82 @@ +{ + "application/pdf": { + "extension": "pdf", + "name": "PDF", + "description": "PDF document", + "icon": "", + "default_app": "", + "allow_creation": false + }, + "application/vnd.oasis.opendocument.text": { + "extension": "odt", + "name": "OpenDocument", + "description": "OpenDocument text document", + "icon": "", + "default_app": "Collabora", + "allow_creation": true + }, + "application/vnd.oasis.opendocument.spreadsheet": { + "extension": "ods", + "name": "OpenSpreadsheet", + "description": "OpenDocument spreadsheet document", + "icon": "", + "default_app": "Collabora", + "allow_creation": true + }, + "application/vnd.oasis.opendocument.presentation": { + "extension": "odp", + "name": "OpenPresentation", + "description": "OpenDocument presentation document", + "icon": "", + "default_app": "Collabora", + "allow_creation": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { + "extension": "docx", + "name": "Microsoft Word", + "description": "Microsoft Word document", + "icon": "", + "default_app": "OnlyOffice", + "allow_creation": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { + "extension": "xlsx", + "name": "Microsoft Excel", + "description": "Microsoft Excel document", + "icon": "", + "default_app": "OnlyOffice", + "allow_creation": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation": { + "extension": "pptx", + "name": "Microsoft PowerPoint", + "description": "Microsoft PowerPoint document", + "icon": "", + "default_app": "OnlyOffice", + "allow_creation": true + }, + "application/vnd.jupyter": { + "extension": "ipynb", + "name": "Jupyter Notebook", + "description": "Jupyter Notebook", + "icon": "", + "default_app": "", + "allow_creation": true + }, + "text/markdown": { + "extension": "md", + "name": "Markdown file", + "description": "Markdown file", + "icon": "", + "default_app": "CodiMD", + "allow_creation": true + }, + "application/compressed-markdown": { + "extension": "zmd", + "name": "Compressed markdown file", + "description": "Compressed markdown file", + "icon": "", + "default_app": "CodiMD", + "allow_creation": false + } +} diff --git a/deployments/examples/ocis_wopi/config/ocis/proxy-config.json b/deployments/examples/ocis_wopi/config/ocis/proxy-config.json deleted file mode 100644 index 59b0fa28b34..00000000000 --- a/deployments/examples/ocis_wopi/config/ocis/proxy-config.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "HTTP": { - "Namespace": "com.owncloud" - }, - "policy_selector": { - "static": { - "policy": "ocis" - } - }, - "policies": [ - { - "name": "ocis", - "routes": [ - { - "endpoint": "/", - "backend": "http://localhost:9100" - }, - { - "endpoint": "/.well-known/", - "backend": "http://localhost:9130" - }, - { - "endpoint": "/konnect/", - "backend": "http://localhost:9130" - }, - { - "endpoint": "/signin/", - "backend": "http://localhost:9130" - }, - { - "type": "regex", - "endpoint": "/ocs/v[12].php/cloud/(users?|groups)", - "backend": "http://localhost:9110" - }, - { - "endpoint": "/app/", - "backend": "http://localhost:9140" - }, - { - "endpoint": "/ocs/", - "backend": "http://localhost:9140" - }, - { - "type": "query", - "endpoint": "/remote.php/?preview=1", - "backend": "http://localhost:9115" - }, - { - "endpoint": "/remote.php/", - "backend": "http://localhost:9140" - }, - { - "endpoint": "/dav/", - "backend": "http://localhost:9140" - }, - { - "endpoint": "/webdav/", - "backend": "http://localhost:9140" - }, - { - "endpoint": "/status.php", - "backend": "http://localhost:9140" - }, - { - "endpoint": "/index.php/", - "backend": "http://localhost:9140" - }, - { - "endpoint": "/data", - "backend": "http://localhost:9140" - }, - { - "endpoint": "/graph/", - "backend": "http://localhost:9120" - }, - { - "endpoint": "/graph-explorer/", - "backend": "http://localhost:9135" - }, - { - "endpoint": "/api/v0/accounts", - "backend": "http://localhost:9181" - }, - { - "endpoint": "/accounts.js", - "backend": "http://localhost:9181" - }, - { - "endpoint": "/api/v0/settings", - "backend": "http://localhost:9190" - }, - { - "endpoint": "/settings.js", - "backend": "http://localhost:9190" - }, - { - "endpoint": "/api/v0/wopi", - "backend": "http://ocis-wopiserver:9105" - }, - { - "endpoint": "/wopi.js", - "backend": "http://ocis-wopiserver:9105" - } - ] - } - ] -} diff --git a/deployments/examples/ocis_wopi/config/ocis/web-config.dist.json b/deployments/examples/ocis_wopi/config/ocis/web-config.dist.json deleted file mode 100644 index 16621b0ebf3..00000000000 --- a/deployments/examples/ocis_wopi/config/ocis/web-config.dist.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "server": "https://ocis.owncloud.test", - "theme": "owncloud", - "version": "0.1.0", - "openIdConnect": { - "metadata_url": "https://ocis.owncloud.test/.well-known/openid-configuration", - "authority": "https://ocis.owncloud.test", - "client_id": "web", - "response_type": "code", - "scope": "openid profile email" - }, - "apps": ["files"], - "external_apps": [ - { - "id": "settings", - "path": "/settings.js" - }, - { - "id": "accounts", - "path": "/accounts.js" - }, - { - "id": "wopi", - "path": "/wopi.js" - } - ], - "options": { - "hideSearchBar": true - } -} diff --git a/deployments/examples/ocis_wopi/config/wopiserver/entrypoint-override.sh b/deployments/examples/ocis_wopi/config/wopiserver/entrypoint-override.sh index 320527104f2..92d1f1c5311 100755 --- a/deployments/examples/ocis_wopi/config/wopiserver/entrypoint-override.sh +++ b/deployments/examples/ocis_wopi/config/wopiserver/entrypoint-override.sh @@ -3,7 +3,8 @@ set -e echo "${WOPISECRET}" > /etc/wopi/wopisecret echo "${IOPSECRET}" > /etc/wopi/iopsecret - +mkdir -p /var/run/secrets +echo "$CODIMDSECRET" > /var/run/secrets/codimd_apikey cp /etc/wopi/wopiserver.conf.dist /etc/wopi/wopiserver.conf sed -i 's/ocis.owncloud.test/'${OCIS_DOMAIN}'/g' /etc/wopi/wopiserver.conf @@ -12,9 +13,6 @@ sed -i 's/wopiserver.owncloud.test/'${WOPISERVER_DOMAIN}'/g' /etc/wopi/wopiserve touch /var/log/wopi/wopiserver.log -# wait for collabora to be up, else file types might be missing at https://wopiserver.owncloud.test/wopi/cbox/endpoints -while ! curl --output /dev/null --silent --head --fail http://collabora:9980; do sleep 1 && echo -n .; done; - /app/wopiserver.py & tail -f /var/log/wopi/wopiserver.log diff --git a/deployments/examples/ocis_wopi/config/wopiserver/wopiserver.conf.dist b/deployments/examples/ocis_wopi/config/wopiserver/wopiserver.conf.dist index c2794cf93d5..a0e297cffd7 100644 --- a/deployments/examples/ocis_wopi/config/wopiserver/wopiserver.conf.dist +++ b/deployments/examples/ocis_wopi/config/wopiserver/wopiserver.conf.dist @@ -17,10 +17,11 @@ port = 8880 #oosurl = https://officeonline.owncloud.test # URL of your Collabora Online service -codeurl = https://collabora.owncloud.test +#codeurl = https://collabora.owncloud.test -# URL of your WOPI bridge service (for CodiMD) -#wopibridgeurl = https://your-wopi-bridge-server.org:8000 +# URL of your CodiMD service +codimdurl = https://codimd.owncloud.test +codimdinturl = http://codimd:3000 # URL of your WOPI server or your HA proxy in front of it wopiurl = https://wopiserver.owncloud.test @@ -46,6 +47,12 @@ tokenvalidity = 86400 # WOPI lock expiration time [seconds] wopilockexpiration = 7200 +# WOPI lock strict check: if True, WOPI locks will be compared according to specs, +# that is their representation must match. False (default) allows for a more relaxed +# comparison, which compensates incorrect lock requests from Microsoft Office Online +# on-premise setups. +#wopilockstrictcheck = False + # Logging level. Debug enables the Flask debug mode as well. # Valid values are: Debug, Info, Warning, Error. loglevel = Info @@ -73,8 +80,19 @@ wopicert = /etc/grid-security/host.crt wopikey = /etc/grid-security/host.key +[bridge] +# SSL certificate check for the connected apps +sslverify = False + +# Minimal time interval between two consecutive save operations [seconds] +#saveinterval = 200 + +# Minimal time interval before a closed file is WOPI-unlocked [seconds] +#unlockinterval = 90 + + [io] -# Size used for buffered xroot reads [bytes] +# Size used for buffered reads [bytes] chunksize = 4194304 @@ -99,12 +117,12 @@ chunksize = 4194304 revagateway = ocis:9142 # HTTP (WebDAV) endpoint for uploading files -#datagateway = http://172.17.0.1:9100 +#datagateway = https://your-reva-server.org:port/data # Reva/gRPC authentication token expiration time [seconds] # The default value matches Reva's default authtokenvalidity = 3600 -# SSL certificate check for reva - # oCIS uses self signed certificate in this example +# SSL certificate check for Reva +# oCIS uses self signed certificate in this example sslverify = false diff --git a/deployments/examples/ocis_wopi/docker-compose.yml b/deployments/examples/ocis_wopi/docker-compose.yml index 6abe641783b..e4e1dbb0faa 100644 --- a/deployments/examples/ocis_wopi/docker-compose.yml +++ b/deployments/examples/ocis_wopi/docker-compose.yml @@ -10,6 +10,8 @@ services: - ${OCIS_DOMAIN:-ocis.owncloud.test} - ${WOPISERVER_DOMAIN:-wopiserver.owncloud.test} - ${COLLABORA_DOMAIN:-collabora.owncloud.test} + - ${ONLYOFFICE_DOMAIN:-onlyoffice.owncloud.test} + - ${CODIMD_DOMAIN:-codimd.owncloud.test} command: - "--log.level=${TRAEFIK_LOG_LEVEL:-ERROR}" # letsencrypt configuration @@ -52,6 +54,7 @@ services: - /bin/sh - /entrypoint-override.sh environment: + PROXY_ENABLE_BASIC_AUTH: "true" OCIS_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test} OCIS_DOMAIN: ${OCIS_DOMAIN:-ocis.owncloud.test} OCIS_LOG_LEVEL: ${OCIS_LOG_LEVEL:-error} # make oCIS less verbose @@ -62,23 +65,12 @@ services: STORAGE_LDAP_BIND_PASSWORD: ${STORAGE_LDAP_BIND_PASSWORD:-reva} OCIS_JWT_SECRET: ${OCIS_JWT_SECRET:-Pive-Fumkiu4} OCIS_MACHINE_AUTH_API_KEY: ${OCIS_MACHINE_AUTH_API_KEY:-change-me-please} - STORAGE_TRANSFER_SECRET: ${STORAGE_TRANSFER_SECRET:-replace-me-with-a-transfer-secret} - # web ui - WEB_UI_CONFIG: "/var/tmp/ocis/.config/web-config.json" - # proxy - PROXY_CONFIG_FILE: "/var/tmp/ocis/.config/proxy-config.json" - # app provider - APP_PROVIDER_DRIVER: wopi - APP_PROVIDER_WOPI_DRIVER_APP_NAME: Collabora - APP_PROVIDER_WOPI_DRIVER_APP_ICON_URI: https://www.collaboraoffice.com/wp-content/uploads/2019/01/CP-icon.png - APP_PROVIDER_WOPI_DRIVER_APP_URL: https://${COLLABORA_DOMAIN:-collabora.owncloud.test} - APP_PROVIDER_WOPI_DRIVER_INSECURE: "${INSECURE:-false}" - APP_PROVIDER_WOPI_DRIVER_IOP_SECRET: ${WOPI_IOP_SECRET:-LoremIpsum123} - APP_PROVIDER_WOPI_DRIVER_WOPI_URL: https://${WOPISERVER_DOMAIN:-wopiserver.owncloud.test} + OCIS_TRANSFER_SECRET: ${STORAGE_TRANSFER_SECRET:-replace-me-with-a-transfer-secret} + # app registry + STORAGE_APP_REGISTRY_MIMETYPES_JSON: /var/tmp/ocis/app-config/mimetypes.json volumes: - ./config/ocis/entrypoint-override.sh:/entrypoint-override.sh - - ./config/ocis/web-config.dist.json:/config/web-config.dist.json - - ./config/ocis/proxy-config.json:/config/proxy-config.json + - ./config/ocis/mimetypes.json:/var/tmp/ocis/app-config/mimetypes.json - ocis-data:/var/tmp/ocis labels: - "traefik.enable=true" @@ -91,31 +83,95 @@ services: driver: "local" restart: always - ocis-wopiserver: - image: owncloud/ocis-wopiserver:${OCIS_WOPISERVER_DOCKER_TAG:-latest} + ocis-appdriver-collabora: + image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest} networks: ocis-net: + command: storage-app-provider server environment: - OCIS_LOG_LEVEL: ${OCIS_LOG_LEVEL:-error} # make oCIS less verbose - WOPISERVER_REVA_GATEWAY_ADDR: ocis:9142 + REVA_GATEWAY: ${REVA_GATEWAY:-ocis:9142} + APP_PROVIDER_BASIC_EXTERNAL_ADDR: ocis-appdriver-collabora:9164 OCIS_JWT_SECRET: ${OCIS_JWT_SECRET:-Pive-Fumkiu4} OCIS_MACHINE_AUTH_API_KEY: ${OCIS_MACHINE_AUTH_API_KEY:-change-me-please} + APP_PROVIDER_DRIVER: wopi + APP_PROVIDER_WOPI_DRIVER_APP_NAME: Collabora + APP_PROVIDER_WOPI_DRIVER_APP_ICON_URI: https://www.collaboraoffice.com/wp-content/uploads/2019/01/CP-icon.png + APP_PROVIDER_WOPI_DRIVER_APP_URL: https://${COLLABORA_DOMAIN:-collabora.owncloud.test} + APP_PROVIDER_WOPI_DRIVER_INSECURE: "${INSECURE:-false}" + APP_PROVIDER_WOPI_DRIVER_IOP_SECRET: ${WOPI_IOP_SECRET:-LoremIpsum123} + APP_PROVIDER_WOPI_DRIVER_WOPI_URL: https://${WOPISERVER_DOMAIN:-wopiserver.owncloud.test} + logging: + driver: "local" + restart: always + + ocis-appdriver-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: storage-app-provider server + environment: + REVA_GATEWAY: ${REVA_GATEWAY:-ocis:9142} + APP_PROVIDER_BASIC_EXTERNAL_ADDR: ocis-appdriver-onlyoffice:9164 + OCIS_JWT_SECRET: ${OCIS_JWT_SECRET:-Pive-Fumkiu4} + OCIS_MACHINE_AUTH_API_KEY: ${OCIS_MACHINE_AUTH_API_KEY:-change-me-please} + APP_PROVIDER_DRIVER: wopi + APP_PROVIDER_WOPI_DRIVER_APP_NAME: OnlyOffice + APP_PROVIDER_WOPI_DRIVER_APP_ICON_URI: https://www.pikpng.com/pngl/m/343-3435764_onlyoffice-desktop-editors-onlyoffice-logo-clipart.png + APP_PROVIDER_WOPI_DRIVER_APP_URL: https://${ONLYOFFICE_DOMAIN:-onlyoffice.owncloud.test} + APP_PROVIDER_WOPI_DRIVER_INSECURE: "${INSECURE:-false}" + APP_PROVIDER_WOPI_DRIVER_IOP_SECRET: ${WOPI_IOP_SECRET:-LoremIpsum123} + APP_PROVIDER_WOPI_DRIVER_WOPI_URL: https://${WOPISERVER_DOMAIN:-wopiserver.owncloud.test} + volumes: + - ./config/ocis-appdriver-onlyoffice/entrypoint-override.sh:/entrypoint-override.sh + logging: + driver: "local" + restart: always + + ocis-appdriver-codimd: + 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: storage-app-provider server + environment: + REVA_GATEWAY: ${REVA_GATEWAY:-ocis:9142} + APP_PROVIDER_BASIC_EXTERNAL_ADDR: ocis-appdriver-codimd:9164 + OCIS_JWT_SECRET: ${OCIS_JWT_SECRET:-Pive-Fumkiu4} + OCIS_MACHINE_AUTH_API_KEY: ${OCIS_MACHINE_AUTH_API_KEY:-change-me-please} + APP_PROVIDER_DRIVER: wopi + APP_PROVIDER_WOPI_DRIVER_APP_NAME: CodiMD + APP_PROVIDER_WOPI_DRIVER_APP_API_KEY: ${CODIMD_SECRET:-LoremIpsum456} + APP_PROVIDER_WOPI_DRIVER_APP_ICON_URI: https://avatars.githubusercontent.com/u/67865462?v=4 + APP_PROVIDER_WOPI_DRIVER_APP_URL: https://${CODIMD_DOMAIN:-codimd.owncloud.test} + APP_PROVIDER_WOPI_DRIVER_INSECURE: "${INSECURE:-false}" + APP_PROVIDER_WOPI_DRIVER_IOP_SECRET: ${WOPI_IOP_SECRET:-LoremIpsum123} + APP_PROVIDER_WOPI_DRIVER_WOPI_URL: https://${WOPISERVER_DOMAIN:-wopiserver.owncloud.test} + volumes: + - ./config/ocis-appdriver-codimd/entrypoint-override.sh:/entrypoint-override.sh logging: driver: "local" restart: always wopiserver: - image: cs3org/wopiserver:${CS3ORG_WOPISERVER_DOCKER_TAG:-latest} + image: cs3org/wopiserver:${WOPISERVER_DOCKER_TAG:-latest} networks: ocis-net: entrypoint: - /bin/sh - /entrypoint-override.sh environment: - - WOPISECRET=${WOPI_JWT_SECRET:-LoremIpsum567} - - IOPSECRET=${WOPI_IOP_SECRET:-LoremIpsum123} - - WOPISERVER_DOMAIN=${WOPISERVER_DOMAIN:-wopiserver.owncloud.test} - - COLLABORA_DOMAIN=${COLLABORA_DOMAIN:-collabora.owncloud.test} + WOPISECRET: ${WOPI_JWT_SECRET:-LoremIpsum567} + IOPSECRET: ${WOPI_IOP_SECRET:-LoremIpsum123} + CODIMDSECRET: ${CODIMD_SECRET:-LoremIpsum456} + WOPISERVER_DOMAIN: ${WOPISERVER_DOMAIN:-wopiserver.owncloud.test} + COLLABORA_DOMAIN: ${COLLABORA_DOMAIN:-collabora.owncloud.test} volumes: - ./config/wopiserver/entrypoint-override.sh:/entrypoint-override.sh - ./config/wopiserver/wopiserver.conf.dist:/etc/wopi/wopiserver.conf.dist @@ -133,15 +189,15 @@ services: restart: always collabora: - image: collabora/code:6.4.8.1 + image: collabora/code:6.4.11.3 networks: ocis-net: environment: - - domain=${OCIS_DOMAIN:-ocis.owncloud.test} - - DONT_GEN_SSL_CERT=YES - - extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:welcome.enable=false --o:net.frame_ancestors=${OCIS_DOMAIN:-ocis.owncloud.test} - - username=${COLLABORA_ADMIN_USER} - - password=${COLLABORA_ADMIN_PASSWORD} + domain: ${OCIS_DOMAIN:-ocis.owncloud.test} + DONT_GEN_SSL_CERT: "YES" + extra_params: --o:ssl.enable=false --o:ssl.termination=true --o:welcome.enable=false --o:net.frame_ancestors=${OCIS_DOMAIN:-ocis.owncloud.test} + username: ${COLLABORA_ADMIN_USER} + password: ${COLLABORA_ADMIN_PASSWORD} cap_add: - MKNOD labels: @@ -155,11 +211,75 @@ services: driver: "local" restart: always + onlyoffice: + image: onlyoffice/documentserver:6.4.0 + networks: + ocis-net: + environment: + USE_UNAUTHORIZED_STORAGE: "${INSECURE:-false}" # selfsigned certificates + labels: + - "traefik.enable=true" + - "traefik.http.routers.onlyoffice.entrypoints=https" + - "traefik.http.routers.onlyoffice.rule=Host(`${ONLYOFFICE_DOMAIN:-onlyoffice.owncloud.test}`)" + - "traefik.http.routers.onlyoffice.tls.certresolver=http" + - "traefik.http.routers.onlyoffice.service=onlyoffice" + - "traefik.http.services.onlyoffice.loadbalancer.server.port=80" + # websockets can't be opend when this is ommitted + - "traefik.http.middlewares.onlyoffice.headers.customrequestheaders.X-Forwarded-Proto=https" + - "traefik.http.routers.onlyoffice.middlewares=onlyoffice" + logging: + driver: "local" + restart: always + + codimd: + image: gitlab-registry.cern.ch/authoring/notes/codimd:cernbox-integration + networks: + ocis-net: + environment: + CMD_DB_URL: postgres://codimd:codimd@codimd-db/codimd + CMD_AUTO_VERSION_CHECK: "false" + CMD_ALLOW_ANONYMOUS: "true" + CMD_ALLOW_ANONYMOUS_EDITS: "true" + CMD_ALLOW_ANONYMOUS_VIEWS: "true" + CMD_ALLOW_FREEURL: "true" + CMD_EMAIL: "false" + CMD_ALLOW_EMAIL_REGISTER: "false" + CMD_USESSL: "false" + NODE_TLS_REJECT_UNAUTHORIZED: 0 + CMD_APPLIANCE_MODE: "true" + CMD_SAVE_WEBHOOK: https:/${WOPISERVER_DOMAIN:-wopiserver.owncloud.test}/wopi/bridge + CMD_API_KEY: ${CODIMD_SECRET:-LoremIpsum456} + labels: + - "traefik.enable=true" + - "traefik.http.routers.codimd.entrypoints=https" + - "traefik.http.routers.codimd.rule=Host(`${CODIMD_DOMAIN:-codimd.owncloud.test}`)" + - "traefik.http.routers.codimd.tls.certresolver=http" + - "traefik.http.routers.codimd.service=codimd" + - "traefik.http.services.codimd.loadbalancer.server.port=3000" + logging: + driver: "local" + restart: always + + codimd-db: + image: postgres:11.6-alpine + networks: + ocis-net: + environment: + POSTGRES_USER: codimd + POSTGRES_PASSWORD: codimd + POSTGRES_DB: codimd + volumes: + - codimd-db-data:/var/lib/postgresql/data + logging: + driver: "local" + restart: always + volumes: certs: ocis-data: wopi-data: wopi-logs: + codimd-db-data: networks: ocis-net: diff --git a/docs/ocis/deployment/ocis_wopi.md b/docs/ocis/deployment/ocis_wopi.md index 50aeff1226e..ed24b82bac2 100644 --- a/docs/ocis/deployment/ocis_wopi.md +++ b/docs/ocis/deployment/ocis_wopi.md @@ -9,22 +9,26 @@ geekdocFilePath: ocis_wopi.md {{< toc >}} +{{< hint warning >}} +OnlyOffice and CodiMD are not yet fully integrated and there are known issues. For the current state please have a look at [owncloud/ocis#2595](https://github.com/owncloud/ocis/issues/2595) +{{< /hint >}} + ## Overview -* oCIS, Wopi server and Collabora running behind Traefik as reverse proxy -* Collabora enables you to edit text documents in your browser -* Wopi server acts as a bridge to make the oCIS storage accessible to Collabora +* oCIS, Wopi server, Collabora, OnlyOffice and CodiMD running behind Traefik as reverse proxy +* Collabora, OnlyOffice and CodiMD enable you to edit documents in your browser +* Wopi server acts as a bridge to make the oCIS storage accessible to Collabora, OnlyOffice and CodiMD * Traefik generating self signed certificates for local setup or obtaining valid SSL certificates for a server setup [Find this example on GitHub](https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_wopi) -The docker stack consists 5 containers. One of them is Traefik, a proxy which is terminating SSL and forwards the requests to oCIS in the internal docker network. +The docker stack consists of 10 containers. One of them is Traefik, a proxy which is terminating SSL and forwards the requests to oCIS in the internal docker network. -The next container is oCIS itself in a configuration like the [oCIS with Traefik example]({{< ref "ocis_traefik" >}}), except that for this example a custom proxy and web UI configuration is used to enable the oCIS Wopi extension. +The next container is oCIS itself in a configuration like the [oCIS with Traefik example]({{< ref "ocis_traefik" >}}), except that for this example a custom mimetype configuration is used. -The oCIS WOPI server extension is running in another container and enables you to open files in Collabora from within ownCloud Web. +There are three oCIS app driver containers that register Collabora, OnlyOffice and CodiMD at the app registry. -The last two containers are the WOPI server and Collabora. +The last four containers are the WOPI server, Collabora, OnlyOffice and CodiMD. ## Server Deployment @@ -34,6 +38,8 @@ The last two containers are the WOPI server and Collabora. * Three domains set up and pointing to your server - ocis.* for serving oCIS - collabora.* for serving Collabora + - onlyoffice.* for serving OnlyOffice + - codimd.* for serving CodiMD - wopiserver.* for serving the WOPI server - traefik.* for serving the Traefik dashboard @@ -84,10 +90,8 @@ See also [example server setup]({{< ref "preparing_server" >}}) OCIS_MACHINE_AUTH_API_KEY= ### Wopi server settings ### - # oCIS Wopi server version. Defaults to "latest" - OCIS_WOPISERVER_DOCKER_TAG= # cs3org wopi server version. Defaults to "latest" - CS3ORG_WOPISERVER_DOCKER_TAG= + WOPISERVER_DOCKER_TAG= # cs3org wopi server domain. Defaults to "wopiserver.owncloud.test" WOPISERVER_DOMAIN= # JWT secret which is used for the documents to be request by the Wopi client from the cs3org Wopi server. Must be change in order to have a secure Wopi server. Defaults to "LoremIpsum567" @@ -100,9 +104,18 @@ See also [example server setup]({{< ref "preparing_server" >}}) COLLABORA_DOMAIN= # Admin user for Collabora. Defaults to blank, provide one to enable access COLLABORA_ADMIN_USER= - # Admin password for COllabora. Defaults to blank, provide one to enable access + # Admin password for Collabora. Defaults to blank, provide one to enable access COLLABORA_ADMIN_PASSWORD= + ### OnlyOffice settings ### + # Domain of OnlyOffice, where you can find the frontend. Defaults to "onlyoffice.owncloud.test" + ONLYOFFICE_DOMAIN= + + ### CodiMD settings ### + # Domain of Collabora, where you can find the frontend. Defaults to "codimd.owncloud.test" + CODIMD_DOMAIN= + # Secret which is used for the communication with the WOPI server. Must be changed in order to have a secure CodiMD. Defaults to "LoremIpsum456" + CODIMD_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`. @@ -119,18 +132,20 @@ See also [example server setup]({{< ref "preparing_server" >}}) You also must override three default secrets in `IDP_LDAP_BIND_PASSWORD`, `STORAGE_LDAP_BIND_PASSWORD` and `OCIS_JWT_SECRET` in order to secure your oCIS instance. Choose some random strings eg. from the output of `openssl rand -base64 32`. For more information see [secure an oCIS instance]({{< ref "./#secure-an-ocis-instance" >}}). - By default the oCIS WOPI server extension will be started in the `latest` version. If you want to start a specific version of oCIS WOPI server set the version to `OCIS_WOPISERVER_DOCKER_TAG=`. Available versions can be found on [Docker Hub](https://hub.docker.com/r/owncloud/ocis-wopiserver/tags?page=1&ordering=last_updated). + By default the CS3Org WOPI server will also be started in the `latest` version. If you want to start a specific version of it, you can set the version to `WOPISERVER_DOCKER_TAG=`. Available versions can be found on [Docker Hub](https://hub.docker.com/r/cs3org/wopiserver/tags?page=1&ordering=last_updated). - By default the CS3Org WOPI server will also be started in the `latest` version. If you want to start a specific version of it, you can set the version to `CS3ORG_WOPISERVER_DOCKER_TAG=`. Available versions can be found on [Docker Hub](https://hub.docker.com/r/cs3org/wopiserver/tags?page=1&ordering=last_updated). - - Set your domain for the CS3Org WOPI server in `WOPISERVER_DOMAIN=`, where Collabora can download the files. + Set your domain for the CS3Org WOPI server in `WOPISERVER_DOMAIN=`, where all office suites can download the files via the WOPI protocol. You also must override the default WOPI JWT secret and the WOPI IOP secret, in order to have a secure setup. Do this by setting `WOPI_JWT_SECRET` and `WOPI_IOP_SECRET` to a long and random string. - Now it's time to set up Collabora and you need to configure the Domain of Collabora in `COLLABORA_DOMAIN=`. + Now it's time to set up Collabora and you need to configure the domain of Collabora in `COLLABORA_DOMAIN=`. If you want to use the Collabora admin panel you need to set user name and passwort for in `COLLABORA_ADMIN_USER=` and `COLLABORA_ADMIN_PASSWORD=`. + Next up is OnlyOffice, which also needs a domain in `ONLYOFFICE_DOMAIN=`. + + The last configuration options are for CodiMD, which needs a domain in `CODIMD_DOMAIN=` and a random secret in `CODIMD_SECRET=`. + Now you have configured everything and can save the file. * Start the docker stack @@ -149,6 +164,8 @@ On Linux and macOS you can add them to your `/etc/hosts` files like this: 127.0.0.1 ocis.owncloud.test 127.0.0.1 traefik.owncloud.test 127.0.0.1 collabora.owncloud.test +127.0.0.1 onlyoffice.owncloud.test +127.0.0.1 codimd.owncloud.test 127.0.0.1 wopiserver.owncloud.test ``` @@ -156,6 +173,6 @@ After that you're ready to start the application stack: `docker-compose up -d` -Open https://collabora.owncloud.test and https://wopiserver.owncloud.test in your browser and accept the invalid certificate warning. +Open https://collabora.owncloud.test, https://onlyoffice.owncloud.test, https://codimd.owncloud.test and https://wopiserver.owncloud.test in your browser and accept the invalid certificate warning. Open https://ocis.owncloud.test in your browser and accept the invalid certificate warning. You are now able to open an office document in your browser. You may need to wait some minutes until all services are fully ready, so make sure that you try to reload the pages from time to time.