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.

25 lines
447 B

  1. #!/bin/bash
  2. set -e
  3. . lib/common
  4. env=()
  5. url=$(relation-get url)
  6. if [ "${url%://*}" == "https" ]; then
  7. env+=(SYNAPSE_NO_TLS "'yes'")
  8. fi
  9. server_name=$(options-get "server-name") || true
  10. if [ -z "$server_name" ]; then
  11. DOMAIN=$(relation-get domain) || exit 1
  12. env+=(SYNAPSE_SERVER_NAME "$DOMAIN")
  13. fi
  14. if [ "${#env[@]}" -gt 0 ]; then
  15. init-config-add "
  16. $SERVICE_NAME:
  17. environment:
  18. $(printf " %s: %s\n" "${env[@]}")
  19. " || exit 1
  20. fi