fix: Fixes handling tenant in util and lobby.

This commit is contained in:
damencho 2021-05-13 13:07:44 -05:00 committed by Дамян Минков
parent 2bce5acad3
commit a39f2aebd9
3 changed files with 13 additions and 12 deletions

View File

@ -35,6 +35,7 @@ server {
ssl_session_tickets off;
add_header Strict-Transport-Security "max-age=63072000" always;
set $prefix "";
ssl_certificate /etc/jitsi/meet/jitsi-meet.example.com.crt;
ssl_certificate_key /etc/jitsi/meet/jitsi-meet.example.com.key;
@ -76,7 +77,7 @@ server {
# BOSH
location = /http-bind {
proxy_pass http://localhost:5280/http-bind;
proxy_pass http://127.0.0.1:5280/http-bind?prefix=$prefix&$args;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
}
@ -125,13 +126,6 @@ server {
alias /etc/jitsi/meet/jitsi-meet.example.com-config.js;
}
# Anything that didn't match above, and isn't a real file, assume it's a room name and redirect to /
location ~ ^/([^/?&:'"]+)/(.*)$ {
set $subdomain "$1.";
set $subdir "$1/";
rewrite ^/([^/?&:'"]+)/(.*)$ /$2;
}
# BOSH for subdomains
location ~ ^/([^/?&:'"]+)/http-bind {
set $subdomain "$1.";
@ -149,4 +143,11 @@ server {
rewrite ^/(.*)$ /xmpp-websocket;
}
# Anything that didn't match above, and isn't a real file, assume it's a room name and redirect to /
location ~ ^/([^/?&:'"]+)/(.*)$ {
set $subdomain "$1.";
set $subdir "$1/";
rewrite ^/([^/?&:'"]+)/(.*)$ /$2;
}
}

View File

@ -40,6 +40,7 @@ local NOTIFY_LOBBY_ACCESS_GRANTED = 'LOBBY-ACCESS-GRANTED';
local NOTIFY_LOBBY_ACCESS_DENIED = 'LOBBY-ACCESS-DENIED';
local util = module:require "util";
local get_room_by_name_and_subdomain = util.get_room_by_name_and_subdomain;
local is_healthcheck_room = util.is_healthcheck_room;
local presence_check_status = util.presence_check_status;
@ -207,10 +208,9 @@ function process_lobby_muc_loaded(lobby_muc, host_module)
local session, reply, node = event.origin, event.reply, event.node;
if node == LOBBY_IDENTITY_TYPE
and session.jitsi_web_query_room
and main_muc_service
and check_display_name_required then
local room = main_muc_service.get_room_from_jid(
jid_bare(session.jitsi_web_query_room .. '@' .. main_muc_component_config));
local room = get_room_by_name_and_subdomain(session.jitsi_web_query_room, session.jitsi_web_query_prefix);
if room and room._data.lobbyroom then
reply:tag('feature', { var = DISPLAY_NAME_REQUIRED_FEATURE }):up();
end

View File

@ -125,7 +125,7 @@ function get_room_by_name_and_subdomain(room_name, subdomain)
-- if there is a subdomain we are in multidomain mode and that subdomain is not our main host
if subdomain and subdomain ~= "" and subdomain ~= muc_domain_base then
room_address = "["..subdomain.."]"..room_address;
room_address = jid.join("["..subdomain.."]"..room_name, muc_domain);
else
room_address = jid.join(room_name, muc_domain);
end