Browse Source

Adds room name validation logic for web.

master
damencho 6 years ago
parent
commit
f46387a226

+ 17
- 9
doc/debian/jitsi-meet/jitsi-meet.example View File

19
     ssl_certificate_key /etc/jitsi/meet/jitsi-meet.example.com.key;
19
     ssl_certificate_key /etc/jitsi/meet/jitsi-meet.example.com.key;
20
 
20
 
21
     root /usr/share/jitsi-meet;
21
     root /usr/share/jitsi-meet;
22
+    ssi on;
22
     index index.html index.htm;
23
     index index.html index.htm;
23
     error_page 404 /static/404.html;
24
     error_page 404 /static/404.html;
24
 
25
 
25
-    location /config.js {
26
+    location = /config.js {
26
         alias /etc/jitsi/meet/jitsi-meet.example.com-config.js;
27
         alias /etc/jitsi/meet/jitsi-meet.example.com-config.js;
27
     }
28
     }
28
 
29
 
29
-    location /external_api.js {
30
+    location = /external_api.js {
30
         alias /usr/share/jitsi-meet/libs/external_api.min.js;
31
         alias /usr/share/jitsi-meet/libs/external_api.min.js;
31
     }
32
     }
32
 
33
 
33
-    location ~ ^/([a-zA-Z0-9=\?]+)$ {
34
-        rewrite ^/(.*)$ / break;
35
-    }
36
-
37
-    location / {
38
-        ssi on;
34
+    #ensure all static content can always be found first
35
+    location ~ ^/(libs|css|static|images|fonts|lang|sounds|connection_optimization|.well-known)/(.*)$
36
+    {
37
+        add_header 'Access-Control-Allow-Origin' '*';
38
+        alias /usr/share/jitsi-meet/$1/$2;
39
     }
39
     }
40
 
40
 
41
     # BOSH
41
     # BOSH
42
-    location /http-bind {
42
+    location = /http-bind {
43
         proxy_pass      http://localhost:5280/http-bind;
43
         proxy_pass      http://localhost:5280/http-bind;
44
         proxy_set_header X-Forwarded-For $remote_addr;
44
         proxy_set_header X-Forwarded-For $remote_addr;
45
         proxy_set_header Host $http_host;
45
         proxy_set_header Host $http_host;
46
     }
46
     }
47
+
48
+    location ~ ^/([^?&:’“]+)$ {
49
+        try_files $uri @root_path;
50
+    }
51
+
52
+    location @root_path {
53
+        rewrite ^/(.*)$ / break;
54
+    }
47
 }
55
 }

+ 1
- 1
lang/main.json View File

725
         "connectCalendarButton": "Connect your calendar",
725
         "connectCalendarButton": "Connect your calendar",
726
         "connectCalendarText": "Connect your calendar to view all your meetings in {{app}}. Plus, add {{provider}} meetings to your calendar and start them with one click.",
726
         "connectCalendarText": "Connect your calendar to view all your meetings in {{app}}. Plus, add {{provider}} meetings to your calendar and start them with one click.",
727
         "enterRoomTitle": "Start a new meeting",
727
         "enterRoomTitle": "Start a new meeting",
728
-        "onlyAsciiAllowed": "Meeting name should only contain latin characters and numbers.",
728
+        "roomNameAllowedChars": "Meeting name should not contain any of these characters: ?, &, :, ', \", %, #.",
729
         "go": "GO",
729
         "go": "GO",
730
         "join": "JOIN",
730
         "join": "JOIN",
731
         "info": "Info",
731
         "info": "Info",

+ 28
- 4
react/features/welcome/components/WelcomePage.web.js View File

12
 import { AbstractWelcomePage, _mapStateToProps } from './AbstractWelcomePage';
12
 import { AbstractWelcomePage, _mapStateToProps } from './AbstractWelcomePage';
13
 import Tabs from './Tabs';
13
 import Tabs from './Tabs';
14
 
14
 
15
+/**
16
+ * The pattern used to validate room name.
17
+ * @type {string}
18
+ */
19
+export const ROOM_NAME_VALIDATE_PATTERN_STR = '^[^?&:\u0022\u0027%#]+$';
20
+
15
 /**
21
 /**
16
  * The Web container rendering the welcome page.
22
  * The Web container rendering the welcome page.
17
  *
23
  *
53
          */
59
          */
54
         this._additionalContentRef = null;
60
         this._additionalContentRef = null;
55
 
61
 
62
+        this._roomInputRef = null;
63
+
56
         /**
64
         /**
57
          * The HTML Element used as the container for additional toolbar content. Used
65
          * The HTML Element used as the container for additional toolbar content. Used
58
          * for directly appending the additional content template to the dom.
66
          * for directly appending the additional content template to the dom.
88
         this._onRoomChange = this._onRoomChange.bind(this);
96
         this._onRoomChange = this._onRoomChange.bind(this);
89
         this._setAdditionalContentRef
97
         this._setAdditionalContentRef
90
             = this._setAdditionalContentRef.bind(this);
98
             = this._setAdditionalContentRef.bind(this);
99
+        this._setRoomInputRef = this._setRoomInputRef.bind(this);
91
         this._setAdditionalToolbarContentRef
100
         this._setAdditionalToolbarContentRef
92
             = this._setAdditionalToolbarContentRef.bind(this);
101
             = this._setAdditionalToolbarContentRef.bind(this);
93
         this._onTabSelected = this._onTabSelected.bind(this);
102
         this._onTabSelected = this._onTabSelected.bind(this);
184
                                     className = 'enter-room-input'
193
                                     className = 'enter-room-input'
185
                                     id = 'enter_room_field'
194
                                     id = 'enter_room_field'
186
                                     onChange = { this._onRoomChange }
195
                                     onChange = { this._onRoomChange }
187
-                                    pattern = '^[a-zA-Z0-9=\?]+$'
196
+                                    pattern = { ROOM_NAME_VALIDATE_PATTERN_STR }
188
                                     placeholder = { this.state.roomPlaceholder }
197
                                     placeholder = { this.state.roomPlaceholder }
189
-                                    title = { t('welcomepage.onlyAsciiAllowed') }
198
+                                    ref = { this._setRoomInputRef }
199
+                                    title = { t('welcomepage.roomNameAllowedChars') }
190
                                     type = 'text'
200
                                     type = 'text'
191
                                     value = { this.state.room } />
201
                                     value = { this.state.room } />
192
                             </form>
202
                             </form>
194
                         <div
204
                         <div
195
                             className = 'welcome-page-button'
205
                             className = 'welcome-page-button'
196
                             id = 'enter_room_button'
206
                             id = 'enter_room_button'
197
-                            onClick = { this._onJoin }>
207
+                            onClick = { this._onFormSubmit }>
198
                             { t('welcomepage.go') }
208
                             { t('welcomepage.go') }
199
                         </div>
209
                         </div>
200
                     </div>
210
                     </div>
219
     _onFormSubmit(event) {
229
     _onFormSubmit(event) {
220
         event.preventDefault();
230
         event.preventDefault();
221
 
231
 
222
-        this._onJoin();
232
+        if (!this._roomInputRef || this._roomInputRef.reportValidity()) {
233
+            this._onJoin();
234
+        }
223
     }
235
     }
224
 
236
 
225
     /**
237
     /**
311
         this._additionalToolbarContentRef = el;
323
         this._additionalToolbarContentRef = el;
312
     }
324
     }
313
 
325
 
326
+    /**
327
+     * Sets the internal reference to the HTMLInputElement used to hold the
328
+     * welcome page input room element.
329
+     *
330
+     * @param {HTMLInputElement} el - The HTMLElement for the input of the room name on the welcome page.
331
+     * @private
332
+     * @returns {void}
333
+     */
334
+    _setRoomInputRef(el) {
335
+        this._roomInputRef = el;
336
+    }
337
+
314
     /**
338
     /**
315
      * Returns whether or not additional content should be displayed below
339
      * Returns whether or not additional content should be displayed below
316
      * the welcome page's header for entering a room name.
340
      * the welcome page's header for entering a room name.

Loading…
Cancel
Save