|
@@ -36,26 +36,6 @@ case "$1" in
|
36
|
36
|
NGINX_CONFIG="/etc/nginx/sites-available/$JVB_HOSTNAME.conf"
|
37
|
37
|
JITSI_MEET_CONFIG="/etc/jitsi/meet/$JVB_HOSTNAME-config.js"
|
38
|
38
|
|
39
|
|
- NGINX_SITES_ENABLED="/etc/nginx/sites-enabled/"
|
40
|
|
- NGINX_CONFIG_ENABLED="${NGINX_SITES_ENABLED}${JVB_HOSTNAME}.conf"
|
41
|
|
- NGINX_MULTIPLEXING="true"
|
42
|
|
- for site in ${NGINX_SITES_ENABLED}*; do
|
43
|
|
- # if it is not a file continue
|
44
|
|
- [ -f "${site}" ] || continue
|
45
|
|
- # if it is our config skip
|
46
|
|
- [ "${site}" != "${NGINX_CONFIG_ENABLED}" ] || continue
|
47
|
|
- # check whether other enabled hosts has listen 443
|
48
|
|
- if cat ${site} | grep -v "^[[:space:]]*#" | grep listen | grep -q "^.*[[:space:]:]443[;[:space:]].*" ; then
|
49
|
|
- # nothing to do
|
50
|
|
- echo "------------------------------------------------"
|
51
|
|
- echo ""
|
52
|
|
- echo "turnserver is listening on tcp 5349 as other nginx sites use port 443"
|
53
|
|
- echo ""
|
54
|
|
- echo "------------------------------------------------"
|
55
|
|
- NGINX_MULTIPLEXING="false"
|
56
|
|
- fi
|
57
|
|
- done
|
58
|
|
-
|
59
|
39
|
# if there was a turn config backup it so we can configure
|
60
|
40
|
# we cannot recognize at the moment is this a user config or default config when installing coturn
|
61
|
41
|
if [[ -f $TURN_CONFIG ]] && ! grep -q "jitsi-meet coturn config" "$TURN_CONFIG" ; then
|
|
@@ -133,19 +113,9 @@ denied-peer-ip=240.0.0.0-255.255.255.255" >> $TURN_CONFIG
|
133
|
113
|
TURN_SECRET="$RET"
|
134
|
114
|
|
135
|
115
|
# no turn config exists, lt's copy template and fill it in
|
136
|
|
- PUBLIC_IP=$(dig -4 +short myip.opendns.com a @resolver1.opendns.com) || true
|
137
|
|
- if [ -z "$PUBLIC_IP" ] ; then
|
138
|
|
- PUBLIC_IP="127.0.0.1"
|
139
|
|
- echo "------------------------------------------------"
|
140
|
|
- echo "Warning! Could not resolve your external ip address! Error:^"
|
141
|
|
- echo "Your turn server will not work till you edit your $TURN_CONFIG config file."
|
142
|
|
- echo "You need to set your external ip address in external-ip and restart coturn service."
|
143
|
|
- echo "------------------------------------------------"
|
144
|
|
- fi
|
145
|
116
|
cp /usr/share/jitsi-meet-turnserver/turnserver.conf $TURN_CONFIG
|
146
|
117
|
sed -i "s/jitsi-meet.example.com/$JVB_HOSTNAME/g" $TURN_CONFIG
|
147
|
118
|
sed -i "s/__turnSecret__/$TURN_SECRET/g" $TURN_CONFIG
|
148
|
|
- sed -i "s/__external_ip_address__/$PUBLIC_IP/g" $TURN_CONFIG
|
149
|
119
|
|
150
|
120
|
# SSL for nginx
|
151
|
121
|
db_get jitsi-meet/cert-choice
|
|
@@ -170,18 +140,14 @@ denied-peer-ip=240.0.0.0-255.255.255.255" >> $TURN_CONFIG
|
170
|
140
|
invoke-rc.d coturn restart || true
|
171
|
141
|
|
172
|
142
|
NGINX_STREAM_CONFIG="/etc/nginx/modules-enabled/60-jitsi-meet.conf"
|
173
|
|
- if [ $NGINX_MULTIPLEXING = "true" ] && [ ! -f $NGINX_STREAM_CONFIG ] && [ -f $NGINX_CONFIG ] ; then
|
174
|
|
- ln -s /usr/share/jitsi-meet-turnserver/jitsi-meet.conf $NGINX_STREAM_CONFIG
|
175
|
|
- sed -i "s/listen 443 ssl/listen 4444 ssl http2/g" $NGINX_CONFIG
|
176
|
|
- sed -i "s/listen \[\:\:\]\:443 ssl/listen \[\:\:\]\:4444 ssl http2/g" $NGINX_CONFIG
|
177
|
|
- invoke-rc.d nginx reload || true
|
178
|
|
- else
|
179
|
|
- PROSODY_HOST_CONFIG="/etc/prosody/conf.avail/$JVB_HOSTNAME.cfg.lua"
|
180
|
|
- if [ -f $PROSODY_HOST_CONFIG ] ; then
|
181
|
|
- # If we are not multiplexing we need to change the port in prosody config
|
182
|
|
- sed -i 's/"443"/"5349"/g' $PROSODY_HOST_CONFIG
|
183
|
|
- invoke-rc.d prosody restart || true
|
184
|
|
- fi
|
|
143
|
+ if [ -f $NGINX_STREAM_CONFIG ] ; then
|
|
144
|
+ echo "------------------------------------------------"
|
|
145
|
+ echo ""
|
|
146
|
+ echo "You have multiplexing enabled, it is recommended to disable it and migrate to using websockets for the bridge channel."
|
|
147
|
+ echo "The support for sctp data channels is deprecated and will be dropped at some point."
|
|
148
|
+ echo "How to do it at: https://jitsi.org/multiplexing-to-bridge-ws-howto"
|
|
149
|
+ echo ""
|
|
150
|
+ echo "------------------------------------------------"
|
185
|
151
|
fi
|
186
|
152
|
|
187
|
153
|
# Enable turn server in config.js
|