From 2b0081486e64248a80141d0b373da7c24d009c70 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 8 Jan 2013 13:33:35 +0100 Subject: prosodyctl: Load LFS and util.openssl when actually needed (fixes unhelpful warnings if no LuaSec installed) --- prosodyctl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'prosodyctl') diff --git a/prosodyctl b/prosodyctl index 4d3c4790..97232e5c 100755 --- a/prosodyctl +++ b/prosodyctl @@ -639,8 +639,8 @@ function commands.unregister(arg) return 1; end -local openssl = require "util.openssl"; -local lfs = require "lfs"; +local openssl; +local lfs; local cert_commands = {}; @@ -744,6 +744,8 @@ end function commands.cert(arg) if #arg >= 1 and arg[1] ~= "--help" then + openssl = require "util.openssl"; + lfs = require "lfs"; local subcmd = table.remove(arg, 1); if type(cert_commands[subcmd]) == "function" then if not arg[1] then -- cgit v1.2.3 From 7855128caa40d1b681152b92e44ec5792926f69d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 8 Jan 2013 21:20:00 +0100 Subject: prosodyctl, prosody.cfg.lua.dist, certs/Makefile: Use .crt as suffix for certificates everywhere (thanks jasperixla) --- prosodyctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'prosodyctl') diff --git a/prosodyctl b/prosodyctl index 97232e5c..134624b2 100755 --- a/prosodyctl +++ b/prosodyctl @@ -723,7 +723,7 @@ end function cert_commands.generate(arg) if #arg >= 1 and arg[1] ~= "--help" then - local cert_filename = (CFG_DATADIR or ".") .. "/" .. arg[1] .. ".cert"; + local cert_filename = (CFG_DATADIR or ".") .. "/" .. arg[1] .. ".crt"; if ask_overwrite(cert_filename) then return nil, cert_filename; end -- cgit v1.2.3 From c445bb3bd8907492a74c97872da15a8ac800b685 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 9 Jan 2013 20:40:44 +0100 Subject: prosodyctl: Pop arg items after use. Fixes #306 --- prosodyctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'prosodyctl') diff --git a/prosodyctl b/prosodyctl index 134624b2..25acbc6a 100755 --- a/prosodyctl +++ b/prosodyctl @@ -67,10 +67,10 @@ do local filename; if arg[1] == "--config" and arg[2] then table.insert(filenames, arg[2]); - table.remove(arg, 1); table.remove(arg, 1); if CFG_CONFIGDIR then table.insert(filenames, CFG_CONFIGDIR.."/"..arg[2]); end + table.remove(arg, 1); table.remove(arg, 1); else for _, format in ipairs(config.parsers()) do table.insert(filenames, (CFG_CONFIGDIR or ".").."/prosody.cfg."..format); -- cgit v1.2.3 From 79a96e236c927803a943e2d38a2bb7ac7410d065 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 9 Jan 2013 22:01:52 +0100 Subject: prosodyctl, prosody: Pass the selected config file from prosodyctl to prosody --- prosodyctl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'prosodyctl') diff --git a/prosodyctl b/prosodyctl index 25acbc6a..0d1194f4 100755 --- a/prosodyctl +++ b/prosodyctl @@ -61,6 +61,7 @@ end config = require "core.configmanager" +local ENV_CONFIG; do local filenames = {}; @@ -81,6 +82,7 @@ do local file = io.open(filename); if file then file:close(); + ENV_CONFIG = filename; CFG_CONFIGDIR = filename:match("^(.*)[\\/][^\\/]*$"); break; end @@ -162,6 +164,7 @@ if ok and pposix then -- Set our umask to protect data files pposix.umask(config.get("*", "core", "umask") or "027"); pposix.setenv("HOME", data_path); + pposix.setenv("PROSODY_CONFIG", ENV_CONFIG); else print("Error: Unable to load pposix module. Check that Prosody is installed correctly.") print("For more help send the below error to us through http://prosody.im/discuss"); -- cgit v1.2.3