#!/bin/bash set -e . lib/common env=() url=$(relation-get url) if [ "${url%://*}" == "https" ]; then env+=(SYNAPSE_NO_TLS "'yes'") fi server_name=$(options-get "server-name") || true if [ -z "$server_name" ]; then DOMAIN=$(relation-get domain) || exit 1 env+=(SYNAPSE_SERVER_NAME "$DOMAIN") fi if [ "${#env[@]}" -gt 0 ]; then init-config-add " $SERVICE_NAME: environment: $(printf " %s: %s\n" "${env[@]}") " || exit 1 fi