From 06b7c5c999a9d13241efe35bd02eccebfc4b4f58 Mon Sep 17 00:00:00 2001 From: default Date: Sun, 10 Apr 2022 14:55:52 +0200 Subject: [PATCH] [NEW] add collabraoffice support --- apache/build/Dockerfile | 2 +- collabraoffice/hooks/init | 31 +++++++++++++++++++ .../hooks/web_proxy-relation-joined | 15 +++++++++ collabraoffice/metadata.yml | 23 ++++++++++++++ 4 files changed, 70 insertions(+), 1 deletion(-) create mode 100755 collabraoffice/hooks/init create mode 100755 collabraoffice/hooks/web_proxy-relation-joined create mode 100644 collabraoffice/metadata.yml diff --git a/apache/build/Dockerfile b/apache/build/Dockerfile index 00beb16..ee488df 100644 --- a/apache/build/Dockerfile +++ b/apache/build/Dockerfile @@ -53,7 +53,7 @@ RUN apt-get update && \ pecl install mongodb && docker-php-ext-enable mongodb && \ pecl install xdebug && docker-php-ext-enable xdebug && \ pecl install imagick && docker-php-ext-enable imagick && \ - MODULES="rewrite headers ssl" && \ + MODULES="rewrite headers ssl proxy proxy_balancer proxy_wstunnel proxy_connect proxy_http" && \ for module in ${MODULES}; do \ a2enmod "$module"; \ done && \ diff --git a/collabraoffice/hooks/init b/collabraoffice/hooks/init new file mode 100755 index 0000000..8a54de7 --- /dev/null +++ b/collabraoffice/hooks/init @@ -0,0 +1,31 @@ +#!/bin/bash + +## Init is run on host +## For now it is run every time the script is launched, but +## it should be launched only once after build. + +## Accessible variables are: +## - SERVICE_NAME Name of current service +## - DOCKER_BASE_IMAGE Base image from which this service might be built if any +## - SERVICE_DATASTORE Location on host of the DATASTORE of this service +## - SERVICE_CONFIGSTORE Location on host of the CONFIGSTORE of this service + + +set -e + +admin_user=$(options-get admin.user 2>&1) || { + admin_user="admin" +} +admin_password=$(options-get admin.password 2>&1) || { + admin_password="admin" +} + +init-config-add "\ +$SERVICE_NAME: + environment: + username: \"$admin_user\" + password: \"$admin_password\" + domain: alusage\\.fr + server_name: share\\.alusage\\.fr + extra_params: --o:ssl.enable=false --o:ssl.termination=true +" diff --git a/collabraoffice/hooks/web_proxy-relation-joined b/collabraoffice/hooks/web_proxy-relation-joined new file mode 100755 index 0000000..3daf374 --- /dev/null +++ b/collabraoffice/hooks/web_proxy-relation-joined @@ -0,0 +1,15 @@ +#!/bin/bash + +DOMAIN=$(relation-get domain) || exit 1 +echo "$DOMAIN" +echo "${DOMAIN//./\\.}" +set -e + +## XXXnjeudy need like share\\.example\\.com + +config-add "\ +services: + $MASTER_BASE_SERVICE_NAME: + cap_add: + - MKNOD +" diff --git a/collabraoffice/metadata.yml b/collabraoffice/metadata.yml new file mode 100644 index 0000000..5bb1056 --- /dev/null +++ b/collabraoffice/metadata.yml @@ -0,0 +1,23 @@ +# from: https://hub.docker.com/r/collabora/code/tags - https://github.com/CollaboraOnline/online/tree/master/docker +docker-image: collabora/code +#data-resources: +# - /var/www/onlyoffice/Data +#config-resources: +# - /etc/onlyoffice/documentserver + +uses: + + ## XXXvlab: public access should NOT be necessary, but seem the only way to make + ## it work: https://dev.onlyoffice.org/viewtopic.php?t=19272 + web-proxy: + #constraint: required | recommended | optional + #auto: pair | summon | none ## default: pair + constraint: required + auto: summon + solves: + proxy: "Public access" + default-options: + target: !var-expand ${MASTER_BASE_SERVICE_NAME}:9980 + apache-core-rules: !var-expand | + ProxyPassMatch "/cool/(.*)/ws$" wss://${MASTER_BASE_SERVICE_NAME}:9980/cool/$1/ws nocanon + ProxyPass /cool/adminws wss://${MASTER_BASE_SERVICE_NAME}:9980/cool/adminws