From 5e43229ec0d87da4013b25455305b779e5acc011 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Thu, 25 Aug 2022 16:13:01 +0200 Subject: [PATCH] chg: [nextcloud] enhance error reporting upong relation failing Signed-off-by: Valentin Lab --- nextcloud/hooks/web_proxy-relation-joined | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/nextcloud/hooks/web_proxy-relation-joined b/nextcloud/hooks/web_proxy-relation-joined index 135df044..2555006d 100755 --- a/nextcloud/hooks/web_proxy-relation-joined +++ b/nextcloud/hooks/web_proxy-relation-joined @@ -6,9 +6,16 @@ DOMAIN=$(relation-get domain) || exit 1 URL="$(relation-get url)" || exit 1 PROTO="${URL%%://*}" -trusted_domains="$( +if ! trusted_domains="$( compose -q --no-relations --no-init occ "$MASTER_BASE_SERVICE_NAME" \ - config:system:get trusted_domains)" + config:system:get trusted_domains)"; then + err "Couldn't get 'trusted_domains'. Here's the ouput:" + echo "$trusted_domains" | prefix " | " >&2 + + echo "If the code of nextcloud is already there (command occ is found), but " >&2 + echo "the database is not yet created, this situation will arise." >&2 + exit 1 +fi occ_opts=( ## necessary as nextcloud do not detect correctly those, and behind