暂时解决session随机数不够安全的问题

This commit is contained in:
2026-03-21 22:11:18 +08:00
parent dcb40a2e5a
commit 1b03a7aa05

View File

@@ -6,6 +6,7 @@ from blueprint.kami_views import kami_bp
from blueprint.index_views import index_bp
import os
import sqlite3
import secrets
def get_owp_db_conn():
conn = sqlite3.connect('/var/open-ww3-project-ww3-tw/databases/sqlite/owp.db')
@@ -16,9 +17,9 @@ app = Flask(__name__, static_url_path='/static/')
# session
#app.secret_key = "508948973a8651f160baf3b26f18c47d"
app.secret_key = '玩鵬畝遜溉痕叛課還擇鼇粹拜溜泉聰倡效蘭鱅都凍芝西鄂'
# 随机数生成
key_hex = secrets.token_hex(32)
app.secret_key = key_hex
# 注册蓝图