forked from thinkst/canarytokens
-
Notifications
You must be signed in to change notification settings - Fork 0
/
frontend.tac
27 lines (20 loc) · 969 Bytes
/
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
import logging
import os
import sys
sys.path.append(os.path.abspath(os.path.dirname(__file__)))
from twisted.application import service
from httpd_site import CanarytokensHttpd
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)