|
@@ -46,14 +46,22 @@ case "$1" in
|
46
|
46
|
# check whether other enabled hosts has listen 443
|
47
|
47
|
if cat ${site} | grep -v "^[[:space:]]*#" | grep listen | grep -q "^.*[[:space:]:]443[;[:space:]].*" ; then
|
48
|
48
|
# nothing to do
|
|
49
|
+ echo "------------------------------------------------"
|
49
|
50
|
echo ""
|
50
|
51
|
echo "turnserver not configured as other nginx sites use port 443"
|
51
|
52
|
echo ""
|
|
53
|
+ echo "------------------------------------------------"
|
52
|
54
|
db_stop
|
53
|
55
|
exit 0
|
54
|
56
|
fi
|
55
|
57
|
done
|
56
|
58
|
|
|
59
|
+ # if there was a turn config backup it so we can configure
|
|
60
|
+ # we cannot recognize at the moment is this a user config or default config when installing coturn
|
|
61
|
+ if [[ -f $TURN_CONFIG ]] && ! grep -q "jitsi-meet coturn config" "$TURN_CONFIG" ; then
|
|
62
|
+ mv $TURN_CONFIG $TURN_CONFIG.bak
|
|
63
|
+ fi
|
|
64
|
+
|
57
|
65
|
# detect dpkg-reconfigure, just delete old links
|
58
|
66
|
db_get jitsi-meet-turnserver/jvb-hostname
|
59
|
67
|
JVB_HOSTNAME_OLD=$RET
|
|
@@ -67,17 +75,21 @@ case "$1" in
|
67
|
75
|
db_get jitsi-meet/jvb-serve || true
|
68
|
76
|
if [ ! -f $NGINX_CONFIG -o "$RET" = "true" ] ; then
|
69
|
77
|
# nothing to do
|
|
78
|
+ echo "------------------------------------------------"
|
70
|
79
|
echo ""
|
71
|
80
|
echo "turnserver not configured as no nginx found to multiplex traffic"
|
72
|
81
|
echo ""
|
|
82
|
+ echo "------------------------------------------------"
|
73
|
83
|
db_stop
|
74
|
84
|
exit 0
|
75
|
85
|
fi
|
76
|
86
|
|
77
|
87
|
if [[ -f $TURN_CONFIG ]] ; then
|
|
88
|
+ echo "------------------------------------------------"
|
78
|
89
|
echo ""
|
79
|
90
|
echo "turnserver is already configured on this machine, skipping."
|
80
|
91
|
echo ""
|
|
92
|
+ echo "------------------------------------------------"
|
81
|
93
|
db_stop
|
82
|
94
|
exit 0
|
83
|
95
|
fi
|
|
@@ -130,7 +142,8 @@ case "$1" in
|
130
|
142
|
invoke-rc.d coturn restart || true
|
131
|
143
|
|
132
|
144
|
NGINX_STREAM_CONFIG="/etc/nginx/modules-enabled/60-jitsi-meet.conf"
|
133
|
|
- if [ -f $NGINX_STREAM_CONFIG ] && [ -f $NGINX_CONFIG ] ; then
|
|
145
|
+ if [ ! -f $NGINX_STREAM_CONFIG ] && [ -f $NGINX_CONFIG ] ; then
|
|
146
|
+ ln -s /usr/share/jitsi-meet-turnserver/jitsi-meet.conf $NGINX_STREAM_CONFIG
|
134
|
147
|
sed -i "s/listen 443 ssl/listen 4444 ssl http2/g" $NGINX_CONFIG
|
135
|
148
|
sed -i "s/listen \[\:\:\]\:443 ssl/listen \[\:\:\]\:4444 ssl http2/g" $NGINX_CONFIG
|
136
|
149
|
invoke-rc.d nginx reload || true
|