Changeset

12415:01ba67e7f824

Merge 0.12->trunk
author Matthew Wild <mwild1@gmail.com>
date Sat, 19 Mar 2022 09:28:59 +0000
parents 12413:e155f4509954 (current diff) 12414:a93e65784f2c (diff)
children 12417:3635b0bfbd55
files
diffstat 5 files changed, 32 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri Mar 18 20:14:20 2022 +0000
+++ b/.hgtags	Sat Mar 19 09:28:59 2022 +0000
@@ -80,3 +80,4 @@
 d117b92fd8e459170a98a8dece7f3930f4b6aed7 0.11.10
 76b4e3f12b53fedae96402d87fa9ee79e704ce5e 0.11.11
 783056b4e4480389d0e27883289b1bfef57e4729 0.11.12
+50fcd387948263335ca98dc98de2a3087b543f8b 0.12.0
--- a/plugins/mod_admin_socket.lua	Fri Mar 18 20:14:20 2022 +0000
+++ b/plugins/mod_admin_socket.lua	Sat Mar 19 09:28:59 2022 +0000
@@ -2,6 +2,15 @@
 
 local have_unix, unix = pcall(require, "socket.unix");
 
+if have_unix and type(unix) == "function" then
+	-- COMPAT #1717
+	-- Before the introduction of datagram support, only the stream socket
+	-- constructor was exported instead of a module table. Due to the lack of a
+	-- proper release of LuaSocket, distros have settled on shipping either the
+	-- last RC tag or some commit since then.
+	-- Here we accomodate both variants.
+	unix = { stream = unix };
+end
 if not have_unix or type(unix) ~= "table" then
 	module:log_status("error", "LuaSocket unix socket support not available or incompatible, ensure it is up to date");
 	return;
--- a/plugins/mod_invites_register.lua	Fri Mar 18 20:14:20 2022 +0000
+++ b/plugins/mod_invites_register.lua	Sat Mar 19 09:28:59 2022 +0000
@@ -141,6 +141,7 @@
 	if inviter_username then
 		module:log("debug", "Creating mutual subscription between %s and %s", inviter_username, contact_username);
 		subscribe_both(module.host, inviter_username, contact_username);
+		rostermanager.roster_push(inviter_username, module.host, contact_username.."@"..module.host);
 	end
 
 	if validated_invite.additional_data then
--- a/util/adminstream.lua	Fri Mar 18 20:14:20 2022 +0000
+++ b/util/adminstream.lua	Sat Mar 19 09:28:59 2022 +0000
@@ -139,6 +139,15 @@
 
 local function new_connection(socket_path, listeners)
 	local have_unix, unix = pcall(require, "socket.unix");
+	if have_unix and type(unix) == "function" then
+		-- COMPAT #1717
+		-- Before the introduction of datagram support, only the stream socket
+		-- constructor was exported instead of a module table. Due to the lack of a
+		-- proper release of LuaSocket, distros have settled on shipping either the
+		-- last RC tag or some commit since then.
+		-- Here we accomodate both variants.
+		unix = { stream = unix };
+	end
 	if type(unix) ~= "table" then
 		have_unix = false;
 	end
--- a/util/prosodyctl/check.lua	Fri Mar 18 20:14:20 2022 +0000
+++ b/util/prosodyctl/check.lua	Sat Mar 19 09:28:59 2022 +0000
@@ -62,9 +62,7 @@
 end
 
 local function check_turn_service(turn_service, ping_service)
-	local array = require "util.array";
 	local ip = require "util.ip";
-	local set = require "util.set";
 	local stun = require "net.stun";
 
 	-- Create UDP socket for communication with the server
@@ -251,9 +249,17 @@
 		return result;
 	end
 
-	local relayed_address_set = set.new(array.pluck(result.relayed_addresses, "address"));
-	if not relayed_address_set:contains(result.external_ip_pong.address) then
+	local relay_address_found, relay_port_matches;
+	for _, relayed_address in ipairs(result.relayed_addresses) do
+		if relayed_address.address == result.external_ip_pong.address then
+			relay_address_found = true;
+			relay_port_matches = result.external_ip_pong.port == relayed_address.port;
+		end
+	end
+	if not relay_address_found then
 		table.insert(result.warnings, "TURN external IP vs relay address mismatch! Is the TURN server behind a NAT and misconfigured?");
+	elseif not relay_port_matches then
+		table.insert(result.warnings, "External port does not match reported relay port! This is probably caused by a NAT in front of the TURN server.");
 	end
 
 	--
@@ -661,7 +667,7 @@
 					end
 				end
 			end
-			for host, host_config in enabled_hosts() do
+			for host, host_config in it.filter(skip_bare_jid_hosts, enabled_hosts()) do
 				local is_component = not not host_config.component_module;
 				if is_component then
 					local parent_domain = host:match("^[^.]+%.(.+)$");
@@ -1284,7 +1290,7 @@
 					end
 				end
 				if result.external_ip_pong then
-					print(("TURN external IP: %s"):format(result.external_ip_pong.address));
+					print(("TURN external address: %s:%d"):format(result.external_ip_pong.address, result.external_ip_pong.port));
 				end
 			end