aboutsummaryrefslogtreecommitdiffstats
path: root/util/prosodyctl/shell.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util/prosodyctl/shell.lua')
-rw-r--r--util/prosodyctl/shell.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/util/prosodyctl/shell.lua b/util/prosodyctl/shell.lua
index 05f81f15..c1cd8f46 100644
--- a/util/prosodyctl/shell.lua
+++ b/util/prosodyctl/shell.lua
@@ -1,4 +1,5 @@
local config = require "prosody.core.configmanager";
+local human_io = require "prosody.util.human.io";
local server = require "prosody.net.server";
local st = require "prosody.util.stanza";
local path = require "prosody.util.paths";
@@ -131,6 +132,21 @@ local function start(arg) --luacheck: ignore 212/arg
end);
client.events.add_handler("received", function (stanza)
+ if stanza.name ~= "repl-request-input" then
+ return;
+ end
+ if stanza.attr.type == "password" then
+ local password = human_io.read_password();
+ client.send(st.stanza("repl-requested-input", { type = stanza.attr.type, id = stanza.attr.id }):text(password));
+ else
+ io.stderr:write("Internal error - unexpected input request type "..tostring(stanza.attr.type).."\n");
+ os.exit(1);
+ end
+ return true;
+ end, 2);
+
+
+ client.events.add_handler("received", function (stanza)
if stanza.name == "repl-output" or stanza.name == "repl-result" then
local result_prefix = stanza.attr.type == "error" and "!" or "|";
local out = result_prefix.." "..stanza:get_text();
@@ -164,4 +180,5 @@ end
return {
shell = start;
+ check_host = check_host;
};