aboutsummaryrefslogtreecommitdiffstats
path: root/prosody
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-11-29 03:27:50 +0000
committerMatthew Wild <mwild1@gmail.com>2008-11-29 03:27:50 +0000
commit7271c148cef981f9263a8794ebe27634423b07bd (patch)
tree837729c161f9e2d3d65a08790d25bebb37e622e1 /prosody
parent5b8969b8d9a926294b0f09b3f835ae994d58d012 (diff)
downloadprosody-7271c148cef981f9263a8794ebe27634423b07bd.tar.gz
prosody-7271c148cef981f9263a8794ebe27634423b07bd.zip
Update Makefile to now pass config paths to prosody. Update prosody, modulemanager and connectionlisteners to obey these paths.
Diffstat (limited to 'prosody')
-rwxr-xr-xprosody23
1 files changed, 20 insertions, 3 deletions
diff --git a/prosody b/prosody
index 6f13decd..58ebc16a 100755
--- a/prosody
+++ b/prosody
@@ -2,15 +2,32 @@
-- Config here --
-
+CFG_SOURCEDIR=nil;
+CFG_CONFIGDIR=nil;
+CFG_PLUGINDIR=nil;
-- -- -- -- -- --
if CFG_SOURCEDIR then
+ if os.getenv("HOME") then
+ CFG_SOURCEDIR = CFG_SOURCEDIR:gsub("^~", os.getenv("HOME"));
+ end
package.path = CFG_SOURCEDIR.."/?.lua;"..package.path
- package.cpath = CFG_SOURCEDIR.."/?.lua;"..package.cpath
+ package.cpath = CFG_SOURCEDIR.."/?.so;"..package.cpath
end
+if CFG_CONFIGDIR then
+ if os.getenv("HOME") then
+ CFG_CONFIGDIR = CFG_CONFIGDIR:gsub("^~", os.getenv("HOME"));
+ end
+end
+
+if CFG_PLUGINDIR then
+ if os.getenv("HOME") then
+ CFG_PLUGINDIR = CFG_PLUGINDIR:gsub("^~", os.getenv("HOME"));
+ end
+end
+
-- Required to be able to find packages installed with luarocks
pcall(require, "luarocks.require")
@@ -21,7 +38,7 @@ log = require "util.logger".init("general");
do
-- TODO: Check for other formats when we add support for them
-- Use lfs? Make a new conf/ dir?
- local ok, err = config.load("lxmppd.cfg.lua");
+ local ok, err = config.load((CFG_CONFIGDIR or ".").."/prosody.cfg.lua");
if not ok then
log("error", "Couldn't load config file: %s", err);
log("info", "Falling back to old config file format...")