add OBP key gen page
This commit is contained in:
parent
651ced5ebd
commit
61372e74d1
33
web/app.py
33
web/app.py
@ -47,6 +47,9 @@ from gen_script_template import gen_script
|
|||||||
import os, ast
|
import os, ast
|
||||||
##import hb_config
|
##import hb_config
|
||||||
|
|
||||||
|
from cryptography.fernet import Fernet
|
||||||
|
|
||||||
|
|
||||||
script_links = {}
|
script_links = {}
|
||||||
active_tgs = {}
|
active_tgs = {}
|
||||||
ping_list = {}
|
ping_list = {}
|
||||||
@ -5283,6 +5286,10 @@ TG #: <strong> ''' + str(tg_d.tg) + '''</strong>
|
|||||||
</table>
|
</table>
|
||||||
<p> </p>
|
<p> </p>
|
||||||
|
|
||||||
|
<p style="text-align: center;"><a href="/OBP_key_gen"><button class="btn btn-primary" type="button">Generate OpenBridge Encryption Key</button></a></p>
|
||||||
|
|
||||||
|
<p> </p>
|
||||||
|
|
||||||
''' + m_list
|
''' + m_list
|
||||||
|
|
||||||
return render_template('flask_user_layout.html', markup_content = Markup(content))
|
return render_template('flask_user_layout.html', markup_content = Markup(content))
|
||||||
@ -5722,6 +5729,32 @@ TG #: <strong> ''' + str(tg_d.tg) + '''</strong>
|
|||||||
|
|
||||||
return render_template('flask_user_layout.html', markup_content = Markup(content))
|
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 = '''
|
||||||
|
<h3 style="text-align: center;">Generate OpenBridge Encryption Key</h3>
|
||||||
|
<p> </p>
|
||||||
|
<p style="text-align: center;">Both ends of the OpenBridge connection must share this same key.</p>
|
||||||
|
<p> </p>
|
||||||
|
<table style="width: 500px; margin-left: auto; margin-right: auto;" border="1">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align: center;">KEY: (Copy and Paste)</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align: center;"><strong>''' + str(key)[2:-1] + '''</strong></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<p> </p>
|
||||||
|
'''
|
||||||
|
|
||||||
|
return render_template('flask_user_layout.html', markup_content = Markup(content))
|
||||||
|
|
||||||
@app.route('/svr', methods=['POST'])
|
@app.route('/svr', methods=['POST'])
|
||||||
def auth():
|
def auth():
|
||||||
hblink_req = request.json
|
hblink_req = request.json
|
||||||
|
@ -8,3 +8,5 @@ pymysql
|
|||||||
folium
|
folium
|
||||||
requests
|
requests
|
||||||
libscrc
|
libscrc
|
||||||
|
dmr_utils3
|
||||||
|
cryptography
|
||||||
|
Loading…
x
Reference in New Issue
Block a user