Skip to content

Commit 79a4635

Browse files
committed
jvb: add ability to disable XMPP
In case the REST API is the only API that is going to be used.
1 parent 77ce86a commit 79a4635

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ services:
424424
- JVB_AUTH_PASSWORD
425425
- JVB_BREWERY_MUC
426426
- JVB_DISABLE_STUN
427+
- JVB_DISABLE_XMPP
427428
- JVB_INSTANCE_ID
428429
- JVB_PORT
429430
- JVB_MUC_NICKNAME

jvb/rootfs/defaults/jvb.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{ $COLIBRI_REST_ENABLED := .Env.COLIBRI_REST_ENABLED | default "false" | toBool -}}
2+
{{ $DISABLE_XMPP := .Env.JVB_DISABLE_XMPP | default "0" | toBool -}}
23
{{ $ENABLE_COLIBRI_WEBSOCKET := .Env.ENABLE_COLIBRI_WEBSOCKET | default "1" | toBool -}}
34
{{ $ENABLE_OCTO := .Env.ENABLE_OCTO | default "0" | toBool -}}
45
{{ $ENABLE_SCTP := .Env.ENABLE_SCTP | default "0" | toBool -}}
@@ -37,6 +38,7 @@ videobridge {
3738
advertise-private-candidates = {{ $JVB_ADVERTISE_PRIVATE_CANDIDATES }}
3839
}
3940
apis {
41+
{{ if not $DISABLE_XMPP -}}
4042
xmpp-client {
4143
configs {
4244
{{ if $ENABLE_JVB_XMPP_SERVER }}
@@ -67,9 +69,10 @@ videobridge {
6769
DISABLE_CERTIFICATE_VERIFICATION = true
6870
}
6971
{{ end -}}
70-
{{ end }}
72+
{{ end -}}
7173
}
7274
}
75+
{{ end -}}
7376
rest {
7477
enabled = {{ $COLIBRI_REST_ENABLED }}
7578
}

jvb/rootfs/etc/cont-init.d/10-config

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
#!/usr/bin/with-contenv bash
22

3-
if [[ -z $JVB_AUTH_PASSWORD ]]; then
4-
echo 'FATAL ERROR: JVB auth password must be set'
5-
exit 1
6-
fi
3+
if [[ -z $JVB_DISABLE_XMPP ]]; then
4+
if [[ -z $JVB_AUTH_PASSWORD ]]; then
5+
echo 'FATAL ERROR: JVB auth password must be set'
6+
exit 1
7+
fi
78

8-
OLD_JVB_AUTH_PASSWORD=passw0rd
9-
if [[ "$JVB_AUTH_PASSWORD" == "$OLD_JVB_AUTH_PASSWORD" ]]; then
10-
echo 'FATAL ERROR: JVB auth password must be changed, check the README'
11-
exit 1
12-
fi
9+
OLD_JVB_AUTH_PASSWORD=passw0rd
10+
if [[ "$JVB_AUTH_PASSWORD" == "$OLD_JVB_AUTH_PASSWORD" ]]; then
11+
echo 'FATAL ERROR: JVB auth password must be changed, check the README'
12+
exit 1
13+
fi
1314

14-
[ -z "${XMPP_SERVER}" ] && export XMPP_SERVER=xmpp.meet.jitsi
15+
[ -z "${XMPP_SERVER}" ] && export XMPP_SERVER=xmpp.meet.jitsi
16+
17+
# On environments like Swarm the IP address used by the default gateway need not be
18+
# the one used for inter-container traffic. Use that one for our fallback ID.
19+
XMPP_SERVER_IP=$(dig +short +search ${XMPP_SERVER})
20+
export JVB_WS_SERVER_ID_FALLBACK=$(ip route get ${XMPP_SERVER_IP} | grep -oP '(?<=src ).*' | awk '{ print $1 '})
21+
fi
1522

1623
# Migration from DOCKER_HOST_ADDRESS to JVB_ADVERTISE_IPS
1724
if [[ -z "${JVB_ADVERTISE_IPS}" ]]; then
@@ -21,11 +28,6 @@ if [[ -z "${JVB_ADVERTISE_IPS}" ]]; then
2128
fi
2229
fi
2330

24-
# On environments like Swarm the IP address used by the default gateway need not be
25-
# the one used for inter-container traffic. Use that one for our fallback ID.
26-
XMPP_SERVER_IP=$(dig +short +search ${XMPP_SERVER})
27-
export JVB_WS_SERVER_ID_FALLBACK=$(ip route get ${XMPP_SERVER_IP} | grep -oP '(?<=src ).*' | awk '{ print $1 '})
28-
2931
# Local IP for the ice4j mapping harvester.
3032
export LOCAL_ADDRESS=$(ip route get 1 | grep -oP '(?<=src ).*' | awk '{ print $1 '})
3133

0 commit comments

Comments
 (0)