2017-11-19 14:46:42 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
from twisted.internet import reactor
|
|
|
|
from twisted.internet.ssl import DefaultOpenSSLContextFactory
|
2017-11-23 20:37:00 +00:00
|
|
|
|
2017-12-24 21:04:48 +00:00
|
|
|
#from twisted.python import log
|
|
|
|
#from sys import stdout
|
|
|
|
#log.startLogging(stdout)
|
|
|
|
|
2018-02-23 22:05:40 +00:00
|
|
|
from core.main import (
|
|
|
|
numbers,
|
|
|
|
configPath,
|
|
|
|
certPath,
|
|
|
|
listener,
|
|
|
|
connections,
|
|
|
|
IRCPool,
|
|
|
|
ReactorPool,
|
|
|
|
FactoryPool,
|
|
|
|
MonitorPool,
|
|
|
|
saveConf,
|
|
|
|
loadConf,
|
|
|
|
initMain,
|
2018-02-24 12:42:27 +00:00
|
|
|
)
|
|
|
|
|
2018-02-23 22:05:40 +00:00
|
|
|
initMain()
|
|
|
|
|
|
|
|
from core.main import (
|
|
|
|
config,
|
|
|
|
keyconf,
|
|
|
|
pool,
|
|
|
|
help,
|
|
|
|
wholist,
|
2018-02-24 12:42:27 +00:00
|
|
|
counters,
|
|
|
|
)
|
2017-11-19 14:46:42 +00:00
|
|
|
|
2018-02-22 19:30:31 +00:00
|
|
|
from utils.logging.log import *
|
2018-02-23 22:05:40 +00:00
|
|
|
import modules.userinfo as userinfo
|
|
|
|
import core.helper as helper
|
2018-03-04 13:26:53 +00:00
|
|
|
from core.server import Server, ServerFactory
|
2017-11-24 19:16:08 +00:00
|
|
|
|
2017-11-19 14:46:42 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2017-11-23 20:37:00 +00:00
|
|
|
for i in pool.keys():
|
|
|
|
if pool[i]["enabled"] == True:
|
|
|
|
helper.addBot(i)
|
2017-11-19 14:46:42 +00:00
|
|
|
|
2018-03-04 13:26:53 +00:00
|
|
|
listener = ServerFactory()
|
2018-01-17 19:02:41 +00:00
|
|
|
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"]))
|
2017-11-19 14:46:42 +00:00
|
|
|
else:
|
2018-01-17 19:02:41 +00:00
|
|
|
reactor.listenTCP(config["Listener"]["Port"], listener, interface=config["Listener"]["Address"])
|
|
|
|
log("Threshold running on %s:%s" % (config["Listener"]["Address"], config["Listener"]["Port"]))
|
2017-11-19 14:46:42 +00:00
|
|
|
|
|
|
|
reactor.run()
|