monolith/threshold

31 lines
1.2 KiB
Python
Executable File

#!/usr/bin/env python
from twisted.internet import reactor
from twisted.internet.ssl import DefaultOpenSSLContextFactory
#from twisted.python import log
#from sys import stdout
#log.startLogging(stdout)
import main
main.initMain()
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 main.config["Listener"]["UseSSL"] == True:
reactor.listenSSL(main.config["Listener"]["Port"], listener, DefaultOpenSSLContextFactory(main.certPath+main.config["Listener"]["Key"], main.certPath+main.config["Listener"]["Certificate"]), interface=main.config["Listener"]["Address"])
log("Threshold running with SSL on %s:%s" % (main.config["Listener"]["Address"], main.config["Listener"]["Port"]))
else:
reactor.listenTCP(main.config["Listener"]["Port"], listener, interface=main.config["Listener"]["Address"])
log("Threshold running on %s:%s" % (main.config["Listener"]["Address"], main.config["Listener"]["Port"]))
for i in main.pool.keys():
if main.pool[i]["enabled"] == True:
helper.addBot(i)
reactor.run()