X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=prosodyctl;h=a9858c445eab4ff6de771760546145942207e770;hb=4bb95ec0969311768be5c6da51ea80a31286f4d3;hp=02f2e1367a3050cfa883b5c795422674ec7d3b42;hpb=4f2be6682eda803e3d95ec532f561907e0d8cb4d;p=prosody.git diff --git a/prosodyctl b/prosodyctl index 02f2e136..a9858c44 100755 --- a/prosodyctl +++ b/prosodyctl @@ -110,8 +110,14 @@ local original_logging_config = config.get("*", "core", "log"); config.set("*", "core", "log", { { levels = { min="info" }, to = "console" } }); local data_path = config.get("*", "core", "data_path") or CFG_DATADIR or "data"; +local custom_plugin_paths = config.get("*", "core", "plugin_paths"); +if custom_plugin_paths then + local path_sep = package.config:sub(3,3); + -- path1;path2;path3;defaultpath... + CFG_PLUGINDIR = table.concat(custom_plugin_paths, path_sep)..path_sep..(CFG_PLUGINDIR or "plugins"); +end prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR, - plugins = CFG_PLUGINDIR, data = data_path }; + plugins = CFG_PLUGINDIR or "plugins", data = data_path }; require "core.loggingmanager" @@ -479,6 +485,54 @@ function commands.restart(arg) return commands.start(arg); end +function commands.about(arg) + if arg[1] == "--help" then + show_usage([[about]], [[Show information about this Prosody installation]]); + return 1; + end + + require "util.array"; + require "util.iterators"; + + print("Prosody "..(prosody.version or "(unknown version)")); + print(""); + print("# Prosody directories"); + print("Data directory: ", CFG_DATADIR or "./"); + print("Plugin directory:", CFG_PLUGINDIR or "./"); + print("Config directory:", CFG_CONFIGDIR or "./"); + print("Source directory:", CFG_SOURCEDIR or "./"); + print(""); + print("# Lua environment"); + print("Lua version: ", _G._VERSION); + print(""); + print("Lua module search paths:"); + for path in package.path:gmatch("[^;]+") do + print(" "..path); + end + print(""); + print("Lua C module search paths:"); + for path in package.cpath:gmatch("[^;]+") do + print(" "..path); + end + print(""); + print("# Lua module versions"); + local module_versions, longest_name = {}, 8; + for name, module in pairs(package.loaded) do + if type(module) == "table" and rawget(module, "_VERSION") + and name ~= "_G" and not name:match("%.") then + if #name > longest_name then + longest_name = #name; + end + module_versions[name] = module._VERSION; + end + end + local sorted_keys = array.collect(keys(module_versions)):sort(); + for _, name in ipairs(array.collect(keys(module_versions)):sort()) do + print(name..":"..string.rep(" ", longest_name-#name), module_versions[name]); + end + print(""); +end + -- ejabberdctl compatibility function commands.register(arg) @@ -582,7 +636,7 @@ if not commands[command] then -- Show help for all commands print("Where COMMAND may be one of:\n"); local hidden_commands = require "util.set".new{ "register", "unregister", "addplugin" }; - local commands_order = { "adduser", "passwd", "deluser", "start", "stop", "restart" }; + local commands_order = { "adduser", "passwd", "deluser", "start", "stop", "restart", "about" }; local done = {};