Skip to content

Commit a88c6e4

Browse files
feat(prosody): allow s2s whitelist additions (jitsi#1940)
* feat(prosody): allow s2s whitelist additions * change to vhost name to reflect additional uses * whitespace improvement
1 parent b89c328 commit a88c6e4

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ services:
291291
- PROSODY_TRUSTED_PROXIES
292292
- PROSODY_VISITOR_INDEX
293293
- PROSODY_VISITORS_MUC_PREFIX
294+
- PROSODY_VISITORS_S2S_VHOSTS
294295
- PUBLIC_URL
295296
- STUN_HOST
296297
- STUN_PORT

prosody/rootfs/defaults/conf.d/visitors.cfg.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ s2sout_override = {
104104
{{ if or $ENABLE_RECORDING $ENABLE_TRANSCRIPTIONS -}}
105105
["{{ $XMPP_RECORDER_DOMAIN }}"] = "tcp://{{ $XMPP_SERVER }}:{{ $XMPP_SERVER_S2S_PORT }}";
106106
{{ end -}}
107+
{{ if .Env.PROSODY_VISITORS_S2S_VHOSTS -}}
108+
{{- range $index, $vhost := (splitList "," .Env.PROSODY_VISITORS_S2S_VHOSTS | compact) }}
109+
["{{ $vhost }}"] = "tcp://{{ $XMPP_SERVER }}:{{ $XMPP_SERVER_S2S_PORT }}";
110+
{{ end -}}
111+
{{ end -}}
112+
107113
}
108114

109115
muc_limit_messages_count = 10;

prosody/rootfs/defaults/prosody.cfg.lua

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,20 +224,22 @@ s2s_ports = { {{ $S2S_PORT }} } -- Listen on specific s2s port
224224

225225
{{ if eq $PROSODY_MODE "visitors" -}}
226226
s2s_whitelist = {
227-
{{ if $ENABLE_VISITORS -}}
227+
{{- if $ENABLE_VISITORS }}
228228
'{{ $XMPP_MUC_DOMAIN }}'; -- needed for visitors to send messages to main room
229229
'visitors.{{ $XMPP_DOMAIN }}'; -- needed for sending promotion request to visitors.{{ $XMPP_DOMAIN }} component
230230
'{{ $XMPP_DOMAIN }}'; -- unavailable presences back to main room
231+
{{- end }}
231232

232-
{{ end -}}
233-
{{ if $ENABLE_GUEST_DOMAIN -}}
233+
{{- if $ENABLE_GUEST_DOMAIN }}
234234
'{{ $XMPP_GUEST_DOMAIN }}';
235-
236-
{{ end }}
237-
{{ if or $ENABLE_RECORDING $ENABLE_TRANSCRIPTIONS -}}
235+
{{- end }}
236+
{{ if or $ENABLE_RECORDING $ENABLE_TRANSCRIPTIONS -}}
238237
'{{ $XMPP_RECORDER_DOMAIN }}';
238+
{{- end }}
239239

240-
{{ end -}}
240+
{{- if .Env.PROSODY_VISITORS_S2S_VHOSTS }}
241+
'{{ join "';\n '" (splitList "," .Env.PROSODY_VISITORS_S2S_VHOSTS | compact) }}';
242+
{{- end }}
241243
}
242244
{{ end -}}
243245

0 commit comments

Comments
 (0)