From bfb37fef56bcc4df6e63335fe5a96d8f2dc8119a Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 13:46:29 +0800 Subject: [PATCH 01/51] Update mw.py --- class/core/mw.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/class/core/mw.py b/class/core/mw.py index 85cc528c6..57bf3a9c4 100755 --- a/class/core/mw.py +++ b/class/core/mw.py @@ -89,8 +89,8 @@ def setBackupDir(bdir): def triggerTask(): - isTask = mw.getRunDir() + '/tmp/panelTask.pl' - mw.writeFile(isTask, 'True') + isTask = getRunDir() + '/tmp/panelTask.pl' + writeFile(isTask, 'True') def getOs(): From 3d6dda0d1728016217967aa62b26030278c71838 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 13:54:44 +0800 Subject: [PATCH 02/51] Update ioncube.sh --- plugins/php/versions/55/ioncube.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/php/versions/55/ioncube.sh b/plugins/php/versions/55/ioncube.sh index 7d8812962..2b688e9af 100755 --- a/plugins/php/versions/55/ioncube.sh +++ b/plugins/php/versions/55/ioncube.sh @@ -42,7 +42,7 @@ Install_lib() php_lib=$sourcePath/php_lib mkdir -p $php_lib - if [ ! -d $php_lib/ioncube_loaders_lin.tar.gz ];then + if [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz fi From 158b679b053cbf8b07a8d608876fa57e0ea08698 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 13:56:27 +0800 Subject: [PATCH 03/51] Update phplib.conf --- plugins/php/versions/phplib.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/php/versions/phplib.conf b/plugins/php/versions/phplib.conf index 64a1759be..53e2c6d92 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -29,7 +29,7 @@ "type": "脚本解密", "msg": "用于解密ionCube Encoder加密脚本!", "shell": "ioncube.sh", - "check": "ioncube_loader_lin" + "check": "ioncube.so" }, { "name": "opcache", From 7cd65e6e6576e7bfd1de349577d5c0bb1b5878a3 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 13:57:16 +0800 Subject: [PATCH 04/51] Update ioncube.sh --- plugins/php/versions/55/ioncube.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/php/versions/55/ioncube.sh b/plugins/php/versions/55/ioncube.sh index 2b688e9af..bcd8729ef 100755 --- a/plugins/php/versions/55/ioncube.sh +++ b/plugins/php/versions/55/ioncube.sh @@ -58,7 +58,7 @@ Install_lib() echo "" >> $serverPath/php/$version/etc/php.ini echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini - echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' From f7e1e49106ec5f0a9958b9b8400694ccbcef6fcb Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 14:53:00 +0800 Subject: [PATCH 05/51] =?UTF-8?q?ionCube=20php52-php74=E5=85=A8=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/php/versions/52/ioncube.sh | 96 ++++++++++++++++++++++++++++++ plugins/php/versions/53/ioncube.sh | 96 ++++++++++++++++++++++++++++++ plugins/php/versions/54/ioncube.sh | 96 ++++++++++++++++++++++++++++++ plugins/php/versions/56/ioncube.sh | 96 ++++++++++++++++++++++++++++++ plugins/php/versions/70/ioncube.sh | 96 ++++++++++++++++++++++++++++++ plugins/php/versions/71/ioncube.sh | 96 ++++++++++++++++++++++++++++++ plugins/php/versions/72/ioncube.sh | 96 ++++++++++++++++++++++++++++++ plugins/php/versions/73/ioncube.sh | 96 ++++++++++++++++++++++++++++++ plugins/php/versions/74/ioncube.sh | 95 +++++++++++++++++++++++++++++ plugins/php/versions/phplib.conf | 11 +++- 10 files changed, 873 insertions(+), 1 deletion(-) create mode 100755 plugins/php/versions/52/ioncube.sh create mode 100755 plugins/php/versions/53/ioncube.sh create mode 100755 plugins/php/versions/54/ioncube.sh create mode 100755 plugins/php/versions/56/ioncube.sh create mode 100755 plugins/php/versions/70/ioncube.sh create mode 100755 plugins/php/versions/71/ioncube.sh create mode 100755 plugins/php/versions/72/ioncube.sh create mode 100755 plugins/php/versions/73/ioncube.sh create mode 100644 plugins/php/versions/74/ioncube.sh diff --git a/plugins/php/versions/52/ioncube.sh b/plugins/php/versions/52/ioncube.sh new file mode 100755 index 000000000..bcd8729ef --- /dev/null +++ b/plugins/php/versions/52/ioncube.sh @@ -0,0 +1,96 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=ioncube +LIBV=0 +sysName=`uname` +actionType=$1 +version=$2 +IC_VERSION=${version:0:1}.${version:1:2} + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} +extFile=${extDir}/${LIBNAME}.so + +if [ "$sysName" == "Darwin" ];then + BAK='_bak' +else + BAK='' +fi + + +Install_lib() +{ + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + + if [ ! -f "$extFile" ];then + + php_lib=$sourcePath/php_lib + mkdir -p $php_lib + if [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then + wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz + cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz + fi + cd $php_lib/ioncube + + cp -rf $php_lib/ioncube/ioncube_loader_lin_${IC_VERSION}.so $extFile + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp not install ${LIBNAME}, Plese select other version!" + return + fi + + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/53/ioncube.sh b/plugins/php/versions/53/ioncube.sh new file mode 100755 index 000000000..bcd8729ef --- /dev/null +++ b/plugins/php/versions/53/ioncube.sh @@ -0,0 +1,96 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=ioncube +LIBV=0 +sysName=`uname` +actionType=$1 +version=$2 +IC_VERSION=${version:0:1}.${version:1:2} + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} +extFile=${extDir}/${LIBNAME}.so + +if [ "$sysName" == "Darwin" ];then + BAK='_bak' +else + BAK='' +fi + + +Install_lib() +{ + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + + if [ ! -f "$extFile" ];then + + php_lib=$sourcePath/php_lib + mkdir -p $php_lib + if [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then + wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz + cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz + fi + cd $php_lib/ioncube + + cp -rf $php_lib/ioncube/ioncube_loader_lin_${IC_VERSION}.so $extFile + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp not install ${LIBNAME}, Plese select other version!" + return + fi + + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/54/ioncube.sh b/plugins/php/versions/54/ioncube.sh new file mode 100755 index 000000000..bcd8729ef --- /dev/null +++ b/plugins/php/versions/54/ioncube.sh @@ -0,0 +1,96 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=ioncube +LIBV=0 +sysName=`uname` +actionType=$1 +version=$2 +IC_VERSION=${version:0:1}.${version:1:2} + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} +extFile=${extDir}/${LIBNAME}.so + +if [ "$sysName" == "Darwin" ];then + BAK='_bak' +else + BAK='' +fi + + +Install_lib() +{ + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + + if [ ! -f "$extFile" ];then + + php_lib=$sourcePath/php_lib + mkdir -p $php_lib + if [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then + wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz + cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz + fi + cd $php_lib/ioncube + + cp -rf $php_lib/ioncube/ioncube_loader_lin_${IC_VERSION}.so $extFile + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp not install ${LIBNAME}, Plese select other version!" + return + fi + + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/56/ioncube.sh b/plugins/php/versions/56/ioncube.sh new file mode 100755 index 000000000..bcd8729ef --- /dev/null +++ b/plugins/php/versions/56/ioncube.sh @@ -0,0 +1,96 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=ioncube +LIBV=0 +sysName=`uname` +actionType=$1 +version=$2 +IC_VERSION=${version:0:1}.${version:1:2} + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} +extFile=${extDir}/${LIBNAME}.so + +if [ "$sysName" == "Darwin" ];then + BAK='_bak' +else + BAK='' +fi + + +Install_lib() +{ + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + + if [ ! -f "$extFile" ];then + + php_lib=$sourcePath/php_lib + mkdir -p $php_lib + if [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then + wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz + cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz + fi + cd $php_lib/ioncube + + cp -rf $php_lib/ioncube/ioncube_loader_lin_${IC_VERSION}.so $extFile + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp not install ${LIBNAME}, Plese select other version!" + return + fi + + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/70/ioncube.sh b/plugins/php/versions/70/ioncube.sh new file mode 100755 index 000000000..bcd8729ef --- /dev/null +++ b/plugins/php/versions/70/ioncube.sh @@ -0,0 +1,96 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=ioncube +LIBV=0 +sysName=`uname` +actionType=$1 +version=$2 +IC_VERSION=${version:0:1}.${version:1:2} + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} +extFile=${extDir}/${LIBNAME}.so + +if [ "$sysName" == "Darwin" ];then + BAK='_bak' +else + BAK='' +fi + + +Install_lib() +{ + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + + if [ ! -f "$extFile" ];then + + php_lib=$sourcePath/php_lib + mkdir -p $php_lib + if [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then + wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz + cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz + fi + cd $php_lib/ioncube + + cp -rf $php_lib/ioncube/ioncube_loader_lin_${IC_VERSION}.so $extFile + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp not install ${LIBNAME}, Plese select other version!" + return + fi + + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/71/ioncube.sh b/plugins/php/versions/71/ioncube.sh new file mode 100755 index 000000000..bcd8729ef --- /dev/null +++ b/plugins/php/versions/71/ioncube.sh @@ -0,0 +1,96 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=ioncube +LIBV=0 +sysName=`uname` +actionType=$1 +version=$2 +IC_VERSION=${version:0:1}.${version:1:2} + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} +extFile=${extDir}/${LIBNAME}.so + +if [ "$sysName" == "Darwin" ];then + BAK='_bak' +else + BAK='' +fi + + +Install_lib() +{ + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + + if [ ! -f "$extFile" ];then + + php_lib=$sourcePath/php_lib + mkdir -p $php_lib + if [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then + wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz + cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz + fi + cd $php_lib/ioncube + + cp -rf $php_lib/ioncube/ioncube_loader_lin_${IC_VERSION}.so $extFile + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp not install ${LIBNAME}, Plese select other version!" + return + fi + + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/72/ioncube.sh b/plugins/php/versions/72/ioncube.sh new file mode 100755 index 000000000..bcd8729ef --- /dev/null +++ b/plugins/php/versions/72/ioncube.sh @@ -0,0 +1,96 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=ioncube +LIBV=0 +sysName=`uname` +actionType=$1 +version=$2 +IC_VERSION=${version:0:1}.${version:1:2} + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} +extFile=${extDir}/${LIBNAME}.so + +if [ "$sysName" == "Darwin" ];then + BAK='_bak' +else + BAK='' +fi + + +Install_lib() +{ + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + + if [ ! -f "$extFile" ];then + + php_lib=$sourcePath/php_lib + mkdir -p $php_lib + if [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then + wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz + cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz + fi + cd $php_lib/ioncube + + cp -rf $php_lib/ioncube/ioncube_loader_lin_${IC_VERSION}.so $extFile + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp not install ${LIBNAME}, Plese select other version!" + return + fi + + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/73/ioncube.sh b/plugins/php/versions/73/ioncube.sh new file mode 100755 index 000000000..bcd8729ef --- /dev/null +++ b/plugins/php/versions/73/ioncube.sh @@ -0,0 +1,96 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=ioncube +LIBV=0 +sysName=`uname` +actionType=$1 +version=$2 +IC_VERSION=${version:0:1}.${version:1:2} + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} +extFile=${extDir}/${LIBNAME}.so + +if [ "$sysName" == "Darwin" ];then + BAK='_bak' +else + BAK='' +fi + + +Install_lib() +{ + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + + if [ ! -f "$extFile" ];then + + php_lib=$sourcePath/php_lib + mkdir -p $php_lib + if [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then + wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz + cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz + fi + cd $php_lib/ioncube + + cp -rf $php_lib/ioncube/ioncube_loader_lin_${IC_VERSION}.so $extFile + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp not install ${LIBNAME}, Plese select other version!" + return + fi + + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/74/ioncube.sh b/plugins/php/versions/74/ioncube.sh new file mode 100644 index 000000000..3471cc62a --- /dev/null +++ b/plugins/php/versions/74/ioncube.sh @@ -0,0 +1,95 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=ioncube +LIBV=0 +sysName=`uname` +actionType=$1 +version=$2 +IC_VERSION=${version:0:1}.${version:1:2} + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} +extFile=${extDir}/${LIBNAME}.so + + BAK='_bak' +else + BAK='' +fi + + +Install_lib() +{ + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + + if [ ! -f "$extFile" ];then + + php_lib=$sourcePath/php_lib + mkdir -p $php_lib + if [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then + wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz + cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz + fi + cd $php_lib/ioncube + + cp -rf $php_lib/ioncube/ioncube_loader_lin_${IC_VERSION}.so $extFile + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp not install ${LIBNAME}, Plese select other version!" + return + fi + + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/phplib.conf b/plugins/php/versions/phplib.conf index 53e2c6d92..4fd4f3050 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -24,7 +24,16 @@ { "name": "ionCube", "versions": [ - "55" + "52", + "53", + "54", + "55", + "56", + "70", + "71", + "72", + "73", + "74" ], "type": "脚本解密", "msg": "用于解密ionCube Encoder加密脚本!", From d098bc90f5de8496d18c102204328eae1c21ce2c Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 14:53:04 +0800 Subject: [PATCH 06/51] Update ioncube.sh --- plugins/php/versions/74/ioncube.sh | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 plugins/php/versions/74/ioncube.sh diff --git a/plugins/php/versions/74/ioncube.sh b/plugins/php/versions/74/ioncube.sh old mode 100644 new mode 100755 index 3471cc62a..bcd8729ef --- a/plugins/php/versions/74/ioncube.sh +++ b/plugins/php/versions/74/ioncube.sh @@ -22,6 +22,7 @@ NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-deb extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} extFile=${extDir}/${LIBNAME}.so +if [ "$sysName" == "Darwin" ];then BAK='_bak' else BAK='' From 41d54cc4c963437ed3a7f2a994124c899c12881c Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 15:03:06 +0800 Subject: [PATCH 07/51] Update all_test.sh --- plugins/php/all_test.sh | 132 ++++++---------------------------------- 1 file changed, 17 insertions(+), 115 deletions(-) diff --git a/plugins/php/all_test.sh b/plugins/php/all_test.sh index e010a8b30..3a38e8553 100644 --- a/plugins/php/all_test.sh +++ b/plugins/php/all_test.sh @@ -3,6 +3,8 @@ export PATH=$PATH:/opt/local/bin:/opt/local/sbin:/opt/local/share/man:/usr/local DIR=$(cd "$(dirname "$0")"; pwd) +# cd /www/server/mdserver-web/plugins/php && bash all_test.sh + PHP_VER=53 echo "php${PHP_VER} -- start" cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') @@ -19,123 +21,23 @@ echo "php${PHP_VER} -- end" -PHP_VER=54 -echo "php${PHP_VER} -- start" -cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') -cd $DIR && /bin/bash install.sh install $PHP_VER -for ii in $cmd_ext -do - if [ "install.sh" == "$ii" ];then - echo '' > /tmp/t.log - else - cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER - fi -done -echo "php${PHP_VER} -- end" - - -PHP_VER=55 -echo "php${PHP_VER} -- start" -cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') -cd $DIR && /bin/bash install.sh install $PHP_VER -for ii in $cmd_ext -do - if [ "install.sh" == "$ii" ];then - echo '' > /tmp/t.log - else - cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER - fi -done -echo "php${PHP_VER} -- end" - - -PHP_VER=56 -echo "php${PHP_VER} -- start" -cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') -cd $DIR && /bin/bash install.sh install $PHP_VER -for ii in $cmd_ext -do - if [ "install.sh" == "$ii" ];then - echo '' > /tmp/t.log - else - cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER - fi -done -echo "php${PHP_VER} -- end" - - - -PHP_VER=70 -echo "php${PHP_VER} -- start" -cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') -cd $DIR && /bin/bash install.sh install $PHP_VER -for ii in $cmd_ext -do - if [ "install.sh" == "$ii" ];then - echo '' > /tmp/t.log - else - cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER - fi -done -echo "php${PHP_VER} -- end" - - -PHP_VER=71 -echo "php${PHP_VER} -- start" -cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') -cd $DIR && /bin/bash install.sh install $PHP_VER -for ii in $cmd_ext -do - if [ "install.sh" == "$ii" ];then - echo '' > /tmp/t.log - else - cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER - fi -done -echo "php${PHP_VER} -- end" - - -PHP_VER=72 -echo "php${PHP_VER} -- start" -cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') -cd $DIR && /bin/bash install.sh install $PHP_VER -for ii in $cmd_ext -do - if [ "install.sh" == "$ii" ];then - echo '' > /tmp/t.log - else - cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER - fi -done -echo "php${PHP_VER} -- end" - -PHP_VER=73 -echo "php${PHP_VER} -- start" -cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') -cd $DIR && /bin/bash install.sh install $PHP_VER -for ii in $cmd_ext -do - if [ "install.sh" == "$ii" ];then - echo '' > /tmp/t.log - else - cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER +PHP_VER_LIST=(54 55 56 71 72 73 74 80 81) +# PHP_VER_LIST=(81) +for PHP_VER in ${PHP_VER_LIST[@]}; do + echo "php${PHP_VER} -- start" + if [ -d /www/server/php/${PHP_VER} ];then + cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') + for ii in cmd_ext + do + if [ "install.sh" == "$ii" ];then + echo '' > /tmp/t.log + else + cd $DIR/versions/$PHP_VER && bash $ii install ${PHP_VER} + fi + done fi + echo "php${PHP_VER} -- end" done -echo "php${PHP_VER} -- end" -PHP_VER=74 -echo "php${PHP_VER} -- start" -cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') -cd $DIR && /bin/bash install.sh install $PHP_VER -for ii in $cmd_ext -do - if [ "install.sh" == "$ii" ];then - echo '' > /tmp/t.log - else - cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER - fi -done -echo "php${PHP_VER} -- end" - rm -rf /tmp/t.log From 4aca759b5d42cf44a5c39f8b580879117a98830b Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 16:16:55 +0800 Subject: [PATCH 08/51] up --- plugins/mysql/versions/5.5/install.sh | 2 +- plugins/mysql/versions/5.6/install.sh | 2 +- plugins/mysql/versions/5.7/install.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/mysql/versions/5.5/install.sh b/plugins/mysql/versions/5.5/install.sh index b7d0a257d..eec5fc632 100755 --- a/plugins/mysql/versions/5.5/install.sh +++ b/plugins/mysql/versions/5.5/install.sh @@ -34,7 +34,7 @@ Install_mysql() fi if [ ! -f ${mysqlDir}/mysql-5.5.62.tar.gz ];then - wget -O ${mysqlDir}/mysql-5.5.62.tar.gz https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.62.tar.gz + wget -O ${mysqlDir}/mysql-5.5.62.tar.gz --tries=3 https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.62.tar.gz fi if [ ! -d ${mysqlDir}/mysql-5.5.62 ];then diff --git a/plugins/mysql/versions/5.6/install.sh b/plugins/mysql/versions/5.6/install.sh index 4937df5aa..790360d73 100755 --- a/plugins/mysql/versions/5.6/install.sh +++ b/plugins/mysql/versions/5.6/install.sh @@ -38,7 +38,7 @@ Install_mysql() if [ ! -f ${mysqlDir}/mysql-5.6.50.tar.gz ];then - wget -O ${mysqlDir}/mysql-5.6.50.tar.gz https://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.50.tar.gz + wget -O ${mysqlDir}/mysql-5.6.50.tar.gz --tries=3 https://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.50.tar.gz fi if [ ! -d ${mysqlDir}/mysql-5.6.50 ];then diff --git a/plugins/mysql/versions/5.7/install.sh b/plugins/mysql/versions/5.7/install.sh index b95f7a311..8c374cca0 100755 --- a/plugins/mysql/versions/5.7/install.sh +++ b/plugins/mysql/versions/5.7/install.sh @@ -40,7 +40,7 @@ Install_mysql() if [ ! -f ${mysqlDir}/mysql-boost-${VERSION}.tar.gz ];then - wget -O ${mysqlDir}/mysql-boost-${VERSION}.tar.gz https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-${VERSION}.tar.gz + wget -O ${mysqlDir}/mysql-boost-${VERSION}.tar.gz --tries=3 https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-${VERSION}.tar.gz fi #检测文件是否损坏. @@ -52,7 +52,7 @@ Install_mysql() else # 重新下载 rm -rf ${mysqlDir}/mysql-${VERSION} - wget -O ${mysqlDir}/mysql-boost-${VERSION}.tar.gz https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-${VERSION}.tar.gz + wget -O ${mysqlDir}/mysql-boost-${VERSION}.tar.gz --tries=3 https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-${VERSION}.tar.gz fi fi From 5bc3ee2b7cdf67a2c4a1fa690d06da779a273294 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 19:19:55 +0800 Subject: [PATCH 09/51] Update files_api.py --- class/core/files_api.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/class/core/files_api.py b/class/core/files_api.py index 8f7974d8f..6ffd23be0 100755 --- a/class/core/files_api.py +++ b/class/core/files_api.py @@ -210,7 +210,6 @@ class files_api: try: name = mw.M('tasks').where('id=?', (mid,)).getField('name') status = mw.M('tasks').where('id=?', (mid,)).getField('status') - # print(name, status) mw.M('tasks').delete(mid) if status == '-1': task_pid = mw.execShell( @@ -220,8 +219,7 @@ class files_api: for i in range(len(task_list)): self.removeTaskRecursion(task_list[i]) - isTask = mw.getRootDir() + '/tmp/panelTask.pl' - mw.writeFile(isTask, 'True') + mw.triggerTask() system_api.system_api().restartTask() except: system_api.system_api().restartTask() From c9a068241bc0f46b74150ca2b7b5710c0d040378 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 19:31:17 +0800 Subject: [PATCH 10/51] Update all_test.sh --- plugins/php/all_test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/php/all_test.sh b/plugins/php/all_test.sh index 3a38e8553..04feb077f 100644 --- a/plugins/php/all_test.sh +++ b/plugins/php/all_test.sh @@ -20,19 +20,19 @@ done echo "php${PHP_VER} -- end" - PHP_VER_LIST=(54 55 56 71 72 73 74 80 81) # PHP_VER_LIST=(81) for PHP_VER in ${PHP_VER_LIST[@]}; do echo "php${PHP_VER} -- start" if [ -d /www/server/php/${PHP_VER} ];then cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') - for ii in cmd_ext + for ii in $cmd_ext do + echo "${ii}" if [ "install.sh" == "$ii" ];then echo '' > /tmp/t.log else - cd $DIR/versions/$PHP_VER && bash $ii install ${PHP_VER} + cd $DIR/versions/$PHP_VER/ && bash $ii install ${PHP_VER} fi done fi From bd14b88c00d85a2a34aed2766bbbd023e816ea9f Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 19:34:57 +0800 Subject: [PATCH 11/51] Create exif.sh --- plugins/php/versions/53/exif.sh | 105 ++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100755 plugins/php/versions/53/exif.sh diff --git a/plugins/php/versions/53/exif.sh b/plugins/php/versions/53/exif.sh new file mode 100755 index 000000000..f52c194c5 --- /dev/null +++ b/plugins/php/versions/53/exif.sh @@ -0,0 +1,105 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +appPath=$(dirname "$curPath") + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +actionType=$1 +version=$2 + +LIBNAME=exif +LIBV=0 + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so + +sysName=`uname` +if [ "$sysName" == "Darwin" ];then + BAK='_bak' +else + BAK='' +fi + +Install_lib() +{ + + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + + if [ ! -d $sourcePath/php${version}/ext ];then + cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version} + fi + + cd $sourcePath/php${version}/ext/${LIBNAME} + + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config + + FIND_C99=`cat Makefile|grep c99` + if [ "$FIND_C99" == "" ];then + sed -i $BAK 's/CFLAGS \=/CFLAGS \= -std=c99/g' Makefile + fi + + + make && make install && make clean + + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini + echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file From 90dfcf7d7a0c329be135fc076bd04dfd8721c22b Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 19:43:17 +0800 Subject: [PATCH 12/51] Update index.py --- plugins/php/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/php/index.py b/plugins/php/index.py index 6db5faba6..bd556eaee 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -675,7 +675,7 @@ def installLib(version): name + '.sh' + ' install ' + version rettime = time.strftime('%Y-%m-%d %H:%M:%S') - insert_info = (None, '安装[' + name + '-' + version + ']', + insert_info = (None, '安装[' + name + '-PHP' + version + ']', 'execshell', '0', rettime, execstr) mw.M('tasks').add('id,name,type,status,addtime,execstr', insert_info) From 1630095d78da8a52400530e36cd1bbc3ca677de3 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 20:45:48 +0800 Subject: [PATCH 13/51] up --- plugins/php/lib/libmemcached.sh | 26 ++++++++++++++++++++++++++ scripts/lib.sh | 2 ++ 2 files changed, 28 insertions(+) create mode 100644 plugins/php/lib/libmemcached.sh diff --git a/plugins/php/lib/libmemcached.sh b/plugins/php/lib/libmemcached.sh new file mode 100644 index 000000000..680aef46d --- /dev/null +++ b/plugins/php/lib/libmemcached.sh @@ -0,0 +1,26 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") + +# echo $rootPath + +SERVER_ROOT=$rootPath/lib +SOURCE_ROOT=$rootPath/source/lib + +#----------------------------- libmemcached start -------------------------# +if [ ! -d ${SERVER_ROOT}/libmemcached ];then + cd ${SOURCE_ROOT} + if [ ! -f ${SOURCE_ROOT}/libmemcached-1.0.4.tar.gz ];then + wget -O libmemcached-1.0.4.tar.gz https://launchpad.net/libmemcached/1.0/1.0.4/+download/libmemcached-1.0.4.tar.gz -T 20 + fi + tar -zxf libmemcached-1.0.4.tar.gz + cd libmemcached-1.0.4 + ./configure --prefix=${SERVER_ROOT}/libmemcached -with-memcached && make && make install +fi +#----------------------------- libmemcached end -------------------------# \ No newline at end of file diff --git a/scripts/lib.sh b/scripts/lib.sh index 2ed03a3ab..3c49e986f 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -277,11 +277,13 @@ elif [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "debian" ]; then apt install -y cmake automake make apt install -y webp scons + apt install -y libwebp-dev apt install -y lzma lzma-dev apt install -y libunwind-dev apt install -y libpcre3 libpcre3-dev apt install -y openssl + apt install -y imagemagick apt install -y libxml2 libxml2-dev libbz2-dev libmcrypt-dev libpspell-dev librecode-dev apt install -y libgmp-dev libgmp3-dev libreadline-dev libxpm-dev From 2a9ecd9e4cabd33f8a8cb149e7270b7fdf12aebf Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 20:56:00 +0800 Subject: [PATCH 14/51] Update all_test.sh --- plugins/php/all_test.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/php/all_test.sh b/plugins/php/all_test.sh index 04feb077f..fc51ec3d7 100644 --- a/plugins/php/all_test.sh +++ b/plugins/php/all_test.sh @@ -5,6 +5,8 @@ DIR=$(cd "$(dirname "$0")"; pwd) # cd /www/server/mdserver-web/plugins/php && bash all_test.sh +# cd /www/server/mdserver-web/plugins/php/versions/71/ && bash openssl.sh install 71 + PHP_VER=53 echo "php${PHP_VER} -- start" cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') @@ -20,7 +22,7 @@ done echo "php${PHP_VER} -- end" -PHP_VER_LIST=(54 55 56 71 72 73 74 80 81) +PHP_VER_LIST=(54 55 56 70 71 72 73 74 80 81) # PHP_VER_LIST=(81) for PHP_VER in ${PHP_VER_LIST[@]}; do echo "php${PHP_VER} -- start" From 1ce9ec23d063b70d473402774b54764d1b5a0581 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 21:14:14 +0800 Subject: [PATCH 15/51] =?UTF-8?q?yaf=E7=89=88=E6=9C=AC=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/php/lib/libmemcached.sh | 2 ++ plugins/php/versions/70/yaf.sh | 2 +- plugins/php/versions/71/yaf.sh | 2 +- plugins/php/versions/72/yaf.sh | 2 +- plugins/php/versions/73/yaf.sh | 2 +- plugins/php/versions/74/yaf.sh | 2 +- plugins/php/versions/80/yaf.sh | 2 +- plugins/php/versions/81/yaf.sh | 2 +- 8 files changed, 9 insertions(+), 7 deletions(-) diff --git a/plugins/php/lib/libmemcached.sh b/plugins/php/lib/libmemcached.sh index 680aef46d..76297d853 100644 --- a/plugins/php/lib/libmemcached.sh +++ b/plugins/php/lib/libmemcached.sh @@ -10,6 +10,8 @@ rootPath=$(dirname "$rootPath") # echo $rootPath +# cd /www/server/mdserver-web/plugins/php/lib && /bin/bash libmemcached.sh + SERVER_ROOT=$rootPath/lib SOURCE_ROOT=$rootPath/source/lib diff --git a/plugins/php/versions/70/yaf.sh b/plugins/php/versions/70/yaf.sh index c82c102a0..0b3a89485 100755 --- a/plugins/php/versions/70/yaf.sh +++ b/plugins/php/versions/70/yaf.sh @@ -18,7 +18,7 @@ version=$2 sysName=`uname` LIBNAME=yaf -LIBV=3.2.5 +LIBV=3.3.5 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so diff --git a/plugins/php/versions/71/yaf.sh b/plugins/php/versions/71/yaf.sh index f5d2c9a88..1e224d8f3 100755 --- a/plugins/php/versions/71/yaf.sh +++ b/plugins/php/versions/71/yaf.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yaf -LIBV=3.2.5 +LIBV=3.3.5 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so diff --git a/plugins/php/versions/72/yaf.sh b/plugins/php/versions/72/yaf.sh index e10fcef0c..e14b8a79d 100755 --- a/plugins/php/versions/72/yaf.sh +++ b/plugins/php/versions/72/yaf.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yaf -LIBV=3.2.5 +LIBV=3.3.5 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` diff --git a/plugins/php/versions/73/yaf.sh b/plugins/php/versions/73/yaf.sh index 071ecaa34..4c7742f87 100755 --- a/plugins/php/versions/73/yaf.sh +++ b/plugins/php/versions/73/yaf.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yaf -LIBV=3.2.5 +LIBV=3.3.5 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so diff --git a/plugins/php/versions/74/yaf.sh b/plugins/php/versions/74/yaf.sh index 071ecaa34..4c7742f87 100755 --- a/plugins/php/versions/74/yaf.sh +++ b/plugins/php/versions/74/yaf.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yaf -LIBV=3.2.5 +LIBV=3.3.5 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so diff --git a/plugins/php/versions/80/yaf.sh b/plugins/php/versions/80/yaf.sh index a74c212ac..f420ee14c 100755 --- a/plugins/php/versions/80/yaf.sh +++ b/plugins/php/versions/80/yaf.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yaf -LIBV=3.3.0 +LIBV=3.3.5 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` diff --git a/plugins/php/versions/81/yaf.sh b/plugins/php/versions/81/yaf.sh index 0eebee9fd..f420ee14c 100755 --- a/plugins/php/versions/81/yaf.sh +++ b/plugins/php/versions/81/yaf.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yaf -LIBV=3.2.5 +LIBV=3.3.5 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` From e8926d3bf0de38bc2a27878765f24f493f12f12c Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 22:15:16 +0800 Subject: [PATCH 16/51] =?UTF-8?q?swoole=E6=9B=B4=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/php/versions/72/swoole.sh | 2 +- plugins/php/versions/73/swoole.sh | 2 +- plugins/php/versions/74/swoole.sh | 2 +- plugins/php/versions/80/swoole.sh | 2 +- plugins/php/versions/81/swoole.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/php/versions/72/swoole.sh b/plugins/php/versions/72/swoole.sh index 333707bbd..7d11372da 100755 --- a/plugins/php/versions/72/swoole.sh +++ b/plugins/php/versions/72/swoole.sh @@ -16,7 +16,7 @@ version=$2 LIBNAME=swoole -LIBV=4.5.2 +LIBV=4.8.10 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so diff --git a/plugins/php/versions/73/swoole.sh b/plugins/php/versions/73/swoole.sh index 5db5d34b2..46a981273 100755 --- a/plugins/php/versions/73/swoole.sh +++ b/plugins/php/versions/73/swoole.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=swoole -LIBV=4.5.2 +LIBV=4.8.10 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so diff --git a/plugins/php/versions/74/swoole.sh b/plugins/php/versions/74/swoole.sh index 1ca2c0d7f..8d80d4d5f 100755 --- a/plugins/php/versions/74/swoole.sh +++ b/plugins/php/versions/74/swoole.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=swoole -LIBV=4.5.2 +LIBV=4.8.10 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` diff --git a/plugins/php/versions/80/swoole.sh b/plugins/php/versions/80/swoole.sh index f599d070e..c3711d6ad 100755 --- a/plugins/php/versions/80/swoole.sh +++ b/plugins/php/versions/80/swoole.sh @@ -16,7 +16,7 @@ version=$2 LIBNAME=swoole -LIBV=4.6.3 +LIBV=4.8.10 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so diff --git a/plugins/php/versions/81/swoole.sh b/plugins/php/versions/81/swoole.sh index f599d070e..c3711d6ad 100755 --- a/plugins/php/versions/81/swoole.sh +++ b/plugins/php/versions/81/swoole.sh @@ -16,7 +16,7 @@ version=$2 LIBNAME=swoole -LIBV=4.6.3 +LIBV=4.8.10 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so From b167bae1980c85de208058ee9b830d2bd8186543 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 22:28:29 +0800 Subject: [PATCH 17/51] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E7=AD=89=E5=BE=85=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cli.sh | 9 +++++++-- scripts/install/alma.sh | 20 +++++++++++++++++--- scripts/install/centos.sh | 19 ++++++++++++++++--- scripts/install/debian.sh | 20 +++++++++++++++++--- scripts/install/fedora.sh | 18 ++++++++++++++---- scripts/install/rocky.sh | 18 ++++++++++++++---- scripts/install/ubuntu.sh | 19 ++++++++++++++++--- 7 files changed, 101 insertions(+), 22 deletions(-) diff --git a/cli.sh b/cli.sh index abc5d49fc..f38e77abb 100755 --- a/cli.sh +++ b/cli.sh @@ -18,7 +18,6 @@ mw_start(){ mw_start_debug(){ - python3 task.py >> $DIR/logs/task.log 2>&1 & gunicorn -b :7200 -k gevent -w 1 app:app } @@ -36,7 +35,13 @@ mw_stop() do kill -9 $i done - ps -ef|grep task.py |grep -v grep|awk '{print $2}'|xargs kill -9 + + pids=`ps -ef|grep task.py | grep -v grep |awk '{print $2}'` + arr=($pids) + for p in ${arr[@]} + do + kill -9 $p + done } case "$1" in diff --git a/scripts/install/alma.sh b/scripts/install/alma.sh index d7ddc4136..1e70f2e15 100755 --- a/scripts/install/alma.sh +++ b/scripts/install/alma.sh @@ -86,10 +86,24 @@ chmod 755 /www/server/mdserver-web/data cd /www/server/mdserver-web && ./cli.sh start -sleep 5 +isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'` +n=0 +while [[ ! -f /etc/init.d/mw ]]; +do + echo -e ".\c" + sleep 1 + let n+=1 + if [ $n -gt 20 ];then + echo -e "start mw fail" + exit 1 + fi +done -cd /www/server/mdserver-web && ./cli.sh stop -cd /www/server/mdserver-web && ./scripts/init.d/mw default +cd /www/server/mdserver-web && /etc/init.d/mw stop cd /www/server/mdserver-web && /etc/init.d/mw start +cd /www/server/mdserver-web && /etc/init.d/mw default + + + diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index e2b548a1f..ffc3aa855 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -95,10 +95,23 @@ chmod 755 /www/server/mdserver-web/data cd /www/server/mdserver-web && ./cli.sh start -sleep 5 +isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'` +n=0 +while [[ ! -f /etc/init.d/mw ]]; +do + echo -e ".\c" + sleep 1 + let n+=1 + if [ $n -gt 20 ];then + echo -e "start mw fail" + exit 1 + fi +done -cd /www/server/mdserver-web && ./cli.sh stop -cd /www/server/mdserver-web && ./scripts/init.d/mw default +cd /www/server/mdserver-web && /etc/init.d/mw stop cd /www/server/mdserver-web && /etc/init.d/mw start +cd /www/server/mdserver-web && /etc/init.d/mw default + + diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index 8d36831f4..ea3761dd6 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -104,11 +104,25 @@ chmod 755 /www/server/mdserver-web/data cd /www/server/mdserver-web && ./cli.sh start -sleep 5 +isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'` +n=0 +while [[ ! -f /etc/init.d/mw ]]; +do + echo -e ".\c" + sleep 1 + let n+=1 + if [ $n -gt 20 ];then + echo -e "start mw fail" + exit 1 + fi +done -cd /www/server/mdserver-web && ./cli.sh stop -cd /www/server/mdserver-web && ./scripts/init.d/mw default +cd /www/server/mdserver-web && /etc/init.d/mw stop cd /www/server/mdserver-web && /etc/init.d/mw start +cd /www/server/mdserver-web && /etc/init.d/mw default + + + diff --git a/scripts/install/fedora.sh b/scripts/install/fedora.sh index feec8833d..fbba069c6 100644 --- a/scripts/install/fedora.sh +++ b/scripts/install/fedora.sh @@ -85,12 +85,22 @@ cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data - cd /www/server/mdserver-web && ./cli.sh start -sleep 5 +isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'` +n=0 +while [[ ! -f /etc/init.d/mw ]]; +do + echo -e ".\c" + sleep 1 + let n+=1 + if [ $n -gt 20 ];then + echo -e "start mw fail" + exit 1 + fi +done -cd /www/server/mdserver-web && ./cli.sh stop -cd /www/server/mdserver-web && ./scripts/init.d/mw default +cd /www/server/mdserver-web && /etc/init.d/mw stop cd /www/server/mdserver-web && /etc/init.d/mw start +cd /www/server/mdserver-web && /etc/init.d/mw default diff --git a/scripts/install/rocky.sh b/scripts/install/rocky.sh index 7d1b6c925..c4cbcf1b5 100644 --- a/scripts/install/rocky.sh +++ b/scripts/install/rocky.sh @@ -84,11 +84,21 @@ chmod 755 /www/server/mdserver-web/data cd /www/server/mdserver-web && ./cli.sh start -sleep 5 +isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'` +n=0 +while [[ ! -f /etc/init.d/mw ]]; +do + echo -e ".\c" + sleep 1 + let n+=1 + if [ $n -gt 20 ];then + echo -e "start mw fail" + exit 1 + fi +done -cd /www/server/mdserver-web && ./cli.sh stop -cd /www/server/mdserver-web && ./scripts/init.d/mw default +cd /www/server/mdserver-web && /etc/init.d/mw stop cd /www/server/mdserver-web && /etc/init.d/mw start - +cd /www/server/mdserver-web && /etc/init.d/mw default diff --git a/scripts/install/ubuntu.sh b/scripts/install/ubuntu.sh index 152c0bb4f..0e143a4cf 100644 --- a/scripts/install/ubuntu.sh +++ b/scripts/install/ubuntu.sh @@ -66,9 +66,22 @@ chmod 755 /www/server/mdserver-web/data cd /www/server/mdserver-web && ./cli.sh start -sleep 5 +isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'` +n=0 +while [[ ! -f /etc/init.d/mw ]]; +do + echo -e ".\c" + sleep 1 + let n+=1 + if [ $n -gt 20 ];then + echo -e "start mw fail" + exit 1 + fi +done -cd /www/server/mdserver-web && ./cli.sh stop -cd /www/server/mdserver-web && ./scripts/init.d/mw default +cd /www/server/mdserver-web && /etc/init.d/mw stop cd /www/server/mdserver-web && /etc/init.d/mw start +cd /www/server/mdserver-web && /etc/init.d/mw default + + From f397db2c6ff143a904a7f347fbaa17d53d43137b Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 22:34:34 +0800 Subject: [PATCH 18/51] Update centos.sh --- scripts/install/centos.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index ffc3aa855..de18732a0 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -114,4 +114,3 @@ cd /www/server/mdserver-web && /etc/init.d/mw default - From fb14df91324a85c942675e3b20b5a59587dcb403 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 23:20:41 +0800 Subject: [PATCH 19/51] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dphp=E6=9F=A5=E7=9C=8Bph?= =?UTF-8?q?pinfo=E7=9A=84=E5=8A=9F=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/php/conf/phpinfo.conf | 2 +- plugins/php/index.py | 26 +++++++++++++++----------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/plugins/php/conf/phpinfo.conf b/plugins/php/conf/phpinfo.conf index 223441d3f..577a70ec0 100644 --- a/plugins/php/conf/phpinfo.conf +++ b/plugins/php/conf/phpinfo.conf @@ -1,4 +1,4 @@ location /{$PHP_VERSION} { root {$ROOT_PATH}/phpinfo; - include enable-php-{$PHP_VERSION}.conf; + include {$SERVER_PATH}/web_conf/php/conf/enable-php-{$PHP_VERSION}.conf; } \ No newline at end of file diff --git a/plugins/php/index.py b/plugins/php/index.py index bd556eaee..0d73308d5 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -605,30 +605,34 @@ def setDisableFunc(version): def checkPhpinfoFile(v): - if mw.isInstalledWeb(): - sdir = mw.getServerDir() - dfile = sdir + '/openresty/nginx/conf/php_status/phpinfo_' + v + '.conf' - if not os.path.exists(dfile): - tpl = getPluginDir() + '/conf/phpinfo.conf' - content = mw.readFile(tpl) - content = contentReplace(content, v) - mw.writeFile(dfile, content) - mw.restartWeb() + sdir = mw.getServerDir() + dfile = sdir + '/web_conf/php/status/phpinfo_' + v + '.conf' + if not os.path.exists(dfile): + tpl = getPluginDir() + '/conf/phpinfo.conf' + content = mw.readFile(tpl) + content = contentReplace(content, v) + mw.writeFile(dfile, content) + mw.restartWeb() def getPhpinfo(v): checkPhpinfoFile(v) sPath = mw.getRootDir() + '/phpinfo/' + v - mw.execShell("rm -rf " + mw.getRootDir() + '/phpinfo') + + # mw.execShell("rm -rf " + mw.getRootDir() + '/phpinfo') mw.execShell("mkdir -p " + sPath) mw.writeFile(sPath + '/phpinfo.php', '') url = 'http://127.0.0.1/' + v + '/phpinfo.php' phpinfo = mw.httpGet(url) - os.system("rm -rf " + mw.getRootDir() + '/phpinfo') + # os.system("rm -rf " + mw.getRootDir() + '/phpinfo') + + print(mw.getRootDir() + '/phpinfo', sPath, url) return phpinfo def get_php_info(args): + if not mw.isInstalledWeb(): + return "openresty is not running!!!" return getPhpinfo(args['version']) From a7e0f282166279a9f15a92ec6b3d49d47245b323 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 30 Jun 2022 23:21:58 +0800 Subject: [PATCH 20/51] Update index.py --- plugins/php/index.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/php/index.py b/plugins/php/index.py index 0d73308d5..069230fdd 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -619,14 +619,12 @@ def getPhpinfo(v): checkPhpinfoFile(v) sPath = mw.getRootDir() + '/phpinfo/' + v - # mw.execShell("rm -rf " + mw.getRootDir() + '/phpinfo') + mw.execShell("rm -rf " + mw.getRootDir() + '/phpinfo') mw.execShell("mkdir -p " + sPath) mw.writeFile(sPath + '/phpinfo.php', '') url = 'http://127.0.0.1/' + v + '/phpinfo.php' phpinfo = mw.httpGet(url) - # os.system("rm -rf " + mw.getRootDir() + '/phpinfo') - - print(mw.getRootDir() + '/phpinfo', sPath, url) + os.system("rm -rf " + mw.getRootDir() + '/phpinfo') return phpinfo From d1e97cc8e4512752ba99bc8272a5f38fe3092615 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 00:39:43 +0800 Subject: [PATCH 21/51] Update zendguardloader.sh --- plugins/php/versions/56/zendguardloader.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/php/versions/56/zendguardloader.sh b/plugins/php/versions/56/zendguardloader.sh index c746acd9f..976101749 100755 --- a/plugins/php/versions/56/zendguardloader.sh +++ b/plugins/php/versions/56/zendguardloader.sh @@ -31,7 +31,8 @@ Install_lib() fi NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` - extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so + extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} + extFile=${extDir}/${LIBNAME}.so if [ ! -f "$extFile" ];then @@ -45,8 +46,8 @@ Install_lib() fi cd $php_lib && tar xvf zend-loader-php5.6.tar.gz - cd zend-loader-php5.6* - cp ZendGuardLoader.so $serverPath/php/$version/lib/php/extensions/no-debug-non-zts-20131226/ + cd zend-loader-php5.6-* + cp ZendGuardLoader.so ${extDir} fi From 5c25ddc3fd9d7eacaee08148b8d5f3b9e49db707 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 01:24:52 +0800 Subject: [PATCH 22/51] up --- plugins/php/all_test.sh | 1 + plugins/php/versions/70/imagemagick.sh | 2 +- plugins/php/versions/70/yac.sh | 2 +- plugins/php/versions/71/imagemagick.sh | 2 +- plugins/php/versions/71/yac.sh | 2 +- plugins/php/versions/72/imagemagick.sh | 2 +- plugins/php/versions/72/yac.sh | 2 +- plugins/php/versions/73/imagemagick.sh | 2 +- plugins/php/versions/73/yac.sh | 2 +- plugins/php/versions/74/imagemagick.sh | 2 +- plugins/php/versions/74/yac.sh | 2 +- plugins/php/versions/80/imagemagick.sh | 2 +- plugins/php/versions/80/yac.sh | 2 +- plugins/php/versions/81/imagemagick.sh | 2 +- plugins/php/versions/81/memcached.sh | 2 +- plugins/php/versions/81/yac.sh | 2 +- scripts/lib.sh | 4 +++- 17 files changed, 19 insertions(+), 16 deletions(-) diff --git a/plugins/php/all_test.sh b/plugins/php/all_test.sh index fc51ec3d7..b1320db99 100644 --- a/plugins/php/all_test.sh +++ b/plugins/php/all_test.sh @@ -6,6 +6,7 @@ DIR=$(cd "$(dirname "$0")"; pwd) # cd /www/server/mdserver-web/plugins/php && bash all_test.sh # cd /www/server/mdserver-web/plugins/php/versions/71/ && bash openssl.sh install 71 +# cd /www/server/mdserver-web/plugins/php/versions/81/ && bash imagemagick.sh install 81 PHP_VER=53 echo "php${PHP_VER} -- start" diff --git a/plugins/php/versions/70/imagemagick.sh b/plugins/php/versions/70/imagemagick.sh index fde729fad..7490287e6 100755 --- a/plugins/php/versions/70/imagemagick.sh +++ b/plugins/php/versions/70/imagemagick.sh @@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=imagick -LIBV=3.6.0 +LIBV=3.7.0 sysName=`uname` actionType=$1 version=$2 diff --git a/plugins/php/versions/70/yac.sh b/plugins/php/versions/70/yac.sh index 46292d91d..2687801c0 100755 --- a/plugins/php/versions/70/yac.sh +++ b/plugins/php/versions/70/yac.sh @@ -17,7 +17,7 @@ version=$2 sysName=`uname` LIBNAME=yac -LIBV=2.3.0 +LIBV=2.3.1 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so diff --git a/plugins/php/versions/71/imagemagick.sh b/plugins/php/versions/71/imagemagick.sh index fde729fad..7490287e6 100755 --- a/plugins/php/versions/71/imagemagick.sh +++ b/plugins/php/versions/71/imagemagick.sh @@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=imagick -LIBV=3.6.0 +LIBV=3.7.0 sysName=`uname` actionType=$1 version=$2 diff --git a/plugins/php/versions/71/yac.sh b/plugins/php/versions/71/yac.sh index 9107616af..b34f952b8 100755 --- a/plugins/php/versions/71/yac.sh +++ b/plugins/php/versions/71/yac.sh @@ -16,7 +16,7 @@ actionType=$1 version=$2 LIBNAME=yac -LIBV=2.3.0 +LIBV=2.3.1 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so diff --git a/plugins/php/versions/72/imagemagick.sh b/plugins/php/versions/72/imagemagick.sh index fde729fad..7490287e6 100755 --- a/plugins/php/versions/72/imagemagick.sh +++ b/plugins/php/versions/72/imagemagick.sh @@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=imagick -LIBV=3.6.0 +LIBV=3.7.0 sysName=`uname` actionType=$1 version=$2 diff --git a/plugins/php/versions/72/yac.sh b/plugins/php/versions/72/yac.sh index b97b6c742..995a4f9a1 100755 --- a/plugins/php/versions/72/yac.sh +++ b/plugins/php/versions/72/yac.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yac -LIBV=2.3.0 +LIBV=2.3.1 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so diff --git a/plugins/php/versions/73/imagemagick.sh b/plugins/php/versions/73/imagemagick.sh index fde729fad..7490287e6 100755 --- a/plugins/php/versions/73/imagemagick.sh +++ b/plugins/php/versions/73/imagemagick.sh @@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=imagick -LIBV=3.6.0 +LIBV=3.7.0 sysName=`uname` actionType=$1 version=$2 diff --git a/plugins/php/versions/73/yac.sh b/plugins/php/versions/73/yac.sh index b97b6c742..995a4f9a1 100755 --- a/plugins/php/versions/73/yac.sh +++ b/plugins/php/versions/73/yac.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yac -LIBV=2.3.0 +LIBV=2.3.1 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so diff --git a/plugins/php/versions/74/imagemagick.sh b/plugins/php/versions/74/imagemagick.sh index fde729fad..7490287e6 100755 --- a/plugins/php/versions/74/imagemagick.sh +++ b/plugins/php/versions/74/imagemagick.sh @@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=imagick -LIBV=3.6.0 +LIBV=3.7.0 sysName=`uname` actionType=$1 version=$2 diff --git a/plugins/php/versions/74/yac.sh b/plugins/php/versions/74/yac.sh index b97b6c742..995a4f9a1 100755 --- a/plugins/php/versions/74/yac.sh +++ b/plugins/php/versions/74/yac.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yac -LIBV=2.3.0 +LIBV=2.3.1 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so diff --git a/plugins/php/versions/80/imagemagick.sh b/plugins/php/versions/80/imagemagick.sh index fde729fad..7490287e6 100755 --- a/plugins/php/versions/80/imagemagick.sh +++ b/plugins/php/versions/80/imagemagick.sh @@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=imagick -LIBV=3.6.0 +LIBV=3.7.0 sysName=`uname` actionType=$1 version=$2 diff --git a/plugins/php/versions/80/yac.sh b/plugins/php/versions/80/yac.sh index b97b6c742..995a4f9a1 100755 --- a/plugins/php/versions/80/yac.sh +++ b/plugins/php/versions/80/yac.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yac -LIBV=2.3.0 +LIBV=2.3.1 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so diff --git a/plugins/php/versions/81/imagemagick.sh b/plugins/php/versions/81/imagemagick.sh index fde729fad..7490287e6 100755 --- a/plugins/php/versions/81/imagemagick.sh +++ b/plugins/php/versions/81/imagemagick.sh @@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=imagick -LIBV=3.6.0 +LIBV=3.7.0 sysName=`uname` actionType=$1 version=$2 diff --git a/plugins/php/versions/81/memcached.sh b/plugins/php/versions/81/memcached.sh index 63bfc33ac..80a9d8426 100755 --- a/plugins/php/versions/81/memcached.sh +++ b/plugins/php/versions/81/memcached.sh @@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=memcached -LIBV=3.1.5 +LIBV=3.2.0 sysName=`uname` actionType=$1 version=$2 diff --git a/plugins/php/versions/81/yac.sh b/plugins/php/versions/81/yac.sh index b97b6c742..995a4f9a1 100755 --- a/plugins/php/versions/81/yac.sh +++ b/plugins/php/versions/81/yac.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yac -LIBV=2.3.0 +LIBV=2.3.1 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so diff --git a/scripts/lib.sh b/scripts/lib.sh index 3c49e986f..7a550eb10 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -283,7 +283,9 @@ elif [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "debian" ]; then apt install -y libpcre3 libpcre3-dev apt install -y openssl - apt install -y imagemagick + apt install -y libmemcached-dev + #apt install -y imagemagick libmagickwand-dev + # apt install -y php-imagick php-imagick-all-dev apt install -y libxml2 libxml2-dev libbz2-dev libmcrypt-dev libpspell-dev librecode-dev apt install -y libgmp-dev libgmp3-dev libreadline-dev libxpm-dev From 740035e8aa6a6cf410b30fb997e4b830efefb65a Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 01:30:12 +0800 Subject: [PATCH 23/51] Update lib.sh --- scripts/lib.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/lib.sh b/scripts/lib.sh index 7a550eb10..6a4ef9140 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -284,8 +284,7 @@ elif [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "debian" ]; then apt install -y libpcre3 libpcre3-dev apt install -y openssl apt install -y libmemcached-dev - #apt install -y imagemagick libmagickwand-dev - # apt install -y php-imagick php-imagick-all-dev + apt install -y imagemagick libmagickwand-dev apt install -y libxml2 libxml2-dev libbz2-dev libmcrypt-dev libpspell-dev librecode-dev apt install -y libgmp-dev libgmp3-dev libreadline-dev libxpm-dev From afda85b23dbcb79467a311c98f00131c2a19b2ef Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 01:32:04 +0800 Subject: [PATCH 24/51] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 706e50d8e..193e8ef94 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,7 +7,7 @@ flask==2.0.3 flask-session==0.3.2 flask-helper==0.19 cache==1.0.3 -gevent==21.1.2 +gevent==21.12.0 gevent-websocket==0.10.1 psutil==5.9.1 chardet==3.0.4 From e03817853db5a85ec09c757f1b052fc9d16f03a2 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 01:33:05 +0800 Subject: [PATCH 25/51] Update lib.sh --- scripts/lib.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/lib.sh b/scripts/lib.sh index 6a4ef9140..f4ee7c559 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -351,7 +351,6 @@ pip install --upgrade pip pip3 install --upgrade setuptools cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt -pip3 install gunicorn==20.1.0 pip3 install gevent-websocket==0.10.1 pip3 install requests==2.20.0 pip3 install flask-caching==1.10.1 @@ -376,7 +375,6 @@ pip install --upgrade pip pip3 install --upgrade setuptools pip3 install -r /www/server/mdserver-web/requirements.txt -pip3 install gunicorn==20.1.0 pip3 install gevent-websocket==0.10.1 pip3 install requests==2.20.0 pip3 install flask-caching==1.10.1 From 7daeaae995348becc4643a9d3bfe74c35cf4b7ef Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 01:40:02 +0800 Subject: [PATCH 26/51] up --- scripts/install/ubuntu.sh | 19 +++++++++++++++++++ scripts/lib.sh | 12 ++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/scripts/install/ubuntu.sh b/scripts/install/ubuntu.sh index 0e143a4cf..8defa90b2 100644 --- a/scripts/install/ubuntu.sh +++ b/scripts/install/ubuntu.sh @@ -64,6 +64,25 @@ cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data +VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` + + +if [ "${VERSION_ID}" == "22.04" ];then + pip3 install -U --force-reinstall --no-binary :all: gevent +fi + +if [ ! -f /www/server/mdserver-web/bin/activate ];then + cd /www/server/mdserver-web && python3 -m venv . + cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate +else + cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate +fi + +if [ "${VERSION_ID}" == "22.04" ];then + pip3 install -U --force-reinstall --no-binary :all: gevent +fi + + cd /www/server/mdserver-web && ./cli.sh start isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'` diff --git a/scripts/lib.sh b/scripts/lib.sh index f4ee7c559..32a89a3ba 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -360,9 +360,9 @@ pip3 install psutil pip3 install flask-socketio==5.2.0 pip3 install mysqlclient -if [ "${OSNAME}" == "ubuntu" ] && [ "${VERSION_ID}" == "22.04" ];then - pip3 install -U --force-reinstall --no-binary :all: gevent -fi +# if [ "${OSNAME}" == "ubuntu" ] && [ "${VERSION_ID}" == "22.04" ];then +# pip3 install -U --force-reinstall --no-binary :all: gevent +# fi if [ ! -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && python3 -m venv . @@ -384,9 +384,9 @@ pip3 install psutil pip3 install flask-socketio==5.2.0 pip3 install mysqlclient -if [ "${OSNAME}" == "ubuntu" ] && [ "${VERSION_ID}" == "22.04" ];then - pip3 install -U --force-reinstall --no-binary :all: gevent -fi +# if [ "${OSNAME}" == "ubuntu" ] && [ "${VERSION_ID}" == "22.04" ];then +# pip3 install -U --force-reinstall --no-binary :all: gevent +# fi ##### common start ##### From e2e5dc0420a1bc208316e220541d4dc386ab5eec Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 01:46:58 +0800 Subject: [PATCH 27/51] Update xhprof.sh --- plugins/php/versions/70/xhprof.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/php/versions/70/xhprof.sh b/plugins/php/versions/70/xhprof.sh index 759081253..78654123f 100755 --- a/plugins/php/versions/70/xhprof.sh +++ b/plugins/php/versions/70/xhprof.sh @@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=xhprof -LIBV=2.3.5 +LIBV=2.1.2 sysName=`uname` actionType=$1 version=$2 From 6d2196222d09b8dca12a429de185f791726dc23a Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 01:49:37 +0800 Subject: [PATCH 28/51] Update yaf.sh --- plugins/php/versions/70/yaf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/php/versions/70/yaf.sh b/plugins/php/versions/70/yaf.sh index 0b3a89485..94543b9cc 100755 --- a/plugins/php/versions/70/yaf.sh +++ b/plugins/php/versions/70/yaf.sh @@ -18,7 +18,7 @@ version=$2 sysName=`uname` LIBNAME=yaf -LIBV=3.3.5 +LIBV=3.2.2 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so From 1c3176e905beb25d998f4bf761568381708b12b2 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 01:51:35 +0800 Subject: [PATCH 29/51] Update lib.sh --- scripts/lib.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/lib.sh b/scripts/lib.sh index 32a89a3ba..6e1e48f5e 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -295,6 +295,7 @@ elif [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "debian" ]; then apt install -y libjpeg62-turbo-dev apt install -y libfreetype6-dev apt install -y libevent-dev libncurses5-dev libldap2-dev + apt install -y libzip-dev apt install -y libicu-dev From fb11d318440d8c56329fc70cbabbe608f4c931f9 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 02:01:02 +0800 Subject: [PATCH 30/51] ip --- plugins/php/versions/71/intl.sh | 5 ++++- plugins/php/versions/72/intl.sh | 5 ++++- plugins/php/versions/73/intl.sh | 5 ++++- plugins/php/versions/74/intl.sh | 5 ++++- plugins/php/versions/80/intl.sh | 5 ++++- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/plugins/php/versions/71/intl.sh b/plugins/php/versions/71/intl.sh index c58d8741c..a0374a4f0 100755 --- a/plugins/php/versions/71/intl.sh +++ b/plugins/php/versions/71/intl.sh @@ -42,10 +42,13 @@ Install_lib() cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version} fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash icu.sh + cd $sourcePath/php${version}/ext/${LIBNAME} $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-icu-dir=${serverPath}/lib/icu make && make install && make clean diff --git a/plugins/php/versions/72/intl.sh b/plugins/php/versions/72/intl.sh index c58d8741c..a0374a4f0 100755 --- a/plugins/php/versions/72/intl.sh +++ b/plugins/php/versions/72/intl.sh @@ -42,10 +42,13 @@ Install_lib() cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version} fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash icu.sh + cd $sourcePath/php${version}/ext/${LIBNAME} $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-icu-dir=${serverPath}/lib/icu make && make install && make clean diff --git a/plugins/php/versions/73/intl.sh b/plugins/php/versions/73/intl.sh index c58d8741c..a0374a4f0 100755 --- a/plugins/php/versions/73/intl.sh +++ b/plugins/php/versions/73/intl.sh @@ -42,10 +42,13 @@ Install_lib() cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version} fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash icu.sh + cd $sourcePath/php${version}/ext/${LIBNAME} $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-icu-dir=${serverPath}/lib/icu make && make install && make clean diff --git a/plugins/php/versions/74/intl.sh b/plugins/php/versions/74/intl.sh index c58d8741c..a0374a4f0 100755 --- a/plugins/php/versions/74/intl.sh +++ b/plugins/php/versions/74/intl.sh @@ -42,10 +42,13 @@ Install_lib() cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version} fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash icu.sh + cd $sourcePath/php${version}/ext/${LIBNAME} $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-icu-dir=${serverPath}/lib/icu make && make install && make clean diff --git a/plugins/php/versions/80/intl.sh b/plugins/php/versions/80/intl.sh index c58d8741c..a0374a4f0 100755 --- a/plugins/php/versions/80/intl.sh +++ b/plugins/php/versions/80/intl.sh @@ -42,10 +42,13 @@ Install_lib() cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version} fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash icu.sh + cd $sourcePath/php${version}/ext/${LIBNAME} $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-icu-dir=${serverPath}/lib/icu make && make install && make clean From cf0b00891e1346f519badb31b26308f3f6fa7184 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 02:37:57 +0800 Subject: [PATCH 31/51] openssl --- plugins/php/lib/openssl.sh | 26 ++++++++ plugins/php/versions/52/openssl.sh | 103 +++++++++++++++++++++++++++++ plugins/php/versions/53/openssl.sh | 103 +++++++++++++++++++++++++++++ plugins/php/versions/54/openssl.sh | 103 +++++++++++++++++++++++++++++ plugins/php/versions/55/openssl.sh | 103 +++++++++++++++++++++++++++++ plugins/php/versions/56/openssl.sh | 14 +++- plugins/php/versions/70/openssl.sh | 103 +++++++++++++++++++++++++++++ plugins/php/versions/71/openssl.sh | 5 +- plugins/php/versions/72/openssl.sh | 5 +- plugins/php/versions/73/openssl.sh | 5 +- plugins/php/versions/74/openssl.sh | 5 +- plugins/php/versions/80/openssl.sh | 5 +- plugins/php/versions/phplib.conf | 3 + 13 files changed, 577 insertions(+), 6 deletions(-) create mode 100644 plugins/php/lib/openssl.sh create mode 100755 plugins/php/versions/52/openssl.sh create mode 100755 plugins/php/versions/53/openssl.sh create mode 100755 plugins/php/versions/54/openssl.sh create mode 100755 plugins/php/versions/55/openssl.sh create mode 100755 plugins/php/versions/70/openssl.sh diff --git a/plugins/php/lib/openssl.sh b/plugins/php/lib/openssl.sh new file mode 100644 index 000000000..f3f834a3d --- /dev/null +++ b/plugins/php/lib/openssl.sh @@ -0,0 +1,26 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") + +# echo $rootPath + +SERVER_ROOT=$rootPath/lib +SOURCE_ROOT=$rootPath/source/lib + +if [ ! -d ${SERVER_ROOT}/openssl ];then + cd ${SOURCE_ROOT} + if [ ! -f ${SOURCE_ROOT}/openssl-1.0.2q.tar.gz ];then + wget https://github.com/midoks/mdserver-web/releases/download/init/openssl-1.0.2q.tar.gz -T 20 + fi + tar -zxf openssl-1.0.2q.tar.gz + cd openssl-1.0.2q + ./config --openssldir=${SERVER_ROOT}/openssl zlib-dynamic shared + make && make install +fi + diff --git a/plugins/php/versions/52/openssl.sh b/plugins/php/versions/52/openssl.sh new file mode 100755 index 000000000..29a8478a8 --- /dev/null +++ b/plugins/php/versions/52/openssl.sh @@ -0,0 +1,103 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +actionType=$1 +version=$2 + +LIBNAME=openssl +LIBV=0 + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so + +sysName=`uname` +if [ "$sysName" == "Darwin" ];then + BAK='_bak' +else + BAK='' +fi + +Install_lib() +{ + + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + + if [ ! -f "$extFile" ];then + + if [ ! -d $sourcePath/php${version}/ext ];then + cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version} + fi + + cd $sourcePath/php${version}/ext/${LIBNAME} + + if [ ! -f "config.m4" ];then + mv config0.m4 config.m4 + fi + + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl=${serverPath}/lib/openssl + make clean && make && make install && make clean + + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini + echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/53/openssl.sh b/plugins/php/versions/53/openssl.sh new file mode 100755 index 000000000..29a8478a8 --- /dev/null +++ b/plugins/php/versions/53/openssl.sh @@ -0,0 +1,103 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +actionType=$1 +version=$2 + +LIBNAME=openssl +LIBV=0 + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so + +sysName=`uname` +if [ "$sysName" == "Darwin" ];then + BAK='_bak' +else + BAK='' +fi + +Install_lib() +{ + + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + + if [ ! -f "$extFile" ];then + + if [ ! -d $sourcePath/php${version}/ext ];then + cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version} + fi + + cd $sourcePath/php${version}/ext/${LIBNAME} + + if [ ! -f "config.m4" ];then + mv config0.m4 config.m4 + fi + + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl=${serverPath}/lib/openssl + make clean && make && make install && make clean + + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini + echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/54/openssl.sh b/plugins/php/versions/54/openssl.sh new file mode 100755 index 000000000..29a8478a8 --- /dev/null +++ b/plugins/php/versions/54/openssl.sh @@ -0,0 +1,103 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +actionType=$1 +version=$2 + +LIBNAME=openssl +LIBV=0 + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so + +sysName=`uname` +if [ "$sysName" == "Darwin" ];then + BAK='_bak' +else + BAK='' +fi + +Install_lib() +{ + + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + + if [ ! -f "$extFile" ];then + + if [ ! -d $sourcePath/php${version}/ext ];then + cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version} + fi + + cd $sourcePath/php${version}/ext/${LIBNAME} + + if [ ! -f "config.m4" ];then + mv config0.m4 config.m4 + fi + + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl=${serverPath}/lib/openssl + make clean && make && make install && make clean + + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini + echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/55/openssl.sh b/plugins/php/versions/55/openssl.sh new file mode 100755 index 000000000..29a8478a8 --- /dev/null +++ b/plugins/php/versions/55/openssl.sh @@ -0,0 +1,103 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +actionType=$1 +version=$2 + +LIBNAME=openssl +LIBV=0 + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so + +sysName=`uname` +if [ "$sysName" == "Darwin" ];then + BAK='_bak' +else + BAK='' +fi + +Install_lib() +{ + + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + + if [ ! -f "$extFile" ];then + + if [ ! -d $sourcePath/php${version}/ext ];then + cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version} + fi + + cd $sourcePath/php${version}/ext/${LIBNAME} + + if [ ! -f "config.m4" ];then + mv config0.m4 config.m4 + fi + + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl=${serverPath}/lib/openssl + make clean && make && make install && make clean + + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini + echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/56/openssl.sh b/plugins/php/versions/56/openssl.sh index d93233b72..29a8478a8 100755 --- a/plugins/php/versions/56/openssl.sh +++ b/plugins/php/versions/56/openssl.sh @@ -36,8 +36,14 @@ Install_lib() return fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + if [ ! -f "$extFile" ];then + if [ ! -d $sourcePath/php${version}/ext ];then + cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version} + fi + cd $sourcePath/php${version}/ext/${LIBNAME} if [ ! -f "config.m4" ];then @@ -45,11 +51,17 @@ Install_lib() fi $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl=${serverPath}/lib/openssl make clean && make && make install && make clean fi + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + echo "" >> $serverPath/php/$version/etc/php.ini echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini diff --git a/plugins/php/versions/70/openssl.sh b/plugins/php/versions/70/openssl.sh new file mode 100755 index 000000000..29a8478a8 --- /dev/null +++ b/plugins/php/versions/70/openssl.sh @@ -0,0 +1,103 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +actionType=$1 +version=$2 + +LIBNAME=openssl +LIBV=0 + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so + +sysName=`uname` +if [ "$sysName" == "Darwin" ];then + BAK='_bak' +else + BAK='' +fi + +Install_lib() +{ + + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + + if [ ! -f "$extFile" ];then + + if [ ! -d $sourcePath/php${version}/ext ];then + cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version} + fi + + cd $sourcePath/php${version}/ext/${LIBNAME} + + if [ ! -f "config.m4" ];then + mv config0.m4 config.m4 + fi + + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl=${serverPath}/lib/openssl + make clean && make && make install && make clean + + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini + echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/71/openssl.sh b/plugins/php/versions/71/openssl.sh index 165e01bd2..29a8478a8 100755 --- a/plugins/php/versions/71/openssl.sh +++ b/plugins/php/versions/71/openssl.sh @@ -36,6 +36,8 @@ Install_lib() return fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + if [ ! -f "$extFile" ];then if [ ! -d $sourcePath/php${version}/ext ];then @@ -49,7 +51,8 @@ Install_lib() fi $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl=${serverPath}/lib/openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/72/openssl.sh b/plugins/php/versions/72/openssl.sh index 165e01bd2..29a8478a8 100755 --- a/plugins/php/versions/72/openssl.sh +++ b/plugins/php/versions/72/openssl.sh @@ -36,6 +36,8 @@ Install_lib() return fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + if [ ! -f "$extFile" ];then if [ ! -d $sourcePath/php${version}/ext ];then @@ -49,7 +51,8 @@ Install_lib() fi $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl=${serverPath}/lib/openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/73/openssl.sh b/plugins/php/versions/73/openssl.sh index 165e01bd2..29a8478a8 100755 --- a/plugins/php/versions/73/openssl.sh +++ b/plugins/php/versions/73/openssl.sh @@ -36,6 +36,8 @@ Install_lib() return fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + if [ ! -f "$extFile" ];then if [ ! -d $sourcePath/php${version}/ext ];then @@ -49,7 +51,8 @@ Install_lib() fi $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl=${serverPath}/lib/openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/74/openssl.sh b/plugins/php/versions/74/openssl.sh index 165e01bd2..29a8478a8 100755 --- a/plugins/php/versions/74/openssl.sh +++ b/plugins/php/versions/74/openssl.sh @@ -36,6 +36,8 @@ Install_lib() return fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + if [ ! -f "$extFile" ];then if [ ! -d $sourcePath/php${version}/ext ];then @@ -49,7 +51,8 @@ Install_lib() fi $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl=${serverPath}/lib/openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/80/openssl.sh b/plugins/php/versions/80/openssl.sh index 165e01bd2..29a8478a8 100755 --- a/plugins/php/versions/80/openssl.sh +++ b/plugins/php/versions/80/openssl.sh @@ -36,6 +36,8 @@ Install_lib() return fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + if [ ! -f "$extFile" ];then if [ ! -d $sourcePath/php${version}/ext ];then @@ -49,7 +51,8 @@ Install_lib() fi $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl=${serverPath}/lib/openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/phplib.conf b/plugins/php/versions/phplib.conf index 4fd4f3050..d1c903c96 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -63,6 +63,9 @@ { "name": "openssl", "versions": [ + "53", + "54", + "55", "56", "71", "72", From 28305c62ba665198ce9c45ccd00111ca4cd04d49 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 02:49:45 +0800 Subject: [PATCH 32/51] up --- plugins/php/versions/53/xdebug.sh | 2 +- plugins/php/versions/54/xdebug.sh | 2 +- plugins/php/versions/55/xdebug.sh | 2 +- plugins/php/versions/56/xdebug.sh | 2 +- plugins/php/versions/70/xdebug.sh | 2 +- plugins/php/versions/71/xdebug.sh | 2 +- plugins/php/versions/72/xdebug.sh | 2 +- plugins/php/versions/73/xdebug.sh | 2 +- plugins/php/versions/74/xdebug.sh | 2 +- plugins/php/versions/80/xdebug.sh | 2 +- plugins/php/versions/81/xdebug.sh | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/plugins/php/versions/53/xdebug.sh b/plugins/php/versions/53/xdebug.sh index aa1ae0d1c..349dfe1c8 100755 --- a/plugins/php/versions/53/xdebug.sh +++ b/plugins/php/versions/53/xdebug.sh @@ -60,7 +60,7 @@ Install_lib() echo "" >> $serverPath/php/$version/etc/php.ini echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini - echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/54/xdebug.sh b/plugins/php/versions/54/xdebug.sh index 7aaf482e3..79bf20805 100755 --- a/plugins/php/versions/54/xdebug.sh +++ b/plugins/php/versions/54/xdebug.sh @@ -57,7 +57,7 @@ Install_lib() echo "" >> $serverPath/php/$version/etc/php.ini echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini - echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/55/xdebug.sh b/plugins/php/versions/55/xdebug.sh index b57ee4885..decf2180b 100755 --- a/plugins/php/versions/55/xdebug.sh +++ b/plugins/php/versions/55/xdebug.sh @@ -61,7 +61,7 @@ Install_lib() echo "" >> $serverPath/php/$version/etc/php.ini echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini - echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/56/xdebug.sh b/plugins/php/versions/56/xdebug.sh index 5a1c06c54..bdac443aa 100755 --- a/plugins/php/versions/56/xdebug.sh +++ b/plugins/php/versions/56/xdebug.sh @@ -59,7 +59,7 @@ Install_lib() echo "" >> $serverPath/php/$version/etc/php.ini echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini - echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/70/xdebug.sh b/plugins/php/versions/70/xdebug.sh index 98de7fdcf..e55391fed 100755 --- a/plugins/php/versions/70/xdebug.sh +++ b/plugins/php/versions/70/xdebug.sh @@ -58,7 +58,7 @@ Install_lib() echo "" >> $serverPath/php/$version/etc/php.ini echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini - echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/71/xdebug.sh b/plugins/php/versions/71/xdebug.sh index 0c9fa0c18..8fbb08afd 100755 --- a/plugins/php/versions/71/xdebug.sh +++ b/plugins/php/versions/71/xdebug.sh @@ -57,7 +57,7 @@ Install_lib() echo "" >> $serverPath/php/$version/etc/php.ini echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini - echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/72/xdebug.sh b/plugins/php/versions/72/xdebug.sh index c08c3dfa9..97ecfdb86 100755 --- a/plugins/php/versions/72/xdebug.sh +++ b/plugins/php/versions/72/xdebug.sh @@ -56,7 +56,7 @@ Install_lib() echo "" >> $serverPath/php/$version/etc/php.ini echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini - echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/73/xdebug.sh b/plugins/php/versions/73/xdebug.sh index a28100421..e610af9f6 100755 --- a/plugins/php/versions/73/xdebug.sh +++ b/plugins/php/versions/73/xdebug.sh @@ -58,7 +58,7 @@ Install_lib() echo "" >> $serverPath/php/$version/etc/php.ini echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini - echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/74/xdebug.sh b/plugins/php/versions/74/xdebug.sh index bb2aac870..b8d00c3a0 100755 --- a/plugins/php/versions/74/xdebug.sh +++ b/plugins/php/versions/74/xdebug.sh @@ -60,7 +60,7 @@ Install_lib() echo "" >> $serverPath/php/$version/etc/php.ini echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini - echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/80/xdebug.sh b/plugins/php/versions/80/xdebug.sh index 8c31817f5..661f2dcca 100755 --- a/plugins/php/versions/80/xdebug.sh +++ b/plugins/php/versions/80/xdebug.sh @@ -59,7 +59,7 @@ Install_lib() echo "" >> $serverPath/php/$version/etc/php.ini echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini - echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/81/xdebug.sh b/plugins/php/versions/81/xdebug.sh index 8c31817f5..661f2dcca 100755 --- a/plugins/php/versions/81/xdebug.sh +++ b/plugins/php/versions/81/xdebug.sh @@ -59,7 +59,7 @@ Install_lib() echo "" >> $serverPath/php/$version/etc/php.ini echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini - echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' From 892ba9e85d88d9ed75eff618f2b6f3df22d6833b Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 03:14:07 +0800 Subject: [PATCH 33/51] up --- plugins/php/versions/74/openssl.sh | 2 +- plugins/php/versions/80/openssl.sh | 2 +- scripts/lib.sh | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/php/versions/74/openssl.sh b/plugins/php/versions/74/openssl.sh index 29a8478a8..b78529e26 100755 --- a/plugins/php/versions/74/openssl.sh +++ b/plugins/php/versions/74/openssl.sh @@ -52,7 +52,7 @@ Install_lib() $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ - --with-openssl=${serverPath}/lib/openssl + --with-openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/80/openssl.sh b/plugins/php/versions/80/openssl.sh index 29a8478a8..b78529e26 100755 --- a/plugins/php/versions/80/openssl.sh +++ b/plugins/php/versions/80/openssl.sh @@ -52,7 +52,7 @@ Install_lib() $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ - --with-openssl=${serverPath}/lib/openssl + --with-openssl make clean && make && make install && make clean fi diff --git a/scripts/lib.sh b/scripts/lib.sh index 6e1e48f5e..0e2718cc0 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -272,6 +272,7 @@ elif [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "debian" ]; then apt install -y devscripts apt install -y net-tools apt install -y python3-dev + apt install -y autoconf apt install -y libffi-dev apt install -y cmake automake make @@ -283,7 +284,10 @@ elif [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "debian" ]; then apt install -y libpcre3 libpcre3-dev apt install -y openssl + apt install -y libssl-dev + apt install -y libcurl4-openssl-dev apt install -y libmemcached-dev + apt install -y libsasl2-dev apt install -y imagemagick libmagickwand-dev apt install -y libxml2 libxml2-dev libbz2-dev libmcrypt-dev libpspell-dev librecode-dev @@ -299,7 +303,7 @@ elif [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "debian" ]; then apt install -y libicu-dev - apt install -y gcc build-essential libssl-dev + apt install -y gcc build-essential apt install -y curl libcurl4-gnutls-dev #https://blog.csdn.net/qq_36228377/article/details/123154344 From 287134c15b02d3e987e0b263889fc219b74a760e Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 09:23:15 +0800 Subject: [PATCH 34/51] Update site_api.py --- class/core/site_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class/core/site_api.py b/class/core/site_api.py index 1f8c7a7f5..06506905c 100755 --- a/class/core/site_api.py +++ b/class/core/site_api.py @@ -287,7 +287,7 @@ class site_api: domains.append(tmp) data['domains'] = domains data['email'] = mw.M('users').getField('email') - if data['email'] == '287962566@qq.com': + if data['email'] == 'midoks@163.com': data['email'] = '' return mw.returnJson(True, 'OK', data) From 175846a5a84bc80206ba594688b30e9fb6be2dad Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 09:56:57 +0800 Subject: [PATCH 35/51] up --- plugins/php/versions/74/openssl.sh | 1 + plugins/php/versions/80/openssl.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/php/versions/74/openssl.sh b/plugins/php/versions/74/openssl.sh index b78529e26..cd893ed36 100755 --- a/plugins/php/versions/74/openssl.sh +++ b/plugins/php/versions/74/openssl.sh @@ -50,6 +50,7 @@ Install_lib() mv config0.m4 config.m4 fi + export PKG_CONFIG_PATH=/www/server/lib/openssl/lib/pkgconfig $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ --with-openssl diff --git a/plugins/php/versions/80/openssl.sh b/plugins/php/versions/80/openssl.sh index b78529e26..cd893ed36 100755 --- a/plugins/php/versions/80/openssl.sh +++ b/plugins/php/versions/80/openssl.sh @@ -50,6 +50,7 @@ Install_lib() mv config0.m4 config.m4 fi + export PKG_CONFIG_PATH=/www/server/lib/openssl/lib/pkgconfig $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ --with-openssl From d51ffca6976150bf7df2fd758a2b54d5d914226e Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 10:37:54 +0800 Subject: [PATCH 36/51] =?UTF-8?q?php=E6=89=A9=E5=B1=95=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=AE=8C=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- class/core/config_api.py | 2 +- plugins/php/all_test.sh | 31 ++++++++++++++++--------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/class/core/config_api.py b/class/core/config_api.py index 71f991acc..6bca6fc85 100755 --- a/class/core/config_api.py +++ b/class/core/config_api.py @@ -18,7 +18,7 @@ class config_api: # 本版解决自启动问题 # 文件管理重命名 # 优化计划任务管理 - __version = '0.8.6.1' + __version = '0.8.6.2' def __init__(self): pass diff --git a/plugins/php/all_test.sh b/plugins/php/all_test.sh index b1320db99..0b4122dcf 100644 --- a/plugins/php/all_test.sh +++ b/plugins/php/all_test.sh @@ -5,25 +5,26 @@ DIR=$(cd "$(dirname "$0")"; pwd) # cd /www/server/mdserver-web/plugins/php && bash all_test.sh -# cd /www/server/mdserver-web/plugins/php/versions/71/ && bash openssl.sh install 71 +# cd /www/server/mdserver-web/plugins/php/versions/74/ && bash openssl.sh install 74 # cd /www/server/mdserver-web/plugins/php/versions/81/ && bash imagemagick.sh install 81 +# cd /www/server/mdserver-web/plugins/php/versions/70/ && bash imagemagick.sh install 70 -PHP_VER=53 -echo "php${PHP_VER} -- start" -cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') -cd $DIR && /bin/bash install.sh install $PHP_VER -for ii in $cmd_ext -do - if [ "install.sh" == "$ii" ];then - echo '' > /tmp/t.log - else - cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER - fi -done -echo "php${PHP_VER} -- end" +# PHP_VER=52 +# echo "php${PHP_VER} -- start" +# cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') +# cd $DIR && /bin/bash install.sh install $PHP_VER +# for ii in $cmd_ext +# do +# if [ "install.sh" == "$ii" ];then +# echo '' > /tmp/t.log +# else +# cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER +# fi +# done +# echo "php${PHP_VER} -- end" -PHP_VER_LIST=(54 55 56 70 71 72 73 74 80 81) +PHP_VER_LIST=(53 54 55 56 70 71 72 73 74 80 81) # PHP_VER_LIST=(81) for PHP_VER in ${PHP_VER_LIST[@]}; do echo "php${PHP_VER} -- start" From 64f7b9b50ad6171b8a93440257405be4cb53a963 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 12:04:29 +0800 Subject: [PATCH 37/51] =?UTF-8?q?=20=E5=88=9B=E5=BB=BA=E7=AB=99=E7=82=B9?= =?UTF-8?q?=E6=A3=80=E6=9F=A5web=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- class/core/plugins_api.py | 2 +- class/core/site_api.py | 21 ++++++++++++++++++++- route/static/app/site.js | 15 +++++++++++++++ route/static/app/soft.js | 11 ----------- route/static/img/apache.png | Bin 1400 -> 0 bytes route/static/img/mysql.png | Bin 388 -> 0 bytes route/static/img/nginx.png | Bin 375 -> 0 bytes route/static/img/php.png | Bin 801 -> 0 bytes 8 files changed, 36 insertions(+), 13 deletions(-) delete mode 100755 route/static/img/apache.png delete mode 100755 route/static/img/mysql.png delete mode 100755 route/static/img/nginx.png delete mode 100755 route/static/img/php.png diff --git a/class/core/plugins_api.py b/class/core/plugins_api.py index eb99e2124..77ac43824 100755 --- a/class/core/plugins_api.py +++ b/class/core/plugins_api.py @@ -794,7 +794,7 @@ class plugins_api: return mw.returnJson(True, '删除成功!') # shell 调用 - def run(self, name, func, version, args='', script='index'): + def run(self, name, func, version='', args='', script='index'): path = mw.getRunDir() + '/' + self.__plugin_dir + \ '/' + name + '/' + script + '.py' py = 'python3 ' + path diff --git a/class/core/site_api.py b/class/core/site_api.py index 06506905c..aa2a78889 100755 --- a/class/core/site_api.py +++ b/class/core/site_api.py @@ -823,6 +823,25 @@ class site_api: port = request.form.get('port', '') return self.add(webname, port, ps, path, version) + def checkWebStatusApi(self): + ''' + 创建站点检查web服务 + ''' + if not mw.isInstalledWeb(): + return mw.returnJson(False, '请安装并启动OpenResty服务!') + + path = mw.getServerDir() + '/openresty/init.d/openresty' + data = mw.execShell(path + " status") + if data[0].strip().find('stopped') != -1: + return mw.returnJson(False, '请启动OpenResty服务!') + + # import plugins_api + # data = plugins_api.plugins_api().run('openresty', 'status') + # if data[0].strip() == 'stop': + # return mw.returnJson(False, '请启动OpenResty服务!') + + return mw.returnJson(True, 'OK') + def addDomainApi(self): isError = mw.checkWebConfig() if isError != True: @@ -1075,7 +1094,7 @@ class site_api: # self.closeHasPwd(get) filename = self.passPath + '/' + siteName + '.pass' - print(filename) + # print(filename) passconf = username + ':' + mw.hasPwd(password) if siteName == 'phpmyadmin': diff --git a/route/static/app/site.js b/route/static/app/site.js index 02e7866b8..fe9b437f4 100755 --- a/route/static/app/site.js +++ b/route/static/app/site.js @@ -163,8 +163,23 @@ function setWebPs(b, e, a) { },'json'); } +function checkWebStatus(){ + data = syncPost('/site/check_web_status') + if (data.status){ + return true + } + layer.msg(data.msg,{icon:0,time:3000,shade: [0.3, "#000"]}) + return false +} + //添加站点 function webAdd(type) { + checkPass = checkWebStatus() + //未开启openresty,不能继续 + if (!checkPass){ + return + } + if (type == 1) { var array; var str=""; diff --git a/route/static/app/soft.js b/route/static/app/soft.js index 94bca7e5e..8f59f2a80 100755 --- a/route/static/app/soft.js +++ b/route/static/app/soft.js @@ -146,17 +146,6 @@ function getSList(isdisplay) { '' + indexshow + '' + '' + handle + '' + ''; - - // sBody += '' + - // '' + plugin_title + '' + - // '' + plugin.ps + '' + - // '' + softPath + '' + - // '' + state + '' + - // '' + indexshow + '' + - // '' + handle + '' + - // ''; } sBody += pBody; diff --git a/route/static/img/apache.png b/route/static/img/apache.png deleted file mode 100755 index e321bcae0f90bab21f58152d6e96c1b14f77247e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1400 zcmV-;1&8{HP)~j=XNimF81^3aSKkHCp;XSl#WB=hqWEa*NbUDG!waW>x zZ3CYd*pQ#9(Bj!Q5?7M=c($;H#N&!-pf>e!B}3k^CAhsOrHAIB5S&S%g^KVO2dN`} z(CP1YCi=8BZT+?*`JFD0aNB2pqIob}wGt>Q z%CFNzWDIC=ob1h8yo|x!6kwYkxRU6Vj(i0eX`%>tUJpTFup5g{qVF8JxaThVI6JS*|jxI>*7Q> zR1#H9?fE6`NF-IbrI-L(dfozm#d9wUj%qc`jgtzZlBg)JNwgL?$JDvlPEMW~EWY(| z!R@@Ft^kMISJN}+o{m-vHocuq%bvagI0|tlfL5aWux=|l-%p#*u7E9>O`kGwB^KlH2%Wsf>ZVCNhN{9ZGJ87 zS-D0kX9DPOTNQ9Av8n>2lC^2dX;;!i6;1^bIH@Swj;ZFMz;1+*Dg}`@S4+`i(N(tDu)&W_hs3$1WPenp2Of^>*2jo za3+BM!Ux}>1+gmxu&Y=dN-tgmun338QCSR5&R%zqsh|AL!cYHDXdwW=?JVAeelB|@ zst0IPIkZ2Ko}$9G8UZfuH{PFC>n2nWEfw5f6)we4;4!p1!tns<@VA{QpgYBVNzEzS zP;k0bQ<@yB1ssr3YZX7f(C-uBOaWc~(qKlJwm<ZXME9bc)zo6p`o#6gf;_*>ftt8jccsCa62&x#HQ>GxY5%90`gp} zp#V`uR1;N2`$L>@;FK@>bo;hqC;BtihJGsEi5ge9m>#qm3KnZ}XzNF4)u`#=x-$-R z)(u{O>H&x92@qhko7W{;JDiB(#(_MI7M}?MK2_0@k0;WnC*4AJ>{L__)f6PJO&tz} zap1CL%bYdAvS8BWNyKdySe@dRpo*xbp!o!5*rSZAJbx(rKr@CV43tx8)dpuGVF6vFn7 zBSz&8J{LtmG-o*H9!{KN?GG4l-m=l|QJQ z;)^dTtUrFEtSi38hXJrRR0zYhLin~~RQ{l?`XGQBz_6-&1^T}4aRo88aiZNELZ0Q@ zK7Xjo02>QGUu1t|pvBKyd|$4^`*;pR!g2N%#)OG>2IPN>%XbeU^LoDk0000gF$Eq{NGv6tt33k^-GrxK3LLJ2tStHe|8Jjc zJb7}$;=cUD-rTWG)#5)2S$bZ!DNpOkx_?lJv1j57>1@-zg-@ey{p|Zwxouvy#iXcz z_b0tt`SJlvLh7FUn71Z2{}tt({FZ!7dEFTDsqX5=`LeZQUlrPG+8%z8->WP8UG3$S zmeX@(7Oa(f{FA$VZcgo!-P2TeKT)yab}+7=wEe-G&5F8?CodEf>3_O(`pASVk$A@` zQx)EZ%$_B$w}=bYn_s4ZgQq+1E_?ftx7OOD z8G=Jl#Snabz9!=|nt*hNU^beFiUpxuGMbo0DOg?b+(B_MPGjPN{L}8>P*I#YxW&u` z9B6J;vD{4S?Un0ago1mNMo*b$(v^C9b&FeWco+w6 zbs&+8^kIN8u4flcf`@?*+_OgEyE zPq}j(`~9BZAFE&HdES%+NPw;+KmsH{0wh2JBtQaGy$|MF{cGC4{8XC&0*r;`@Aa@5 zpfhO`A-6vaio&g`d%FoB!0b5O%vOL512qhHOS<~;QT$h+Ws|z^AbX|P%M)|D>iuG9 z1gImR1dV{!;rH09z`K_ByeZzJfyx+=Gvpl6?5RUpUU`}R$M}io8mJ7#<1I8@)a$h! zJZ zY!`A=hF!QImx{X%`82+BW5^qm+rwxsN7wEu4k4AX&`8F+N=JDJI9kKzcos52rOkD$ ztIh?N+Tm|OsJQ&y)Bf#)j9*nV3O!ypDO_+GOUUA>11C+XO_%H?yImeSLdA*PWh7$B zW!v01`ZBdT0cLhRgr4l!G2?VJ=kel1XNc6X)9*Yn=k) zCaB9T*%j}(Dz&lejLVU)hokcHtqJ=FDWxD_&SE@(I=|$nI+pTzo=23Ljb{v(%cf((*nwq9r=m4(sRJ5C^mIH#bf9kG!9EC_Yao_&sBNAA_@HV}chYr`{v z5NN|w6{zl8cC3B~h`T-ag6GLO_R*icTw^lN2BPXnlAnSFNPq-LfCNZ@ f1W14cXfyf)&s-7#c$c%c00000NkvXXu0mjfF-U|# From e7bc0ba1fbd748de21abe9a4a7bd925557ef1639 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 12:31:34 +0800 Subject: [PATCH 38/51] Update site_api.py --- class/core/site_api.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/class/core/site_api.py b/class/core/site_api.py index aa2a78889..5148eb66f 100755 --- a/class/core/site_api.py +++ b/class/core/site_api.py @@ -830,11 +830,16 @@ class site_api: if not mw.isInstalledWeb(): return mw.returnJson(False, '请安装并启动OpenResty服务!') - path = mw.getServerDir() + '/openresty/init.d/openresty' - data = mw.execShell(path + " status") - if data[0].strip().find('stopped') != -1: + # 这个快点 + pid = mw.getServerDir() + '/openresty/nginx/logs/nginx.pid' + if not os.path.exists(pid): return mw.returnJson(False, '请启动OpenResty服务!') + # path = mw.getServerDir() + '/openresty/init.d/openresty' + # data = mw.execShell(path + " status") + # if data[0].strip().find('stopped') != -1: + # return mw.returnJson(False, '请启动OpenResty服务!') + # import plugins_api # data = plugins_api.plugins_api().run('openresty', 'status') # if data[0].strip() == 'stop': From 9471134647cd44eb7d2acebcbcf4cac6c914a84a Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 13:15:33 +0800 Subject: [PATCH 39/51] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E7=9B=B8?= =?UTF-8?q?=E5=AF=B9=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/php/versions/52/openssl.sh | 3 ++- plugins/php/versions/53/openssl.sh | 3 ++- plugins/php/versions/54/openssl.sh | 3 ++- plugins/php/versions/55/openssl.sh | 3 ++- plugins/php/versions/56/openssl.sh | 3 ++- plugins/php/versions/70/openssl.sh | 3 ++- plugins/php/versions/71/openssl.sh | 3 ++- plugins/php/versions/72/openssl.sh | 3 ++- plugins/php/versions/73/openssl.sh | 3 ++- plugins/php/versions/74/openssl.sh | 2 +- plugins/php/versions/80/openssl.sh | 2 +- 11 files changed, 20 insertions(+), 11 deletions(-) diff --git a/plugins/php/versions/52/openssl.sh b/plugins/php/versions/52/openssl.sh index 29a8478a8..17950eef8 100755 --- a/plugins/php/versions/52/openssl.sh +++ b/plugins/php/versions/52/openssl.sh @@ -50,9 +50,10 @@ Install_lib() mv config0.m4 config.m4 fi + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ - --with-openssl=${serverPath}/lib/openssl + --with-openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/53/openssl.sh b/plugins/php/versions/53/openssl.sh index 29a8478a8..17950eef8 100755 --- a/plugins/php/versions/53/openssl.sh +++ b/plugins/php/versions/53/openssl.sh @@ -50,9 +50,10 @@ Install_lib() mv config0.m4 config.m4 fi + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ - --with-openssl=${serverPath}/lib/openssl + --with-openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/54/openssl.sh b/plugins/php/versions/54/openssl.sh index 29a8478a8..17950eef8 100755 --- a/plugins/php/versions/54/openssl.sh +++ b/plugins/php/versions/54/openssl.sh @@ -50,9 +50,10 @@ Install_lib() mv config0.m4 config.m4 fi + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ - --with-openssl=${serverPath}/lib/openssl + --with-openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/55/openssl.sh b/plugins/php/versions/55/openssl.sh index 29a8478a8..17950eef8 100755 --- a/plugins/php/versions/55/openssl.sh +++ b/plugins/php/versions/55/openssl.sh @@ -50,9 +50,10 @@ Install_lib() mv config0.m4 config.m4 fi + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ - --with-openssl=${serverPath}/lib/openssl + --with-openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/56/openssl.sh b/plugins/php/versions/56/openssl.sh index 29a8478a8..17950eef8 100755 --- a/plugins/php/versions/56/openssl.sh +++ b/plugins/php/versions/56/openssl.sh @@ -50,9 +50,10 @@ Install_lib() mv config0.m4 config.m4 fi + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ - --with-openssl=${serverPath}/lib/openssl + --with-openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/70/openssl.sh b/plugins/php/versions/70/openssl.sh index 29a8478a8..17950eef8 100755 --- a/plugins/php/versions/70/openssl.sh +++ b/plugins/php/versions/70/openssl.sh @@ -50,9 +50,10 @@ Install_lib() mv config0.m4 config.m4 fi + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ - --with-openssl=${serverPath}/lib/openssl + --with-openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/71/openssl.sh b/plugins/php/versions/71/openssl.sh index 29a8478a8..17950eef8 100755 --- a/plugins/php/versions/71/openssl.sh +++ b/plugins/php/versions/71/openssl.sh @@ -50,9 +50,10 @@ Install_lib() mv config0.m4 config.m4 fi + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ - --with-openssl=${serverPath}/lib/openssl + --with-openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/72/openssl.sh b/plugins/php/versions/72/openssl.sh index 29a8478a8..17950eef8 100755 --- a/plugins/php/versions/72/openssl.sh +++ b/plugins/php/versions/72/openssl.sh @@ -50,9 +50,10 @@ Install_lib() mv config0.m4 config.m4 fi + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ - --with-openssl=${serverPath}/lib/openssl + --with-openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/73/openssl.sh b/plugins/php/versions/73/openssl.sh index 29a8478a8..17950eef8 100755 --- a/plugins/php/versions/73/openssl.sh +++ b/plugins/php/versions/73/openssl.sh @@ -50,9 +50,10 @@ Install_lib() mv config0.m4 config.m4 fi + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ - --with-openssl=${serverPath}/lib/openssl + --with-openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/74/openssl.sh b/plugins/php/versions/74/openssl.sh index cd893ed36..17950eef8 100755 --- a/plugins/php/versions/74/openssl.sh +++ b/plugins/php/versions/74/openssl.sh @@ -50,7 +50,7 @@ Install_lib() mv config0.m4 config.m4 fi - export PKG_CONFIG_PATH=/www/server/lib/openssl/lib/pkgconfig + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ --with-openssl diff --git a/plugins/php/versions/80/openssl.sh b/plugins/php/versions/80/openssl.sh index cd893ed36..17950eef8 100755 --- a/plugins/php/versions/80/openssl.sh +++ b/plugins/php/versions/80/openssl.sh @@ -50,7 +50,7 @@ Install_lib() mv config0.m4 config.m4 fi - export PKG_CONFIG_PATH=/www/server/lib/openssl/lib/pkgconfig + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ --with-openssl From 4bd4d97eb7933ee983b9400cb7dfd10ae434bfd1 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 13:36:13 +0800 Subject: [PATCH 40/51] =?UTF-8?q?=E8=A7=A3=E5=86=B3openssl=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E9=97=AE=E9=A2=98=EF=BC=8Copenssl=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=A4=AA=E9=AB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/mysql/versions/5.6/install.sh | 18 +++++++++++++++--- plugins/mysql/versions/5.7/install.sh | 11 +++++++++++ plugins/mysql/versions/8.0/install.sh | 10 ++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/plugins/mysql/versions/5.6/install.sh b/plugins/mysql/versions/5.6/install.sh index 790360d73..4d11114e9 100755 --- a/plugins/mysql/versions/5.6/install.sh +++ b/plugins/mysql/versions/5.6/install.sh @@ -44,7 +44,17 @@ Install_mysql() if [ ! -d ${mysqlDir}/mysql-5.6.50 ];then cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-5.6.50.tar.gz fi - + + + OPTIONS='' + ##check openssl version + OPENSSL_VERSION=`openssl version|awk '{print $2}'|awk -F '.' '{print $1}'` + if [ "${OPENSSL_VERSION}" -ge "3" ];then + #openssl version to high + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig + OPTIONS="-DWITH_SSL=${serverPath}/lib/openssl" + fi if [ ! -d $serverPath/mysql ];then cd ${mysqlDir}/mysql-5.6.50 && cmake \ @@ -59,9 +69,11 @@ Install_mysql() -DWITH_PARTITION_STORAGE_ENGINE=1 \ -DEXTRA_CHARSETS=all \ -DDEFAULT_CHARSET=utf8mb4 \ + -DDEFAULT_COLLATION=utf8mb4_general_ci \ + $OPTIONS \ -DCMAKE_C_COMPILER=/usr/bin/gcc \ - -DCMAKE_CXX_COMPILER=/usr/bin/g++ \ - -DDEFAULT_COLLATION=utf8mb4_general_ci + -DCMAKE_CXX_COMPILER=/usr/bin/g++ + make clean && make && make install && make clean diff --git a/plugins/mysql/versions/5.7/install.sh b/plugins/mysql/versions/5.7/install.sh index 8c374cca0..851cd656b 100755 --- a/plugins/mysql/versions/5.7/install.sh +++ b/plugins/mysql/versions/5.7/install.sh @@ -60,6 +60,16 @@ Install_mysql() cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-boost-${VERSION}.tar.gz fi + OPTIONS='' + ##check openssl version + OPENSSL_VERSION=`openssl version|awk '{print $2}'|awk -F '.' '{print $1}'` + if [ "${OPENSSL_VERSION}" -ge "3" ];then + #openssl version to high + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig + OPTIONS="-DWITH_SSL=${serverPath}/lib/openssl" + fi + if [ ! -d $serverPath/mysql ];then cd ${mysqlDir}/mysql-${VERSION} && cmake \ -DCMAKE_INSTALL_PREFIX=$serverPath/mysql \ @@ -75,6 +85,7 @@ Install_mysql() -DDEFAULT_CHARSET=utf8mb4 \ -DDEFAULT_COLLATION=utf8mb4_general_ci \ -DDOWNLOAD_BOOST=1 \ + $OPTIONS \ -DCMAKE_C_COMPILER=/usr/bin/gcc \ -DCMAKE_CXX_COMPILER=/usr/bin/g++ \ -DWITH_BOOST=${mysqlDir}/mysql-${VERSION}/boost/ diff --git a/plugins/mysql/versions/8.0/install.sh b/plugins/mysql/versions/8.0/install.sh index 9603b6d4b..f892ad1d9 100755 --- a/plugins/mysql/versions/8.0/install.sh +++ b/plugins/mysql/versions/8.0/install.sh @@ -59,6 +59,15 @@ Install_mysql() cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-boost-8.0.25.tar.gz fi + OPTIONS='' + ##check openssl version + OPENSSL_VERSION=`openssl version|awk '{print $2}'|awk -F '.' '{print $1}'` + if [ "${OPENSSL_VERSION}" -ge "3" ];then + #openssl version to high + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig + OPTIONS="-DWITH_SSL=${serverPath}/lib/openssl" + fi if [ ! -d $serverPath/mysql ];then cd ${mysqlDir}/mysql-8.0.25 && ${INSTALL_CMD} \ @@ -76,6 +85,7 @@ Install_mysql() -DDEFAULT_COLLATION=utf8mb4_general_ci \ -DDOWNLOAD_BOOST=1 \ -DFORCE_INSOURCE_BUILD=1 \ + $OPTIONS \ -DCMAKE_C_COMPILER=/usr/bin/gcc \ -DCMAKE_CXX_COMPILER=/usr/bin/g++ \ -DWITH_BOOST=${mysqlDir}/mysql-8.0.25/boost/ From 80879ffb537284ba1fe29c1c77958e67b7111718 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 13:46:02 +0800 Subject: [PATCH 41/51] =?UTF-8?q?=E6=9B=B4=E6=96=B0openssl=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/php/lib/openssl.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/plugins/php/lib/openssl.sh b/plugins/php/lib/openssl.sh index f3f834a3d..48c212d9f 100644 --- a/plugins/php/lib/openssl.sh +++ b/plugins/php/lib/openssl.sh @@ -13,13 +13,25 @@ rootPath=$(dirname "$rootPath") SERVER_ROOT=$rootPath/lib SOURCE_ROOT=$rootPath/source/lib +# if [ ! -d ${SERVER_ROOT}/openssl ];then +# cd ${SOURCE_ROOT} +# if [ ! -f ${SOURCE_ROOT}/openssl-1.0.2q.tar.gz ];then +# wget https://github.com/midoks/mdserver-web/releases/download/init/openssl-1.0.2q.tar.gz -T 20 +# fi +# tar -zxf openssl-1.0.2q.tar.gz +# cd openssl-1.0.2q +# ./config --openssldir=${SERVER_ROOT}/openssl zlib-dynamic shared +# make && make install +# fi + + if [ ! -d ${SERVER_ROOT}/openssl ];then cd ${SOURCE_ROOT} - if [ ! -f ${SOURCE_ROOT}/openssl-1.0.2q.tar.gz ];then - wget https://github.com/midoks/mdserver-web/releases/download/init/openssl-1.0.2q.tar.gz -T 20 + if [ ! -f ${SOURCE_ROOT}/openssl-1.1.1p.tar.gz ];then + wget -O ${SOURCE_ROOT}/openssl-1.1.1p.tar.gz https://www.openssl.org/source/openssl-1.1.1p.tar.gz fi - tar -zxf openssl-1.0.2q.tar.gz - cd openssl-1.0.2q + tar -zxf openssl-1.1.1p.tar.gz + cd openssl-1.1.1p ./config --openssldir=${SERVER_ROOT}/openssl zlib-dynamic shared make && make install fi From 03af9e8c0bfc43854b3f17874e46edc624f19961 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 14:35:31 +0800 Subject: [PATCH 42/51] Update openssl.sh --- plugins/php/lib/openssl.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/php/lib/openssl.sh b/plugins/php/lib/openssl.sh index 48c212d9f..4d6294eac 100644 --- a/plugins/php/lib/openssl.sh +++ b/plugins/php/lib/openssl.sh @@ -30,9 +30,9 @@ if [ ! -d ${SERVER_ROOT}/openssl ];then if [ ! -f ${SOURCE_ROOT}/openssl-1.1.1p.tar.gz ];then wget -O ${SOURCE_ROOT}/openssl-1.1.1p.tar.gz https://www.openssl.org/source/openssl-1.1.1p.tar.gz fi - tar -zxf openssl-1.1.1p.tar.gz + tar -zxvf openssl-1.1.1p.tar.gz cd openssl-1.1.1p - ./config --openssldir=${SERVER_ROOT}/openssl zlib-dynamic shared + ./config --prefix=${SERVER_ROOT}/openssl zlib-dynamic shared make && make install fi From 9e16e464e64b2745a6741237f253e2b600239210 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 14:38:27 +0800 Subject: [PATCH 43/51] =?UTF-8?q?=E5=88=A0=E9=99=A4openresty1.11.2.5=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/openresty/info.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/openresty/info.json b/plugins/openresty/info.json index 29d2f0e54..22a15e32c 100755 --- a/plugins/openresty/info.json +++ b/plugins/openresty/info.json @@ -11,6 +11,6 @@ "home":"http://openresty.org", "date":"2017-11-24", "pid": "1", - "versions": ["1.11.2.5", "1.13.6.2","1.15.8.3","1.19.3.1","1.21.4.1"], - "updates": ["1.11.2.5", "1.13.6.2","1.15.8.3","1.19.3.1","1.21.4.1"] + "versions": [ "1.13.6.2","1.15.8.3","1.19.3.1","1.21.4.1"], + "updates": ["1.13.6.2","1.15.8.3","1.19.3.1","1.21.4.1"] } \ No newline at end of file From e334c1a70200b8a01d5edf835d39493a714fdf9d Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 15:35:24 +0800 Subject: [PATCH 44/51] up --- plugins/openresty/info.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/openresty/info.json b/plugins/openresty/info.json index 22a15e32c..606fdc769 100755 --- a/plugins/openresty/info.json +++ b/plugins/openresty/info.json @@ -11,6 +11,6 @@ "home":"http://openresty.org", "date":"2017-11-24", "pid": "1", - "versions": [ "1.13.6.2","1.15.8.3","1.19.3.1","1.21.4.1"], - "updates": ["1.13.6.2","1.15.8.3","1.19.3.1","1.21.4.1"] + "versions": ["1.15.8.3","1.17.8.2","1.19.3.1","1.21.4.1"], + "updates": ["1.15.8.3","1.17.8.2","1.19.3.1","1.21.4.1"] } \ No newline at end of file From f55b0c0a8b3774d2ad9814c1e153096d77202072 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 16:03:11 +0800 Subject: [PATCH 45/51] =?UTF-8?q?=E9=98=B6=E6=AE=B5=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/mongodb/info.json | 6 ++--- plugins/mongodb/install.sh | 55 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 56 insertions(+), 5 deletions(-) diff --git a/plugins/mongodb/info.json b/plugins/mongodb/info.json index 6172e4ac6..3f3550329 100755 --- a/plugins/mongodb/info.json +++ b/plugins/mongodb/info.json @@ -4,15 +4,15 @@ "name": "mongodb", "title": "Mongodb", "shell": "install.sh", - "versions":["4.4.14","5.0.4"], - "updates":["4.4.14","5.0.4"], + "versions":["4.4","5.0"], + "updates":["4.4","5.0"], "tip": "soft", "checks": "server/mongodb", "path": "server/mongodb", "display": 1, "author": "mongodb", "date": "2021-11-23", - "home": "https://www.mongodb.com/", + "home": "https://www.mongodb.com/docs/v4.4/installation/", "type": 0, "pid": "2" } \ No newline at end of file diff --git a/plugins/mongodb/install.sh b/plugins/mongodb/install.sh index 646d1dc48..a44d66a73 100755 --- a/plugins/mongodb/install.sh +++ b/plugins/mongodb/install.sh @@ -32,6 +32,11 @@ else OSNAME='unknow' fi + +SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` + + + Install_app_mac() { @@ -45,13 +50,59 @@ Install_app_mac() } + + +Install_Linux_Ubuntu() +{ +##################### Ubuntu start ##################### + if [ "$SYS_VERSION_ID" == "22" ]; then + echo "Not yet supported" + exit 1 + fi + + + wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - + sudo apt install gnupg + touch /etc/apt/sources.list.d/mongodb-org-4.4.list + lsb_release -dc + + echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list +##################### Ubuntu end ##################### +} + +Install_Linux_Debian() +{ +##################### debian start ##################### + +##################### debian end ##################### +} + + # https://repo.mongodb.org/yum/redhat/7/mongodb-org/5.0/x86_64/RPMS/mongodb-org-server-5.0.4-1.el7.x86_64.rpm -Install_app_linux(){ +Install_Linux_CentOS() +{ +##################### centos start ##################### if [ ! -f $serverPath/source/mongodb-org-server-${VERSION}-1.el7.x86_64.rpm ];then wget -O $serverPath/source/mongodb-org-server-${VERSION}-1.el7.x86_64.rpm https://repo.mongodb.org/yum/redhat/7/mongodb-org/5.0/x86_64/RPMS/mongodb-org-server-${VERSION}-1.el7.x86_64.rpm fi - + rpm -ivh $serverPath/source/mongodb-org-server-${VERSION}-1.el7.x86_64.rpm +##################### centos end ##################### +} + + +Install_app_linux() +{ + if [ "$OSNAME" == "ubuntu" ];then + Install_Linux_Ubuntu + elif [ "$OSNAME" == "debian" ];then + Install_Linux_Debian + elif [ "$OSNAME" == "centos" ];then + Install_Linux_CentOS + else + echo "Not yet supported" + exit 1 + fi } From 95496247c4ffd02848803d5bef8e364bc1a1d06c Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 16:30:24 +0800 Subject: [PATCH 46/51] Update install.sh --- plugins/pm2/install.sh | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/plugins/pm2/install.sh b/plugins/pm2/install.sh index eb543160f..9e96542ad 100755 --- a/plugins/pm2/install.sh +++ b/plugins/pm2/install.sh @@ -8,15 +8,46 @@ rootPath=$(dirname "$curPath") rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") - install_tmp=${rootPath}/tmp/mw_install.pl +_os=`uname` +echo "use system: ${_os}" +if [ ${_os} == "Darwin" ]; then + OSNAME='macos' +elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then + OSNAME='centos' +elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then + OSNAME='fedora' +elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then + OSNAME='rocky' +elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then + OSNAME='alma' +elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then + OSNAME='debian' +elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then + OSNAME='ubuntu' +elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then + OSNAME='raspbian' +else + OSNAME='unknow' +fi + + Install_pm2() { echo '正在安装脚本文件...' > $install_tmp - yum install -y nodejs + + curl -o- http://npmjs.org/install.sh | bash - npm install pm2 -g + + if [ "$OSNAME" == 'debian' ] && [ "$OSNAME" == 'ubuntu' ];then + apt install -y nodejs + apt install -y pm2 + else + yum install -y nodejs + npm install pm2 -g + fi + curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash mkdir -p $serverPath/pm2 From dc5e885a37c55d539f1fbbcee0c22eb5ea897061 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 16:53:32 +0800 Subject: [PATCH 47/51] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0IP=EF=BC=8C=E4=BC=98=E5=85=88=E9=80=89?= =?UTF-8?q?=E6=8B=A9ipv4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- class/core/mw.py | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/class/core/mw.py b/class/core/mw.py index 57bf3a9c4..80530088c 100755 --- a/class/core/mw.py +++ b/class/core/mw.py @@ -597,20 +597,29 @@ def getLocalIpBack(): def getLocalIp(): - # 取本地外网IP + filename = 'data/iplist.txt' try: - import re - filename = 'data/iplist.txt' ipaddress = readFile(filename) if not ipaddress or ipaddress == '127.0.0.1': - import urllib - url = 'https://v6r.ipip.net/?format=text' - req = urllib.request.urlopen(url, timeout=10) - ipaddress = req.read().decode('utf-8') - writeFile(filename, ipaddress) + raise return ipaddress - except Exception as ex: - return '127.0.0.1' + except Exception as e: + cmd = "curl -4 -sS --connect-timeout 5 -m 60 https://v6r.ipip.net/?format=text" + ip = execShell(cmd) + result = ip[0].strip() + if result == '': + raise + writeFile(filename, result) + return result + except Exception as e: + cmd = "curl -6 -sS --connect-timeout 5 -m 60 https://v6r.ipip.net/?format=text" + ip = execShell(cmd) + result = ip[0].strip() + if result == '': + return '127.0.0.1' + writeFile(filename, result) + return result + return '127.0.0.1' def inArray(arrays, searchStr): From 7cde08268d4ab5923dbae85ffdc7c87bf6dd05f3 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 18:06:45 +0800 Subject: [PATCH 48/51] Update setting.py --- setting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setting.py b/setting.py index c60fd7c9e..235927164 100755 --- a/setting.py +++ b/setting.py @@ -40,7 +40,7 @@ else: bind.append('0.0.0.0:%s' % mw_port) if workers > 2: - workers = 2 + workers = 1 threads = workers * 1 backlog = 512 From c53b209bbb060fef2a9b473de05bd4c1aec89796 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 18:18:08 +0800 Subject: [PATCH 49/51] up --- .gitignore | 1 + app.py | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/.gitignore b/.gitignore index 11beb38ba..9b03b43d9 100644 --- a/.gitignore +++ b/.gitignore @@ -142,3 +142,4 @@ data/edate.pl plugins/l2tp plugins/openlitespeed plugins/gdrive +debug.out diff --git a/app.py b/app.py index 13e12f3be..e564d4253 100644 --- a/app.py +++ b/app.py @@ -1,5 +1,10 @@ # coding:utf-8 +# pip install profiler_online +# 性能测试 +# from profiler_online import run_profiler +# run_profiler() + from gevent import monkey monkey.patch_all() @@ -12,6 +17,12 @@ from route import app, socketio from gevent.pywsgi import WSGIServer from geventwebsocket.handler import WebSocketHandler + +from pyinstrument import Profiler +profiler = Profiler() +profiler.start() + + try: if __name__ == "__main__": From fa118cc815ec85201f7c0cce886a7d2e6bd65b2d Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 18:22:39 +0800 Subject: [PATCH 50/51] Update __init__.py --- route/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/route/__init__.py b/route/__init__.py index a8e374c0c..d1e3863a6 100755 --- a/route/__init__.py +++ b/route/__init__.py @@ -131,8 +131,8 @@ def publicObject(toObject, func, action=None, get=None): return mw.getJson(data) -@app.route("/test") -def test(): +@app.route("/debug") +def debug(): print(sys.version_info) print(session) os = mw.getOs() From 0985d84285d7e8e5c8876fd6f27ef3434d5639e6 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 1 Jul 2022 18:33:25 +0800 Subject: [PATCH 51/51] Update app.py --- app.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app.py b/app.py index e564d4253..8e63dbc9b 100644 --- a/app.py +++ b/app.py @@ -17,12 +17,6 @@ from route import app, socketio from gevent.pywsgi import WSGIServer from geventwebsocket.handler import WebSocketHandler - -from pyinstrument import Profiler -profiler = Profiler() -profiler.start() - - try: if __name__ == "__main__":