暂时解决session随机数不够安全的问题
This commit is contained in:
7
main.py
7
main.py
@@ -6,6 +6,7 @@ from blueprint.kami_views import kami_bp
|
|||||||
from blueprint.index_views import index_bp
|
from blueprint.index_views import index_bp
|
||||||
import os
|
import os
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
import secrets
|
||||||
|
|
||||||
def get_owp_db_conn():
|
def get_owp_db_conn():
|
||||||
conn = sqlite3.connect('/var/open-ww3-project-ww3-tw/databases/sqlite/owp.db')
|
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
|
# session
|
||||||
#app.secret_key = "508948973a8651f160baf3b26f18c47d"
|
# 随机数生成
|
||||||
app.secret_key = '玩鵬畝遜溉痕叛課還擇鼇粹拜溜泉聰倡效蘭鱅都凍芝西鄂'
|
key_hex = secrets.token_hex(32)
|
||||||
|
app.secret_key = key_hex
|
||||||
|
|
||||||
|
|
||||||
# 注册蓝图
|
# 注册蓝图
|
||||||
|
|||||||
Reference in New Issue
Block a user