diff --git a/configs/core.cfg.sample b/configs/core.cfg.sample index 031927eb..632e1d07 100644 --- a/configs/core.cfg.sample +++ b/configs/core.cfg.sample @@ -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 diff --git a/var/www/Flask_server.py b/var/www/Flask_server.py index 201c080d..f5d6d19f 100755 --- a/var/www/Flask_server.py +++ b/var/www/Flask_server.py @@ -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)