# HG changeset patch # User Kim Alvefur # Date 1604921912 -3600 # Node ID d10f59ac7f74fb8c637da341dbaba79f4842e3aa # Parent 58492b4b85ea63f6596cd57260e52beca5289a06 util.prosodyctl.cert: Fix for prompt functions having moved to util.human.io diff -r 58492b4b85ea -r d10f59ac7f74 util/prosodyctl/cert.lua --- a/util/prosodyctl/cert.lua Fri Nov 06 16:52:38 2020 +0100 +++ b/util/prosodyctl/cert.lua Mon Nov 09 12:38:32 2020 +0100 @@ -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 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 @@ 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 @@ 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));