浏览代码

debian: updates around coturn package and order of install (#5729)

* debian: Update coturn udp port to non-privileged one.

* debian: Turnserver config requires jitsi-meet-web-config files.

* doc: Updates doc, removing `--no-install-recommends`.

* debian: Moves checks and configs to default to prosody 0.11.

* debian: Disable room locking on internal muc.

* add scripts for deploying coturn with certbot

* turnserver: Removes unused variable showing error.

* debian: updates let's encrypt and coturn scripts.

* debian: Detect failure to retrieve external ip address.

* debian: Always configure turn when the turnserver package is installed.

Co-authored-by: Julien Fastré <julien.fastre@champs-libres.coop>
master
Дамян Минков 5 年前
父节点
当前提交
ffdd4f2eed
没有帐户链接到提交者的电子邮件

+ 1
- 1
config.js 查看文件

342
         // The STUN servers that will be used in the peer to peer connections
342
         // The STUN servers that will be used in the peer to peer connections
343
         stunServers: [
343
         stunServers: [
344
 
344
 
345
-            // { urls: 'stun:jitsi-meet.example.com:443' },
345
+            // { urls: 'stun:jitsi-meet.example.com:4446' },
346
             { urls: 'stun:meet-jit-si-turnrelay.jitsi.net:443' }
346
             { urls: 'stun:meet-jit-si-turnrelay.jitsi.net:443' }
347
         ],
347
         ],
348
 
348
 

+ 1
- 0
debian/control 查看文件

53
 Package: jitsi-meet-turnserver
53
 Package: jitsi-meet-turnserver
54
 Architecture: all
54
 Architecture: all
55
 Breaks: apache2
55
 Breaks: apache2
56
+Pre-Depends: jitsi-meet-web-config
56
 Depends: ${misc:Depends}, nginx (>= 1.13.10) | nginx-full (>= 1.13.10) | nginx-extras (>= 1.13.10), jitsi-meet-prosody, coturn, dnsutils
57
 Depends: ${misc:Depends}, nginx (>= 1.13.10) | nginx-full (>= 1.13.10) | nginx-extras (>= 1.13.10), jitsi-meet-prosody, coturn, dnsutils
57
 Description: Configures coturn to be used with Jitsi Meet
58
 Description: Configures coturn to be used with Jitsi Meet

+ 6
- 7
debian/jitsi-meet-prosody.postinst 查看文件

137
         # as we are migrating configs
137
         # as we are migrating configs
138
         if [ -f $PROSODY_HOST_CONFIG ] && ! grep -q "internal.auth.$JVB_HOSTNAME" $PROSODY_HOST_CONFIG; then
138
         if [ -f $PROSODY_HOST_CONFIG ] && ! grep -q "internal.auth.$JVB_HOSTNAME" $PROSODY_HOST_CONFIG; then
139
             echo -e "\nComponent \"internal.auth.$JVB_HOSTNAME\" \"muc\"" >> $PROSODY_HOST_CONFIG
139
             echo -e "\nComponent \"internal.auth.$JVB_HOSTNAME\" \"muc\"" >> $PROSODY_HOST_CONFIG
140
-            echo -e "    storage = \"null\"" >> $PROSODY_HOST_CONFIG
140
+            echo -e "    storage = \"memory\"" >> $PROSODY_HOST_CONFIG
141
             echo -e "    modules_enabled = { \"ping\"; }" >> $PROSODY_HOST_CONFIG
141
             echo -e "    modules_enabled = { \"ping\"; }" >> $PROSODY_HOST_CONFIG
142
             echo -e "    admins = { \"$JICOFO_AUTH_USER@auth.$JVB_HOSTNAME\", \"jvb@auth.$JVB_HOSTNAME\" }" >> $PROSODY_HOST_CONFIG
142
             echo -e "    admins = { \"$JICOFO_AUTH_USER@auth.$JVB_HOSTNAME\", \"jvb@auth.$JVB_HOSTNAME\" }" >> $PROSODY_HOST_CONFIG
143
         fi
143
         fi
151
             ln -sf /var/lib/prosody/$JVB_HOSTNAME.crt /etc/prosody/certs/$JVB_HOSTNAME.crt
151
             ln -sf /var/lib/prosody/$JVB_HOSTNAME.crt /etc/prosody/certs/$JVB_HOSTNAME.crt
152
         fi
152
         fi
153
 
153
 
154
-        PR11_INSTALL_CHECK="$(dpkg-query -f '${Status}' -W 'prosody-0.11' 2>/dev/null | awk '{print $3}' || true)"
154
+        PRTRUNK_INSTALL_CHECK="$(dpkg-query -f '${Status}' -W 'prosody-trunk' 2>/dev/null | awk '{print $3}' || true)"
155
         PR10_INSTALL_CHECK="$(dpkg-query -f '${Status}' -W 'prosody-0.10' 2>/dev/null | awk '{print $3}' || true)"
155
         PR10_INSTALL_CHECK="$(dpkg-query -f '${Status}' -W 'prosody-0.10' 2>/dev/null | awk '{print $3}' || true)"
156
         PR_VER_INSTALLED=$(dpkg-query -f='${Version}\n' --show prosody  2>/dev/null || true)
156
         PR_VER_INSTALLED=$(dpkg-query -f='${Version}\n' --show prosody  2>/dev/null || true)
157
-        if [ "$PR11_INSTALL_CHECK" = "installed" ] \
158
-            || [ "$PR11_INSTALL_CHECK" = "unpacked" ] \
159
-            || dpkg --compare-versions "$PR_VER_INSTALLED" gt "0.11" ; then
157
+        if [ "$PRTRUNK_INSTALL_CHECK" = "installed" ] \
158
+            || [ "$PRTRUNK_INSTALL_CHECK" = "unpacked" ] ; then
160
             if [ -f $PROSODY_HOST_CONFIG ]; then
159
             if [ -f $PROSODY_HOST_CONFIG ]; then
161
-                sed -i 's/storage = \"null\"/storage = \"memory\"/g' $PROSODY_HOST_CONFIG
160
+                sed -i 's/storage = \"memory\"/storage = \"null\"/g' $PROSODY_HOST_CONFIG
162
 
161
 
163
                 # trigger a restart
162
                 # trigger a restart
164
                 PROSODY_CONFIG_PRESENT="false"
163
                 PROSODY_CONFIG_PRESENT="false"
171
             # if the version is 0.10.X (>0.10 and <0.11)
170
             # if the version is 0.10.X (>0.10 and <0.11)
172
             if [ -f $PROSODY_HOST_CONFIG ] \
171
             if [ -f $PROSODY_HOST_CONFIG ] \
173
                 && dpkg --compare-versions "$PR_VER_INSTALLED" lt "0.11" ; then
172
                 && dpkg --compare-versions "$PR_VER_INSTALLED" lt "0.11" ; then
174
-                sed -i 's/storage = \"null\"/storage = \"none\"/g' $PROSODY_HOST_CONFIG
173
+                sed -i 's/storage = \"memory\"/storage = \"none\"/g' $PROSODY_HOST_CONFIG
175
 
174
 
176
                 # trigger a restart
175
                 # trigger a restart
177
                 PROSODY_CONFIG_PRESENT="false"
176
                 PROSODY_CONFIG_PRESENT="false"

+ 8
- 5
debian/jitsi-meet-tokens.postinst 查看文件

69
                    echo "Failed to install basexx - try installing it manually"
69
                    echo "Failed to install basexx - try installing it manually"
70
                 fi
70
                 fi
71
 
71
 
72
-                PR11_INSTALL_CHECK="$(dpkg-query -f '${Status}' -W 'prosody-0.11' 2>/dev/null | awk '{print $3}' || true)"
72
+                PR10_INSTALL_CHECK="$(dpkg-query -f '${Status}' -W 'prosody-0.10' 2>/dev/null | awk '{print $3}' || true)"
73
+                PRTRUNK_INSTALL_CHECK="$(dpkg-query -f '${Status}' -W 'prosody-trunk' 2>/dev/null | awk '{print $3}' || true)"
73
                 PR_VER_INSTALLED=$(dpkg-query -f='${Version}\n' --show prosody  2>/dev/null || true)
74
                 PR_VER_INSTALLED=$(dpkg-query -f='${Version}\n' --show prosody  2>/dev/null || true)
74
-                if [ "$PR11_INSTALL_CHECK" = "installed" ] \
75
-                    || [ "$PR11_INSTALL_CHECK" = "unpacked" ] \
76
-                    || dpkg --compare-versions "$PR_VER_INSTALLED" gt "0.11" ; then
77
-                    sed -i 's/module:hook/module:hook_global/g' /usr/share/jitsi-meet/prosody-plugins/mod_auth_token.lua
75
+                if [ "$PR10_INSTALL_CHECK" = "installed" ] \
76
+                    || "$PR10_INSTALL_CHECK" = "unpacked"  \
77
+                    || "$PRTRUNK_INSTALL_CHECK" = "installed"  \
78
+                    || "$PRTRUNK_INSTALL_CHECK" = "unpacked"  \
79
+                    || dpkg --compare-versions "$PR_VER_INSTALLED" lt "0.11" ; then
80
+                    sed -i 's/module:hook_global(/module:hook(/g' /usr/share/jitsi-meet/prosody-plugins/mod_auth_token.lua
78
                 fi
81
                 fi
79
 
82
 
80
                 if [ -x "/etc/init.d/prosody" ]; then
83
                 if [ -x "/etc/init.d/prosody" ]; then

+ 3
- 2
debian/jitsi-meet-turnserver.install 查看文件

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/
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/

+ 22
- 14
debian/jitsi-meet-turnserver.postinst 查看文件

38
 
38
 
39
         NGINX_SITES_ENABLED="/etc/nginx/sites-enabled/"
39
         NGINX_SITES_ENABLED="/etc/nginx/sites-enabled/"
40
         NGINX_CONFIG_ENABLED="${NGINX_SITES_ENABLED}${JVB_HOSTNAME}.conf"
40
         NGINX_CONFIG_ENABLED="${NGINX_SITES_ENABLED}${JVB_HOSTNAME}.conf"
41
+        NGINX_MULTIPLEXING="true"
41
         for site in ${NGINX_SITES_ENABLED}*; do
42
         for site in ${NGINX_SITES_ENABLED}*; do
42
             # if it is not a file continue
43
             # if it is not a file continue
43
             [ -f "${site}" ] || continue
44
             [ -f "${site}" ] || continue
48
                 # nothing to do
49
                 # nothing to do
49
                 echo "------------------------------------------------"
50
                 echo "------------------------------------------------"
50
                 echo ""
51
                 echo ""
51
-                echo "turnserver not configured as other nginx sites use port 443"
52
+                echo "turnserver is listening on tcp 4445 as other nginx sites use port 443"
52
                 echo ""
53
                 echo ""
53
                 echo "------------------------------------------------"
54
                 echo "------------------------------------------------"
54
-                db_stop
55
-                exit 0
55
+                NGINX_MULTIPLEXING="false"
56
             fi
56
             fi
57
         done
57
         done
58
 
58
 
77
             # nothing to do
77
             # nothing to do
78
             echo "------------------------------------------------"
78
             echo "------------------------------------------------"
79
             echo ""
79
             echo ""
80
-            echo "turnserver not configured as no nginx found to multiplex traffic"
80
+            echo "turnserver not configured"
81
             echo ""
81
             echo ""
82
             echo "------------------------------------------------"
82
             echo "------------------------------------------------"
83
             db_stop
83
             db_stop
106
         TURN_SECRET="$RET"
106
         TURN_SECRET="$RET"
107
 
107
 
108
         # no turn config exists, lt's copy template and fill it in
108
         # no turn config exists, lt's copy template and fill it in
109
-        PUBLIC_IP=$(dig +short myip.opendns.com @resolver1.opendns.com)
109
+        PUBLIC_IP=$(dig +short myip.opendns.com @resolver1.opendns.com) || true
110
+        if [ -z "$PUBLIC_IP" ] ; then
111
+            PUBLIC_IP="127.0.0.1"
112
+            echo "------------------------------------------------"
113
+            echo "Warning! Could not resolve your external ip address! Error:^"
114
+            echo "Your turn server will not work till you edit your $TURN_CONFIG config file."
115
+            echo "You need to set your external ip address in external-ip and restart coturn service."
116
+            echo "------------------------------------------------"
117
+        fi
110
         cp /usr/share/jitsi-meet-turnserver/turnserver.conf $TURN_CONFIG
118
         cp /usr/share/jitsi-meet-turnserver/turnserver.conf $TURN_CONFIG
111
         sed -i "s/jitsi-meet.example.com/$JVB_HOSTNAME/g" $TURN_CONFIG
119
         sed -i "s/jitsi-meet.example.com/$JVB_HOSTNAME/g" $TURN_CONFIG
112
         sed -i "s/__turnSecret__/$TURN_SECRET/g" $TURN_CONFIG
120
         sed -i "s/__turnSecret__/$TURN_SECRET/g" $TURN_CONFIG
113
-        sed -i "s/__external_ip_address__/$JVB_HOSTNAME/g" $TURN_CONFIG
114
-
115
-        # Hack Debian Buster coturn to be able to bind privileged port 443
116
-        COTURN_UNIT_FILE="/lib/systemd/system/coturn.service"
117
-        if [[ -f $COTURN_UNIT_FILE ]] && ! grep -q "CAP_NET_BIND_SERVICE" "$COTURN_UNIT_FILE" ; then
118
-            sed -i "s/\[Service\]/\[Service\]\nAmbientCapabilities=CAP_NET_BIND_SERVICE/g" $COTURN_UNIT_FILE
119
-            systemctl daemon-reload
120
-        fi
121
+        sed -i "s/__external_ip_address__/$PUBLIC_IP/g" $TURN_CONFIG
121
 
122
 
122
         # SSL for nginx
123
         # SSL for nginx
123
         db_get jitsi-meet/cert-choice
124
         db_get jitsi-meet/cert-choice
142
         invoke-rc.d coturn restart || true
143
         invoke-rc.d coturn restart || true
143
 
144
 
144
         NGINX_STREAM_CONFIG="/etc/nginx/modules-enabled/60-jitsi-meet.conf"
145
         NGINX_STREAM_CONFIG="/etc/nginx/modules-enabled/60-jitsi-meet.conf"
145
-        if [ ! -f $NGINX_STREAM_CONFIG ] && [ -f $NGINX_CONFIG ] ; then
146
+        if [ $NGINX_MULTIPLEXING = "true" ] && [ ! -f $NGINX_STREAM_CONFIG ] && [ -f $NGINX_CONFIG ] ; then
146
             ln -s /usr/share/jitsi-meet-turnserver/jitsi-meet.conf $NGINX_STREAM_CONFIG
147
             ln -s /usr/share/jitsi-meet-turnserver/jitsi-meet.conf $NGINX_STREAM_CONFIG
147
             sed -i "s/listen 443 ssl/listen 4444 ssl http2/g" $NGINX_CONFIG
148
             sed -i "s/listen 443 ssl/listen 4444 ssl http2/g" $NGINX_CONFIG
148
             sed -i "s/listen \[\:\:\]\:443 ssl/listen \[\:\:\]\:4444 ssl http2/g" $NGINX_CONFIG
149
             sed -i "s/listen \[\:\:\]\:443 ssl/listen \[\:\:\]\:4444 ssl http2/g" $NGINX_CONFIG
149
             invoke-rc.d nginx reload || true
150
             invoke-rc.d nginx reload || true
151
+        else
152
+            PROSODY_HOST_CONFIG="/etc/prosody/conf.avail/$JVB_HOSTNAME.cfg.lua"
153
+            if [ -f $PROSODY_HOST_CONFIG ] ; then
154
+                # If we are not multiplexing we need to change the port in prosody config
155
+                sed -i 's/"443"/"4445"/g' $PROSODY_HOST_CONFIG
156
+                invoke-rc.d prosody restart || true
157
+            fi
150
         fi
158
         fi
151
 
159
 
152
         # Enable turn server in config.js
160
         # Enable turn server in config.js

+ 6
- 4
doc/debian/jitsi-meet-prosody/prosody.cfg.lua-jvb.example 查看文件

6
 turncredentials_secret = "__turnSecret__";
6
 turncredentials_secret = "__turnSecret__";
7
 
7
 
8
 turncredentials = {
8
 turncredentials = {
9
-  { type = "stun", host = "jitmeet.example.com", port = "443" },
10
-  { type = "turn", host = "jitmeet.example.com", port = "443", transport = "udp" },
9
+  { type = "stun", host = "jitmeet.example.com", port = "4446" },
10
+  { type = "turn", host = "jitmeet.example.com", port = "4446", transport = "udp" },
11
   { type = "turns", host = "jitmeet.example.com", port = "443", transport = "tcp" }
11
   { type = "turns", host = "jitmeet.example.com", port = "443", transport = "tcp" }
12
 };
12
 };
13
 
13
 
43
         c2s_require_encryption = false
43
         c2s_require_encryption = false
44
 
44
 
45
 Component "conference.jitmeet.example.com" "muc"
45
 Component "conference.jitmeet.example.com" "muc"
46
-    storage = "null"
46
+    storage = "memory"
47
     modules_enabled = {
47
     modules_enabled = {
48
         "muc_meeting_id";
48
         "muc_meeting_id";
49
         "muc_domain_mapper";
49
         "muc_domain_mapper";
55
 
55
 
56
 -- internal muc component
56
 -- internal muc component
57
 Component "internal.auth.jitmeet.example.com" "muc"
57
 Component "internal.auth.jitmeet.example.com" "muc"
58
-    storage = "null"
58
+    storage = "memory"
59
     modules_enabled = {
59
     modules_enabled = {
60
       "ping";
60
       "ping";
61
     }
61
     }
62
     admins = { "focusUser@auth.jitmeet.example.com", "jvb@auth.jitmeet.example.com" }
62
     admins = { "focusUser@auth.jitmeet.example.com", "jvb@auth.jitmeet.example.com" }
63
+    muc_room_locking = false
64
+    muc_room_default_public_jids = true
63
 
65
 
64
 VirtualHost "auth.jitmeet.example.com"
66
 VirtualHost "auth.jitmeet.example.com"
65
     authentication = "internal_plain"
67
     authentication = "internal_plain"

+ 45
- 0
doc/debian/jitsi-meet-turn/coturn-certbot-deploy.sh 查看文件

1
+#!/bin/sh
2
+
3
+set -e
4
+
5
+COTURN_CERT_DIR="/etc/coturn/certs"
6
+TURN_CONFIG="/etc/turnserver.conf"
7
+
8
+# create a directory to store certs if it does not exists
9
+if [ ! -d "$COTURN_CERT_DIR" ]; then
10
+    mkdir -p $COTURN_CERT_DIR
11
+    chown -R turnserver:turnserver /etc/coturn/
12
+    chmod -R 700 /etc/coturn/
13
+fi
14
+
15
+# This is a template and when copied to /etc/letsencrypt/renewal-hooks/deploy/
16
+# during creating the Let's encrypt certs script
17
+# jitsi-meet.example.com will be replaced with the real domain of deployment
18
+for domain in $RENEWED_DOMAINS; do
19
+        case $domain in
20
+        jitsi-meet.example.com)
21
+                # Make sure the certificate and private key files are
22
+                # never world readable, even just for an instant while
23
+                # we're copying them into daemon_cert_root.
24
+                umask 077
25
+
26
+                cp "$RENEWED_LINEAGE/fullchain.pem" "$COTURN_CERT_DIR/$domain.fullchain.pem"
27
+                cp "$RENEWED_LINEAGE/privkey.pem" "$COTURN_CERT_DIR/$domain.privkey.pem"
28
+
29
+                # Apply the proper file ownership and permissions for
30
+                # the daemon to read its certificate and key.
31
+                chown turnserver "$COTURN_CERT_DIR/$domain.fullchain.pem" \
32
+                        "$COTURN_CERT_DIR/$domain.privkey.pem"
33
+                chmod 400 "$COTURN_CERT_DIR/$domain.fullchain.pem" \
34
+                        "$COTURN_CERT_DIR/$domain.privkey.pem"
35
+
36
+                if [ -f $TURN_CONFIG ] && grep -q "jitsi-meet coturn config" "$TURN_CONFIG" ; then
37
+                    echo "Configuring turnserver"
38
+                    sed -i "/^cert/c\cert=\/etc\/coturn\/certs\/${domain}.fullchain.pem" $TURN_CONFIG
39
+                    sed -i "/^pkey/c\pkey=\/etc\/coturn\/certs\/${domain}.privkey.pem" $TURN_CONFIG
40
+                fi
41
+                service coturn restart
42
+                ;;
43
+        esac
44
+done
45
+

+ 1
- 2
doc/debian/jitsi-meet-turn/turnserver.conf 查看文件

1
 # jitsi-meet coturn config. Do not modify this line
1
 # jitsi-meet coturn config. Do not modify this line
2
-lt-cred-mech
3
 use-auth-secret
2
 use-auth-secret
4
 keep-address-family
3
 keep-address-family
5
 static-auth-secret=__turnSecret__
4
 static-auth-secret=__turnSecret__
8
 pkey=/etc/jitsi/meet/jitsi-meet.example.com.key
7
 pkey=/etc/jitsi/meet/jitsi-meet.example.com.key
9
 
8
 
10
 no-tcp
9
 no-tcp
11
-listening-port=443
10
+listening-port=4446
12
 tls-listening-port=4445
11
 tls-listening-port=4445
13
 external-ip=__external_ip_address__
12
 external-ip=__external_ip_address__
14
 
13
 

+ 1
- 1
doc/quick-install.md 查看文件

29
 ### Install Jitsi Meet
29
 ### Install Jitsi Meet
30
 
30
 
31
 _Note_: The installer will check if [Nginx](https://nginx.org/) or [Apache](https://httpd.apache.org/) is present (in that order) and configure a virtualhost within the web server it finds to serve Jitsi Meet. If none of the above is found it then defaults to Nginx.
31
 _Note_: The installer will check if [Nginx](https://nginx.org/) or [Apache](https://httpd.apache.org/) is present (in that order) and configure a virtualhost within the web server it finds to serve Jitsi Meet. If none of the above is found it then defaults to Nginx.
32
-If you are already running Nginx on port 443 on the same machine you better skip the turnserver configuration as it will conflict with your current port 443, so use the command `apt install --no-install-recommends jitsi-meet`.
32
+If you are already running Nginx on port 443 on the same machine turnserver configuration will be skipped as it will conflict with your current port 443.
33
 
33
 
34
 ```sh
34
 ```sh
35
 # Ensure support is available for apt repositories served via HTTPS
35
 # Ensure support is available for apt repositories served via HTTPS

+ 14
- 32
resources/install-letsencrypt-cert.sh 查看文件

14
 echo "- Install additional dependencies in order to request Let’s Encrypt certificate"
14
 echo "- Install additional dependencies in order to request Let’s Encrypt certificate"
15
 echo "- If running with jetty serving web content, will stop Jitsi Videobridge"
15
 echo "- If running with jetty serving web content, will stop Jitsi Videobridge"
16
 echo "- Configure and reload nginx or apache2, whichever is used"
16
 echo "- Configure and reload nginx or apache2, whichever is used"
17
+echo "- Configure the coturn server to use Let's Encrypt certificate and add required deploy hooks"
18
+echo "- Add command in weekly cron job to renew certificates regularly"
17
 echo ""
19
 echo ""
18
 echo "You need to agree to the ACME server's Subscriber Agreement (https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf) "
20
 echo "You need to agree to the ACME server's Subscriber Agreement (https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf) "
19
 echo "by providing an email address for important account notifications"
21
 echo "by providing an email address for important account notifications"
40
 
42
 
41
 if [ -f /etc/nginx/sites-enabled/$DOMAIN.conf ] ; then
43
 if [ -f /etc/nginx/sites-enabled/$DOMAIN.conf ] ; then
42
 
44
 
45
+    TURN_CONFIG="/etc/turnserver.conf"
46
+    TURN_HOOK=/etc/letsencrypt/renewal-hooks/deploy/0000-coturn-certbot-deploy.sh
47
+    if [ -f $TURN_CONFIG ] && grep -q "jitsi-meet coturn config" "$TURN_CONFIG" ; then
48
+        mkdir -p $(dirname $TURN_HOOK)
49
+
50
+        cp /usr/share/jitsi-meet-turnserver/coturn-certbot-deploy.sh $TURN_HOOK
51
+        chmod u+x $TURN_HOOK
52
+        sed -i "s/jitsi-meet.example.com/$DOMAIN/g" $TURN_HOOK
53
+    fi
54
+
43
     ./certbot-auto certonly --noninteractive \
55
     ./certbot-auto certonly --noninteractive \
44
     --webroot --webroot-path /usr/share/jitsi-meet \
56
     --webroot --webroot-path /usr/share/jitsi-meet \
45
     -d $DOMAIN \
57
     -d $DOMAIN \
46
-    --agree-tos --email $EMAIL
58
+    --agree-tos --email $EMAIL \
59
+    --deploy-hook $TURN_HOOK
47
 
60
 
48
     echo "Configuring nginx"
61
     echo "Configuring nginx"
49
 
62
 
59
 
72
 
60
     echo "service nginx reload" >> $CRON_FILE
73
     echo "service nginx reload" >> $CRON_FILE
61
     service nginx reload
74
     service nginx reload
62
-
63
-    TURN_CONFIG="/etc/turnserver.conf"
64
-    if [ -f $TURN_CONFIG ] && grep -q "jitsi-meet coturn config" "$TURN_CONFIG" ; then
65
-        echo "Configuring turnserver"
66
-        sed -i "s/cert=\/etc\/jitsi\/meet\/.*crt/cert=$CERT_CRT_ESC/g" $TURN_CONFIG
67
-        sed -i "s/pkey=\/etc\/jitsi\/meet\/.*key/pkey=$CERT_KEY_ESC/g" $TURN_CONFIG
68
-
69
-        echo "service coturn restart" >> $CRON_FILE
70
-        service coturn restart
71
-    fi
72
 elif [ -f /etc/apache2/sites-enabled/$DOMAIN.conf ] ; then
75
 elif [ -f /etc/apache2/sites-enabled/$DOMAIN.conf ] ; then
73
 
76
 
74
     ./certbot-auto certonly --noninteractive \
77
     ./certbot-auto certonly --noninteractive \
90
 
93
 
91
     echo "service apache2 reload" >> $CRON_FILE
94
     echo "service apache2 reload" >> $CRON_FILE
92
     service apache2 reload
95
     service apache2 reload
93
-else
94
-    service jitsi-videobridge stop
95
-
96
-    ./certbot-auto certonly --noninteractive \
97
-    --standalone \
98
-    -d $DOMAIN \
99
-    --agree-tos --email $EMAIL
100
-
101
-    echo "Configuring jetty"
102
-
103
-    CERT_P12="/etc/jitsi/videobridge/$DOMAIN.p12"
104
-    CERT_JKS="/etc/jitsi/videobridge/$DOMAIN.jks"
105
-    # create jks from  certs
106
-    openssl pkcs12 -export \
107
-        -in $CERT_CRT -inkey $CERT_KEY -passout pass:changeit > $CERT_P12
108
-    keytool -importkeystore -destkeystore $CERT_JKS \
109
-        -srckeystore $CERT_P12 -srcstoretype pkcs12 \
110
-        -noprompt -storepass changeit -srcstorepass changeit
111
-
112
-    service jitsi-videobridge start
113
-
114
 fi
96
 fi
115
 
97
 
116
 # the cron file that will renew certificates
98
 # the cron file that will renew certificates

+ 2
- 2
resources/prosody-plugins/mod_auth_token.lua 查看文件

37
     end
37
     end
38
 end
38
 end
39
 
39
 
40
-module:hook("bosh-session", init_session);
41
-module:hook("websocket-session", init_session);
40
+module:hook_global("bosh-session", init_session);
41
+module:hook_global("websocket-session", init_session);
42
 
42
 
43
 function provider.test_password(username, password)
43
 function provider.test_password(username, password)
44
 	return nil, "Password based auth not supported";
44
 	return nil, "Password based auth not supported";

正在加载...
取消
保存