mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 01:39:25 +08:00
+5
-1
@@ -35,7 +35,7 @@ redis
|
||||
pillow
|
||||
Jinja2>=2.11.2
|
||||
PyMySQL>=1.0.2
|
||||
whitenoise==5.3.0
|
||||
whitenoise>5.3.0
|
||||
tldextract
|
||||
pyotp
|
||||
pytz
|
||||
@@ -46,3 +46,7 @@ pyyaml
|
||||
croniter
|
||||
bcrypt
|
||||
packaging
|
||||
Flask-Compress
|
||||
brotli
|
||||
zstd
|
||||
zstandard
|
||||
@@ -377,6 +377,7 @@ mw_install(){
|
||||
mw_common_proxy
|
||||
echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh")"
|
||||
bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh")
|
||||
mw_clean_lib
|
||||
bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh")
|
||||
}
|
||||
|
||||
@@ -401,8 +402,8 @@ mw_update_dev()
|
||||
|
||||
mw_common_proxy
|
||||
echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh")"
|
||||
mw_clean_lib
|
||||
bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh")
|
||||
|
||||
cd ${PANEL_DIR}
|
||||
}
|
||||
|
||||
|
||||
+11
-2
@@ -24,6 +24,7 @@ from flask import Response
|
||||
from flask import Flask, abort, current_app, session, url_for
|
||||
from flask import Blueprint, render_template
|
||||
from flask import render_template_string
|
||||
from flask_compress import Compress
|
||||
|
||||
from flask_socketio import SocketIO, emit, send
|
||||
|
||||
@@ -44,15 +45,23 @@ setup.init()
|
||||
|
||||
app = Flask(__name__, template_folder='templates/default')
|
||||
|
||||
|
||||
# curl --compressed -I "http://127.0.0.1:44010/" -H "Accept-Encoding: zstd" --write-out "%{json}"
|
||||
app.config["COMPRESS_ALGORITHM"] = ["zstd", "br", "gzip", "deflate"]
|
||||
Compress(app)
|
||||
|
||||
# 缓存配置
|
||||
cache = Cache(config={'CACHE_TYPE': 'simple'})
|
||||
cache.init_app(app, config={'CACHE_TYPE': 'simple'})
|
||||
|
||||
# 静态文件配置
|
||||
from whitenoise import WhiteNoise
|
||||
app.wsgi_app = WhiteNoise(app.wsgi_app, root="../web/static/", prefix="static/", max_age=604800)
|
||||
app.static_folder = "../static"
|
||||
app.static_url_path = "/static"
|
||||
app.jinja_env.trim_blocks = True
|
||||
|
||||
# from whitenoise import WhiteNoise
|
||||
# app.wsgi_app = WhiteNoise(app.wsgi_app, root="../web/static/", prefix="static/", max_age=604800)
|
||||
|
||||
# session配置
|
||||
# app.secret_key = uuid.UUID(int=uuid.getnode()).hex[-12:]
|
||||
app.config['SECRET_KEY'] = uuid.UUID(int=uuid.getnode()).hex[-12:]
|
||||
|
||||
Reference in New Issue
Block a user