You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
927 B

  1. #!/bin/bash
  2. set -e
  3. DOMAIN=$(relation-get domain) || exit 1
  4. URL="$(relation-get url)" || exit 1
  5. PROTO="${URL%%://*}"
  6. occ_opts=(
  7. ## necessary as nextcloud do not detect correctly those, and behind
  8. ## a proxy, it will generate a lot of URL that are not detected
  9. ## by means of ``ReverseProxyPass`` on apache for instance
  10. config:system:set overwritehost --value="$DOMAIN" \;
  11. config:system:set overwriteprotocol --value="$PROTO"
  12. )
  13. compose --no-relations --no-init occ "$MASTER_BASE_SERVICE_NAME" "${occ_opts[@]}" || {
  14. err "Failure to execute these ${WHITE}occ${NORMAL} commands:"
  15. echo " ${WHITE}$(printf ' %q' "${occ_opts[@]}")${NORMAL}" |
  16. sed -r "s/\\;/$'n'/g" | prefix " ${DARKGRAY}>${NORMAL} " >&2
  17. echo " "
  18. echo " If the code of nextcloud is already there (command occ is found), but " >&2
  19. echo " the database is not yet created, this situation will arise." >&2
  20. exit 1
  21. }