mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-29 17:27:17 +00:00
fix: [Flask server + cookie session] chg default cookie name (also use port number) + add Flask port number to config
This commit is contained in:
parent
f139e9564e
commit
7f278bd315
2 changed files with 11 additions and 1 deletions
|
@ -36,6 +36,8 @@ sender_pw = None
|
|||
[Flask]
|
||||
#Proxying requests to the app
|
||||
baseUrl = /
|
||||
#Flask server port
|
||||
port = 7000
|
||||
#Number of logs to display in the dashboard
|
||||
max_dashboard_logs = 15
|
||||
#Maximum number of character to display in the toolip
|
||||
|
|
|
@ -51,6 +51,11 @@ baseUrl = baseUrl.replace('/', '')
|
|||
if baseUrl != '':
|
||||
baseUrl = '/'+baseUrl
|
||||
|
||||
try:
|
||||
FLASK_PORT = config_loader.get_config_int("Flask", "port")
|
||||
except Exception:
|
||||
FLASK_PORT = 7000
|
||||
|
||||
# ========= REDIS =========#
|
||||
r_serv_db = config_loader.get_redis_conn("ARDB_DB")
|
||||
r_serv_tags = config_loader.get_redis_conn("ARDB_Tags")
|
||||
|
@ -90,6 +95,9 @@ app.register_blueprint(correlation, url_prefix=baseUrl)
|
|||
app.register_blueprint(tags_ui, url_prefix=baseUrl)
|
||||
# ========= =========#
|
||||
|
||||
# ========= Cookie name ========
|
||||
app.config.update(SESSION_COOKIE_NAME='ail_framework_{}'.format(FLASK_PORT))
|
||||
|
||||
# ========= session ========
|
||||
app.secret_key = str(random.getrandbits(256))
|
||||
login_manager = LoginManager()
|
||||
|
@ -242,4 +250,4 @@ r_serv_db.sadd('list_export_tags', 'infoleak:submission="manual"')
|
|||
# ============ MAIN ============
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host='0.0.0.0', port=7000, threaded=True, ssl_context=ssl_context)
|
||||
app.run(host='0.0.0.0', port=FLASK_PORT, threaded=True, ssl_context=ssl_context)
|
||||
|
|
Loading…
Reference in a new issue