Skip to content

Commit 5679578

Browse files
sapkrasaghul
authored andcommitted
prosody: add env var to config cross domain settings
1 parent effb30b commit 5679578

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ services:
135135
- XMPP_MUC_MODULES
136136
- XMPP_INTERNAL_MUC_MODULES
137137
- XMPP_RECORDER_DOMAIN
138+
- XMPP_CROSS_DOMAIN
138139
- JICOFO_COMPONENT_SECRET
139140
- JICOFO_AUTH_USER
140141
- JICOFO_AUTH_PASSWORD

env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ XMPP_INTERNAL_MUC_DOMAIN=internal-muc.meet.jitsi
217217
# XMPP domain for unauthenticated users
218218
XMPP_GUEST_DOMAIN=guest.meet.jitsi
219219

220+
# Comma separated list of domains for cross domain policy or "true" to allow all
221+
# The PUBLIC_URL is always allowed
222+
#XMPP_CROSS_DOMAIN=true
223+
220224
# Custom Prosody modules for XMPP_DOMAIN (comma separated)
221225
XMPP_MODULES=
222226

prosody/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ RUN \
1818

1919
FROM ${JITSI_REPO}/base
2020

21+
ENV XMPP_CROSS_DOMAIN="false"
22+
2123
RUN \
2224
wget -q https://prosody.im/files/prosody-debian-packages.key -O - | gpg --enarmor > /etc/apt/trusted.gpg.d/prosody.asc \
2325
&& echo "deb http://packages.prosody.im/debian buster main" > /etc/apt/sources.list.d/prosody.list \

prosody/rootfs/defaults/conf.d/jitsi-meet.cfg.lua

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,20 @@ asap_accepted_issuers = { "{{ join "\",\"" (splitList "," .Env.JWT_ACCEPTED_ISSU
2626
asap_accepted_audiences = { "{{ join "\",\"" (splitList "," .Env.JWT_ACCEPTED_AUDIENCES) }}" }
2727
{{ end }}
2828

29-
{{ if $ENABLE_XMPP_WEBSOCKET }}
29+
consider_bosh_secure = true;
30+
3031
-- Deprecated in 0.12
3132
-- https://github.com/bjc/prosody/commit/26542811eafd9c708a130272d7b7de77b92712de
32-
cross_domain_websocket = { "{{ $PUBLIC_URL }}" };
33-
consider_bosh_secure = true;
33+
{{ $XMPP_CROSS_DOMAINS := $PUBLIC_URL }}
34+
{{ if eq .Env.XMPP_CROSS_DOMAIN "true"}}
35+
cross_domain_websocket = true
36+
cross_domain_bosh = true
37+
{{ else }}
38+
{{ if and .Env.XMPP_CROSS_DOMAIN (not (eq .Env.XMPP_CROSS_DOMAIN "false" )) }}
39+
{{ $XMPP_CROSS_DOMAINS = list $PUBLIC_URL .Env.XMPP_CROSS_DOMAIN | join "," }}
40+
{{ end }}
41+
cross_domain_websocket = { "{{ join "\",\"" (splitList "," $XMPP_CROSS_DOMAINS) }}" }
42+
cross_domain_bosh = { "{{ join "\",\"" (splitList "," $XMPP_CROSS_DOMAINS) }}" }
3443
{{ end }}
3544

3645
VirtualHost "{{ .Env.XMPP_DOMAIN }}"

0 commit comments

Comments
 (0)