forked from thinkst/canarytokens
-
Notifications
You must be signed in to change notification settings - Fork 0
/
frontend.tac
29 lines (22 loc) · 1.03 KB
/
frontend.tac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import sys, os
import logging
sys.path.append(os.path.abspath(os.path.dirname(__file__)))
from twisted.names import server
from twisted.application import service, internet
from httpd_site import CanarytokensHttpd
from switchboard import Switchboard
import setup_db
from twisted.logger import ILogObserver, textFileLogObserver
from twisted.python import logfile
import settings
logging.basicConfig()
logger = logging.getLogger('generator_httpd')
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger.debug('Canarydrops generator HTTPd')
application = service.Application("Canarydrops Generator Web Server")
f = logfile.LogFile.fromFullPath(settings.LOG_FILE, rotateLength=settings.FRONTEND_LOG_SIZE,
maxRotatedFiles=settings.FRONTEND_LOG_COUNT)
application.setComponent(ILogObserver, textFileLogObserver(f))
canarytokens_httpd = CanarytokensHttpd(port=settings.CANARYTOKENS_HTTP_PORT)
canarytokens_httpd.service.setServiceParent(application)