From f54e1a2c8e6138bf95dbbc9a2a8bbb867b5b1e11 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Wed, 9 Dec 2020 10:57:47 +0100 Subject: [PATCH] new: [onlyoffice] upgraded to v6.1.0 Signed-off-by: Valentin Lab --- .../hooks/postgres_database-relation-joined | 34 +++++++++++++++++++ onlyoffice/metadata.yml | 15 +++++++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100755 onlyoffice/hooks/postgres_database-relation-joined diff --git a/onlyoffice/hooks/postgres_database-relation-joined b/onlyoffice/hooks/postgres_database-relation-joined new file mode 100755 index 0000000..56a93ba --- /dev/null +++ b/onlyoffice/hooks/postgres_database-relation-joined @@ -0,0 +1,34 @@ +#!/bin/bash + +. lib/common + +set -e + +PASSWORD="$(relation-get password)" +USER="$(relation-get user)" +DBNAME="$(relation-get dbname)" +ADMIN_PASSWORD=$(relation-base-compose-get admin-password 2>/dev/null) || { + if [ -e "$CONFIG" ]; then + ADMIN_PASSWORD=$(grep ^admin_passwd "$CONFIG" | sed -r 's/^admin_passwd\s+=\s+(.+)$/\1/g') + fi + if [ -z "$ADMIN_PASSWORD" ]; then + info "Generating odoo admin password" + ADMIN_PASSWORD=$(gen_password) + fi +} + +database=$(options-get database 2>/dev/null) || true +database="${database:-$DBNAME}" + +config-add "\ +services: + $MASTER_BASE_SERVICE_NAME: + environment: + DB_TYPE: \"postgres\" + DB_HOST: \"$MASTER_TARGET_SERVICE_NAME\" + DB_NAME: \"$DBNAME\" + DB_PWD: \"$PASSWORD\" + DB_USER: \"$USER\" +" + +info "Configured $SERVICE_NAME code for $TARGET_SERVICE_NAME access." diff --git a/onlyoffice/metadata.yml b/onlyoffice/metadata.yml index 0e9d3e3..6914d74 100644 --- a/onlyoffice/metadata.yml +++ b/onlyoffice/metadata.yml @@ -1,7 +1,14 @@ -docker-image: docker.0k.io/oods:1.0.0 +# from: https://github.com/0k/Docker-DocumentServer (6.1.0) +docker-image: docker.0k.io/oods:2.0.0 data-resources: - /var/www/onlyoffice/Data - /var/log/onlyoffice + ## not documented but found in entrypoint and docker inspect + - /var/lib/onlyoffice + - /var/lib/postgres + - /var/lib/rabbitmq + - /var/lib/redis + - /usr/share/fonts/truetype/custom config-resources: - /etc/onlyoffice/documentserver @@ -25,3 +32,9 @@ uses: proxy: "Public access" default-options: target: !var-expand ${MASTER_BASE_SERVICE_NAME}:80 + + postgres-database: + constraint: required + auto: summon + solves: + database: "main storage"