From daf001ededb273ea91bf5d6e3a41ba8cf74a9fd5 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 1 Oct 2008 22:11:28 +0100 Subject: Moved hosts to a config file, still need better config though --- lxmppd.cfg.dist | 25 +++++++++++++++++++++++++ main.lua | 22 +++++----------------- 2 files changed, 30 insertions(+), 17 deletions(-) create mode 100644 lxmppd.cfg.dist diff --git a/lxmppd.cfg.dist b/lxmppd.cfg.dist new file mode 100644 index 00000000..b1b0d9ad --- /dev/null +++ b/lxmppd.cfg.dist @@ -0,0 +1,25 @@ + + +sessions = {}; +hosts = { + ["localhost"] = { + type = "local"; + connected = true; + sessions = {}; + }; + ["getjabber.ath.cx"] = { + type = "local"; + connected = true; + sessions = {}; + }; + } + +-- If the following is not defined, no SSL will be set up on 5223 +ssl_ctx = { + mode = "server", + protocol = "sslv23", + + key = "/home/matthew/ssl_cert/server.key", + certificate = "/home/matthew/ssl_cert/server.crt", + capath = "/etc/ssl/certs", verify = "none", + } diff --git a/main.lua b/main.lua index b6bcba84..ddab301b 100644 --- a/main.lua +++ b/main.lua @@ -8,6 +8,10 @@ require "lxp" function log(type, area, message) print(type, area, message); end + +dofile "lxmppd.cfg" + +sessions = {}; require "core.stanza_dispatch" require "core.xmlhandlers" @@ -30,25 +34,9 @@ local st = stanza; local init_xmlhandlers = xmlhandlers.init_xmlhandlers; ------------------------------ -sessions = {}; -hosts = { - ["localhost"] = { - type = "local"; - connected = true; - sessions = {}; - }; - ["getjabber.ath.cx"] = { - type = "local"; - connected = true; - sessions = {}; - }; - } -local hosts, users = hosts, users; - -local ssl_ctx = { mode = "server", protocol = "sslv23", key = "/home/matthew/ssl_cert/server.key", - certificate = "/home/matthew/ssl_cert/server.crt", capath = "/etc/ssl/certs", verify = "none", } +local hosts, users = hosts, users; function connect_host(host) hosts[host] = { type = "remote", sendbuffer = {} }; -- cgit v1.2.3