diff --git a/web/app.py b/web/app.py index 7c846b6..b77eaaa 100644 --- a/web/app.py +++ b/web/app.py @@ -47,6 +47,9 @@ from gen_script_template import gen_script import os, ast ##import hb_config +from cryptography.fernet import Fernet + + script_links = {} active_tgs = {} ping_list = {} @@ -5283,6 +5286,10 @@ TG #: ''' + str(tg_d.tg) + '''

 

+

+ +

 

+ ''' + m_list return render_template('flask_user_layout.html', markup_content = Markup(content)) @@ -5722,6 +5729,32 @@ TG #: ''' + str(tg_d.tg) + ''' return render_template('flask_user_layout.html', markup_content = Markup(content)) + @login_required + @roles_required('Admin') + @app.route('/OBP_key_gen') + def obp_key_gen(): + key = Fernet.generate_key() +## content = str(key)[2:-1] + content = ''' +

Generate OpenBridge Encryption Key

+

 

+

Both ends of the OpenBridge connection must share this same key.

+

 

+ + + + + + + + + +
KEY: (Copy and Paste)
''' + str(key)[2:-1] + '''
+

 

+''' + + return render_template('flask_user_layout.html', markup_content = Markup(content)) + @app.route('/svr', methods=['POST']) def auth(): hblink_req = request.json diff --git a/web/requirements.txt b/web/requirements.txt index 1dcdbf7..f3df138 100644 --- a/web/requirements.txt +++ b/web/requirements.txt @@ -8,3 +8,5 @@ pymysql folium requests libscrc +dmr_utils3 +cryptography