mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
update
This commit is contained in:
@@ -577,6 +577,31 @@ def setCfg():
|
||||
if not re.search(r"\d+", v):
|
||||
return mw.returnJson(False, '参数值错误,请输入数字整数')
|
||||
|
||||
if k == "brotli":
|
||||
if v == "on":
|
||||
# 批量替换所有以 #brotli 开头的指令为 brotli
|
||||
rep_var = r"#brotli[\w_]*\s+[^\;\n]+"
|
||||
newconf = lambda m: m.group(0).lstrip('#')
|
||||
content = re.sub(rep_var, newconf, content)
|
||||
if v == "off":
|
||||
# 批量替换所有以 brotli 开头且没有 # 前缀的指令为 #brotli
|
||||
rep_var = r"(?<!#)brotli[\w_]*\s+[^\;\n]+"
|
||||
newconf = lambda m: '#' + m.group(0)
|
||||
content = re.sub(rep_var, newconf, content)
|
||||
|
||||
|
||||
if k == "zstd":
|
||||
if v == "on":
|
||||
# 批量替换所有以 #zstd 开头的指令为 zstd
|
||||
rep_var = r"#zstd[\w_]*\s+[^\;\n]+"
|
||||
newconf = lambda m: m.group(0).lstrip('#')
|
||||
content = re.sub(rep_var, newconf, content)
|
||||
if v == "off":
|
||||
# 批量替换所有以 zstd 开头且没有 # 前缀的指令为 #zstd
|
||||
rep_var = r"(?<!#)zstd[\w_]*\s+[^\;\n]+"
|
||||
newconf = lambda m: '#' + m.group(0)
|
||||
content = re.sub(rep_var, newconf, content)
|
||||
|
||||
if k == "worker_processes" :
|
||||
k_wca = "worker_cpu_affinity"
|
||||
rep_wca = r"%s\s+[^\;\n]+" % k_wca
|
||||
|
||||
@@ -133,14 +133,22 @@ Install_openresty()
|
||||
fi
|
||||
|
||||
OPTIONS="${OPTIONS} --with-threads"
|
||||
OPTIONS="${OPTIONS} --with-file-aio"
|
||||
OPTIONS="${OPTIONS} --with-pcre-jit"
|
||||
OPTIONS="${OPTIONS} --with-http_gzip_static_module"
|
||||
|
||||
if [ ! -d ${openrestyDir}/zstd-nginx-module ];then
|
||||
if [ "$sysName" != "Darwin" ];then
|
||||
OPTIONS="${OPTIONS} --with-file-aio"
|
||||
fi
|
||||
|
||||
if [ ! -d ${openrestyDir}/zstd-nginx-module-master ];then
|
||||
cd ${openrestyDir} && wget -O $openrestyDir/zstd-nginx-module.tar.gz https://github.com/tokers/zstd-nginx-module/archive/refs/heads/master.tar.gz
|
||||
cd ${openrestyDir} && tar -zxvf zstd-nginx-module.tar.gz
|
||||
|
||||
if [ "$sysName" == "Darwin" ];then
|
||||
export ZSTD_INC=/opt/homebrew/include
|
||||
export ZSTD_LIB=/opt/homebrew/lib
|
||||
fi
|
||||
|
||||
pkg-config --exists --print-errors libzstd
|
||||
if [ "$?" == "0" ];then
|
||||
OPTIONS="${OPTIONS} --add-module=${openrestyDir}/zstd-nginx-module-master"
|
||||
|
||||
@@ -134,14 +134,22 @@ Install_openresty()
|
||||
fi
|
||||
|
||||
OPTIONS="${OPTIONS} --with-threads"
|
||||
OPTIONS="${OPTIONS} --with-file-aio"
|
||||
OPTIONS="${OPTIONS} --with-pcre-jit"
|
||||
OPTIONS="${OPTIONS} --with-http_gzip_static_module"
|
||||
|
||||
if [ ! -d ${openrestyDir}/zstd-nginx-module ];then
|
||||
if [ "$sysName" != "Darwin" ];then
|
||||
OPTIONS="${OPTIONS} --with-file-aio"
|
||||
fi
|
||||
|
||||
if [ ! -d ${openrestyDir}/zstd-nginx-module-master ];then
|
||||
cd ${openrestyDir} && wget -O $openrestyDir/zstd-nginx-module.tar.gz https://github.com/tokers/zstd-nginx-module/archive/refs/heads/master.tar.gz
|
||||
cd ${openrestyDir} && tar -zxvf zstd-nginx-module.tar.gz
|
||||
|
||||
if [ "$sysName" == "Darwin" ];then
|
||||
export ZSTD_INC=/opt/homebrew/include
|
||||
export ZSTD_LIB=/opt/homebrew/lib
|
||||
fi
|
||||
|
||||
pkg-config --exists --print-errors libzstd
|
||||
if [ "$?" == "0" ];then
|
||||
OPTIONS="${OPTIONS} --add-module=${openrestyDir}/zstd-nginx-module-master"
|
||||
|
||||
@@ -133,14 +133,22 @@ Install_openresty()
|
||||
fi
|
||||
|
||||
OPTIONS="${OPTIONS} --with-threads"
|
||||
OPTIONS="${OPTIONS} --with-file-aio"
|
||||
OPTIONS="${OPTIONS} --with-pcre-jit"
|
||||
OPTIONS="${OPTIONS} --with-http_gzip_static_module"
|
||||
|
||||
if [ ! -d ${openrestyDir}/zstd-nginx-module ];then
|
||||
if [ "$sysName" != "Darwin" ];then
|
||||
OPTIONS="${OPTIONS} --with-file-aio"
|
||||
fi
|
||||
|
||||
if [ ! -d ${openrestyDir}/zstd-nginx-module-master ];then
|
||||
cd ${openrestyDir} && wget -O $openrestyDir/zstd-nginx-module.tar.gz https://github.com/tokers/zstd-nginx-module/archive/refs/heads/master.tar.gz
|
||||
cd ${openrestyDir} && tar -zxvf zstd-nginx-module.tar.gz
|
||||
|
||||
if [ "$sysName" == "Darwin" ];then
|
||||
export ZSTD_INC=/opt/homebrew/include
|
||||
export ZSTD_LIB=/opt/homebrew/lib
|
||||
fi
|
||||
|
||||
pkg-config --exists --print-errors libzstd
|
||||
if [ "$?" == "0" ];then
|
||||
OPTIONS="${OPTIONS} --add-module=${openrestyDir}/zstd-nginx-module-master"
|
||||
|
||||
@@ -149,14 +149,22 @@ Install_openresty()
|
||||
fi
|
||||
|
||||
OPTIONS="${OPTIONS} --with-threads"
|
||||
OPTIONS="${OPTIONS} --with-file-aio"
|
||||
OPTIONS="${OPTIONS} --with-pcre-jit"
|
||||
OPTIONS="${OPTIONS} --with-http_gzip_static_module"
|
||||
|
||||
if [ ! -d ${openrestyDir}/zstd-nginx-module ];then
|
||||
if [ "$sysName" != "Darwin" ];then
|
||||
OPTIONS="${OPTIONS} --with-file-aio"
|
||||
fi
|
||||
|
||||
if [ ! -d ${openrestyDir}/zstd-nginx-module-master ];then
|
||||
cd ${openrestyDir} && wget -O $openrestyDir/zstd-nginx-module.tar.gz https://github.com/tokers/zstd-nginx-module/archive/refs/heads/master.tar.gz
|
||||
cd ${openrestyDir} && tar -zxvf zstd-nginx-module.tar.gz
|
||||
|
||||
if [ "$sysName" == "Darwin" ];then
|
||||
export ZSTD_INC=/opt/homebrew/include
|
||||
export ZSTD_LIB=/opt/homebrew/lib
|
||||
fi
|
||||
|
||||
pkg-config --exists --print-errors libzstd
|
||||
if [ "$?" == "0" ];then
|
||||
OPTIONS="${OPTIONS} --add-module=${openrestyDir}/zstd-nginx-module-master"
|
||||
|
||||
@@ -132,22 +132,31 @@ Install_openresty()
|
||||
fi
|
||||
|
||||
# br
|
||||
if [ ! -d ${openrestyDir}/openresty-${VERSION}/ngx_brotli ];then
|
||||
cd ${openrestyDir}/openresty-${VERSION} && git clone https://github.com/wxx9248/ngx_brotli.git
|
||||
cd ${openrestyDir}/openresty-${VERSION}/ngx_brotli && git submodule update --init
|
||||
if [ ! -d ${openrestyDir}/ngx_brotli ];then
|
||||
cd ${openrestyDir} && git clone https://github.com/wxx9248/ngx_brotli.git
|
||||
cd ${openrestyDir}/ngx_brotli && git submodule update --init
|
||||
|
||||
OPTIONS="${OPTIONS} --add-module=${openrestyDir}/openresty-${VERSION}/ngx_brotli"
|
||||
OPTIONS="${OPTIONS} --add-module=${openrestyDir}/ngx_brotli"
|
||||
fi
|
||||
|
||||
OPTIONS="${OPTIONS} --with-threads"
|
||||
OPTIONS="${OPTIONS} --with-file-aio"
|
||||
OPTIONS="${OPTIONS} --with-pcre-jit"
|
||||
OPTIONS="${OPTIONS} --with-http_gzip_static_module"
|
||||
|
||||
if [ ! -d ${openrestyDir}/zstd-nginx-module ];then
|
||||
|
||||
if [ "$sysName" != "Darwin" ];then
|
||||
OPTIONS="${OPTIONS} --with-file-aio"
|
||||
fi
|
||||
|
||||
if [ ! -d ${openrestyDir}/zstd-nginx-module-master ];then
|
||||
cd ${openrestyDir} && wget -O $openrestyDir/zstd-nginx-module.tar.gz https://github.com/tokers/zstd-nginx-module/archive/refs/heads/master.tar.gz
|
||||
cd ${openrestyDir} && tar -zxvf zstd-nginx-module.tar.gz
|
||||
|
||||
if [ "$sysName" == "Darwin" ];then
|
||||
export ZSTD_INC=/opt/homebrew/include
|
||||
export ZSTD_LIB=/opt/homebrew/lib
|
||||
fi
|
||||
|
||||
pkg-config --exists --print-errors libzstd
|
||||
if [ "$?" == "0" ];then
|
||||
OPTIONS="${OPTIONS} --add-module=${openrestyDir}/zstd-nginx-module-master"
|
||||
|
||||
@@ -140,15 +140,23 @@ Install_openresty()
|
||||
fi
|
||||
|
||||
OPTIONS="${OPTIONS} --with-threads"
|
||||
OPTIONS="${OPTIONS} --with-file-aio"
|
||||
OPTIONS="${OPTIONS} --with-pcre-jit"
|
||||
OPTIONS="${OPTIONS} --with-http_gzip_static_module"
|
||||
|
||||
if [ "$sysName" != "Darwin" ];then
|
||||
OPTIONS="${OPTIONS} --with-file-aio"
|
||||
fi
|
||||
|
||||
#zstd
|
||||
if [ ! -d ${openrestyDir}/zstd-nginx-module ];then
|
||||
if [ ! -d ${openrestyDir}/zstd-nginx-module-master ];then
|
||||
cd ${openrestyDir} && wget -O $openrestyDir/zstd-nginx-module.tar.gz https://github.com/tokers/zstd-nginx-module/archive/refs/heads/master.tar.gz
|
||||
cd ${openrestyDir} && tar -zxvf zstd-nginx-module.tar.gz
|
||||
|
||||
if [ "$sysName" == "Darwin" ];then
|
||||
export ZSTD_INC=/opt/homebrew/include
|
||||
export ZSTD_LIB=/opt/homebrew/lib
|
||||
fi
|
||||
|
||||
pkg-config --exists --print-errors libzstd
|
||||
if [ "$?" == "0" ];then
|
||||
OPTIONS="${OPTIONS} --add-module=${openrestyDir}/zstd-nginx-module-master"
|
||||
@@ -195,9 +203,9 @@ Install_openresty()
|
||||
rm -rf $openrestyDir/openresty-${VERSION}
|
||||
fi
|
||||
|
||||
if [ -d $openrestyDir/zstd-nginx-module-master ];then
|
||||
rm -rf $openrestyDir/zstd-nginx-module-master
|
||||
fi
|
||||
# if [ -d $openrestyDir/zstd-nginx-module-master ];then
|
||||
# rm -rf $openrestyDir/zstd-nginx-module-master
|
||||
# fi
|
||||
|
||||
# if [ -d $openrestyDir/ngx_brotli ];then
|
||||
# rm -rf $openrestyDir/ngx_brotli
|
||||
|
||||
Reference in New Issue
Block a user