diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-09 16:46:16 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-09 16:46:16 +0000 |
commit | 64d4efdb4d040112eec10691bd197ceece33923f (patch) | |
tree | a6c6fb03bf474877207129f9b1379b93e93be87f /lualib/rspamadm | |
parent | bde5ef41009e4b8517b1cc0c4a476d3054858c5f (diff) | |
parent | 866b3c205b368f3c863d1ae77e5e195f672ed039 (diff) | |
download | rspamd-64d4efdb4d040112eec10691bd197ceece33923f.tar.gz rspamd-64d4efdb4d040112eec10691bd197ceece33923f.zip |
Merge pull request #2064 from moisseev/configwizard
[Minor] configwizard: minor fixes
Diffstat (limited to 'lualib/rspamadm')
-rw-r--r-- | lualib/rspamadm/configwizard.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lualib/rspamadm/configwizard.lua b/lualib/rspamadm/configwizard.lua index 24a0dbfc5..d42f4c3f3 100644 --- a/lualib/rspamadm/configwizard.lua +++ b/lualib/rspamadm/configwizard.lua @@ -220,6 +220,12 @@ local function setup_redis(cfg, changes) end local function setup_dkim_signing(cfg, changes) + -- Remove the trailing slash of a pathname, if present. + local function remove_trailing_slash(path) + if string.sub(path, -1) ~= "/" then return path end + return string.sub(path, 1, string.len(path) - 1) + end + local domains = {} local has_domains = false @@ -227,7 +233,7 @@ local function setup_dkim_signing(cfg, changes) local prompt = string.format("Enter output directory for the keys [default: %s]: ", highlight(dkim_keys_dir)) - dkim_keys_dir = readline_default(prompt, dkim_keys_dir) + dkim_keys_dir = remove_trailing_slash(readline_default(prompt, dkim_keys_dir)) local ret, err = rspamd_util.mkdir(dkim_keys_dir, true) @@ -258,7 +264,7 @@ local function setup_dkim_signing(cfg, changes) end until #domain ~= 0 - local selector = readline_default("Enter domain to sign [default: dkim]: ", 'dkim') + local selector = readline_default("Enter selector [default: dkim]: ", 'dkim') if not selector then selector = 'dkim' end local privkey_file = string.format("%s/%s.%s.key", dkim_keys_dir, domain, |