Bläddra i källkod

feat: Adds jaas choice when installing.

factor2
damencho 3 år sedan
förälder
incheckning
fce15b491d

+ 9
- 5
config.js Visa fil

22
     subdomain = '';
22
     subdomain = '';
23
 }
23
 }
24
 
24
 
25
+var enableJaaS = false;
26
+
25
 var config = {
27
 var config = {
26
     // Connection
28
     // Connection
27
     //
29
     //
1287
     // {"countryCode":"US","tollFree":false,"formattedNumber":"+1 123-456-7890"}
1289
     // {"countryCode":"US","tollFree":false,"formattedNumber":"+1 123-456-7890"}
1288
     // dialInConfCodeUrl is the conference mapper converting a meeting id to a PIN used for dial-in
1290
     // dialInConfCodeUrl is the conference mapper converting a meeting id to a PIN used for dial-in
1289
     // or the other way around (more info in resources/cloud-api.swagger)
1291
     // or the other way around (more info in resources/cloud-api.swagger)
1290
-    //
1291
-    // For JaaS customers the default values are:
1292
-    // dialInNumbersUrl: 'https://conference-mapper.jitsi.net/v1/access/dids',
1293
-    // dialInConfCodeUrl: 'https://conference-mapper.jitsi.net/v1/access',
1294
-    //
1295
 
1292
 
1296
     // List of undocumented settings used in jitsi-meet
1293
     // List of undocumented settings used in jitsi-meet
1297
     /**
1294
     /**
1494
     // Application logo url
1491
     // Application logo url
1495
     // defaultLogoUrl: 'images/watermark.svg',
1492
     // defaultLogoUrl: 'images/watermark.svg',
1496
 };
1493
 };
1494
+
1495
+// Set the default values for JaaS customers
1496
+if (enableJaaS) {
1497
+    config.dialInNumbersUrl = 'https://conference-mapper.jitsi.net/v1/access/dids';
1498
+    config.dialInConfCodeUrl = 'https://conference-mapper.jitsi.net/v1/access';
1499
+    config.roomPasswordNumberOfDigits = 10; // skip re-adding it (do not remove comment)
1500
+}

+ 1
- 0
debian/jitsi-meet-prosody.install Visa fil

1
 doc/debian/jitsi-meet-prosody/prosody.cfg.lua-jvb.example   /usr/share/jitsi-meet-prosody/
1
 doc/debian/jitsi-meet-prosody/prosody.cfg.lua-jvb.example   /usr/share/jitsi-meet-prosody/
2
+doc/debian/jitsi-meet-prosody/jaas.cfg.lua                  /usr/share/jitsi-meet-prosody/
2
 resources/prosody-plugins/                                  /usr/share/jitsi-meet/
3
 resources/prosody-plugins/                                  /usr/share/jitsi-meet/

+ 36
- 1
debian/jitsi-meet-prosody.postinst Visa fil

83
             TURN_SECRET="$RET"
83
             TURN_SECRET="$RET"
84
         fi
84
         fi
85
 
85
 
86
+        db_get jitsi-meet/jaas-choice
87
+        JAAS_INPUT="$RET"
88
+        # In the case of updating from an older version the configure of -prosody package may happen before the -config
89
+        # one, so if JAAS_INPUT is empty (the question is not asked), let's ask it now.
90
+        if [ -z "$JAAS_INPUT" ] ; then
91
+            db_subst jitsi-meet/jaas-choice domain "${JVB_HOSTNAME}"
92
+            db_input critical jitsi-meet/jaas-choice || true
93
+            db_go
94
+            db_get jitsi-meet/jaas-choice
95
+            JAAS_INPUT="$RET"
96
+        fi
97
+
86
         # and we're done with debconf
98
         # and we're done with debconf
87
         db_stop
99
         db_stop
88
 
100
 
141
         # New:
153
         # New:
142
         # Component "focus.jitmeet.example.com" "client_proxy"
154
         # Component "focus.jitmeet.example.com" "client_proxy"
143
         #    target_address = "focus@auth.jitmeet.example.com"
155
         #    target_address = "focus@auth.jitmeet.example.com"
144
-        if grep -q "Component \"focus.$JVB_HOSTNAME\"" $PROSODY_HOST_CONFIG && ! grep "Component \"focus.$JVB_HOSTNAME\" \"client_proxy\"" $PROSODY_HOST_CONFIG ;then
156
+        if grep -q "Component \"focus.$JVB_HOSTNAME\"" $PROSODY_HOST_CONFIG && ! grep -q "Component \"focus.$JVB_HOSTNAME\" \"client_proxy\"" $PROSODY_HOST_CONFIG ;then
145
             sed -i "s/Component \"focus.$JVB_HOSTNAME\"/Component \"focus.$JVB_HOSTNAME\" \"client_proxy\"\n    target_address = \"$JICOFO_AUTH_USER@$JICOFO_AUTH_DOMAIN\"/g" $PROSODY_HOST_CONFIG
157
             sed -i "s/Component \"focus.$JVB_HOSTNAME\"/Component \"focus.$JVB_HOSTNAME\" \"client_proxy\"\n    target_address = \"$JICOFO_AUTH_USER@$JICOFO_AUTH_DOMAIN\"/g" $PROSODY_HOST_CONFIG
146
             PROSODY_CONFIG_PRESENT="false"
158
             PROSODY_CONFIG_PRESENT="false"
147
         fi
159
         fi
166
             PROSODY_CONFIG_PRESENT="false"
178
             PROSODY_CONFIG_PRESENT="false"
167
         fi
179
         fi
168
 
180
 
181
+        JAAS_HOST_CONFIG="/etc/prosody/conf.avail/jaas.cfg.lua"
182
+        if [ "${JAAS_INPUT}" = "true" ] && [ ! -f $JAAS_HOST_CONFIG ]; then
183
+            sed -i "s/enabled = false -- Jitsi meet components/enabled = true -- Jitsi meet components/g" $PROSODY_HOST_CONFIG
184
+            PROSODY_CONFIG_PRESENT="false"
185
+        fi
186
+
187
+        # For those deployments that don't have the config in the jitsi-meet prosody config add the new jaas file
188
+        if [ ! -f $JAAS_HOST_CONFIG ] && ! grep -q "VirtualHost \"jigasi.meet.jitsi\"" $PROSODY_HOST_CONFIG; then
189
+            PROSODY_CONFIG_PRESENT="false"
190
+            cp /usr/share/jitsi-meet-prosody/jaas.cfg.lua $JAAS_HOST_CONFIG
191
+            sed -i "s/jitmeet.example.com/$JVB_HOSTNAME/g" $JAAS_HOST_CONFIG
192
+        fi
193
+
194
+        if [ "${JAAS_INPUT}" = "true" ]; then
195
+            JAAS_HOST_CONFIG_ENABLED="/etc/prosody/conf.d/jaas.cfg.lua "
196
+            if [ ! -f $JAAS_HOST_CONFIG_ENABLED ] && ! grep -q "VirtualHost \"jigasi.meet.jitsi\"" $PROSODY_HOST_CONFIG; then
197
+                if [ -f $JAAS_HOST_CONFIG ]; then
198
+                    ln -s $JAAS_HOST_CONFIG $JAAS_HOST_CONFIG_ENABLED
199
+                    PROSODY_CONFIG_PRESENT="false"
200
+                fi
201
+            fi
202
+        fi
203
+
169
         # Make sure the focus@auth user's roster includes the proxy component (this is idempotent)
204
         # Make sure the focus@auth user's roster includes the proxy component (this is idempotent)
170
         prosodyctl mod_roster_command subscribe focus.$JVB_HOSTNAME $JICOFO_AUTH_USER@$JICOFO_AUTH_DOMAIN
205
         prosodyctl mod_roster_command subscribe focus.$JVB_HOSTNAME $JICOFO_AUTH_USER@$JICOFO_AUTH_DOMAIN
171
 
206
 

+ 2
- 0
debian/jitsi-meet-prosody.postrm Visa fil

35
         if [ -n "$RET" ]; then
35
         if [ -n "$RET" ]; then
36
             rm -f /etc/prosody/conf.avail/$JVB_HOSTNAME.cfg.lua
36
             rm -f /etc/prosody/conf.avail/$JVB_HOSTNAME.cfg.lua
37
             rm -f /etc/prosody/conf.d/$JVB_HOSTNAME.cfg.lua
37
             rm -f /etc/prosody/conf.d/$JVB_HOSTNAME.cfg.lua
38
+            rm -f /etc/prosody/conf.avail/jaas.cfg.lua
39
+            rm -f /etc/prosody/conf.d/jaas.cfg.lua
38
 
40
 
39
             JICOFO_AUTH_DOMAIN="auth.$JVB_HOSTNAME"
41
             JICOFO_AUTH_DOMAIN="auth.$JVB_HOSTNAME"
40
             # clean up generated certificates
42
             # clean up generated certificates

+ 0
- 8
debian/jitsi-meet-web-config.config Visa fil

1
-#!/bin/sh -e
2
-
3
-# Source debconf library.
4
-. /usr/share/debconf/confmodule
5
-
6
-# certificate type choice
7
-db_input critical jitsi-meet/cert-choice || true
8
-db_go

+ 47
- 21
debian/jitsi-meet-web-config.postinst Visa fil

68
             FORCE_NGINX="false"
68
             FORCE_NGINX="false"
69
         fi
69
         fi
70
 
70
 
71
+        db_subst jitsi-meet/jaas-choice domain "${JVB_HOSTNAME}"
72
+        db_input critical jitsi-meet/jaas-choice || true
73
+        db_go
74
+        db_get jitsi-meet/jaas-choice
75
+        JAAS_INPUT="$RET"
76
+
71
         UPLOADED_CERT_CHOICE="I want to use my own certificate"
77
         UPLOADED_CERT_CHOICE="I want to use my own certificate"
72
         # if first time config ask for certs, or if we are reconfiguring
78
         # if first time config ask for certs, or if we are reconfiguring
73
         if [ -z "$JVB_HOSTNAME_OLD" ] || [ "$RECONFIGURING" = "true" ] ; then
79
         if [ -z "$JVB_HOSTNAME_OLD" ] || [ "$RECONFIGURING" = "true" ] ; then
74
             RET=""
80
             RET=""
81
+            db_input critical jitsi-meet/cert-choice || true
82
+            db_go
75
             db_get jitsi-meet/cert-choice
83
             db_get jitsi-meet/cert-choice
76
             CERT_CHOICE="$RET"
84
             CERT_CHOICE="$RET"
77
 
85
 
122
             sed -i "s/jitsi-meet.example.com/$JVB_HOSTNAME/g" $JITSI_MEET_CONFIG
130
             sed -i "s/jitsi-meet.example.com/$JVB_HOSTNAME/g" $JITSI_MEET_CONFIG
123
         fi
131
         fi
124
 
132
 
133
+        if [ "${JAAS_INPUT}" = "true" ] && ! grep -q "^var enableJaaS = true;$" $JITSI_MEET_CONFIG;  then
134
+            if grep -q "^var enableJaaS = false;$" $JITSI_MEET_CONFIG; then
135
+                sed -i "s/^var enableJaaS = false;$/var enableJaaS = true;/g" $JITSI_MEET_CONFIG
136
+            else
137
+                # old config, let's add the lines at the end. Adding var enableJaaS to avoid adding it on update again
138
+                echo "var enableJaaS = true;" >> $JITSI_MEET_CONFIG
139
+                echo "config.dialInNumbersUrl = 'https://conference-mapper.jitsi.net/v1/access/dids';" >> $JITSI_MEET_CONFIG
140
+                echo "config.dialInConfCodeUrl = 'https://conference-mapper.jitsi.net/v1/access';" >> $JITSI_MEET_CONFIG
141
+
142
+                # Sets roomPasswordNumberOfDigits only if there was not already set
143
+                if ! cat $JITSI_MEET_CONFIG | grep roomPasswordNumberOfDigits | grep -qv //; then
144
+                    echo "config.roomPasswordNumberOfDigits = 10; // skip re-adding it (do not remove comment)" >> $JITSI_MEET_CONFIG
145
+                fi
146
+            fi
147
+        fi
148
+
125
         if [[ "$FORCE_NGINX" = "true" && ( -z "$JVB_HOSTNAME_OLD" || "$RECONFIGURING" = "true" ) ]] ; then
149
         if [[ "$FORCE_NGINX" = "true" && ( -z "$JVB_HOSTNAME_OLD" || "$RECONFIGURING" = "true" ) ]] ; then
126
 
150
 
127
             # this is a reconfigure, lets just delete old links
151
             # this is a reconfigure, lets just delete old links
191
         echo ""
215
         echo ""
192
         echo "----------------"
216
         echo "----------------"
193
 
217
 
194
-        echo ""
195
-        echo ""
196
-        echo "       ;dOocd;"
197
-        echo "     .dNMM0dKO."
198
-        echo "     lNMMMKd0K,"
199
-        echo "    .xMMMMNxkNc"
200
-        echo "     dMMMMMkxXc"
201
-        echo "     cNMMMNl.."
202
-        echo "     .kMMMX;             Interested in adding telephony to your Jitsi meetings?"
203
-        echo "      ;XMMMO'"
204
-        echo "       lNMMWO'           Sign up on https://jaas.8x8.vc/#/components"
205
-        echo "        lNMMM0,                        and follow the guide in the dev console."
206
-        echo "         lXMMMK:."
207
-        echo "          ;KMMMNKd.  'oo,"
208
-        echo "           'xNMMMMXkkkkOKOl'"
209
-        echo "             :0WMMMMMMNOkk0Kk,"
210
-        echo "              .cdOWMMMMMWXOkOl"
211
-        echo "                 .;dKWMMMMMXc."
212
-        echo "                    .,:cll:'"
213
-        echo ""
214
-        echo ""
218
+        if [ "${JAAS_INPUT}" != "true" ]; then
219
+            echo ""
220
+            echo ""
221
+            echo "       ;dOocd;"
222
+            echo "     .dNMM0dKO."
223
+            echo "     lNMMMKd0K,"
224
+            echo "    .xMMMMNxkNc"
225
+            echo "     dMMMMMkxXc"
226
+            echo "     cNMMMNl.."
227
+            echo "     .kMMMX;             Interested in adding telephony to your Jitsi meetings?"
228
+            echo "      ;XMMMO'"
229
+            echo "       lNMMWO'           Sign up on https://jaas.8x8.vc/components?host=${JVB_HOSTNAME}"
230
+            echo "        lNMMM0,                        and follow the guide in the dev console."
231
+            echo "         lXMMMK:."
232
+            echo "          ;KMMMNKd.  'oo,"
233
+            echo "           'xNMMMMXkkkkOKOl'"
234
+            echo "             :0WMMMMMMNOkk0Kk,"
235
+            echo "              .cdOWMMMMMWXOkOl"
236
+            echo "                 .;dKWMMMMMXc."
237
+            echo "                    .,:cll:'"
238
+            echo ""
239
+            echo ""
240
+        fi
215
 
241
 
216
         # and we're done with debconf
242
         # and we're done with debconf
217
         db_stop
243
         db_stop

+ 9
- 0
debian/jitsi-meet-web-config.templates Visa fil

5
  Jitsi Meet is best to be set up with an SSL certificate.
5
  Jitsi Meet is best to be set up with an SSL certificate.
6
  Having no certificate, a self-signed one will be generated.
6
  Having no certificate, a self-signed one will be generated.
7
  By choosing self-signed you will later have a chance to install Let’s Encrypt certificates.
7
  By choosing self-signed you will later have a chance to install Let’s Encrypt certificates.
8
+ In the case of using a self-signed certificate, only the web app will be available with some warnings, the mobile app will not connect.
8
  Having a certificate signed by a recognised CA, it can be uploaded on the server
9
  Having a certificate signed by a recognised CA, it can be uploaded on the server
9
  and point its location. The default filenames will be /etc/ssl/--domain.name--.key
10
  and point its location. The default filenames will be /etc/ssl/--domain.name--.key
10
  for the key and /etc/ssl/--domain.name--.crt for the certificate.
11
  for the key and /etc/ssl/--domain.name--.crt for the certificate.
30
 Type: string
31
 Type: string
31
 _Description: Hostname:
32
 _Description: Hostname:
32
  The Jitsi Meet web config package needs the DNS hostname of your instance.
33
  The Jitsi Meet web config package needs the DNS hostname of your instance.
34
+
35
+Template: jitsi-meet/jaas-choice
36
+Type: boolean
37
+_Description: Interested in adding telephony to your Jitsi meetings?
38
+ You can easily add dialing in support to your meetings using JaaS (Jitsi as a Service).
39
+ You need to:
40
+  - have a certificate signed by a recognised CA or Let’s Encrypt on your deployment
41
+  - sign in for JaaS at https://jaas.8x8.vc/components?host=${domain}

+ 12
- 0
doc/debian/jitsi-meet-prosody/jaas.cfg.lua Visa fil

1
+-- Enables dial-in for Jitsi meet components customers
2
+VirtualHost "jigasi.meet.jitsi"
3
+    modules_enabled = {
4
+        "ping";
5
+        "bosh";
6
+        "muc_password_check";
7
+    }
8
+    authentication = "token"
9
+    app_id = "jitsi";
10
+    asap_key_server = "https://jaas-public-keys.jitsi.net/jitsi-components/prod-8x8"
11
+    asap_accepted_issuers = { "jaas-components" }
12
+    asap_accepted_audiences = { "jigasi.jitmeet.example.com" }

+ 0
- 13
doc/debian/jitsi-meet-prosody/prosody.cfg.lua-jvb.example Visa fil

140
         "muc_rate_limit";
140
         "muc_rate_limit";
141
         "polls";
141
         "polls";
142
     }
142
     }
143
-
144
-VirtualHost "jigasi.meet.jitsi"
145
-    enabled = false -- Jitsi meet components customers remove this line
146
-    modules_enabled = {
147
-      "ping";
148
-      "bosh";
149
-      "muc_password_check";
150
-    }
151
-    authentication = "token"
152
-    app_id = "jitsi";
153
-    asap_key_server = "https://jaas-public-keys.jitsi.net/jitsi-components/prod-8x8"
154
-    asap_accepted_issuers = { "jaas-components" }
155
-    asap_accepted_audiences = { "jigasi.jitmeet.example.com" }

+ 0
- 1
resources/install-letsencrypt-cert.sh Visa fil

12
 echo "- Need a working DNS record pointing to this machine(for domain ${DOMAIN})"
12
 echo "- Need a working DNS record pointing to this machine(for domain ${DOMAIN})"
13
 echo "- Download certbot-auto from https://dl.eff.org to /usr/local/sbin"
13
 echo "- Download certbot-auto from https://dl.eff.org to /usr/local/sbin"
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"
16
 echo "- Configure and reload nginx or apache2, whichever is used"
15
 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"
16
 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 "- Add command in weekly cron job to renew certificates regularly"

Laddar…
Avbryt
Spara