From d3003d4fcdd1457656fdf28cbe1cb5e04b871ab0 Mon Sep 17 00:00:00 2001 From: paweldomas Date: Wed, 14 Jan 2015 17:58:13 +0100 Subject: [PATCH 1/3] Adjusts anonymous domain functionality to work with Jicofo. --- moderator.js | 12 +++++++++++- muc.js | 15 ++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/moderator.js b/moderator.js index 5f0ed3bd8b..be58236a0b 100644 --- a/moderator.js +++ b/moderator.js @@ -190,7 +190,17 @@ var Moderator = (function (my) { // Not authorized to create new room if ($(error).find('>error>not-authorized').length) { console.warn("Unauthorized to start the conference"); - UI.onAuthenticationRequired(); + var toDomain + = Strophe.getDomainFromJid(error.getAttribute('to')); + if (toDomain === config.hosts.anonymousdomain) { + // we are connected with anonymous domain and + // only non anonymous users can create rooms + // we must authorize the user + $(document).trigger('passwordrequired.main'); + } else { + // External authentication mode + UI.onAuthenticationRequired(); + } return; } var waitMs = getNextErrorTimeout(); diff --git a/muc.js b/muc.js index 98b3473374..a2abbdc01a 100644 --- a/muc.js +++ b/muc.js @@ -255,9 +255,18 @@ Strophe.addConnectionPlugin('emuc', { '>error[type="cancel"]>not-allowed[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length) { var toDomain = Strophe.getDomainFromJid(pres.getAttribute('to')); if(toDomain === config.hosts.anonymousdomain) { - // we are connected with anonymous domain and only non anonymous users can create rooms - // we must authorize the user - $(document).trigger('passwordrequired.main'); + // We are connected with anonymous domain and only non anonymous + // users can create rooms, but focus should not allow us to + // enter the room by replying with 'not-authorized'. This would + // result in reconnection from authorized domain. + // We're either missing Jicofo/Prosody config for anonymous + // domains or something is wrong. + //$(document).trigger('passwordrequired.main'); + UI.messageHandler.openReportDialog(null, + 'Oops ! We couldn`t join the conference.' + + ' There might be some problem with security' + + ' configuration. Please contact service' + + ' administrator.', pres); } else { console.warn('onPresError ', pres); UI.messageHandler.openReportDialog(null, From 398fd18b8e4d6f84f26bb9ca45457e4c45b9c0ec Mon Sep 17 00:00:00 2001 From: paweldomas Date: Fri, 16 Jan 2015 12:34:47 +0100 Subject: [PATCH 2/3] Advertises dtls/sctp support in capabilities. --- libs/strophe/strophe.jingle.js | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/strophe/strophe.jingle.js b/libs/strophe/strophe.jingle.js index cbc0817980..88176aea73 100644 --- a/libs/strophe/strophe.jingle.js +++ b/libs/strophe/strophe.jingle.js @@ -39,6 +39,7 @@ Strophe.addConnectionPlugin('jingle', { this.connection.disco.addFeature('urn:xmpp:jingle:1'); this.connection.disco.addFeature('urn:xmpp:jingle:apps:rtp:1'); this.connection.disco.addFeature('urn:xmpp:jingle:transports:ice-udp:1'); + this.connection.disco.addFeature('urn:xmpp:jingle:transports:dtls-sctp:1'); this.connection.disco.addFeature('urn:xmpp:jingle:apps:rtp:audio'); this.connection.disco.addFeature('urn:xmpp:jingle:apps:rtp:video'); From ed78c0053c52d49035c4d506016fc799f7ea6511 Mon Sep 17 00:00:00 2001 From: paweldomas Date: Fri, 16 Jan 2015 13:20:40 +0100 Subject: [PATCH 3/3] Makes it possible to append URL parameters after room name. Adds ?login=true to enforce authenticated domain when anonymous domain is used. This allows to get moderator permissions after room has been created. --- app.js | 10 +++++++++- doc/debian/jitsi-meet/jitsi-meet.example | 2 +- doc/example-config-files/jitsi.example.com.example | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 93c88eb452..845307f73a 100644 --- a/app.js +++ b/app.js @@ -53,7 +53,15 @@ function init() { RTC.addStreamListener(maybeDoJoin, StreamEventTypes.EVENT_TYPE_LOCAL_CREATED); RTC.start(); - var jid = document.getElementById('jid').value || config.hosts.anonymousdomain || config.hosts.domain || window.location.hostname; + var configDomain = config.hosts.anonymousdomain || config.hosts.domain; + + // Force authenticated domain if room is appended with '?login=true' + if (config.hosts.anonymousdomain && + window.location.search.indexOf("login=true") !== -1) { + configDomain = config.hosts.domain; + } + + var jid = document.getElementById('jid').value || configDomain || window.location.hostname; connect(jid); } diff --git a/doc/debian/jitsi-meet/jitsi-meet.example b/doc/debian/jitsi-meet/jitsi-meet.example index 896912b809..f69499fb68 100644 --- a/doc/debian/jitsi-meet/jitsi-meet.example +++ b/doc/debian/jitsi-meet/jitsi-meet.example @@ -17,7 +17,7 @@ server { alias /etc/jitsi/meet/jitsi-meet.example.com-config.js; } - location ~ ^/([a-zA-Z0-9]+)$ { + location ~ ^/([a-zA-Z0-9=\?]+)$ { rewrite ^/(.*)$ / break; } diff --git a/doc/example-config-files/jitsi.example.com.example b/doc/example-config-files/jitsi.example.com.example index 68dc464de4..96ae864f95 100755 --- a/doc/example-config-files/jitsi.example.com.example +++ b/doc/example-config-files/jitsi.example.com.example @@ -6,7 +6,7 @@ server { root /srv/jitsi.example.com; index index.html; - location ~ ^/([a-zA-Z0-9]+)$ { + location ~ ^/([a-zA-Z0-9=\?]+)$ { rewrite ^/(.*)$ / break; }