Merge pull request #545 from midoks/dev

http/3调整
This commit is contained in:
Mr Chen 2024-04-17 17:54:09 +08:00 committed by GitHub
commit 030734cc93
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 28 additions and 11 deletions

View File

@ -763,6 +763,8 @@ class site_api:
conf = re.sub(rep, '', conf)
rep = "\s+listen\s+\[\:\:\]\:443.*;"
conf = re.sub(rep, '', conf)
rep = "\s+http2\s+on;"
conf = re.sub(rep, '', conf)
mw.writeFile(file, conf)
msg = mw.getInfo('网站[{1}]关闭SSL成功!', (siteName,))
@ -2784,10 +2786,10 @@ location ^~ {from} {\n\
if conf:
if conf.find('ssl_certificate') == -1:
#ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
# add_header Alt-Svc 'h3=":443";ma=86400,h3-29=":443";ma=86400';
http3Header = """
add_header Strict-Transport-Security "max-age=63072000";
add_header Alt-Svc 'h3=":443";ma=86400,h3-29=":443";ma=86400';
add_header Alt-Svc 'h3=":443";ma=86400';
"""
if version != '1.25.3.1':
http3Header = '';
@ -2811,11 +2813,17 @@ location ^~ {from} {\n\
tmp = re.findall(rep, conf)
if not mw.inArray(tmp, '443'):
listen = re.search(rep, conf).group()
http_ssl = "\n\tlisten 443 ssl http2;"
http_ssl = http_ssl + "\n\tlisten [::]:443 ssl http2;"
if version == '1.25.3.1':
http_ssl = "\n\tlisten 443 ssl;"
http_ssl = http_ssl + "\n\tlisten [::]:443 ssl;#reuseport"
http_ssl = http_ssl + "\n\tlisten 443 quic;"
http_ssl = http_ssl + "\n\tlisten [::]:443 quic;"
http_ssl = http_ssl + "\n\thttp2 on;"
else:
http_ssl = "\n\tlisten 443 ssl http2;"
http_ssl = http_ssl + "\n\tlisten [::]:443 ssl http2;"
conf = conf.replace(listen, listen + http_ssl)

View File

@ -63,7 +63,7 @@ if [ "${action}" == "install" ] && [ -d ${serverPath}/php/${type} ];then
# cd /www/server/mdserver-web/plugins/php/versions/common && bash intl.sh install 73
# cd /www/server/mdserver-web/plugins/php/versions/common && bash gd.sh install 56
# cd /www/server/mdserver-web/plugins/php/versions/common && bash openssl.sh install 56
# cd /www/server/mdserver-web/plugins/php/versions/common && bash sodium.sh install 81
# cd /www/server/mdserver-web/plugins/php/versions/common && bash fileinfo.sh install 81
cd ${rootPath}/plugins/php/versions/common && bash gd.sh install ${type}
cd ${rootPath}/plugins/php/versions/common && bash iconv.sh install ${type}
cd ${rootPath}/plugins/php/versions/common && bash exif.sh install ${type}

View File

@ -39,7 +39,7 @@ for PHP_VER in ${PHP_VER_LIST[@]}; do
done
cd $DIR
PHP_VER_LIST=(53 54 55 56 70 71 72 73 74 80 81 82)
PHP_VER_LIST=(53 54 55 56 70 71 72 73 74 80 81 82 83)
# yar
PHP_EXT_LIST=(ZendGuardLoader pdo mysqlnd sqlite3 openssl opcache mcrypt fileinfo \
exif gd intl pcntl memcache memcached redis imagemagick xdebug \

View File

@ -37,6 +37,8 @@ else
BAK=''
fi
OSNAME=`cat ${rootPath}/data/osname.pl`
Install_lib()
{
@ -59,6 +61,7 @@ Install_lib()
OPTIONS="$OPTIONS --build=aarch64-unknown-linux-gnu --host=aarch64-unknown-linux-gnu"
fi
$serverPath/php/$version/bin/phpize
./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS
@ -66,7 +69,6 @@ Install_lib()
# It is considered as a temporary bug
if [ "$version" == "81" ] || [ "$version" == "82" ];then
bash ${rootPath}/scripts/getos.sh
OSNAME=`cat ${rootPath}/data/osname.pl`
if [ "$OSNAME" == 'centos' ];then
FILE_softmagic=$sourcePath/php${version}/ext/${LIBNAME}/libmagic/softmagic.c
FIND_UNDEF_STRNDUP=`cat $FILE_softmagic|grep '#undef strndup'`
@ -81,6 +83,11 @@ Install_lib()
sed -i $BAK 's/CFLAGS \=/CFLAGS \= -std=gnu99/g' Makefile
fi
if [ "$version" -gt "80" ] && [ "$OSNAME" == 'centos' ];then
sed -i $BAK "s#CFLAGS = -g -O2#CFLAGS = -std=c99 -g#g" $sourcePath/php${version}/ext/${LIBNAME}/Makefile
fi
make clean && make && make install && make clean
if [ -d $sourcePath/php${version} ];then

View File

@ -1,7 +1,7 @@
setuptools>=33.1.1
Werkzeug>=1.0.1,<3.0.0
wheel>=0.37.1
gunicorn==20.1.0
gunicorn==22.0.0
requests>=2.27.1
urllib3>=1.21.1
flask>=2.0.3,<3.0.0

View File

@ -2,4 +2,5 @@ cryptography==36.0.1
flask==2.0.3
pyOpenSSL==22.0.0
requests==2.27.1
gevent==22.10.2
gevent==22.10.2
gunicorn==21.2.0

View File

@ -1,2 +1,3 @@
urllib3==1.21.1
gevent==22.10.2
gevent==22.10.2
gunicorn==21.2.0