|
|
|
@ -387,6 +387,10 @@ def api_get_logs():
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return json.dumps(result, ensure_ascii=False)
|
|
|
|
return json.dumps(result, ensure_ascii=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def datas(logs):
|
|
|
|
|
|
|
|
for log in logs:
|
|
|
|
|
|
|
|
yield log['data']
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/api/red', methods=['POST'])
|
|
|
|
@app.route('/api/red', methods=['POST'])
|
|
|
|
def api_red_logs():
|
|
|
|
def api_red_logs():
|
|
|
|
global STARTED
|
|
|
|
global STARTED
|
|
|
|
@ -404,7 +408,8 @@ def api_red_logs():
|
|
|
|
|
|
|
|
|
|
|
|
with open('./database/logs/red.json') as f:
|
|
|
|
with open('./database/logs/red.json') as f:
|
|
|
|
logs_list = json.load(f)
|
|
|
|
logs_list = json.load(f)
|
|
|
|
logs_list.append(temp_json_n)
|
|
|
|
if temp_json_n['data'] not in datas(logs_list):
|
|
|
|
|
|
|
|
logs_list.append(temp_json_n)
|
|
|
|
with open('./database/logs/red.json', 'w') as f:
|
|
|
|
with open('./database/logs/red.json', 'w') as f:
|
|
|
|
json.dump(logs_list, f, ensure_ascii=False)
|
|
|
|
json.dump(logs_list, f, ensure_ascii=False)
|
|
|
|
|
|
|
|
|
|
|
|
@ -440,5 +445,5 @@ def custom_404(error):
|
|
|
|
clear_session_full()
|
|
|
|
clear_session_full()
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
if __name__ == '__main__':
|
|
|
|
app.run(host='0.0.0.0', threaded=True, use_reloader=True, port=8088)
|
|
|
|
app.run(host='0.0.0.0', threaded=True, use_reloader=True, port=8086)
|
|
|
|
# app.run(host='185.78.255.231', threaded=True,use_reloader=True, port=443, ssl_context=('/etc/letsencrypt/live/network.kyudev.xyz/fullchain.pem', '/etc/letsencrypt/live/network.kyudev.xyz/privkey.pem'))
|
|
|
|
# app.run(host='185.78.255.231', threaded=True,use_reloader=True, port=443, ssl_context=('/etc/letsencrypt/live/network.kyudev.xyz/fullchain.pem', '/etc/letsencrypt/live/network.kyudev.xyz/privkey.pem'))
|
|
|
|
|