Changeset

13771:5f26164c738f

Merge 13.0->trunk
author Matthew Wild <mwild1@gmail.com>
date Thu, 13 Mar 2025 11:41:32 +0000
parents 13766:b11242656300 (current diff) 13770:a28349b8a387 (diff)
children 13775:d1f9924516d7
files
diffstat 3 files changed, 51 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_admin_shell.lua	Tue Mar 11 18:45:23 2025 +0000
+++ b/plugins/mod_admin_shell.lua	Thu Mar 13 11:41:32 2025 +0000
@@ -92,13 +92,8 @@
 -- Seed with default sections and their description text
 help_topic "console" "Help regarding the console itself" [[
 Hey! Welcome to Prosody's admin console.
-First thing, if you're ever wondering how to get out, simply type 'quit'.
-Secondly, note that we don't support the full telnet protocol yet (it's coming)
-so you may have trouble using the arrow keys, etc. depending on your system.
-
-For now we offer a couple of handy shortcuts:
-!! - Repeat the last command
-!old!new! - repeat the last command, but with 'old' replaced by 'new'
+If you're ever wondering how to get out, simply type 'quit' (ctrl+d should also
+work).
 
 For those well-versed in Prosody's internals, or taking instruction from those who are,
 you can prefix a command with > to escape the console sandbox, and access everything in
@@ -347,6 +342,8 @@
 	local line = event.stanza:get_text();
 	local useglobalenv;
 
+	session.repl = event.stanza.attr.repl ~= "0";
+
 	local result = st.stanza("repl-result");
 
 	if line:match("^>") then
@@ -427,10 +424,6 @@
 		end
 	end
 
-	if not source then
-		session.repl = true;
-	end
-
 	taskok, message = chunk(flags);
 
 	if promise.is_promise(taskok) then
--- a/util/prosodyctl/check.lua	Tue Mar 11 18:45:23 2025 +0000
+++ b/util/prosodyctl/check.lua	Thu Mar 13 11:41:32 2025 +0000
@@ -11,6 +11,7 @@
 local modulemanager = require "prosody.core.modulemanager";
 local async = require "prosody.util.async";
 local httputil = require "prosody.util.http";
+local human_units = require "prosody.util.human.units";
 
 local function api(host)
 	return setmetatable({ name = "prosodyctl.check"; host = host; log = prosody.log }, { __index = moduleapi })
@@ -1493,6 +1494,10 @@
 		local function print_feature_status(feature, host)
 			if quiet then return; end
 			print("", feature.ok and "OK" or "(!)", feature.name);
+			if feature.desc then
+				print("", "", feature.desc);
+				print("");
+			end
 			if not feature.ok then
 				if feature.lacking_modules then
 					table.sort(feature.lacking_modules);
@@ -1552,6 +1557,11 @@
 					end
 				end
 			end
+			if feature.meta then
+				for k, v in it.sorted_pairs(feature.meta) do
+					print("", "", (" - %s: %s"):format(k, v));
+				end
+			end
 			print("");
 		end
 
@@ -1638,29 +1648,33 @@
 					current_feature.lacking_components = current_feature.lacking_components or {};
 					table.insert(current_feature.lacking_components, suggested);
 				end
+				return found;
 			end
 
 			local features = {
 				{
 					name = "Basic functionality";
+					desc = "Support for secure connections, authentication and messaging";
 					check = function ()
 						check_module("disco");
 						check_module("roster");
 						check_module("saslauth");
 						check_module("tls");
+					end;
+				};
+				{
+					name = "Multi-device messaging and data synchronization";
+					desc = "Multiple clients connected to the same account stay in sync";
+					check = function ()
+						check_module("carbons");
+						check_module("mam");
+						check_module("bookmarks");
 						check_module("pep");
 					end;
 				};
 				{
-					name = "Multi-device sync";
-					check = function ()
-						check_module("carbons");
-						check_module("mam");
-						check_module("bookmarks");
-					end;
-				};
-				{
 					name = "Mobile optimizations";
+					desc = "Help mobile clients reduce battery and data usage";
 					check = function ()
 						check_module("smacks");
 						check_module("csi_simple", "csi_battery_saver");
@@ -1668,6 +1682,7 @@
 				};
 				{
 					name = "Web connections";
+					desc = "Allow connections from browser-based web clients";
 					check = function ()
 						check_module("bosh");
 						check_module("websocket");
@@ -1675,24 +1690,28 @@
 				};
 				{
 					name = "User profiles";
+					desc = "Enable users to publish profile information";
 					check = function ()
 						check_module("vcard_legacy", "vcard");
 					end;
 				};
 				{
 					name = "Blocking";
+					desc = "Block communication with chosen entities";
 					check = function ()
 						check_module("blocklist");
 					end;
 				};
 				{
 					name = "Push notifications";
+					desc = "Receive notifications on platforms that don't support persistent connections";
 					check = function ()
 						check_module("cloud_notify");
 					end;
 				};
 				{
-					name = "Audio/video calls";
+					name = "Audio/video calls and P2P";
+					desc = "Assist clients in setting up connections between each other";
 					check = function ()
 						check_module(
 							"turn_external",
@@ -1704,12 +1723,25 @@
 				};
 				{
 					name = "File sharing";
-					check = function ()
-						check_component("http_file_share", "http_upload", "http_upload_external");
+					desc = "Sharing of files to groups and offline users";
+					check = function (self)
+						local service = check_component("http_file_share", "http_upload", "http_upload_external");
+						if service then
+							local size_limit;
+							if api(service):get_option("component_module") == "http_file_share" then
+								size_limit = api(service):get_option_number("http_file_share_size_limit", 10*1024*1024);
+							end
+							if size_limit then
+								self.meta = {
+									["Size limit"] = human_units.format(size_limit, "b", "b");
+								};
+							end
+						end
 					end;
 				};
 				{
 					name = "Group chats";
+					desc = "Create group chats and channels";
 					check = function ()
 						check_component("muc");
 					end;
@@ -1722,7 +1754,7 @@
 
 			for _, feature in ipairs(features) do
 				current_feature = feature;
-				feature.check();
+				feature:check();
 				feature.ok = (
 					not feature.lacking_modules and
 					not feature.lacking_components and
--- a/util/prosodyctl/shell.lua	Tue Mar 11 18:45:23 2025 +0000
+++ b/util/prosodyctl/shell.lua	Thu Mar 13 11:41:32 2025 +0000
@@ -29,8 +29,8 @@
 	end
 end
 
-local function send_line(client, line)
-	client.send(st.stanza("repl-input", { width = tostring(term_width()) }):text(line));
+local function send_line(client, line, interactive)
+	client.send(st.stanza("repl-input", { width = tostring(term_width()), repl = interactive == false and "0" or "1" }):text(line));
 end
 
 local function repl(client)
@@ -91,7 +91,7 @@
 		end
 
 		client.events.add_handler("connected", function()
-			send_line(client, arg[1]);
+			send_line(client, arg[1], false);
 			return true;
 		end, 1);