mirror of https://github.com/CIRCL/AIL-framework
chg: [Flask server] https support + create self signed certificate
parent
bb65179e50
commit
be251289a7
|
@ -19,6 +19,19 @@ echo -e $GREEN"Shutting down AIL ..."$DEFAULT
|
|||
bash ${AIL_BIN}/LAUNCH.sh -k
|
||||
wait
|
||||
|
||||
echo ""
|
||||
echo -e $GREEN"Create Self-Signed Certificate"$DEFAULT
|
||||
echo ""
|
||||
pushd ${AIL_BIN}/helper/gen_cert
|
||||
bash gen_root.sh
|
||||
wait
|
||||
bash gen_cert.sh
|
||||
wait
|
||||
popd
|
||||
|
||||
cp ${AIL_BIN}/helper/gen_cert/server.crt ${AIL_FLASK}/server.crt
|
||||
cp ${AIL_BIN}/helper/gen_cert/server.key ${AIL_FLASK}/server.key
|
||||
|
||||
echo ""
|
||||
echo -e $GREEN"Update requirement"$DEFAULT
|
||||
echo ""
|
||||
|
@ -30,7 +43,7 @@ wait
|
|||
echo ""
|
||||
echo ""
|
||||
|
||||
bash ${AIL_BIN}LAUNCH.sh -lav &
|
||||
bash ${AIL_BIN}/LAUNCH.sh -lav &
|
||||
wait
|
||||
echo ""
|
||||
|
||||
|
|
|
@ -4,14 +4,13 @@
|
|||
import os
|
||||
import re
|
||||
import sys
|
||||
import ssl
|
||||
import time
|
||||
|
||||
import redis
|
||||
import configparser
|
||||
import random
|
||||
import json
|
||||
import datetime
|
||||
import time
|
||||
import calendar
|
||||
import configparser
|
||||
|
||||
from flask import Flask, render_template, jsonify, request, Request, session, redirect, url_for
|
||||
from flask_login import LoginManager, current_user, login_user, logout_user, login_required
|
||||
|
||||
|
@ -57,6 +56,12 @@ r_serv_tags = redis.StrictRedis(
|
|||
|
||||
# ========= =========#
|
||||
|
||||
# ========= TLS =========#
|
||||
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
|
||||
ssl_context.load_cert_chain(certfile='server.crt', keyfile='server.key')
|
||||
#print(ssl_context.get_ciphers())
|
||||
# ========= =========#
|
||||
|
||||
Flask_config.app = Flask(__name__, static_url_path=baseUrl+'/static/')
|
||||
app = Flask_config.app
|
||||
app.config['MAX_CONTENT_LENGTH'] = 900 * 1024 * 1024
|
||||
|
@ -258,4 +263,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)
|
||||
app.run(host='0.0.0.0', port=7000, threaded=True, ssl_context=ssl_context)
|
||||
|
|
|
@ -176,7 +176,7 @@ max_dashboard_logs = int(cfg.get("Flask", "max_dashboard_logs"))
|
|||
|
||||
crawler_enabled = cfg.getboolean("Crawler", "activate_crawler")
|
||||
|
||||
email_regex = r'[^@]+@[^@]+\.[^@]+'
|
||||
email_regex = r'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}'
|
||||
email_regex = re.compile(email_regex)
|
||||
|
||||
# VT
|
||||
|
|
Loading…
Reference in New Issue