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.

23 lines
506 B

  1. #!/bin/bash
  2. set -e
  3. NEXTCLOUD_APP_CONNECTION_DIR="$state_tmpdir/$PROJECT_NAME/$SERVICE_NAME/"
  4. mkdir -p "$NEXTCLOUD_APP_CONNECTION_DIR"
  5. # Atomicity
  6. i=1
  7. while ! mkdir "$NEXTCLOUD_APP_CONNECTION_DIR"/"$i"; do ((i++)) ; done
  8. if ! nextcloud_url=$(relation:get "$MASTER_TARGET_SERVICE_NAME":web-proxy url) || [ -z "$nextcloud_url" ]; then
  9. nextcloud_url="http://$TARGET_SERVICE_NAME:80"
  10. fi
  11. config-add "\
  12. services:
  13. $MASTER_BASE_SERVICE_NAME:
  14. environment:
  15. aliasgroup$i: \"${nextcloud_url}\"
  16. "