monolith/threshold

51 lines
1.4 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env python
from twisted.internet import reactor
from twisted.internet.ssl import DefaultOpenSSLContextFactory
2017-11-23 20:37:00 +00:00
#from twisted.python import log
#from sys import stdout
#log.startLogging(stdout)
from core.main import (
configPath,
certPath,
connections,
IRCPool,
ReactorPool,
FactoryPool,
MonitorPool,
saveConf,
loadConf,
initMain,
)
initMain()
from core.main import (
config,
keyconf,
pool,
help,
wholist,
counters,
)
2018-02-22 19:30:31 +00:00
from utils.logging.log import *
import modules.userinfo as userinfo
import core.helper as helper
from core.server import Server, ServerFactory
if __name__ == "__main__":
listener = ServerFactory()
if config["Listener"]["UseSSL"] == True:
reactor.listenSSL(config["Listener"]["Port"], listener, DefaultOpenSSLContextFactory(certPath+config["Listener"]["Key"], certPath+config["Listener"]["Certificate"]), interface=config["Listener"]["Address"])
log("Threshold running with SSL on %s:%s" % (config["Listener"]["Address"], config["Listener"]["Port"]))
else:
reactor.listenTCP(config["Listener"]["Port"], listener, interface=config["Listener"]["Address"])
log("Threshold running on %s:%s" % (config["Listener"]["Address"], config["Listener"]["Port"]))
for i in pool.keys():
if pool[i]["enabled"] == True:
helper.addBot(i)
reactor.run()