forked from secureworks/dalton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.py
36 lines (29 loc) · 1018 Bytes
/
run.py
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
30
31
32
33
34
35
36
from flask import Flask
from flask_caching import Cache
from flask_compress import Compress
from app.dalton import dalton_blueprint
from app.flowsynth import flowsynth_blueprint
import logging
# create
daltonfs = Flask(__name__, static_folder='app/static')
# register modules
#
# dalton
daltonfs.register_blueprint(dalton_blueprint)
# flowsynth
daltonfs.register_blueprint(flowsynth_blueprint, url_prefix='/flowsynth')
daltonfs.debug = True
# Apparently the werkzeug default logger logs every HTTP request
# which bubbles up to the root logger and gets output to the
# console which ends up in the docker logs. Since each agent
# checks in every second (by default), this can be voluminous
# and is superfluous for my current needs.
try:
logging.getLogger("werkzeug").setLevel(logging.ERROR)
except Exception as e:
pass
compress = Compress()
cache = Cache(daltonfs, config={"CACHE_TYPE": "simple"})
compress.init_app(daltonfs)
if __name__ == "__main__":
daltonfs.run(host='0.0.0.0', port=8080)