소스 검색

feat: Adds jaas choice when installing.

factor2
damencho 3 년 전
부모
커밋
fce15b491d

+ 9
- 5
config.js 파일 보기

@@ -22,6 +22,8 @@ if (subdomain.startsWith('<!--')) {
22 22
     subdomain = '';
23 23
 }
24 24
 
25
+var enableJaaS = false;
26
+
25 27
 var config = {
26 28
     // Connection
27 29
     //
@@ -1287,11 +1289,6 @@ var config = {
1287 1289
     // {"countryCode":"US","tollFree":false,"formattedNumber":"+1 123-456-7890"}
1288 1290
     // dialInConfCodeUrl is the conference mapper converting a meeting id to a PIN used for dial-in
1289 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 1293
     // List of undocumented settings used in jitsi-meet
1297 1294
     /**
@@ -1494,3 +1491,10 @@ var config = {
1494 1491
     // Application logo url
1495 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 파일 보기

@@ -1,2 +1,3 @@
1 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 3
 resources/prosody-plugins/                                  /usr/share/jitsi-meet/

+ 36
- 1
debian/jitsi-meet-prosody.postinst 파일 보기

@@ -83,6 +83,18 @@ case "$1" in
83 83
             TURN_SECRET="$RET"
84 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 98
         # and we're done with debconf
87 99
         db_stop
88 100
 
@@ -141,7 +153,7 @@ case "$1" in
141 153
         # New:
142 154
         # Component "focus.jitmeet.example.com" "client_proxy"
143 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 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 158
             PROSODY_CONFIG_PRESENT="false"
147 159
         fi
@@ -166,6 +178,29 @@ case "$1" in
166 178
             PROSODY_CONFIG_PRESENT="false"
167 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 204
         # Make sure the focus@auth user's roster includes the proxy component (this is idempotent)
170 205
         prosodyctl mod_roster_command subscribe focus.$JVB_HOSTNAME $JICOFO_AUTH_USER@$JICOFO_AUTH_DOMAIN
171 206
 

+ 2
- 0
debian/jitsi-meet-prosody.postrm 파일 보기

@@ -35,6 +35,8 @@ case "$1" in
35 35
         if [ -n "$RET" ]; then
36 36
             rm -f /etc/prosody/conf.avail/$JVB_HOSTNAME.cfg.lua
37 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 41
             JICOFO_AUTH_DOMAIN="auth.$JVB_HOSTNAME"
40 42
             # clean up generated certificates

+ 0
- 8
debian/jitsi-meet-web-config.config 파일 보기

@@ -1,8 +0,0 @@
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 파일 보기

@@ -68,10 +68,18 @@ case "$1" in
68 68
             FORCE_NGINX="false"
69 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 77
         UPLOADED_CERT_CHOICE="I want to use my own certificate"
72 78
         # if first time config ask for certs, or if we are reconfiguring
73 79
         if [ -z "$JVB_HOSTNAME_OLD" ] || [ "$RECONFIGURING" = "true" ] ; then
74 80
             RET=""
81
+            db_input critical jitsi-meet/cert-choice || true
82
+            db_go
75 83
             db_get jitsi-meet/cert-choice
76 84
             CERT_CHOICE="$RET"
77 85
 
@@ -122,6 +130,22 @@ case "$1" in
122 130
             sed -i "s/jitsi-meet.example.com/$JVB_HOSTNAME/g" $JITSI_MEET_CONFIG
123 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 149
         if [[ "$FORCE_NGINX" = "true" && ( -z "$JVB_HOSTNAME_OLD" || "$RECONFIGURING" = "true" ) ]] ; then
126 150
 
127 151
             # this is a reconfigure, lets just delete old links
@@ -191,27 +215,29 @@ case "$1" in
191 215
         echo ""
192 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 242
         # and we're done with debconf
217 243
         db_stop

+ 9
- 0
debian/jitsi-meet-web-config.templates 파일 보기

@@ -5,6 +5,7 @@ _Description: SSL certificate for the Jitsi Meet instance
5 5
  Jitsi Meet is best to be set up with an SSL certificate.
6 6
  Having no certificate, a self-signed one will be generated.
7 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 9
  Having a certificate signed by a recognised CA, it can be uploaded on the server
9 10
  and point its location. The default filenames will be /etc/ssl/--domain.name--.key
10 11
  for the key and /etc/ssl/--domain.name--.crt for the certificate.
@@ -30,3 +31,11 @@ Template: jitsi-videobridge/jvb-hostname
30 31
 Type: string
31 32
 _Description: Hostname:
32 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 파일 보기

@@ -0,0 +1,12 @@
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 파일 보기

@@ -140,19 +140,3 @@ Component "lobby.jitmeet.example.com" "muc"
140 140
         "muc_rate_limit";
141 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 파일 보기

@@ -12,7 +12,6 @@ echo "This script will:"
12 12
 echo "- Need a working DNS record pointing to this machine(for domain ${DOMAIN})"
13 13
 echo "- Download certbot-auto from https://dl.eff.org to /usr/local/sbin"
14 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 15
 echo "- Configure and reload nginx or apache2, whichever is used"
17 16
 echo "- Configure the coturn server to use Let's Encrypt certificate and add required deploy hooks"
18 17
 echo "- Add command in weekly cron job to renew certificates regularly"

Loading…
취소
저장