diff --git a/docker-compose.yml b/docker-compose.yml index f9f87e1..1c39a73 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -291,6 +291,7 @@ services: - PROSODY_TRUSTED_PROXIES - PROSODY_VISITOR_INDEX - PROSODY_VISITORS_MUC_PREFIX + - PROSODY_VISITORS_S2S_VHOSTS - PUBLIC_URL - STUN_HOST - STUN_PORT diff --git a/prosody/rootfs/defaults/conf.d/visitors.cfg.lua b/prosody/rootfs/defaults/conf.d/visitors.cfg.lua index 17682a6..4a515e4 100644 --- a/prosody/rootfs/defaults/conf.d/visitors.cfg.lua +++ b/prosody/rootfs/defaults/conf.d/visitors.cfg.lua @@ -104,6 +104,12 @@ s2sout_override = { {{ if or $ENABLE_RECORDING $ENABLE_TRANSCRIPTIONS -}} ["{{ $XMPP_RECORDER_DOMAIN }}"] = "tcp://{{ $XMPP_SERVER }}:{{ $XMPP_SERVER_S2S_PORT }}"; {{ end -}} +{{ if .Env.PROSODY_VISITORS_S2S_VHOSTS -}} + {{- range $index, $vhost := (splitList "," .Env.PROSODY_VISITORS_S2S_VHOSTS | compact) }} + ["{{ $vhost }}"] = "tcp://{{ $XMPP_SERVER }}:{{ $XMPP_SERVER_S2S_PORT }}"; + {{ end -}} +{{ end -}} + } muc_limit_messages_count = 10; diff --git a/prosody/rootfs/defaults/prosody.cfg.lua b/prosody/rootfs/defaults/prosody.cfg.lua index 37e477f..e5a60bf 100644 --- a/prosody/rootfs/defaults/prosody.cfg.lua +++ b/prosody/rootfs/defaults/prosody.cfg.lua @@ -224,20 +224,22 @@ s2s_ports = { {{ $S2S_PORT }} } -- Listen on specific s2s port {{ if eq $PROSODY_MODE "visitors" -}} s2s_whitelist = { - {{ if $ENABLE_VISITORS -}} + {{- if $ENABLE_VISITORS }} '{{ $XMPP_MUC_DOMAIN }}'; -- needed for visitors to send messages to main room 'visitors.{{ $XMPP_DOMAIN }}'; -- needed for sending promotion request to visitors.{{ $XMPP_DOMAIN }} component '{{ $XMPP_DOMAIN }}'; -- unavailable presences back to main room + {{- end }} - {{ end -}} - {{ if $ENABLE_GUEST_DOMAIN -}} + {{- if $ENABLE_GUEST_DOMAIN }} '{{ $XMPP_GUEST_DOMAIN }}'; - - {{ end }} - {{ if or $ENABLE_RECORDING $ENABLE_TRANSCRIPTIONS -}} + {{- end }} + {{ if or $ENABLE_RECORDING $ENABLE_TRANSCRIPTIONS -}} '{{ $XMPP_RECORDER_DOMAIN }}'; + {{- end }} - {{ end -}} + {{- if .Env.PROSODY_VISITORS_S2S_VHOSTS }} + '{{ join "';\n '" (splitList "," .Env.PROSODY_VISITORS_S2S_VHOSTS | compact) }}'; + {{- end }} } {{ end -}}