Browse Source

new: [synapse] support ``server-name``.

Notice that you have to add a special DNS rule in the ``server-name`` zone::

    _matrix._tcp.example.com 3600 IN SRV 10 0 8448 matrix.example.com

This is to declare that ``matrix.example.com`` is matrix server for
domain ``example.com``.
framadate
Valentin Lab 6 years ago
parent
commit
e18f5f5ed2
  1. 2
      synapse/hooks/init
  2. 21
      synapse/hooks/web_proxy-relation-joined

2
synapse/hooks/init

@ -19,6 +19,8 @@ options="$(e "$service_def" | shyaml -y get-value options)" || true
SYNAPSE_OPTIONS=(
server-name:string ## The server name
report-stats:bool ## Enable anon stat reporting back to the Matrix project
enable-registration:bool ## Enable registration on the Synapse instance.
allow-guest:bool ## allow guest joining this server.

21
synapse/hooks/web_proxy-relation-joined

@ -4,20 +4,23 @@ set -e
. lib/common
DOMAIN=$(relation-get domain) || exit 1
env=()
url=$(relation-get url)
if [ "${url%://*}" == "https" ]; then
no_tls=" SYNAPSE_NO_TLS: 'yes'"
else
no_tls=
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
init-config-add "
if [ "${#env[@]}" -gt 0 ]; then
init-config-add "
$SERVICE_NAME:
environment:
SYNAPSE_SERVER_NAME: $DOMAIN
$no_tls
$(printf " %s: %s\n" "${env[@]}")
" || exit 1
fi
Loading…
Cancel
Save