forked from 0k/0k-charms
Valentin Lab
10 months ago
2 changed files with 54 additions and 16 deletions
@ -1,25 +1,20 @@ |
|||
#!/bin/bash |
|||
|
|||
. lib/common |
|||
|
|||
set -e |
|||
|
|||
DOMAIN=$(relation-get domain) || exit 1 |
|||
URL="$(relation-get url)" || exit 1 |
|||
PROTO="${URL%%://*}" |
|||
|
|||
occ_opts=( |
|||
## necessary as nextcloud do not detect correctly those, and behind |
|||
## a proxy, it will generate a lot of URL that are not detected |
|||
## by means of ``ReverseProxyPass`` on apache for instance |
|||
nextcloud:config:simple:add overwritehost "$DOMAIN" || { |
|||
err "Failed to set ${WHITE}overwritehost${NORMAL} to '$DOMAIN'." |
|||
exit 1 |
|||
} |
|||
|
|||
config:system:set overwritehost --value="$DOMAIN" \; |
|||
config:system:set overwriteprotocol --value="$PROTO" |
|||
) |
|||
compose --no-relations --no-init occ "$MASTER_BASE_SERVICE_NAME" "${occ_opts[@]}" || { |
|||
err "Failure to execute these ${WHITE}occ${NORMAL} commands:" |
|||
echo " ${WHITE}$(printf ' %q' "${occ_opts[@]}")${NORMAL}" | |
|||
sed -r "s/\\;/$'n'/g" | prefix " ${DARKGRAY}>${NORMAL} " >&2 |
|||
echo " " |
|||
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 |
|||
nextcloud:config:simple:add overwriteprotocol "$PROTO" || { |
|||
err "Failed to set ${WHITE}overwriteprotocol${NORMAL} to '$PROTO'." |
|||
exit 1 |
|||
} |
|||
} |
|||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue