66 config.set("*", "core", "ssl", _G.config.ssl_ctx); |
66 config.set("*", "core", "ssl", _G.config.ssl_ctx); |
67 end |
67 end |
68 end |
68 end |
69 end |
69 end |
70 |
70 |
71 require "util.datamanager".set_data_path(data_path); |
|
72 |
|
73 local server = require "net.server" |
71 local server = require "net.server" |
74 |
72 |
75 require "util.dependencies" |
73 require "util.dependencies" |
76 |
74 |
77 -- Maps connections to sessions -- |
75 -- Maps connections to sessions -- |
78 sessions = {}; |
76 sessions = {}; |
79 hosts = {}; |
77 hosts = {}; |
80 |
|
81 |
78 |
82 -- Load and initialise core modules -- |
79 -- Load and initialise core modules -- |
83 |
80 |
84 require "util.import" |
81 require "util.import" |
85 require "core.xmlhandlers" |
82 require "core.xmlhandlers" |
102 require "util.stanza" |
99 require "util.stanza" |
103 require "util.jid" |
100 require "util.jid" |
104 |
101 |
105 ------------------------------------------------------------------------ |
102 ------------------------------------------------------------------------ |
106 |
103 |
|
104 |
107 ------------- Begin code without a home --------------------- |
105 ------------- Begin code without a home --------------------- |
108 |
106 |
109 local data_path = config.get("*", "core", "data_path") or CFG_DATADIR or "data"; |
107 local data_path = config.get("*", "core", "data_path") or CFG_DATADIR or "data"; |
|
108 require "util.datamanager".set_data_path(data_path); |
|
109 |
|
110 |
110 local path_separator = "/"; if os.getenv("WINDIR") then path_separator = "\\" end |
111 local path_separator = "/"; if os.getenv("WINDIR") then path_separator = "\\" end |
111 local _mkdir = {} |
112 local _mkdir = {} |
112 function mkdir(path) |
113 function mkdir(path) |
113 path = path:gsub("/", path_separator); |
114 path = path:gsub("/", path_separator); |
114 --print("mkdir",path); |
115 --print("mkdir",path); |