Procházet zdrojové kódy

feat: Enable bridge websockets by default for new installs (#7781)

* feat: Drops multiplexing support by default.

* fix: Fix purge of jitsi-meet-prosody.

Clean the accounts when there is a - in the domain name.
Removes the certificate so reinstall will not cause problems.

* feat: Enables bridge websockets by default.

* fix: External-ip conflicts with denied-peer-ip.

In cases where the bridge and coturn are on the same machine and the local address is any of the networks from denied-peer-ip, coturn is not using its public address to probe it and communication fails as the other address is deneid.

* squash: Fix a comment.
j8
Дамян Минков před 4 roky
rodič
revize
93f4098dc0
Žádný účet není propojen s e-mailovou adresou tvůrce revize

+ 1
- 0
config.js Zobrazit soubor

337
     // 'datachannel'), undefined (treat it as 'datachannel') and false (don't
337
     // 'datachannel'), undefined (treat it as 'datachannel') and false (don't
338
     // open any channel).
338
     // open any channel).
339
     // openBridgeChannel: true,
339
     // openBridgeChannel: true,
340
+    openBridgeChannel: 'websocket',
340
 
341
 
341
 
342
 
342
     // UI
343
     // UI

+ 6
- 2
debian/jitsi-meet-prosody.postrm Zobrazit soubor

45
             rm -rf /var/lib/prosody/$JICOFO_AUTH_DOMAIN.*
45
             rm -rf /var/lib/prosody/$JICOFO_AUTH_DOMAIN.*
46
             rm -rf /var/lib/prosody/$JVB_HOSTNAME.*
46
             rm -rf /var/lib/prosody/$JVB_HOSTNAME.*
47
 
47
 
48
-            # clean created users
49
-            rm -rf /var/lib/prosody/`echo $JICOFO_AUTH_DOMAIN | sed -e "s/\./%2e/g"`
48
+            # clean created users, replace '.' with '%2e', replace '-' with '%2d'
49
+            rm -rf /var/lib/prosody/`echo $JICOFO_AUTH_DOMAIN | sed -e "s/\./%2e/g"| sed -e "s/-/%2d/g"`
50
+
51
+            # clean the prosody cert from the trust store
52
+            rm -rf /usr/local/share/ca-certificates/$JICOFO_AUTH_DOMAIN.*
53
+            update-ca-certificates -f
50
         fi
54
         fi
51
 
55
 
52
         # Clear the debconf variable
56
         # Clear the debconf variable

+ 0
- 1
debian/jitsi-meet-turnserver.install Zobrazit soubor

1
 doc/debian/jitsi-meet-turn/turnserver.conf          /usr/share/jitsi-meet-turnserver/
1
 doc/debian/jitsi-meet-turn/turnserver.conf          /usr/share/jitsi-meet-turnserver/
2
-doc/debian/jitsi-meet/jitsi-meet.conf               /usr/share/jitsi-meet-turnserver/
3
 doc/debian/jitsi-meet-turn/coturn-certbot-deploy.sh /usr/share/jitsi-meet-turnserver/
2
 doc/debian/jitsi-meet-turn/coturn-certbot-deploy.sh /usr/share/jitsi-meet-turnserver/

+ 8
- 42
debian/jitsi-meet-turnserver.postinst Zobrazit soubor

36
         NGINX_CONFIG="/etc/nginx/sites-available/$JVB_HOSTNAME.conf"
36
         NGINX_CONFIG="/etc/nginx/sites-available/$JVB_HOSTNAME.conf"
37
         JITSI_MEET_CONFIG="/etc/jitsi/meet/$JVB_HOSTNAME-config.js"
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
         # if there was a turn config backup it so we can configure
39
         # 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
40
         # 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
41
         if [[ -f $TURN_CONFIG ]] && ! grep -q "jitsi-meet coturn config" "$TURN_CONFIG" ; then
133
         TURN_SECRET="$RET"
113
         TURN_SECRET="$RET"
134
 
114
 
135
         # no turn config exists, lt's copy template and fill it in
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
         cp /usr/share/jitsi-meet-turnserver/turnserver.conf $TURN_CONFIG
116
         cp /usr/share/jitsi-meet-turnserver/turnserver.conf $TURN_CONFIG
146
         sed -i "s/jitsi-meet.example.com/$JVB_HOSTNAME/g" $TURN_CONFIG
117
         sed -i "s/jitsi-meet.example.com/$JVB_HOSTNAME/g" $TURN_CONFIG
147
         sed -i "s/__turnSecret__/$TURN_SECRET/g" $TURN_CONFIG
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
         # SSL for nginx
120
         # SSL for nginx
151
         db_get jitsi-meet/cert-choice
121
         db_get jitsi-meet/cert-choice
170
         invoke-rc.d coturn restart || true
140
         invoke-rc.d coturn restart || true
171
 
141
 
172
         NGINX_STREAM_CONFIG="/etc/nginx/modules-enabled/60-jitsi-meet.conf"
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
         fi
151
         fi
186
 
152
 
187
         # Enable turn server in config.js
153
         # Enable turn server in config.js

+ 0
- 2
debian/jitsi-meet-turnserver.postrm Zobrazit soubor

24
 
24
 
25
 case "$1" in
25
 case "$1" in
26
     remove)
26
     remove)
27
-        rm -rf /etc/nginx/modules-enabled/60-jitsi-meet.conf
28
         if [ -x "/etc/init.d/nginx" ]; then
27
         if [ -x "/etc/init.d/nginx" ]; then
29
             invoke-rc.d nginx reload || true
28
             invoke-rc.d nginx reload || true
30
         fi
29
         fi
33
         fi
32
         fi
34
     ;;
33
     ;;
35
     purge)
34
     purge)
36
-        rm -rf /etc/nginx/modules-enabled/60-jitsi-meet.conf
37
         rm -rf /etc/turnserver.conf
35
         rm -rf /etc/turnserver.conf
38
         if [ -x "/etc/init.d/nginx" ]; then
36
         if [ -x "/etc/init.d/nginx" ]; then
39
             invoke-rc.d nginx reload || true
37
             invoke-rc.d nginx reload || true

+ 1
- 1
doc/debian/jitsi-meet-prosody/prosody.cfg.lua-jvb.example Zobrazit soubor

8
 turncredentials = {
8
 turncredentials = {
9
   { type = "stun", host = "jitmeet.example.com", port = "3478" },
9
   { type = "stun", host = "jitmeet.example.com", port = "3478" },
10
   { type = "turn", host = "jitmeet.example.com", port = "3478", transport = "udp" },
10
   { type = "turn", host = "jitmeet.example.com", port = "3478", transport = "udp" },
11
-  { type = "turns", host = "jitmeet.example.com", port = "443", transport = "tcp" }
11
+  { type = "turns", host = "jitmeet.example.com", port = "5349", transport = "tcp" }
12
 };
12
 };
13
 
13
 
14
 cross_domain_bosh = false;
14
 cross_domain_bosh = false;

+ 0
- 1
doc/debian/jitsi-meet-turn/turnserver.conf Zobrazit soubor

12
 no-tcp
12
 no-tcp
13
 listening-port=3478
13
 listening-port=3478
14
 tls-listening-port=5349
14
 tls-listening-port=5349
15
-external-ip=__external_ip_address__
16
 no-tlsv1
15
 no-tlsv1
17
 no-tlsv1_1
16
 no-tlsv1_1
18
 # https://ssl-config.mozilla.org/#server=haproxy&version=2.1&config=intermediate&openssl=1.1.0g&guideline=5.4
17
 # https://ssl-config.mozilla.org/#server=haproxy&version=2.1&config=intermediate&openssl=1.1.0g&guideline=5.4

+ 0
- 30
doc/debian/jitsi-meet/jitsi-meet.conf Zobrazit soubor

1
-# this is jitsi-meet nginx module configuration
2
-# this forward all http traffic to the nginx virtual host port
3
-# and the rest to the turn server
4
-
5
-stream {
6
-    upstream web {
7
-        server 127.0.0.1:4444;
8
-    }
9
-    upstream turn {
10
-        server 127.0.0.1:5349;
11
-    }
12
-    # since 1.13.10
13
-    map $ssl_preread_alpn_protocols $upstream {
14
-        ~\bh2\b         web;
15
-        ~\bhttp/1\.     web;
16
-        default         turn;
17
-    }
18
-
19
-    server {
20
-        listen 443;
21
-        listen [::]:443;
22
-
23
-        # since 1.11.5
24
-        ssl_preread on;
25
-        proxy_pass $upstream;
26
-
27
-        # Increase buffer to serve video
28
-        proxy_buffer_size 10m;
29
-    }
30
-}

+ 9
- 0
doc/debian/jitsi-meet/jitsi-meet.example Zobrazit soubor

87
         tcp_nodelay on;
87
         tcp_nodelay on;
88
     }
88
     }
89
 
89
 
90
+    # colibri (JVB) websockets for jvb1
91
+    location ~ ^/colibri-ws/default-id/(.*) {
92
+       proxy_pass http://127.0.0.1:9090/colibri-ws/default-id/$1$is_args$args;
93
+       proxy_http_version 1.1;
94
+       proxy_set_header Upgrade $http_upgrade;
95
+       proxy_set_header Connection "upgrade";
96
+       tcp_nodelay on;
97
+    }
98
+
90
     location ~ ^/([^/?&:'"]+)$ {
99
     location ~ ^/([^/?&:'"]+)$ {
91
         try_files $uri @root_path;
100
         try_files $uri @root_path;
92
     }
101
     }

Načítá se…
Zrušit
Uložit