aboutsummaryrefslogtreecommitdiffstats
path: root/util/prosodyctl
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-11-09 12:38:32 +0100
committerKim Alvefur <zash@zash.se>2020-11-09 12:38:32 +0100
commit347d99192bf7f0c457a6717f8416084092ec91ff (patch)
treefe81b0235f81cc8705313a65b3d8c279152a046b /util/prosodyctl
parente471dd1a3be264ca287111609d8167be126ee810 (diff)
downloadprosody-347d99192bf7f0c457a6717f8416084092ec91ff.tar.gz
prosody-347d99192bf7f0c457a6717f8416084092ec91ff.zip
util.prosodyctl.cert: Fix for prompt functions having moved to util.human.io
Diffstat (limited to 'util/prosodyctl')
-rw-r--r--util/prosodyctl/cert.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/util/prosodyctl/cert.lua b/util/prosodyctl/cert.lua
index 29e26ed8..2b96ac5c 100644
--- a/util/prosodyctl/cert.lua
+++ b/util/prosodyctl/cert.lua
@@ -1,6 +1,7 @@
local lfs = require "lfs";
local pctl = require "util.prosodyctl";
+local hi = require "util.human.io";
local configmanager = require "core.configmanager";
local openssl;
@@ -12,7 +13,7 @@ local cert_commands = {};
local function use_existing(filename)
local attrs = lfs.attributes(filename);
if attrs then
- if pctl.show_yesno(filename .. " exists, do you want to replace it? [y/n]") then
+ if hi.show_yesno(filename .. " exists, do you want to replace it? [y/n]") then
local backup = filename..".bkp~"..os.date("%FT%T", attrs.change);
os.rename(filename, backup);
pctl.show_message("%s backed up to %s", filename, backup);
@@ -67,7 +68,7 @@ function cert_commands.config(arg)
v = tld:upper();
end
end
- nv = pctl.show_prompt(("%s (%s):"):format(k, nv or v));
+ nv = hi.show_prompt(("%s (%s):"):format(k, nv or v));
nv = (not nv or nv == "") and v or nv;
if nv:find"[\192-\252][\128-\191]+" then
conf.req.string_mask = "utf8only"
@@ -99,7 +100,7 @@ function cert_commands.key(arg)
return nil, key_filename;
end
os.remove(key_filename); -- This file, if it exists is unlikely to have write permissions
- local key_size = tonumber(arg[2] or pctl.show_prompt("Choose key size (2048):") or 2048);
+ local key_size = tonumber(arg[2] or hi.show_prompt("Choose key size (2048):") or 2048);
local old_umask = pposix.umask("0377");
if openssl.genrsa{out=key_filename, key_size} then
os.execute(("chmod 400 '%s'"):format(key_filename));