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.

55 lines
1.7 KiB

  1. #!/bin/bash
  2. set -e
  3. # if ! nextcloud_domain=$(relation:get "$MASTER_TARGET_SERVICE_NAME":web-proxy domain) || [ -z "$nextcloud_domain" ]; then
  4. # ## No domain, probably no web-proxy then.
  5. # container=$(get_running_containers_for_service "$MASTER_TARGET_SERVICE_NAME" | head -n 1)
  6. # container_network_ip=$(get_docker_ip "$container")
  7. # container_ip=${container_network_ip#*:}
  8. # nextcloud_domain="${container_ip}:80"
  9. # fi
  10. if ! nextcloud_app_service=$(service:traverse "$MASTER_BASE_SERVICE_NAME":nextcloud-app); then
  11. err "Couldn't find service for"\
  12. "${DARKYELLOW}$MASTER_BASE_SERVICE_NAME${NORMAL}--${DARKCYAN}nextcloud-app${NORMAL}--> ?"
  13. exit 1
  14. fi
  15. if ! collabora_domain=$(relation:get "$MASTER_BASE_SERVICE_NAME":web-proxy url) || [ -z "$collabora_domain" ]; then
  16. ## No domain, probably no web-proxy then.
  17. # container=$(get_running_containers_for_service "$MASTER_BASE_SERVICE_NAME" | head -n 1)
  18. # container_network_ip=$(get_docker_ip "$container")
  19. # container_ip=${container_network_ip#*:}
  20. collabora_domain="$SERVICE_NAME:9980"
  21. fi
  22. info "collabora_domain: '$collabora_domain'"
  23. if ! get_healthy_container_ip_for_service "$SERVICE_NAME" 9980; then
  24. exit 17
  25. fi
  26. ## XXXvlab: we really need to have a state based cache thingy, because
  27. ## setting the same password each time is really time consumming.
  28. compose --no-relations --no-init \
  29. occ "$nextcloud_app_service" \
  30. app:install richdocuments \; \
  31. config:app:set --value="${collabora_domain}" richdocuments wopi_url \; \
  32. richdocuments:activate-config
  33. # nextcloud_domain="${nextcloud_domain//./\\.}"
  34. # config-add "\
  35. # services:
  36. # $MASTER_BASE_SERVICE_NAME:
  37. # environment:
  38. # domain: \"${nextcloud_domain}\"
  39. # "