diff --git a/README.md b/README.md
index 4e47218a1..03f02c4d3 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,7 @@
一款简单Linux面板服务
+强烈推荐系统:debian
### 简介 @@ -10,10 +11,11 @@ 复制了后台管理界面,按照自己想要的方式写了一版。 - -  +  + + [](https://github.com/midoks/mdserver-web/wiki) [](https://www.jsdelivr.com/package/gh/midoks/mdserver-web) @@ -90,14 +92,12 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443: ``` -### 版本更新 0.11.3 +### 版本更新 0.11.4 -* 域名绑定修改。 -* 面板ssl配置加入。 -* 文件搜索优化。 -* php加入phalcon。 -* 文件管理UI优化。 -* phpmyadmin优化。 +* PHP82正式释出。 +* PHP-fileinfo扩展优化。 +* 删除任务时删除日志。 +* 优化修改密码后的显示问题(#288)。 ### JSDelivr安装地址 diff --git a/class/core/config_api.py b/class/core/config_api.py index 128395382..2b868fa33 100755 --- a/class/core/config_api.py +++ b/class/core/config_api.py @@ -27,7 +27,7 @@ from flask import request class config_api: - __version = '0.11.3' + __version = '0.11.4' __api_addr = 'data/api.json' def __init__(self): diff --git a/class/core/files_api.py b/class/core/files_api.py index eea61e6f7..b902a0a68 100755 --- a/class/core/files_api.py +++ b/class/core/files_api.py @@ -240,6 +240,11 @@ class files_api: system_api.system_api().restartTask() except: system_api.system_api().restartTask() + + # 删除日志 + task_log = mw.getRunDir() + "/tmp/panelTask.pl" + if os.path.exists(task_log): + os.remove(task_log) return mw.returnJson(True, '任务已删除!') # 上传文件 diff --git a/plugins/php/install.sh b/plugins/php/install.sh index 3a98e5901..e28431f07 100755 --- a/plugins/php/install.sh +++ b/plugins/php/install.sh @@ -32,9 +32,9 @@ if [ ! -d $curPath/versions/$2 ];then fi -if [ "${action}" == "install" ] && [ -d $serverPath/php/${type} ];then - exit 0 -fi +# if [ "${action}" == "install" ] && [ -d $serverPath/php/${type} ];then +# exit 0 +# fi if [ "${action}" == "uninstall" ];then @@ -71,6 +71,12 @@ if [ "${action}" == "install" ] && [ -d ${serverPath}/php/${type} ];then cd ${rootPath}/plugins/php/versions/common && bash gettext.sh install ${type} cd ${rootPath}/plugins/php/versions/common && bash redis.sh install ${type} cd ${rootPath}/plugins/php/versions/common && bash memcached.sh install ${type} + cd ${rootPath}/plugins/php/versions/common && bash zlib.sh install ${type} + + if [ "${type}" -gt "72" ];then + cd ${rootPath}/plugins/php/versions/common && bash zip.sh install ${type} + fi + echo "install PHP${type} extend end" fi diff --git a/plugins/php/versions/82/install.sh b/plugins/php/versions/82/install.sh index 4650bec20..41f9fbb97 100755 --- a/plugins/php/versions/82/install.sh +++ b/plugins/php/versions/82/install.sh @@ -16,7 +16,7 @@ function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; } -version=8.2.0RC7 +version=8.2.0 PHP_VER=82 Install_php() { @@ -32,8 +32,7 @@ cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh if [ ! -d $sourcePath/php/php${PHP_VER} ];then if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then - # wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://downloads.php.net/~pierrick/php-${version}.tar.xz - wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://downloads.php.net/~pierrick/php-${version}.tar.xz + wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://www.php.net/distributions/php-${version}.tar.xz fi cd $sourcePath/php && tar -Jxf $sourcePath/php/php-${version}.tar.xz diff --git a/plugins/php/versions/common/fileinfo.sh b/plugins/php/versions/common/fileinfo.sh index 0f07354ac..b947c9a60 100755 --- a/plugins/php/versions/common/fileinfo.sh +++ b/plugins/php/versions/common/fileinfo.sh @@ -49,6 +49,7 @@ Install_lib() if [ ! -f "$extFile" ];then if [ ! -d $sourcePath/php${version}/ext ];then + echo "cd ${rootPath}/plugins/php && /bin/bash install.sh install ${version}" cd ${rootPath}/plugins/php && /bin/bash install.sh install ${version} fi @@ -57,9 +58,23 @@ Install_lib() $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config + + # 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'` + if [ "$version" -gt "74" ] && [ "$FIND_UNDEF_STRNDUP" == "" ];then + sed -i $BAK "s/char \*strndup/#undef strndup\nchar \*strndup/g" $FILE_softmagic + fi + fi + fi + FIND_C99=`cat Makefile|grep c99` - if [ "$FIND_C99" == "" ];then - sed -i $BAK 's/CFLAGS \=/CFLAGS \= -std=c99/g' Makefile + if [ "$version" -gt "74" ] && [ "$FIND_C99" == "" ];then + sed -i $BAK 's/CFLAGS \=/CFLAGS \= -std=gnu99/g' Makefile fi make clean && make && make install && make clean diff --git a/plugins/php/versions/common/phalcon.sh b/plugins/php/versions/common/phalcon.sh index bcfcc9fb3..b3c201610 100755 --- a/plugins/php/versions/common/phalcon.sh +++ b/plugins/php/versions/common/phalcon.sh @@ -20,12 +20,10 @@ LIBV=4.1.2 if [ "$version" -lt "73" ];then echo "not support!" exit 1 -else +fi if [ "$version" -gt "74" ];then LIBV=5.1.2 -else - echo "not support!" fi LIB_PATH_NAME=lib/php diff --git a/plugins/php/versions/common/redis.sh b/plugins/php/versions/common/redis.sh index b7502f80d..10d6bb239 100755 --- a/plugins/php/versions/common/redis.sh +++ b/plugins/php/versions/common/redis.sh @@ -21,6 +21,8 @@ if [ "$version" == "52" ];then LIBV=2.2.7 elif [ "$version" -lt "70" ];then LIBV=4.2.0 +elif [ "$version" -gt "74" ];then + LIBV=5.3.5 else echo 'ok' fi diff --git a/plugins/php/versions/common/yaf.sh b/plugins/php/versions/common/yaf.sh index 5b3bf8fb0..632b953e8 100755 --- a/plugins/php/versions/common/yaf.sh +++ b/plugins/php/versions/common/yaf.sh @@ -31,11 +31,6 @@ if [ "$version" -eq "72" ] || [ "$version" -eq "73" ];then LIBV=3.2.5 fi -if [ "$version" -eq "82" ];then - echo "not need" - exit 1 -fi - LIB_PATH_NAME=lib/php if [ -d $serverPath/php/${version}/lib64 ];then diff --git a/plugins/php/versions/common/yar.sh b/plugins/php/versions/common/yar.sh index 69306fbd1..3ea9778cc 100755 --- a/plugins/php/versions/common/yar.sh +++ b/plugins/php/versions/common/yar.sh @@ -21,12 +21,6 @@ if [ "$version" -lt "70" ];then LIBV=1.2.5 fi -if [ "$version" -eq "82" ];then - echo "wait php82 release" - exit 0 -fi - - LIB_PATH_NAME=lib/php if [ -d $serverPath/php/${version}/lib64 ];then LIB_PATH_NAME=lib64 diff --git a/plugins/php/versions/phplib.conf b/plugins/php/versions/phplib.conf index a07765625..2fc5f4b5b 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -520,8 +520,7 @@ "73", "74", "80", - "81", - "82" + "81" ], "type": "框架", "msg": "Yaf是一个C语言编写的PHP框架", @@ -541,8 +540,7 @@ "73", "74", "80", - "81", - "82" + "81" ], "type": "框架", "msg": "Yar是一个RPC框架", diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 1a177aa93..8563e9341 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -331,7 +331,8 @@ case "$1" in echo -e "==================================================================" echo -e "$address" echo -e `python3 $mw_path/tools.py username` - echo -e "password: $password" + echo -e `python3 $mw_path/tools.py password` + # echo -e "password: $password" echo -e "\033[33mWarning:\033[0m" echo -e "\033[33mIf you cannot access the panel. \033[0m" echo -e "\033[33mrelease the following port (${show_panel_ip}888|80|443|22) in the security group.\033[0m" diff --git a/tools.py b/tools.py index 6f60765e5..be8da7adc 100755 --- a/tools.py +++ b/tools.py @@ -132,6 +132,22 @@ def set_panel_pwd(password, ncli=False): print(username) +def show_panel_pwd(): + # 设置面板密码 + import db + sql = db.Sql() + password = sql.table('users').where('id=?', (1,)).getField('password') + + file_pwd = '' + if os.path.exists('data/default.pl'): + file_pwd = mw.readFile('data/default.pl').strip() + + if mw.md5(file_pwd) == password: + print('password: ' + file_pwd) + return + print("the password has been changed!") + + def set_panel_username(username=None): # 随机面板用户名 import db @@ -171,6 +187,8 @@ if __name__ == "__main__": set_panel_username(sys.argv[2]) else: set_panel_username() + elif method == 'password': + show_panel_pwd() elif method == 'getServerIp': getServerIp() elif method == "cli":