diff --git a/changelog/unreleased/web-extensions-example.md b/changelog/unreleased/web-extensions-example.md new file mode 100644 index 0000000000..4f442b0e8f --- /dev/null +++ b/changelog/unreleased/web-extensions-example.md @@ -0,0 +1,16 @@ +Enhancement: Add web extensions to the ocis_full example + +We added some of the web extensions from ownCloud to the ocis_full docker compose example. + +- importer +- draw-io +- external-sites +- json-viewer +- unzip +- progressbars + +These can be enabled in the .env file one by one. + +Read more about ocis extensions in https://github.com/owncloud/web-extensions/blob/main/README.md + +https://github.com/owncloud/ocis/pull/10399 diff --git a/deployments/examples/ocis_full/.env b/deployments/examples/ocis_full/.env index 8e5f10c28b..fb0ac765e9 100644 --- a/deployments/examples/ocis_full/.env +++ b/deployments/examples/ocis_full/.env @@ -114,6 +114,34 @@ SMTP_AUTHENTICATION= # Allow insecure connections to the SMTP server. Defaults to false. SMTP_INSECURE= +## oCIS Web Extensions ## +# It is possible to use the oCIS Web Extensions to add custom functionality to the oCIS frontend. +# For more details see https://github.com/owncloud/web-extensions/blob/main/README.md +# Enable this to create a new named volume +#EXTENSIONS=:web_extensions/extensions.yml +# Enable the desired extensions by uncommenting the following lines. +# Note: the leading colon is required to enable the service. +# Note: if you want to remove a web extension, you must delete the ocis-apps volume. It will be properly recreated on docker compose startup. +#UNZIP=:web_extensions/unzip.yml +#DRAWIO=:web_extensions/drawio.yml +#JSONVIEWER=:web_extensions/jsonviewer.yml +#PROGRESSBARS=:web_extensions/progressbars.yml +#EXTERNALSITES=:web_extensions/externalsites.yml +# External Sites needs additional config, see the following files for more details. +# - config/ocis/apps.yaml +# - config/ocis/csp.yaml +#IMPORTER=:web_extensions/importer.yml +# The importer needs additional config, see the following lines for more details. +## The docker image to be used for uppy companion. +# owncloud has built a container with public link import support. +COMPANION_IMAGE= +# Domain of Uppy Companion. Defaults to "companion.owncloud.test". +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= + ## Default Enabled Services ## @@ -163,20 +191,6 @@ COLLABORA_SSL_VERIFICATION=false #MONITORING=:monitoring_tracing/monitoring.yml -### Uppy Companion Settings ### -# Note: the leading colon is required to enable the service. -#CLOUD_IMPORTER=:cloudimporter.yml -## The docker image to be used for uppy companion. -# owncloud has built a container with public link import support. -COMPANION_IMAGE= -# Domain of Uppy Companion. Defaults to "companion.owncloud.test". -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= - - ### Virusscanner Settings ### # Note: the leading colon is required to enable the service. #CLAMAV=:clamav.yml @@ -208,4 +222,4 @@ INBUCKET_DOMAIN= # This MUST be the last line as it assembles the supplemental compose files to be used. # ALL supplemental configs must be added here, whether commented or not. # Each var must either be empty or contain :path/file.yml -COMPOSE_FILE=docker-compose.yml${OCIS:-}${TIKA:-}${S3NG:-}${S3NG_MINIO:-}${COLLABORA:-}${MONITORING:-}${CLOUD_IMPORTER:-}${CLAMAV:-}${ONLYOFFICE:-}${INBUCKET:-} +COMPOSE_FILE=docker-compose.yml${OCIS:-}${TIKA:-}${S3NG:-}${S3NG_MINIO:-}${COLLABORA:-}${MONITORING:-}${IMPORTER:-}${CLAMAV:-}${ONLYOFFICE:-}${INBUCKET:-}${EXTENSIONS:-}${UNZIP:-}${DRAWIO:-}${JSONVIEWER:-}${PROGRESSBARS:-}${EXTERNALSITES:-} diff --git a/deployments/examples/ocis_full/config/ocis/apps.yaml b/deployments/examples/ocis_full/config/ocis/apps.yaml new file mode 100644 index 0000000000..63f17ef1c4 --- /dev/null +++ b/deployments/examples/ocis_full/config/ocis/apps.yaml @@ -0,0 +1,23 @@ +importer: + config: + companionUrl: https://${COMPANION_DOMAIN|companion.owncloud.test} + supportedClouds: + - WebdavPublicLink + #- OneDrive # needs a client id and secret + #- GoogleDrive # needs a client id and secret and an addition to the DNS zone +external-sites: + config: + sites: + # For settings see: https://github.com/owncloud/web-extensions/tree/main/packages/web-app-external-sites + - name: ownCloud + url: "https://owncloud.dev" + target: embedded + color: "#0D856F" + icon: cloud + priority: 50 + - name: Wikipedia + url: "https://www.wikipedia.org" + target: external + color: "#0D856F" + icon: book + priority: 51 diff --git a/deployments/examples/ocis_full/config/ocis/csp.yaml b/deployments/examples/ocis_full/config/ocis/csp.yaml index fb46082e7d..b8e5813d3d 100644 --- a/deployments/examples/ocis_full/config/ocis/csp.yaml +++ b/deployments/examples/ocis_full/config/ocis/csp.yaml @@ -20,6 +20,8 @@ directives: # In contrary to bash and docker the default is given after the | character - 'https://${ONLYOFFICE_DOMAIN|onlyoffice.owncloud.test}/' - 'https://${COLLABORA_DOMAIN|collabora.owncloud.test}/' + # This is needed for the external-sites web extension when embedding sites + - 'https://owncloud.dev' img-src: - '''self''' - 'data:' diff --git a/deployments/examples/ocis_full/config/ocis/web.yaml b/deployments/examples/ocis_full/config/ocis/web.yaml deleted file mode 100644 index 9ffff94810..0000000000 --- a/deployments/examples/ocis_full/config/ocis/web.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_DOMAIN|companion.owncloud.test} - 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_full/web_extensions/drawio.yml b/deployments/examples/ocis_full/web_extensions/drawio.yml new file mode 100644 index 0000000000..4feaac7997 --- /dev/null +++ b/deployments/examples/ocis_full/web_extensions/drawio.yml @@ -0,0 +1,15 @@ +--- +services: + ocis: + depends_on: + drawio-init: + condition: service_completed_successfully + + drawio-init: + image: owncloud/web-extensions:draw-io-0.2.0 + user: root + volumes: + - ocis-apps:/apps + entrypoint: + - /bin/sh + command: ["-c", "cp -R /var/lib/nginx/html/draw-io/ /apps"] diff --git a/deployments/examples/ocis_full/web_extensions/extensions.yml b/deployments/examples/ocis_full/web_extensions/extensions.yml new file mode 100644 index 0000000000..d2a60a039b --- /dev/null +++ b/deployments/examples/ocis_full/web_extensions/extensions.yml @@ -0,0 +1,7 @@ +services: + ocis: + volumes: + - ocis-apps:/var/lib/ocis/web/assets/apps + +volumes: + ocis-apps: diff --git a/deployments/examples/ocis_full/web_extensions/externalsites.yml b/deployments/examples/ocis_full/web_extensions/externalsites.yml new file mode 100644 index 0000000000..378fe43280 --- /dev/null +++ b/deployments/examples/ocis_full/web_extensions/externalsites.yml @@ -0,0 +1,15 @@ +--- +services: + ocis: + depends_on: + externalsites-init: + condition: service_completed_successfully + + externalsites-init: + image: owncloud/web-extensions:external-sites-0.2.0 + user: root + volumes: + - ocis-apps:/apps + entrypoint: + - /bin/sh + command: ["-c", "cp -R /var/lib/nginx/html/external-sites/ /apps"] diff --git a/deployments/examples/ocis_full/cloudimporter.yml b/deployments/examples/ocis_full/web_extensions/importer.yml similarity index 78% rename from deployments/examples/ocis_full/cloudimporter.yml rename to deployments/examples/ocis_full/web_extensions/importer.yml index 7438a8baa9..82f36486ba 100644 --- a/deployments/examples/ocis_full/cloudimporter.yml +++ b/deployments/examples/ocis_full/web_extensions/importer.yml @@ -8,7 +8,19 @@ services: ocis: volumes: # the cloud importer needs to be enabled in the web.yaml - - ./config/ocis/web.yaml:/etc/ocis/web.yaml + - ./config/ocis/apps.yaml:/etc/ocis/apps.yaml + depends_on: + importer-init: + condition: service_completed_successfully + + importer-init: + image: owncloud/web-extensions:importer-0.1.0 + user: root + volumes: + - ocis-apps:/apps + entrypoint: + - /bin/sh + command: [ "-c", "cp -R /var/lib/nginx/html/importer/ /apps" ] companion: image: ${COMPANION_IMAGE:-owncloud/uppy-companion:3.12.13-owncloud} diff --git a/deployments/examples/ocis_full/web_extensions/jsonviewer.yml b/deployments/examples/ocis_full/web_extensions/jsonviewer.yml new file mode 100644 index 0000000000..7d03a29067 --- /dev/null +++ b/deployments/examples/ocis_full/web_extensions/jsonviewer.yml @@ -0,0 +1,15 @@ +--- +services: + ocis: + depends_on: + jsonviewer-init: + condition: service_completed_successfully + + jsonviewer-init: + image: owncloud/web-extensions:json-viewer-0.2.0 + user: root + volumes: + - ocis-apps:/apps + entrypoint: + - /bin/sh + command: ["-c", "cp -R /var/lib/nginx/html/json-viewer/ /apps"] diff --git a/deployments/examples/ocis_full/web_extensions/progressbars.yml b/deployments/examples/ocis_full/web_extensions/progressbars.yml new file mode 100644 index 0000000000..e40d1fe423 --- /dev/null +++ b/deployments/examples/ocis_full/web_extensions/progressbars.yml @@ -0,0 +1,15 @@ +--- +services: + ocis: + depends_on: + progressbars-init: + condition: service_completed_successfully + + progressbars-init: + image: owncloud/web-extensions:progress-bars-0.2.0 + user: root + volumes: + - ocis-apps:/apps + entrypoint: + - /bin/sh + command: ["-c", "cp -R /var/lib/nginx/html/progress-bars/ /apps"] diff --git a/deployments/examples/ocis_full/web_extensions/unzip.yml b/deployments/examples/ocis_full/web_extensions/unzip.yml new file mode 100644 index 0000000000..024596e44f --- /dev/null +++ b/deployments/examples/ocis_full/web_extensions/unzip.yml @@ -0,0 +1,17 @@ +--- +services: + ocis: + depends_on: + unzip-init: + condition: service_completed_successfully + + unzip-init: + image: owncloud/web-extensions:unzip-0.3.0 + user: root + volumes: + - ocis-apps:/apps + entrypoint: + - /bin/sh + command: ["-c", "cp -R /var/lib/nginx/html/unzip/ /apps"] + +