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.
26 lines
447 B
26 lines
447 B
#!/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
|