5 -- |
5 -- |
6 -- This project is MIT/X11 licensed. Please see the |
6 -- This project is MIT/X11 licensed. Please see the |
7 -- COPYING file in the source package for more information. |
7 -- COPYING file in the source package for more information. |
8 -- |
8 -- |
9 |
9 |
10 -- Config here -- |
10 -- Will be modified by configure script if run -- |
11 |
11 |
12 CFG_SOURCEDIR=nil; |
12 CFG_SOURCEDIR=nil; |
13 CFG_CONFIGDIR=os.getenv("PROSODY_CFGDIR"); |
13 CFG_CONFIGDIR=os.getenv("PROSODY_CFGDIR"); |
14 CFG_PLUGINDIR=nil; |
14 CFG_PLUGINDIR=nil; |
15 CFG_DATADIR=os.getenv("PROSODY_DATADIR"); |
15 CFG_DATADIR=os.getenv("PROSODY_DATADIR"); |
16 |
16 |
17 -- -- -- -- -- -- |
17 -- -- -- -- -- -- -- ---- -- -- -- -- -- -- -- -- |
18 |
18 |
19 if CFG_SOURCEDIR then |
19 if CFG_SOURCEDIR then |
20 package.path = CFG_SOURCEDIR.."/?.lua;"..package.path |
20 package.path = CFG_SOURCEDIR.."/?.lua;"..package.path |
21 package.cpath = CFG_SOURCEDIR.."/?.so;"..package.cpath |
21 package.cpath = CFG_SOURCEDIR.."/?.so;"..package.cpath |
22 end |
22 end |
82 require "core.modulemanager" |
82 require "core.modulemanager" |
83 require "core.usermanager" |
83 require "core.usermanager" |
84 require "core.sessionmanager" |
84 require "core.sessionmanager" |
85 require "core.stanza_router" |
85 require "core.stanza_router" |
86 |
86 |
87 --[[ |
87 -- Commented to protect us from |
|
88 -- the second kind of people |
|
89 --[[ |
88 pcall(require, "remdebug.engine"); |
90 pcall(require, "remdebug.engine"); |
89 if remdebug then remdebug.engine.start() end |
91 if remdebug then remdebug.engine.start() end |
90 ]] |
92 ]] |
91 |
93 |
92 local cl = require "net.connlisteners"; |
94 local cl = require "net.connlisteners"; |
101 |
103 |
102 local data_path = config.get("*", "core", "data_path") or CFG_DATADIR or "data"; |
104 local data_path = config.get("*", "core", "data_path") or CFG_DATADIR or "data"; |
103 require "util.datamanager".set_data_path(data_path); |
105 require "util.datamanager".set_data_path(data_path); |
104 |
106 |
105 ----------- End of out-of-place code -------------- |
107 ----------- End of out-of-place code -------------- |
|
108 |
106 |
109 |
107 eventmanager.fire_event("server-starting"); |
110 eventmanager.fire_event("server-starting"); |
108 |
111 |
109 |
112 |
110 -- setup error handling |
113 -- setup error handling |