From 82e2ee2aead5676f54cf1fd20df66c12d0c0864f Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 22 Jul 2024 23:05:33 +0800 Subject: [PATCH 001/146] Update ubuntu.sh --- plugins/zabbix/versions/6.0/ubuntu.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/plugins/zabbix/versions/6.0/ubuntu.sh b/plugins/zabbix/versions/6.0/ubuntu.sh index 16458b4b76..a65f647e71 100644 --- a/plugins/zabbix/versions/6.0/ubuntu.sh +++ b/plugins/zabbix/versions/6.0/ubuntu.sh @@ -10,19 +10,24 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source sysName=`uname` install_tmp=${rootPath}/tmp/mw_install.pl - +SYS_ARCH=`arch` SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` +ubuntu_suffix= +if [ "$SYS_ARCH" == "aarch64" ];then + ubuntu_suffix="-arm64" +fi + # 检查是否通 # zabbix_get -s 127.0.0.1 -k agent.ping Install_App() { mkdir -p $serverPath/source/zabbix - ZABBIX_NAME=zabbix-release_7.0-2+ubuntu${SYS_VERSION_ID}_all.deb - echo "wget -O $serverPath/source/zabbix/${ZABBIX_NAME} https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/${ZABBIX_NAME}" + ZABBIX_NAME=zabbix-release_6.0-5+ubuntu${SYS_VERSION_ID}_all.deb + echo "wget -O $serverPath/source/zabbix/${ZABBIX_NAME} https://repo.zabbix.com/zabbix/6.0/ubuntu${ubuntu_suffix}/pool/main/z/zabbix-release/${ZABBIX_NAME}" if [ ! -f $serverPath/source/zabbix/${ZABBIX_NAME} ];then - wget -O $serverPath/source/zabbix/${ZABBIX_NAME} https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/${ZABBIX_NAME} + wget -O $serverPath/source/zabbix/${ZABBIX_NAME} https://repo.zabbix.com/zabbix/6.0/ubuntu${ubuntu_suffix}/pool/main/z/zabbix-release/${ZABBIX_NAME} fi # apt-get -f install From 9621f112d1c7134272ebe18a866af002598bf8d4 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 22 Jul 2024 23:13:15 +0800 Subject: [PATCH 002/146] update --- plugins/zabbix/versions/6.0/debian.sh | 8 ++++++-- plugins/zabbix/versions/7.0/debian.sh | 8 ++++++-- plugins/zabbix/versions/7.0/ubuntu.sh | 9 ++++++--- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/plugins/zabbix/versions/6.0/debian.sh b/plugins/zabbix/versions/6.0/debian.sh index d5b2b49478..27915ea754 100644 --- a/plugins/zabbix/versions/6.0/debian.sh +++ b/plugins/zabbix/versions/6.0/debian.sh @@ -9,6 +9,10 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source sysName=`uname` install_tmp=${rootPath}/tmp/mw_install.pl +debian_suffix= +if [ "$SYS_ARCH" == "aarch64" ];then + debian_suffix="-arm64" +fi SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` @@ -19,9 +23,9 @@ Install_App() mkdir -p $serverPath/source/zabbix ZABBIX_NAME=zabbix-release_6.0-5+debian${SYS_VERSION_ID}_all.deb - echo "wget -O $serverPath/source/zabbix/${ZABBIX_NAME} https://repo.zabbix.com/zabbix/6.0/debian/pool/main/z/zabbix-release/${ZABBIX_NAME}" + echo "wget -O $serverPath/source/zabbix/${ZABBIX_NAME} https://repo.zabbix.com/zabbix/6.0/debian${debian_suffix}/pool/main/z/zabbix-release/${ZABBIX_NAME}" if [ ! -f $serverPath/source/zabbix/${ZABBIX_NAME} ];then - wget -O $serverPath/source/zabbix/${ZABBIX_NAME} https://repo.zabbix.com/zabbix/6.0/debian/pool/main/z/zabbix-release/${ZABBIX_NAME} + wget -O $serverPath/source/zabbix/${ZABBIX_NAME} https://repo.zabbix.com/zabbix/6.0/debian${debian_suffix}/pool/main/z/zabbix-release/${ZABBIX_NAME} fi dpkg --configure -a diff --git a/plugins/zabbix/versions/7.0/debian.sh b/plugins/zabbix/versions/7.0/debian.sh index bac75fe590..f8144bf118 100644 --- a/plugins/zabbix/versions/7.0/debian.sh +++ b/plugins/zabbix/versions/7.0/debian.sh @@ -9,6 +9,10 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source sysName=`uname` install_tmp=${rootPath}/tmp/mw_install.pl +debian_suffix= +if [ "$SYS_ARCH" == "aarch64" ];then + debian_suffix="-arm64" +fi SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` @@ -19,9 +23,9 @@ Install_App() mkdir -p $serverPath/source/zabbix ZABBIX_NAME=zabbix-release_7.0-2+debian${SYS_VERSION_ID}_all.deb - echo "wget -O $serverPath/source/zabbix/${ZABBIX_NAME} https://repo.zabbix.com/zabbix/7.0/debian/pool/main/z/zabbix-release/${ZABBIX_NAME}" + echo "wget -O $serverPath/source/zabbix/${ZABBIX_NAME} https://repo.zabbix.com/zabbix/7.0/debian${debian_suffix}/pool/main/z/zabbix-release/${ZABBIX_NAME}" if [ ! -f $serverPath/source/zabbix/${ZABBIX_NAME} ];then - wget -O $serverPath/source/zabbix/${ZABBIX_NAME} https://repo.zabbix.com/zabbix/7.0/debian/pool/main/z/zabbix-release/${ZABBIX_NAME} + wget -O $serverPath/source/zabbix/${ZABBIX_NAME} https://repo.zabbix.com/zabbix/7.0/debian${debian_suffix}/pool/main/z/zabbix-release/${ZABBIX_NAME} fi # apt-get -f install diff --git a/plugins/zabbix/versions/7.0/ubuntu.sh b/plugins/zabbix/versions/7.0/ubuntu.sh index 16458b4b76..1a41eef6f5 100644 --- a/plugins/zabbix/versions/7.0/ubuntu.sh +++ b/plugins/zabbix/versions/7.0/ubuntu.sh @@ -10,7 +10,10 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source sysName=`uname` install_tmp=${rootPath}/tmp/mw_install.pl - +ubuntu_suffix= +if [ "$SYS_ARCH" == "aarch64" ];then + ubuntu_suffix="-arm64" +fi SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` # 检查是否通 @@ -20,9 +23,9 @@ Install_App() mkdir -p $serverPath/source/zabbix ZABBIX_NAME=zabbix-release_7.0-2+ubuntu${SYS_VERSION_ID}_all.deb - echo "wget -O $serverPath/source/zabbix/${ZABBIX_NAME} https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/${ZABBIX_NAME}" + echo "wget -O $serverPath/source/zabbix/${ZABBIX_NAME} https://repo.zabbix.com/zabbix/7.0/ubuntu${ubuntu_suffix}/pool/main/z/zabbix-release/${ZABBIX_NAME}" if [ ! -f $serverPath/source/zabbix/${ZABBIX_NAME} ];then - wget -O $serverPath/source/zabbix/${ZABBIX_NAME} https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/${ZABBIX_NAME} + wget -O $serverPath/source/zabbix/${ZABBIX_NAME} https://repo.zabbix.com/zabbix/7.0/ubuntu${ubuntu_suffix}/pool/main/z/zabbix-release/${ZABBIX_NAME} fi # apt-get -f install From 2482a24898aa3b55c3c182507692bf43106361af Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 22 Jul 2024 23:30:24 +0800 Subject: [PATCH 003/146] Update info.json --- 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 43081102c1..ac276fae89 100755 --- a/plugins/openresty/info.json +++ b/plugins/openresty/info.json @@ -12,6 +12,6 @@ "home":"http://openresty.org", "date":"2017-11-24", "pid": "1", - "versions": ["1.17.8.2","1.19.3.1","1.21.4.2","1.21.4.3","1.25.3.1"], - "updates": ["1.17.8.2","1.19.3.1","1.21.4.2","1.21.4.3","1.25.3.1"] + "versions": ["1.17.8.2","1.19.3.1","1.21.4.2","1.21.4.3","1.25.3.2"], + "updates": ["1.17.8.2","1.19.3.1","1.21.4.2","1.21.4.3","1.25.3.2"] } \ No newline at end of file From 20df24ca8083cc124c9f1143578dce4bb31b5e2c Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 00:16:59 +0800 Subject: [PATCH 004/146] Update cert_api.py --- class/core/cert_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class/core/cert_api.py b/class/core/cert_api.py index d9a589e79e..76ca90c573 100644 --- a/class/core/cert_api.py +++ b/class/core/cert_api.py @@ -1391,7 +1391,7 @@ def renewCert(self, index): raise Exception("指定订单号不存在,无法续签!") order_index.append(index) else: - start_time = time.time() + (30 * 86400) + start_time = time.time() - 60 * 86400 # print(self.__config) if not 'orders' in self.__config: self.__config['orders'] = {} From b299d5f74bc26dd48ea1708ea07dd25b4ffe97f8 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 00:17:10 +0800 Subject: [PATCH 005/146] Update cert_api.py --- class/core/cert_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class/core/cert_api.py b/class/core/cert_api.py index 76ca90c573..a5dfcd36fa 100644 --- a/class/core/cert_api.py +++ b/class/core/cert_api.py @@ -1391,7 +1391,7 @@ def renewCert(self, index): raise Exception("指定订单号不存在,无法续签!") order_index.append(index) else: - start_time = time.time() - 60 * 86400 + start_time = time.time() - 89 * 86400 # print(self.__config) if not 'orders' in self.__config: self.__config['orders'] = {} From c7cad36fded7cc7d1e1ac6a846879b8afadf6559 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 00:17:38 +0800 Subject: [PATCH 006/146] Update cert_api.py --- class/core/cert_api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/class/core/cert_api.py b/class/core/cert_api.py index a5dfcd36fa..f6107a1c59 100644 --- a/class/core/cert_api.py +++ b/class/core/cert_api.py @@ -1391,6 +1391,7 @@ def renewCert(self, index): raise Exception("指定订单号不存在,无法续签!") order_index.append(index) else: + # 测试一天过期 start_time = time.time() - 89 * 86400 # print(self.__config) if not 'orders' in self.__config: From d529ff596ba3cbc6c2069941a750e070e11e0217 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 00:45:14 +0800 Subject: [PATCH 007/146] Update __init__.py --- route/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/route/__init__.py b/route/__init__.py index 9ff8eb1402..7991de5216 100755 --- a/route/__init__.py +++ b/route/__init__.py @@ -226,7 +226,7 @@ def publicObject(toObject, func, action=None, get=None): # API发生错误记录 if mw.isDebugMode(): print(traceback.print_exc()) - data = {'msg': '访问异常:' + str(e) + '!', "status": False} + data = {'msg': '访问异常:' + str(mw.getTracebackInfo()) + '!', "status": False} return mw.getJson(data) From bc876232f9215929260c850d9881f699437b1dd8 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 00:49:43 +0800 Subject: [PATCH 008/146] 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 d26cd34e6d..45ee3111b1 100755 --- a/class/core/site_api.py +++ b/class/core/site_api.py @@ -2802,7 +2802,7 @@ def setSslConf(self, siteName): add_header Strict-Transport-Security "max-age=63072000"; add_header Alt-Svc 'h3=":443";ma=86400'; """ - if version != '1.25.3.1': + if not version.startswith('1.25'): http3Header = ''; sslStr = """#error_page 404/404.html; From 167977a3d1bb56aed8dbc0efabf97591268a0b0f Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 00:50:01 +0800 Subject: [PATCH 009/146] 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 45ee3111b1..43de66d876 100755 --- a/class/core/site_api.py +++ b/class/core/site_api.py @@ -2825,7 +2825,7 @@ def setSslConf(self, siteName): if not mw.inArray(tmp, '443'): listen = re.search(rep, conf).group() - if version == '1.25.3.1': + if version.startswith('1.25'): http_ssl = "\n\tlisten 443 ssl;" http_ssl = http_ssl + "\n\tlisten [::]:443 ssl;" http_ssl = http_ssl + "\n\tlisten 443 quic;" From 16892d474e69f7ee76cac2f44bafeaf66473c15b Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 00:52:56 +0800 Subject: [PATCH 010/146] 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 43de66d876..7c4a9e265f 100755 --- a/class/core/site_api.py +++ b/class/core/site_api.py @@ -2820,7 +2820,7 @@ def setSslConf(self, siteName): conf = conf.replace('#error_page 404/404.html;', sslStr) - rep = "listen\s+([0-9]+)\s*[default_server]*;" + rep = "listen\s+([0-9]+)\s*[default_server|reuseport]*;" tmp = re.findall(rep, conf) if not mw.inArray(tmp, '443'): listen = re.search(rep, conf).group() From c1a1e80185dc8b7716da4ae25386055c6a08d57c Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 10:44:55 +0800 Subject: [PATCH 011/146] Update install.sh --- plugins/openresty/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/openresty/install.sh b/plugins/openresty/install.sh index 1f7cea5ae2..ed201edc43 100755 --- a/plugins/openresty/install.sh +++ b/plugins/openresty/install.sh @@ -130,7 +130,7 @@ Install_openresty() fi OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}" - if [ "$VERSION" == "1.25.3.1" ]; then + if [[ "$VERSION" =~ "1.25.3" ]]; then OPTIONS="${OPTIONS} --with-http_v3_module" if [ ! -f ${openrestyDir}/libressl-${libresslVersion}.tar.gz ];then From c7f3445e79880da281d5a006d235a2866e78475f Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 11:00:46 +0800 Subject: [PATCH 012/146] update --- plugins/mariadb/info.json | 2 +- plugins/mariadb/versions/11.4/install.sh | 121 +++++++++++++++++++++++ 2 files changed, 122 insertions(+), 1 deletion(-) create mode 100755 plugins/mariadb/versions/11.4/install.sh diff --git a/plugins/mariadb/info.json b/plugins/mariadb/info.json index acf7ac203c..cdac6f8d56 100755 --- a/plugins/mariadb/info.json +++ b/plugins/mariadb/info.json @@ -8,7 +8,7 @@ "uninstall_pre_inspection":true, "checks": "server/mariadb", "path": "server/mariadb", - "versions":["10.6","10.7","10.8","10.9","10.11","11.0","11.1","11.2","11.3"], + "versions":["10.6","10.7","10.8","10.9","10.11","11.0","11.1","11.2","11.3","11.4"], "shell":"install.sh", "checks":"server/mariadb", "path":"server/mariadb", diff --git a/plugins/mariadb/versions/11.4/install.sh b/plugins/mariadb/versions/11.4/install.sh new file mode 100755 index 0000000000..0a65ecbbec --- /dev/null +++ b/plugins/mariadb/versions/11.4/install.sh @@ -0,0 +1,121 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin +export PATH + +#https://dev.mysql.com/downloads/mysql/5.5.html#downloads +#https://dev.mysql.com/downloads/file/?id=480541 + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sysName=`uname` + +install_tmp=${rootPath}/tmp/mw_install.pl +mariadbDir=${serverPath}/source/mariadb + +MY_VER=11.4.2 + +Install_app() +{ + mkdir -p ${mariadbDir} + echo '正在安装脚本文件...' > $install_tmp + + if [ "$sysName" != "Darwin" ];then + mkdir -p /var/log/mariadb + touch /var/log/mariadb/mariadb.log + fi + + # ----- cpu start ------ + if [ -z "${cpuCore}" ]; then + cpuCore="1" + fi + + if [ -f /proc/cpuinfo ];then + cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l` + fi + + MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}') + if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then + if [ "${cpuCore}" -gt "${MEM_INFO}" ];then + cpuCore="${MEM_INFO}" + fi + else + cpuCore="1" + fi + + if [ "$cpuCore" -gt "2" ];then + cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'` + else + cpuCore="1" + fi + # ----- cpu end ------ + + # if [ ! -f ${mariadbDir}/mariadb-${MY_VER}.tar.gz ];then + # wget --no-check-certificate -O ${mariadbDir}/mariadb-${MY_VER}.tar.gz --tries=3 https://mirrors.aliyun.com/mariadb/mariadb-${MY_VER}/source/mariadb-${MY_VER}.tar.gz + # fi + + # https://downloads.mariadb.org/interstitial/mariadb-10.9.1/source/mariadb-10.9.1.tar.gz + if [ ! -f ${mariadbDir}/mariadb-${MY_VER}.tar.gz ];then + wget --no-check-certificate -O ${mariadbDir}/mariadb-${MY_VER}.tar.gz --tries=3 https://archive.mariadb.org/mariadb-${MY_VER}/source/mariadb-${MY_VER}.tar.gz + fi + + if [ ! -d ${mariadbDir}/mariadb-${MY_VER} ];then + cd ${mariadbDir} && tar -zxvf ${mariadbDir}/mariadb-${MY_VER}.tar.gz + fi + + INSTALL_CMD=cmake + # check cmake version + CMAKE_VERSION=`cmake -version | grep version | awk '{print $3}' | awk -F '.' '{print $1}'` + if [ "$CMAKE_VERSION" -eq "2" ];then + mkdir -p /var/log/mariadb + touch /var/log/mariadb/mariadb.log + INSTALL_CMD=cmake3 + fi + + if [ ! -d $serverPath/mariadb ];then + cd ${mariadbDir}/mariadb-${MY_VER} && ${INSTALL_CMD} \ + -DCMAKE_INSTALL_PREFIX=$serverPath/mariadb \ + -DMYSQL_DATADIR=$serverPath/mariadb/data/ \ + -DMYSQL_USER=mysql \ + -DMYSQL_UNIX_ADDR=$serverPath/mariadb/mysql.sock \ + -DWITH_MYISAM_STORAGE_ENGINE=1 \ + -DWITH_INNOBASE_STORAGE_ENGINE=1 \ + -DWITH_MEMORY_STORAGE_ENGINE=1 \ + -DENABLED_LOCAL_INFILE=1 \ + -DWITH_PARTITION_STORAGE_ENGINE=1 \ + -DEXTRA_CHARSETS=all \ + -DDEFAULT_CHARSET=utf8mb4 \ + -DDEFAULT_COLLATION=utf8mb4_general_ci \ + -DCMAKE_C_COMPILER=/usr/bin/gcc \ + -DCMAKE_CXX_COMPILER=/usr/bin/g++ + make -j${cpuCore} && make install && make clean + + if [ -d $serverPath/mariadb ];then + echo '11.4' > $serverPath/mariadb/version.pl + echo '安装完成' + else + echo '安装失败' + echo 'install fail'>&2 + exit 1 + fi + fi + + if [ -d ${mariadbDir}/mariadb-${MY_VER} ];then + rm -rf ${mariadbDir}/mariadb-${MY_VER} + fi + +} + +Uninstall_app() +{ + rm -rf $serverPath/mariadb + echo '卸载完成' > $install_tmp +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_app +else + Uninstall_app +fi From 277939ba292303f31991a74338ee66f402ff75a3 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 11:02:30 +0800 Subject: [PATCH 013/146] update --- plugins/mariadb/versions/10.11/install.sh | 2 +- plugins/mariadb/versions/10.6/install.sh | 2 +- plugins/mariadb/versions/11.2/install.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/mariadb/versions/10.11/install.sh b/plugins/mariadb/versions/10.11/install.sh index f0d7a126a8..33708c6109 100755 --- a/plugins/mariadb/versions/10.11/install.sh +++ b/plugins/mariadb/versions/10.11/install.sh @@ -14,7 +14,7 @@ sysName=`uname` install_tmp=${rootPath}/tmp/mw_install.pl mariadbDir=${serverPath}/source/mariadb -MY_VER=10.11.7 +MY_VER=10.11.8 Install_app() { diff --git a/plugins/mariadb/versions/10.6/install.sh b/plugins/mariadb/versions/10.6/install.sh index b12f46f856..04789763dc 100755 --- a/plugins/mariadb/versions/10.6/install.sh +++ b/plugins/mariadb/versions/10.6/install.sh @@ -13,7 +13,7 @@ sysName=`uname` install_tmp=${rootPath}/tmp/mw_install.pl mariadbDir=${serverPath}/source/mariadb -MY_VER=10.6.17 +MY_VER=10.6.18 Install_app() { diff --git a/plugins/mariadb/versions/11.2/install.sh b/plugins/mariadb/versions/11.2/install.sh index 93334cd25a..67b1b74083 100755 --- a/plugins/mariadb/versions/11.2/install.sh +++ b/plugins/mariadb/versions/11.2/install.sh @@ -14,7 +14,7 @@ sysName=`uname` install_tmp=${rootPath}/tmp/mw_install.pl mariadbDir=${serverPath}/source/mariadb -MY_VER=11.2.3 +MY_VER=11.2.4 Install_app() { From c962c6f86a0d26e30aa267614146115ee2177c56 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 12:43:11 +0800 Subject: [PATCH 014/146] update --- plugins/mariadb/install.sh | 4 +- plugins/openresty/info.json | 2 +- plugins/openresty/install.sh | 198 ++---------------- plugins/openresty/versions/1.17.8/install.sh | 168 +++++++++++++++ plugins/openresty/versions/1.19.3/install.sh | 183 ++++++++++++++++ plugins/openresty/versions/1.24.4/install.sh | 187 +++++++++++++++++ plugins/openresty/versions/1.25.3/install.sh | 187 +++++++++++++++++ plugins/postgresql/info.json | 2 +- plugins/postgresql/install.sh | 4 +- plugins/postgresql/versions/14/install.sh | 107 ++++++++++ .../versions/{14.4 => 15}/install.sh | 2 +- plugins/postgresql/versions/16/install.sh | 107 ++++++++++ 12 files changed, 969 insertions(+), 182 deletions(-) create mode 100644 plugins/openresty/versions/1.17.8/install.sh create mode 100644 plugins/openresty/versions/1.19.3/install.sh create mode 100644 plugins/openresty/versions/1.24.4/install.sh create mode 100644 plugins/openresty/versions/1.25.3/install.sh create mode 100755 plugins/postgresql/versions/14/install.sh rename plugins/postgresql/versions/{14.4 => 15}/install.sh (99%) create mode 100755 plugins/postgresql/versions/16/install.sh diff --git a/plugins/mariadb/install.sh b/plugins/mariadb/install.sh index d66a45e46b..ae2cbf9c6b 100755 --- a/plugins/mariadb/install.sh +++ b/plugins/mariadb/install.sh @@ -29,12 +29,12 @@ else fi if [ "${2}" == "" ];then - echo '缺少安装脚本...' > $install_tmp + echo '缺少安装脚本...' exit 0 fi if [ ! -d $curPath/versions/$2 ];then - echo '缺少安装脚本2...' > $install_tmp + echo '缺少安装脚本2...' exit 0 fi diff --git a/plugins/openresty/info.json b/plugins/openresty/info.json index ac276fae89..751fbb4e1a 100755 --- a/plugins/openresty/info.json +++ b/plugins/openresty/info.json @@ -8,7 +8,7 @@ "install_pre_inspection":true, "checks":"server/openresty", "path":"server/openresty", - "author":"nginx/agentzh", + "author":"agentzh", "home":"http://openresty.org", "date":"2017-11-24", "pid": "1", diff --git a/plugins/openresty/install.sh b/plugins/openresty/install.sh index ed201edc43..6523abdb0a 100755 --- a/plugins/openresty/install.sh +++ b/plugins/openresty/install.sh @@ -32,175 +32,17 @@ else BAK='' fi -Install_openresty() -{ - if [ -d $serverPath/openresty ];then - exit 0 - fi - - # ----- cpu start ------ - if [ -z "${cpuCore}" ]; then - cpuCore="1" - fi - - if [ -f /proc/cpuinfo ];then - cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l` - fi - - MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}') - if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then - if [ "${cpuCore}" -gt "${MEM_INFO}" ];then - cpuCore="${MEM_INFO}" - fi - else - cpuCore="1" - fi - - if [ "$cpuCore" -gt "2" ];then - cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'` - else - cpuCore="1" - fi - # ----- cpu end ------ - - mkdir -p ${openrestyDir} - echo '正在安装脚本文件...' - - # wget -O openresty-1.21.4.1.tar.gz https://openresty.org/download/openresty-1.21.4.1.tar.gz - if [ ! -f ${openrestyDir}/openresty-${VERSION}.tar.gz ];then - wget --no-check-certificate -O ${openrestyDir}/openresty-${VERSION}.tar.gz https://openresty.org/download/openresty-${VERSION}.tar.gz -T 3 - fi - - DOWNLOAD_SIZE=`wc -c ${openrestyDir}/openresty-${VERSION}.tar.gz | awk '{print $1}'` - if [ "$DOWNLOAD_SIZE" == "0" ];then - echo 'download failed, download again' - rm -rf ${openrestyDir}/openresty-${VERSION}.tar.gz - fi - - # Last Download Method - if [ ! -f ${openrestyDir}/openresty-${VERSION}.tar.gz ];then - wget --no-check-certificate -O ${openrestyDir}/openresty-${VERSION}.tar.gz http://dl.midoks.icu/soft/openresty/openresty-${VERSION}.tar.gz -T 3 - fi - - cd ${openrestyDir} && tar -zxvf openresty-${VERSION}.tar.gz - - OPTIONS='' - if [ "$VERSION" == "1.19.3.1" ]; then - OPTIONS="${OPTIONS} --with-ipv6" - fi - - - opensslVersion="1.1.1p" - libresslVersion="3.9.1" - pcreVersion='8.38' - if [ "$sysName" == "Darwin" ];then - - if [ ! -f ${openrestyDir}/pcre-${pcreVersion}.tar.gz ];then - wget --no-check-certificate -O ${openrestyDir}/pcre-${pcreVersion}.tar.gz https://netix.dl.sourceforge.net/project/pcre/pcre/${pcreVersion}/pcre-${pcreVersion}.tar.gz - fi - - if [ ! -d ${openrestyDir}/pcre-${pcreVersion} ];then - cd ${openrestyDir} && tar -zxvf pcre-${pcreVersion}.tar.gz - fi - OPTIONS="${OPTIONS} --with-pcre=${openrestyDir}/pcre-${pcreVersion}" - - - if [ ! -f ${openrestyDir}/openssl-${opensslVersion}.tar.gz ];then - wget --no-check-certificate -O ${openrestyDir}/openssl-${opensslVersion}.tar.gz https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz - fi - - if [ ! -d ${openrestyDir}/openssl-${opensslVersion} ];then - cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz - fi - OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}" - - # BREW_DIR=`which brew` - # BREW_DIR=${BREW_DIR/\/bin\/brew/} - - # brew info openssl@1.1 | grep /opt/homebrew/Cellar/openssl@1.1 | cut -d \ -f 1 | awk 'END {print}' - # OPENSSL_LIB_DEPEND_DIR=`brew info openssl@1.1 | grep ${BREW_DIR}/Cellar/openssl@1.1 | cut -d \ -f 1 | awk 'END {print}'` - # OPTIONS="${OPTIONS} --with-openssl=${OPENSSL_LIB_DEPEND_DIR}" - else - if [ ! -f ${openrestyDir}/openssl-${opensslVersion}.tar.gz ];then - wget --no-check-certificate -O ${openrestyDir}/openssl-${opensslVersion}.tar.gz https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz - fi - - if [ ! -d ${openrestyDir}/openssl-${opensslVersion} ];then - cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz - fi - OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}" - - if [[ "$VERSION" =~ "1.25.3" ]]; then - OPTIONS="${OPTIONS} --with-http_v3_module" - - if [ ! -f ${openrestyDir}/libressl-${libresslVersion}.tar.gz ];then - wget --no-check-certificate -O ${openrestyDir}/libressl-${libresslVersion}.tar.gz https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${libresslVersion}.tar.gz - fi - - if [ ! -d ${openrestyDir}/libressl-${libresslVersion} ];then - cd ${openrestyDir} && tar -zxvf libressl-${libresslVersion}.tar.gz - fi - - OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/include" - OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/lib" - - # --with-cc-opt="-I../libressl/build/include" - # --with-ld-opt="-L../libressl/build/lib" - fi - fi - - - # --with-openssl=$serverPath/source/lib/openssl-1.0.2q - cd ${openrestyDir}/openresty-${VERSION} && ./configure \ - --prefix=$serverPath/openresty \ - $OPTIONS \ - --with-stream \ - --with-http_v2_module \ - --with-http_ssl_module \ - --with-http_slice_module \ - --with-http_stub_status_module \ - --with-http_sub_module \ - --with-http_realip_module - # --without-luajit-gc64 - # --with-debug - # 用于调式 - - CMD_MAKE=`which gmake` - if [ "$?" == "0" ];then - gmake -j${cpuCore} && gmake install && gmake clean - else - make -j${cpuCore} && make install && make clean - fi - - if [ -d $serverPath/openresty ];then - echo "${VERSION}" > $serverPath/openresty/version.pl - - mkdir -p $serverPath/web_conf/php/conf - echo 'set $PHP_ENV 0;' > $serverPath/web_conf/php/conf/enable-php-00.conf - - #初始化 - cd ${rootPath} && python3 ${rootPath}/plugins/openresty/index.py start - cd ${rootPath} && python3 ${rootPath}/plugins/openresty/index.py initd_install - rm -rf $openrestyDir/openresty-${VERSION} - fi - - if [ -d ${openrestyDir}/pcre-${pcreVersion} ];then - rm -rf ${openrestyDir}/pcre-${pcreVersion} - fi - - if [ -d ${openrestyDir}/openssl-${opensslVersion} ];then - rm -rf ${openrestyDir}/openssl-${opensslVersion} - fi - - if [ -d ${openrestyDir}/libressl-${libresslVersion} ];then - rm -rf ${openrestyDir}/libressl-${libresslVersion} - fi - echo '安装完成' -} - -Uninstall_openresty() -{ +if [ "${2}" == "" ];then + echo '缺少安装脚本版本...' + exit 0 +fi + +if [ ! -d $curPath/versions/$2 ];then + echo '缺少安装版本SHELL...' + exit 0 +fi +if [ "${action}" == "uninstall" ];then if [ -f /usr/lib/systemd/system/openresty.service ] || [ -f /lib/systemd/system/openresty.service ];then systemctl stop openresty rm -rf /usr/systemd/system/openresty.service @@ -213,12 +55,18 @@ Uninstall_openresty() fi rm -rf $serverPath/openresty - echo '卸载完成' -} +fi -action=$1 -if [ "${1}" == 'install' ];then - Install_openresty -else - Uninstall_openresty +sh -x $curPath/versions/$2/install.sh $1 + +if [ "${action}" == "install" ] && [ -d $serverPath/postgresql ];then + echo "${VERSION}" > $serverPath/openresty/version.pl + + mkdir -p $serverPath/web_conf/php/conf + echo 'set $PHP_ENV 0;' > $serverPath/web_conf/php/conf/enable-php-00.conf + + #初始化 + cd ${rootPath} && python3 ${rootPath}/plugins/openresty/index.py start + cd ${rootPath} && python3 ${rootPath}/plugins/openresty/index.py initd_install + rm -rf $openrestyDir/openresty-${VERSION} fi diff --git a/plugins/openresty/versions/1.17.8/install.sh b/plugins/openresty/versions/1.17.8/install.sh new file mode 100644 index 0000000000..efb019f4c8 --- /dev/null +++ b/plugins/openresty/versions/1.17.8/install.sh @@ -0,0 +1,168 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin +export PATH + +# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4.2 +# cd /www/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4.2 + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") + +sysName=`uname` +action=$1 +type=$2 + +VERSION=1.17.8.2 + +install_tmp=${rootPath}/tmp/mw_install.pl +openrestyDir=${serverPath}/source/openresty + +Install_openresty() +{ + if [ -d $serverPath/openresty ];then + exit 0 + fi + + # ----- cpu start ------ + if [ -z "${cpuCore}" ]; then + cpuCore="1" + fi + + if [ -f /proc/cpuinfo ];then + cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l` + fi + + MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}') + if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then + if [ "${cpuCore}" -gt "${MEM_INFO}" ];then + cpuCore="${MEM_INFO}" + fi + else + cpuCore="1" + fi + + if [ "$cpuCore" -gt "2" ];then + cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'` + else + cpuCore="1" + fi + # ----- cpu end ------ + + mkdir -p ${openrestyDir} + echo '正在安装脚本文件...' + + # wget -O openresty-1.21.4.1.tar.gz https://openresty.org/download/openresty-1.21.4.1.tar.gz + if [ ! -f ${openrestyDir}/openresty-${VERSION}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/openresty-${VERSION}.tar.gz https://openresty.org/download/openresty-${VERSION}.tar.gz -T 3 + fi + + DOWNLOAD_SIZE=`wc -c ${openrestyDir}/openresty-${VERSION}.tar.gz | awk '{print $1}'` + if [ "$DOWNLOAD_SIZE" == "0" ];then + echo 'download failed, download again' + rm -rf ${openrestyDir}/openresty-${VERSION}.tar.gz + fi + + # Last Download Method + if [ ! -f ${openrestyDir}/openresty-${VERSION}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/openresty-${VERSION}.tar.gz http://dl.midoks.icu/soft/openresty/openresty-${VERSION}.tar.gz -T 3 + fi + + cd ${openrestyDir} && tar -zxvf openresty-${VERSION}.tar.gz + + OPTIONS='' + if [ "$VERSION" == "1.19.3.1" ]; then + OPTIONS="${OPTIONS} --with-ipv6" + fi + + + opensslVersion="1.1.1p" + libresslVersion="3.9.1" + pcreVersion='8.38' + if [ "$sysName" == "Darwin" ];then + + if [ ! -f ${openrestyDir}/pcre-${pcreVersion}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/pcre-${pcreVersion}.tar.gz https://netix.dl.sourceforge.net/project/pcre/pcre/${pcreVersion}/pcre-${pcreVersion}.tar.gz + fi + + if [ ! -d ${openrestyDir}/pcre-${pcreVersion} ];then + cd ${openrestyDir} && tar -zxvf pcre-${pcreVersion}.tar.gz + fi + OPTIONS="${OPTIONS} --with-pcre=${openrestyDir}/pcre-${pcreVersion}" + + + if [ ! -f ${openrestyDir}/openssl-${opensslVersion}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/openssl-${opensslVersion}.tar.gz https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz + fi + + if [ ! -d ${openrestyDir}/openssl-${opensslVersion} ];then + cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz + fi + OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}" + + # BREW_DIR=`which brew` + # BREW_DIR=${BREW_DIR/\/bin\/brew/} + + # brew info openssl@1.1 | grep /opt/homebrew/Cellar/openssl@1.1 | cut -d \ -f 1 | awk 'END {print}' + # OPENSSL_LIB_DEPEND_DIR=`brew info openssl@1.1 | grep ${BREW_DIR}/Cellar/openssl@1.1 | cut -d \ -f 1 | awk 'END {print}'` + # OPTIONS="${OPTIONS} --with-openssl=${OPENSSL_LIB_DEPEND_DIR}" + else + if [ ! -f ${openrestyDir}/openssl-${opensslVersion}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/openssl-${opensslVersion}.tar.gz https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz + fi + + if [ ! -d ${openrestyDir}/openssl-${opensslVersion} ];then + cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz + fi + OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}" + fi + + + # --with-openssl=$serverPath/source/lib/openssl-1.0.2q + cd ${openrestyDir}/openresty-${VERSION} && ./configure \ + --prefix=$serverPath/openresty \ + $OPTIONS \ + --with-stream \ + --with-http_v2_module \ + --with-http_ssl_module \ + --with-http_slice_module \ + --with-http_stub_status_module \ + --with-http_sub_module \ + --with-http_realip_module + # --without-luajit-gc64 + # --with-debug + # 用于调式 + + CMD_MAKE=`which gmake` + if [ "$?" == "0" ];then + gmake -j${cpuCore} && gmake install && gmake clean + else + make -j${cpuCore} && make install && make clean + fi + + if [ -d ${openrestyDir}/pcre-${pcreVersion} ];then + rm -rf ${openrestyDir}/pcre-${pcreVersion} + fi + + if [ -d ${openrestyDir}/openssl-${opensslVersion} ];then + rm -rf ${openrestyDir}/openssl-${opensslVersion} + fi + + if [ -d ${openrestyDir}/libressl-${libresslVersion} ];then + rm -rf ${openrestyDir}/libressl-${libresslVersion} + fi + echo '安装完成' +} + +Uninstall_openresty() +{ + echo '卸载完成' +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_openresty +else + Uninstall_openresty +fi diff --git a/plugins/openresty/versions/1.19.3/install.sh b/plugins/openresty/versions/1.19.3/install.sh new file mode 100644 index 0000000000..6044f02181 --- /dev/null +++ b/plugins/openresty/versions/1.19.3/install.sh @@ -0,0 +1,183 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin +export PATH + +# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4.2 +# cd /www/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4.2 + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") + +sysName=`uname` +action=$1 +type=$2 + +VERSION=1.19.3.1 + +install_tmp=${rootPath}/tmp/mw_install.pl +openrestyDir=${serverPath}/source/openresty + +Install_openresty() +{ + if [ -d $serverPath/openresty ];then + exit 0 + fi + + # ----- cpu start ------ + if [ -z "${cpuCore}" ]; then + cpuCore="1" + fi + + if [ -f /proc/cpuinfo ];then + cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l` + fi + + MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}') + if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then + if [ "${cpuCore}" -gt "${MEM_INFO}" ];then + cpuCore="${MEM_INFO}" + fi + else + cpuCore="1" + fi + + if [ "$cpuCore" -gt "2" ];then + cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'` + else + cpuCore="1" + fi + # ----- cpu end ------ + + mkdir -p ${openrestyDir} + echo '正在安装脚本文件...' + + # wget -O openresty-1.21.4.1.tar.gz https://openresty.org/download/openresty-1.21.4.1.tar.gz + if [ ! -f ${openrestyDir}/openresty-${VERSION}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/openresty-${VERSION}.tar.gz https://openresty.org/download/openresty-${VERSION}.tar.gz -T 3 + fi + + DOWNLOAD_SIZE=`wc -c ${openrestyDir}/openresty-${VERSION}.tar.gz | awk '{print $1}'` + if [ "$DOWNLOAD_SIZE" == "0" ];then + echo 'download failed, download again' + rm -rf ${openrestyDir}/openresty-${VERSION}.tar.gz + fi + + # Last Download Method + if [ ! -f ${openrestyDir}/openresty-${VERSION}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/openresty-${VERSION}.tar.gz http://dl.midoks.icu/soft/openresty/openresty-${VERSION}.tar.gz -T 3 + fi + + cd ${openrestyDir} && tar -zxvf openresty-${VERSION}.tar.gz + + OPTIONS='' + OPTIONS="${OPTIONS} --with-ipv6" + + opensslVersion="1.1.1p" + libresslVersion="3.9.1" + pcreVersion='8.38' + if [ "$sysName" == "Darwin" ];then + + if [ ! -f ${openrestyDir}/pcre-${pcreVersion}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/pcre-${pcreVersion}.tar.gz https://netix.dl.sourceforge.net/project/pcre/pcre/${pcreVersion}/pcre-${pcreVersion}.tar.gz + fi + + if [ ! -d ${openrestyDir}/pcre-${pcreVersion} ];then + cd ${openrestyDir} && tar -zxvf pcre-${pcreVersion}.tar.gz + fi + OPTIONS="${OPTIONS} --with-pcre=${openrestyDir}/pcre-${pcreVersion}" + + + if [ ! -f ${openrestyDir}/openssl-${opensslVersion}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/openssl-${opensslVersion}.tar.gz https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz + fi + + if [ ! -d ${openrestyDir}/openssl-${opensslVersion} ];then + cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz + fi + OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}" + + # BREW_DIR=`which brew` + # BREW_DIR=${BREW_DIR/\/bin\/brew/} + + # brew info openssl@1.1 | grep /opt/homebrew/Cellar/openssl@1.1 | cut -d \ -f 1 | awk 'END {print}' + # OPENSSL_LIB_DEPEND_DIR=`brew info openssl@1.1 | grep ${BREW_DIR}/Cellar/openssl@1.1 | cut -d \ -f 1 | awk 'END {print}'` + # OPTIONS="${OPTIONS} --with-openssl=${OPENSSL_LIB_DEPEND_DIR}" + else + if [ ! -f ${openrestyDir}/openssl-${opensslVersion}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/openssl-${opensslVersion}.tar.gz https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz + fi + + if [ ! -d ${openrestyDir}/openssl-${opensslVersion} ];then + cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz + fi + OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}" + + if [[ "$VERSION" =~ "1.25.3" ]]; then + OPTIONS="${OPTIONS} --with-http_v3_module" + + if [ ! -f ${openrestyDir}/libressl-${libresslVersion}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/libressl-${libresslVersion}.tar.gz https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${libresslVersion}.tar.gz + fi + + if [ ! -d ${openrestyDir}/libressl-${libresslVersion} ];then + cd ${openrestyDir} && tar -zxvf libressl-${libresslVersion}.tar.gz + fi + + OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/include" + OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/lib" + + # --with-cc-opt="-I../libressl/build/include" + # --with-ld-opt="-L../libressl/build/lib" + fi + fi + + + # --with-openssl=$serverPath/source/lib/openssl-1.0.2q + cd ${openrestyDir}/openresty-${VERSION} && ./configure \ + --prefix=$serverPath/openresty \ + $OPTIONS \ + --with-stream \ + --with-http_v2_module \ + --with-http_ssl_module \ + --with-http_slice_module \ + --with-http_stub_status_module \ + --with-http_sub_module \ + --with-http_realip_module + # --without-luajit-gc64 + # --with-debug + # 用于调式 + + CMD_MAKE=`which gmake` + if [ "$?" == "0" ];then + gmake -j${cpuCore} && gmake install && gmake clean + else + make -j${cpuCore} && make install && make clean + fi + + if [ -d ${openrestyDir}/pcre-${pcreVersion} ];then + rm -rf ${openrestyDir}/pcre-${pcreVersion} + fi + + if [ -d ${openrestyDir}/openssl-${opensslVersion} ];then + rm -rf ${openrestyDir}/openssl-${opensslVersion} + fi + + if [ -d ${openrestyDir}/libressl-${libresslVersion} ];then + rm -rf ${openrestyDir}/libressl-${libresslVersion} + fi + echo '安装完成' +} + +Uninstall_openresty() +{ + echo '卸载完成' +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_openresty +else + Uninstall_openresty +fi diff --git a/plugins/openresty/versions/1.24.4/install.sh b/plugins/openresty/versions/1.24.4/install.sh new file mode 100644 index 0000000000..4b95d0db2d --- /dev/null +++ b/plugins/openresty/versions/1.24.4/install.sh @@ -0,0 +1,187 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin +export PATH + +# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4.2 +# cd /www/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4.2 + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") + +sysName=`uname` +action=$1 +type=$2 + +VERSION=1.21.4.4 + +install_tmp=${rootPath}/tmp/mw_install.pl +openrestyDir=${serverPath}/source/openresty + +Install_openresty() +{ + if [ -d $serverPath/openresty ];then + exit 0 + fi + + # ----- cpu start ------ + if [ -z "${cpuCore}" ]; then + cpuCore="1" + fi + + if [ -f /proc/cpuinfo ];then + cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l` + fi + + MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}') + if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then + if [ "${cpuCore}" -gt "${MEM_INFO}" ];then + cpuCore="${MEM_INFO}" + fi + else + cpuCore="1" + fi + + if [ "$cpuCore" -gt "2" ];then + cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'` + else + cpuCore="1" + fi + # ----- cpu end ------ + + mkdir -p ${openrestyDir} + echo '正在安装脚本文件...' + + # wget -O openresty-1.21.4.1.tar.gz https://openresty.org/download/openresty-1.21.4.1.tar.gz + if [ ! -f ${openrestyDir}/openresty-${VERSION}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/openresty-${VERSION}.tar.gz https://openresty.org/download/openresty-${VERSION}.tar.gz -T 3 + fi + + DOWNLOAD_SIZE=`wc -c ${openrestyDir}/openresty-${VERSION}.tar.gz | awk '{print $1}'` + if [ "$DOWNLOAD_SIZE" == "0" ];then + echo 'download failed, download again' + rm -rf ${openrestyDir}/openresty-${VERSION}.tar.gz + fi + + # Last Download Method + if [ ! -f ${openrestyDir}/openresty-${VERSION}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/openresty-${VERSION}.tar.gz http://dl.midoks.icu/soft/openresty/openresty-${VERSION}.tar.gz -T 3 + fi + + cd ${openrestyDir} && tar -zxvf openresty-${VERSION}.tar.gz + + OPTIONS='' + if [ "$VERSION" == "1.19.3.1" ]; then + OPTIONS="${OPTIONS} --with-ipv6" + fi + + + opensslVersion="1.1.1p" + libresslVersion="3.9.1" + pcreVersion='8.38' + if [ "$sysName" == "Darwin" ];then + + if [ ! -f ${openrestyDir}/pcre-${pcreVersion}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/pcre-${pcreVersion}.tar.gz https://netix.dl.sourceforge.net/project/pcre/pcre/${pcreVersion}/pcre-${pcreVersion}.tar.gz + fi + + if [ ! -d ${openrestyDir}/pcre-${pcreVersion} ];then + cd ${openrestyDir} && tar -zxvf pcre-${pcreVersion}.tar.gz + fi + OPTIONS="${OPTIONS} --with-pcre=${openrestyDir}/pcre-${pcreVersion}" + + + if [ ! -f ${openrestyDir}/openssl-${opensslVersion}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/openssl-${opensslVersion}.tar.gz https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz + fi + + if [ ! -d ${openrestyDir}/openssl-${opensslVersion} ];then + cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz + fi + OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}" + + # BREW_DIR=`which brew` + # BREW_DIR=${BREW_DIR/\/bin\/brew/} + + # brew info openssl@1.1 | grep /opt/homebrew/Cellar/openssl@1.1 | cut -d \ -f 1 | awk 'END {print}' + # OPENSSL_LIB_DEPEND_DIR=`brew info openssl@1.1 | grep ${BREW_DIR}/Cellar/openssl@1.1 | cut -d \ -f 1 | awk 'END {print}'` + # OPTIONS="${OPTIONS} --with-openssl=${OPENSSL_LIB_DEPEND_DIR}" + else + if [ ! -f ${openrestyDir}/openssl-${opensslVersion}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/openssl-${opensslVersion}.tar.gz https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz + fi + + if [ ! -d ${openrestyDir}/openssl-${opensslVersion} ];then + cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz + fi + OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}" + + if [[ "$VERSION" =~ "1.25.3" ]]; then + OPTIONS="${OPTIONS} --with-http_v3_module" + + if [ ! -f ${openrestyDir}/libressl-${libresslVersion}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/libressl-${libresslVersion}.tar.gz https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${libresslVersion}.tar.gz + fi + + if [ ! -d ${openrestyDir}/libressl-${libresslVersion} ];then + cd ${openrestyDir} && tar -zxvf libressl-${libresslVersion}.tar.gz + fi + + OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/include" + OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/lib" + + # --with-cc-opt="-I../libressl/build/include" + # --with-ld-opt="-L../libressl/build/lib" + fi + fi + + + # --with-openssl=$serverPath/source/lib/openssl-1.0.2q + cd ${openrestyDir}/openresty-${VERSION} && ./configure \ + --prefix=$serverPath/openresty \ + $OPTIONS \ + --with-stream \ + --with-http_v2_module \ + --with-http_ssl_module \ + --with-http_slice_module \ + --with-http_stub_status_module \ + --with-http_sub_module \ + --with-http_realip_module + # --without-luajit-gc64 + # --with-debug + # 用于调式 + + CMD_MAKE=`which gmake` + if [ "$?" == "0" ];then + gmake -j${cpuCore} && gmake install && gmake clean + else + make -j${cpuCore} && make install && make clean + fi + + + if [ -d ${openrestyDir}/pcre-${pcreVersion} ];then + rm -rf ${openrestyDir}/pcre-${pcreVersion} + fi + + if [ -d ${openrestyDir}/openssl-${opensslVersion} ];then + rm -rf ${openrestyDir}/openssl-${opensslVersion} + fi + + if [ -d ${openrestyDir}/libressl-${libresslVersion} ];then + rm -rf ${openrestyDir}/libressl-${libresslVersion} + fi + echo '安装完成' +} + +Uninstall_openresty() +{ + echo '卸载完成' +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_openresty +else + Uninstall_openresty +fi diff --git a/plugins/openresty/versions/1.25.3/install.sh b/plugins/openresty/versions/1.25.3/install.sh new file mode 100644 index 0000000000..70aefaa97b --- /dev/null +++ b/plugins/openresty/versions/1.25.3/install.sh @@ -0,0 +1,187 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin +export PATH + +# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4.2 +# cd /www/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4.2 + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") + +sysName=`uname` +action=$1 +type=$2 + +VERSION=1.25.3.2 + +install_tmp=${rootPath}/tmp/mw_install.pl +openrestyDir=${serverPath}/source/openresty + +Install_openresty() +{ + if [ -d $serverPath/openresty ];then + exit 0 + fi + + # ----- cpu start ------ + if [ -z "${cpuCore}" ]; then + cpuCore="1" + fi + + if [ -f /proc/cpuinfo ];then + cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l` + fi + + MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}') + if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then + if [ "${cpuCore}" -gt "${MEM_INFO}" ];then + cpuCore="${MEM_INFO}" + fi + else + cpuCore="1" + fi + + if [ "$cpuCore" -gt "2" ];then + cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'` + else + cpuCore="1" + fi + # ----- cpu end ------ + + mkdir -p ${openrestyDir} + echo '正在安装脚本文件...' + + # wget -O openresty-1.21.4.1.tar.gz https://openresty.org/download/openresty-1.21.4.1.tar.gz + if [ ! -f ${openrestyDir}/openresty-${VERSION}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/openresty-${VERSION}.tar.gz https://openresty.org/download/openresty-${VERSION}.tar.gz -T 3 + fi + + DOWNLOAD_SIZE=`wc -c ${openrestyDir}/openresty-${VERSION}.tar.gz | awk '{print $1}'` + if [ "$DOWNLOAD_SIZE" == "0" ];then + echo 'download failed, download again' + rm -rf ${openrestyDir}/openresty-${VERSION}.tar.gz + fi + + # Last Download Method + if [ ! -f ${openrestyDir}/openresty-${VERSION}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/openresty-${VERSION}.tar.gz http://dl.midoks.icu/soft/openresty/openresty-${VERSION}.tar.gz -T 3 + fi + + cd ${openrestyDir} && tar -zxvf openresty-${VERSION}.tar.gz + + OPTIONS='' + if [ "$VERSION" == "1.19.3.1" ]; then + OPTIONS="${OPTIONS} --with-ipv6" + fi + + + opensslVersion="1.1.1p" + libresslVersion="3.9.1" + pcreVersion='8.38' + if [ "$sysName" == "Darwin" ];then + + if [ ! -f ${openrestyDir}/pcre-${pcreVersion}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/pcre-${pcreVersion}.tar.gz https://netix.dl.sourceforge.net/project/pcre/pcre/${pcreVersion}/pcre-${pcreVersion}.tar.gz + fi + + if [ ! -d ${openrestyDir}/pcre-${pcreVersion} ];then + cd ${openrestyDir} && tar -zxvf pcre-${pcreVersion}.tar.gz + fi + OPTIONS="${OPTIONS} --with-pcre=${openrestyDir}/pcre-${pcreVersion}" + + + if [ ! -f ${openrestyDir}/openssl-${opensslVersion}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/openssl-${opensslVersion}.tar.gz https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz + fi + + if [ ! -d ${openrestyDir}/openssl-${opensslVersion} ];then + cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz + fi + OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}" + + # BREW_DIR=`which brew` + # BREW_DIR=${BREW_DIR/\/bin\/brew/} + + # brew info openssl@1.1 | grep /opt/homebrew/Cellar/openssl@1.1 | cut -d \ -f 1 | awk 'END {print}' + # OPENSSL_LIB_DEPEND_DIR=`brew info openssl@1.1 | grep ${BREW_DIR}/Cellar/openssl@1.1 | cut -d \ -f 1 | awk 'END {print}'` + # OPTIONS="${OPTIONS} --with-openssl=${OPENSSL_LIB_DEPEND_DIR}" + else + if [ ! -f ${openrestyDir}/openssl-${opensslVersion}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/openssl-${opensslVersion}.tar.gz https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz + fi + + if [ ! -d ${openrestyDir}/openssl-${opensslVersion} ];then + cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz + fi + OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}" + + if [[ "$VERSION" =~ "1.25.3" ]]; then + OPTIONS="${OPTIONS} --with-http_v3_module" + + if [ ! -f ${openrestyDir}/libressl-${libresslVersion}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/libressl-${libresslVersion}.tar.gz https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${libresslVersion}.tar.gz + fi + + if [ ! -d ${openrestyDir}/libressl-${libresslVersion} ];then + cd ${openrestyDir} && tar -zxvf libressl-${libresslVersion}.tar.gz + fi + + OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/include" + OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/lib" + + # --with-cc-opt="-I../libressl/build/include" + # --with-ld-opt="-L../libressl/build/lib" + fi + fi + + + # --with-openssl=$serverPath/source/lib/openssl-1.0.2q + cd ${openrestyDir}/openresty-${VERSION} && ./configure \ + --prefix=$serverPath/openresty \ + $OPTIONS \ + --with-stream \ + --with-http_v2_module \ + --with-http_ssl_module \ + --with-http_slice_module \ + --with-http_stub_status_module \ + --with-http_sub_module \ + --with-http_realip_module + # --without-luajit-gc64 + # --with-debug + # 用于调式 + + CMD_MAKE=`which gmake` + if [ "$?" == "0" ];then + gmake -j${cpuCore} && gmake install && gmake clean + else + make -j${cpuCore} && make install && make clean + fi + + + if [ -d ${openrestyDir}/pcre-${pcreVersion} ];then + rm -rf ${openrestyDir}/pcre-${pcreVersion} + fi + + if [ -d ${openrestyDir}/openssl-${opensslVersion} ];then + rm -rf ${openrestyDir}/openssl-${opensslVersion} + fi + + if [ -d ${openrestyDir}/libressl-${libresslVersion} ];then + rm -rf ${openrestyDir}/libressl-${libresslVersion} + fi + echo '安装完成' +} + +Uninstall_openresty() +{ + echo '卸载完成' +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_openresty +else + Uninstall_openresty +fi diff --git a/plugins/postgresql/info.json b/plugins/postgresql/info.json index 813bf9f3d5..6bc549b70c 100755 --- a/plugins/postgresql/info.json +++ b/plugins/postgresql/info.json @@ -8,7 +8,7 @@ "coexist": false, "install_pre_inspection":true, "uninstall_pre_inspection":true, - "versions":["14.4"], + "versions":["14","15","16"], "shell":"install.sh", "checks":"server/postgresql", "path":"server/postgresql", diff --git a/plugins/postgresql/install.sh b/plugins/postgresql/install.sh index c38c07c267..a05beea0cf 100755 --- a/plugins/postgresql/install.sh +++ b/plugins/postgresql/install.sh @@ -21,12 +21,12 @@ fi if [ "${2}" == "" ];then - echo '缺少安装脚本...' > $install_tmp + echo '缺少安装脚本...' exit 0 fi if [ ! -d $curPath/versions/$2 ];then - echo '缺少安装脚本2...' > $install_tmp + echo '缺少安装脚本2...' exit 0 fi diff --git a/plugins/postgresql/versions/14/install.sh b/plugins/postgresql/versions/14/install.sh new file mode 100755 index 0000000000..4d23b5ea74 --- /dev/null +++ b/plugins/postgresql/versions/14/install.sh @@ -0,0 +1,107 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +#https://www.postgresql.org/ftp/source/ + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sysName=`uname` + +install_tmp=${rootPath}/tmp/mw_install.pl +postgreDir=${serverPath}/source/postgresql + +VERSION=14.12 + +# su - postgres -c "/www/server/postgresql/bin/pg_ctl start -D /www/server/postgresql/data" + +Install_App() +{ + mkdir -p ${postgreDir} + echo '正在安装脚本文件...' > $install_tmp + + if id postgres &> /dev/null ;then + echo "postgres uid is `id -u postgres`" + echo "postgres shell is `grep "^postgres:" /etc/passwd |cut -d':' -f7 `" + else + groupadd postgres + useradd -g postgres postgres + fi + + if [ ! -d /home/postgres ];then + mkdir -p /home/postgres + fi + + if [ "$sysName" != "Darwin" ];then + mkdir -p /var/log/mariadb + touch /var/log/mariadb/mariadb.log + fi + + # ----- cpu start ------ + if [ -z "${cpuCore}" ]; then + cpuCore="1" + fi + + if [ -f /proc/cpuinfo ];then + cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l` + fi + + MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}') + if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then + if [ "${cpuCore}" -gt "${MEM_INFO}" ];then + cpuCore="${MEM_INFO}" + fi + else + cpuCore="1" + fi + + # for stable installation + if [ "$cpuCore" -gt "1" ];then + cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'` + fi + # ----- cpu end ------ + + if [ ! -f ${postgreDir}/postgresql-${VERSION}.tar.bz2 ];then + wget --no-check-certificate -O ${postgreDir}/postgresql-${VERSION}.tar.bz2 --tries=3 https://ftp.postgresql.org/pub/source/v${VERSION}/postgresql-${VERSION}.tar.bz2 + fi + + if [ ! -d ${postgreDir}/postgresql-${VERSION} ];then + cd ${postgreDir} && tar -jxvf ${postgreDir}/postgresql-${VERSION}.tar.bz2 + fi + + + if [ ! -d $serverPath/postgresql ];then + cd ${postgreDir}/postgresql-${VERSION} && ./configure \ + --prefix=$serverPath/postgresql \ + --with-openssl + # --with-pgport=33206 + + echo "cd ${postgreDir}/postgresql-${VERSION} && ./configure \ + --prefix=$serverPath/postgresql \ + --with-openssl" + # --with-pgport=33206 + make -j${cpuCore} && make install && make clean + fi + + if [ -d $serverPath/postgresql ];then + echo "${VERSION}" > $serverPath/postgresql/version.pl + echo 'install successful' > $install_tmp + else + echo 'install fail' > $install_tmp + fi +} + +Uninstall_App() +{ + rm -rf $serverPath/postgresql + echo '卸载完成' > $install_tmp +} + +action=$1 +if [ "${1}" == "install" ];then + Install_App +else + Uninstall_App +fi diff --git a/plugins/postgresql/versions/14.4/install.sh b/plugins/postgresql/versions/15/install.sh similarity index 99% rename from plugins/postgresql/versions/14.4/install.sh rename to plugins/postgresql/versions/15/install.sh index 81f1789f2c..75b7670316 100755 --- a/plugins/postgresql/versions/14.4/install.sh +++ b/plugins/postgresql/versions/15/install.sh @@ -13,7 +13,7 @@ sysName=`uname` install_tmp=${rootPath}/tmp/mw_install.pl postgreDir=${serverPath}/source/postgresql -VERSION=14.4 +VERSION=15.7 # su - postgres -c "/www/server/postgresql/bin/pg_ctl start -D /www/server/postgresql/data" diff --git a/plugins/postgresql/versions/16/install.sh b/plugins/postgresql/versions/16/install.sh new file mode 100755 index 0000000000..5dd7f27103 --- /dev/null +++ b/plugins/postgresql/versions/16/install.sh @@ -0,0 +1,107 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +#https://www.postgresql.org/ftp/source/ + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sysName=`uname` + +install_tmp=${rootPath}/tmp/mw_install.pl +postgreDir=${serverPath}/source/postgresql + +VERSION=16.3 + +# su - postgres -c "/www/server/postgresql/bin/pg_ctl start -D /www/server/postgresql/data" + +Install_App() +{ + mkdir -p ${postgreDir} + echo '正在安装脚本文件...' > $install_tmp + + if id postgres &> /dev/null ;then + echo "postgres uid is `id -u postgres`" + echo "postgres shell is `grep "^postgres:" /etc/passwd |cut -d':' -f7 `" + else + groupadd postgres + useradd -g postgres postgres + fi + + if [ ! -d /home/postgres ];then + mkdir -p /home/postgres + fi + + if [ "$sysName" != "Darwin" ];then + mkdir -p /var/log/mariadb + touch /var/log/mariadb/mariadb.log + fi + + # ----- cpu start ------ + if [ -z "${cpuCore}" ]; then + cpuCore="1" + fi + + if [ -f /proc/cpuinfo ];then + cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l` + fi + + MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}') + if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then + if [ "${cpuCore}" -gt "${MEM_INFO}" ];then + cpuCore="${MEM_INFO}" + fi + else + cpuCore="1" + fi + + # for stable installation + if [ "$cpuCore" -gt "1" ];then + cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'` + fi + # ----- cpu end ------ + + if [ ! -f ${postgreDir}/postgresql-${VERSION}.tar.bz2 ];then + wget --no-check-certificate -O ${postgreDir}/postgresql-${VERSION}.tar.bz2 --tries=3 https://ftp.postgresql.org/pub/source/v${VERSION}/postgresql-${VERSION}.tar.bz2 + fi + + if [ ! -d ${postgreDir}/postgresql-${VERSION} ];then + cd ${postgreDir} && tar -jxvf ${postgreDir}/postgresql-${VERSION}.tar.bz2 + fi + + + if [ ! -d $serverPath/postgresql ];then + cd ${postgreDir}/postgresql-${VERSION} && ./configure \ + --prefix=$serverPath/postgresql \ + --with-openssl + # --with-pgport=33206 + + echo "cd ${postgreDir}/postgresql-${VERSION} && ./configure \ + --prefix=$serverPath/postgresql \ + --with-openssl" + # --with-pgport=33206 + make -j${cpuCore} && make install && make clean + fi + + if [ -d $serverPath/postgresql ];then + echo "${VERSION}" > $serverPath/postgresql/version.pl + echo '安装成功' + else + echo '安装失败' + fi +} + +Uninstall_App() +{ + rm -rf $serverPath/postgresql + echo '卸载完成' +} + +action=$1 +if [ "${1}" == "install" ];then + Install_App +else + Uninstall_App +fi From 2e7afad20b9550e66fb0a179ef57a889d23c27ed Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 12:47:30 +0800 Subject: [PATCH 015/146] update --- plugins/openresty/info.json | 4 ++-- plugins/openresty/install.sh | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/plugins/openresty/info.json b/plugins/openresty/info.json index 751fbb4e1a..8ddc42b42d 100755 --- a/plugins/openresty/info.json +++ b/plugins/openresty/info.json @@ -12,6 +12,6 @@ "home":"http://openresty.org", "date":"2017-11-24", "pid": "1", - "versions": ["1.17.8.2","1.19.3.1","1.21.4.2","1.21.4.3","1.25.3.2"], - "updates": ["1.17.8.2","1.19.3.1","1.21.4.2","1.21.4.3","1.25.3.2"] + "versions": ["1.17.8","1.19.3","1.21.4","1.25.3"], + "updates": ["1.17.8.2","1.19.3.1","1.21.4.2","1.25.3.2"] } \ No newline at end of file diff --git a/plugins/openresty/install.sh b/plugins/openresty/install.sh index 6523abdb0a..90b92bd0a0 100755 --- a/plugins/openresty/install.sh +++ b/plugins/openresty/install.sh @@ -26,12 +26,6 @@ else useradd -g www -s /bin/bash www fi -if [ "$sysName" == "Darwin" ];then - BAK='_bak' -else - BAK='' -fi - if [ "${2}" == "" ];then echo '缺少安装脚本版本...' exit 0 From fd81666453af37e04ff31b85fe545c703ff632b3 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 12:49:46 +0800 Subject: [PATCH 016/146] update --- plugins/openresty/versions/{1.24.4 => 1.21.4}/install.sh | 4 ---- plugins/openresty/versions/1.25.3/install.sh | 4 ---- 2 files changed, 8 deletions(-) rename plugins/openresty/versions/{1.24.4 => 1.21.4}/install.sh (98%) diff --git a/plugins/openresty/versions/1.24.4/install.sh b/plugins/openresty/versions/1.21.4/install.sh similarity index 98% rename from plugins/openresty/versions/1.24.4/install.sh rename to plugins/openresty/versions/1.21.4/install.sh index 4b95d0db2d..43c7ec38bf 100644 --- a/plugins/openresty/versions/1.24.4/install.sh +++ b/plugins/openresty/versions/1.21.4/install.sh @@ -72,10 +72,6 @@ Install_openresty() cd ${openrestyDir} && tar -zxvf openresty-${VERSION}.tar.gz OPTIONS='' - if [ "$VERSION" == "1.19.3.1" ]; then - OPTIONS="${OPTIONS} --with-ipv6" - fi - opensslVersion="1.1.1p" libresslVersion="3.9.1" diff --git a/plugins/openresty/versions/1.25.3/install.sh b/plugins/openresty/versions/1.25.3/install.sh index 70aefaa97b..758351f856 100644 --- a/plugins/openresty/versions/1.25.3/install.sh +++ b/plugins/openresty/versions/1.25.3/install.sh @@ -72,10 +72,6 @@ Install_openresty() cd ${openrestyDir} && tar -zxvf openresty-${VERSION}.tar.gz OPTIONS='' - if [ "$VERSION" == "1.19.3.1" ]; then - OPTIONS="${OPTIONS} --with-ipv6" - fi - opensslVersion="1.1.1p" libresslVersion="3.9.1" From c39076dfb7b80f715e3217f4b00da5bdfeea694f Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 12:50:13 +0800 Subject: [PATCH 017/146] Update install.sh --- plugins/openresty/versions/1.17.8/install.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plugins/openresty/versions/1.17.8/install.sh b/plugins/openresty/versions/1.17.8/install.sh index efb019f4c8..69b6ef9a24 100644 --- a/plugins/openresty/versions/1.17.8/install.sh +++ b/plugins/openresty/versions/1.17.8/install.sh @@ -72,10 +72,6 @@ Install_openresty() cd ${openrestyDir} && tar -zxvf openresty-${VERSION}.tar.gz OPTIONS='' - if [ "$VERSION" == "1.19.3.1" ]; then - OPTIONS="${OPTIONS} --with-ipv6" - fi - opensslVersion="1.1.1p" libresslVersion="3.9.1" From 0c06ae60287a07ec152c1f18362feb72e42e9592 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 13:46:24 +0800 Subject: [PATCH 018/146] Update install.sh --- plugins/openresty/install.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/plugins/openresty/install.sh b/plugins/openresty/install.sh index 90b92bd0a0..5812655111 100755 --- a/plugins/openresty/install.sh +++ b/plugins/openresty/install.sh @@ -31,11 +31,6 @@ if [ "${2}" == "" ];then exit 0 fi -if [ ! -d $curPath/versions/$2 ];then - echo '缺少安装版本SHELL...' - exit 0 -fi - if [ "${action}" == "uninstall" ];then if [ -f /usr/lib/systemd/system/openresty.service ] || [ -f /lib/systemd/system/openresty.service ];then systemctl stop openresty From 7af56e1c5648e504a52cf7b4f906c8672ece0a4c Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 14:02:57 +0800 Subject: [PATCH 019/146] update --- plugins/openresty/versions/1.17.8/install.sh | 17 +++++----- plugins/openresty/versions/1.19.3/install.sh | 35 +++++--------------- 2 files changed, 18 insertions(+), 34 deletions(-) diff --git a/plugins/openresty/versions/1.17.8/install.sh b/plugins/openresty/versions/1.17.8/install.sh index 69b6ef9a24..d3bf95aabc 100644 --- a/plugins/openresty/versions/1.17.8/install.sh +++ b/plugins/openresty/versions/1.17.8/install.sh @@ -104,14 +104,15 @@ Install_openresty() # OPENSSL_LIB_DEPEND_DIR=`brew info openssl@1.1 | grep ${BREW_DIR}/Cellar/openssl@1.1 | cut -d \ -f 1 | awk 'END {print}'` # OPTIONS="${OPTIONS} --with-openssl=${OPENSSL_LIB_DEPEND_DIR}" else - if [ ! -f ${openrestyDir}/openssl-${opensslVersion}.tar.gz ];then - wget --no-check-certificate -O ${openrestyDir}/openssl-${opensslVersion}.tar.gz https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz - fi - - if [ ! -d ${openrestyDir}/openssl-${opensslVersion} ];then - cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz - fi - OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}" + echo "openssl" + # if [ ! -f ${openrestyDir}/openssl-${opensslVersion}.tar.gz ];then + # wget --no-check-certificate -O ${openrestyDir}/openssl-${opensslVersion}.tar.gz https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz + # fi + + # if [ ! -d ${openrestyDir}/openssl-${opensslVersion} ];then + # cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz + # fi + # OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}" fi diff --git a/plugins/openresty/versions/1.19.3/install.sh b/plugins/openresty/versions/1.19.3/install.sh index 6044f02181..9934e2a6cb 100644 --- a/plugins/openresty/versions/1.19.3/install.sh +++ b/plugins/openresty/versions/1.19.3/install.sh @@ -105,32 +105,15 @@ Install_openresty() # OPENSSL_LIB_DEPEND_DIR=`brew info openssl@1.1 | grep ${BREW_DIR}/Cellar/openssl@1.1 | cut -d \ -f 1 | awk 'END {print}'` # OPTIONS="${OPTIONS} --with-openssl=${OPENSSL_LIB_DEPEND_DIR}" else - if [ ! -f ${openrestyDir}/openssl-${opensslVersion}.tar.gz ];then - wget --no-check-certificate -O ${openrestyDir}/openssl-${opensslVersion}.tar.gz https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz - fi - - if [ ! -d ${openrestyDir}/openssl-${opensslVersion} ];then - cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz - fi - OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}" - - if [[ "$VERSION" =~ "1.25.3" ]]; then - OPTIONS="${OPTIONS} --with-http_v3_module" - - if [ ! -f ${openrestyDir}/libressl-${libresslVersion}.tar.gz ];then - wget --no-check-certificate -O ${openrestyDir}/libressl-${libresslVersion}.tar.gz https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${libresslVersion}.tar.gz - fi - - if [ ! -d ${openrestyDir}/libressl-${libresslVersion} ];then - cd ${openrestyDir} && tar -zxvf libressl-${libresslVersion}.tar.gz - fi - - OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/include" - OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/lib" - - # --with-cc-opt="-I../libressl/build/include" - # --with-ld-opt="-L../libressl/build/lib" - fi + echo "openssl" + # if [ ! -f ${openrestyDir}/openssl-${opensslVersion}.tar.gz ];then + # wget --no-check-certificate -O ${openrestyDir}/openssl-${opensslVersion}.tar.gz https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz + # fi + + # if [ ! -d ${openrestyDir}/openssl-${opensslVersion} ];then + # cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz + # fi + # OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}" fi From 9e2d17f3f3183e7447cd476fb060a8e4d7e0cc08 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 14:03:43 +0800 Subject: [PATCH 020/146] update --- plugins/openresty/versions/1.21.4/install.sh | 18 -------------- plugins/openresty/versions/1.25.3/install.sh | 26 +++++++++----------- 2 files changed, 12 insertions(+), 32 deletions(-) diff --git a/plugins/openresty/versions/1.21.4/install.sh b/plugins/openresty/versions/1.21.4/install.sh index 43c7ec38bf..531e38368b 100644 --- a/plugins/openresty/versions/1.21.4/install.sh +++ b/plugins/openresty/versions/1.21.4/install.sh @@ -112,24 +112,6 @@ Install_openresty() cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz fi OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}" - - if [[ "$VERSION" =~ "1.25.3" ]]; then - OPTIONS="${OPTIONS} --with-http_v3_module" - - if [ ! -f ${openrestyDir}/libressl-${libresslVersion}.tar.gz ];then - wget --no-check-certificate -O ${openrestyDir}/libressl-${libresslVersion}.tar.gz https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${libresslVersion}.tar.gz - fi - - if [ ! -d ${openrestyDir}/libressl-${libresslVersion} ];then - cd ${openrestyDir} && tar -zxvf libressl-${libresslVersion}.tar.gz - fi - - OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/include" - OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/lib" - - # --with-cc-opt="-I../libressl/build/include" - # --with-ld-opt="-L../libressl/build/lib" - fi fi diff --git a/plugins/openresty/versions/1.25.3/install.sh b/plugins/openresty/versions/1.25.3/install.sh index 758351f856..dbe439cd4c 100644 --- a/plugins/openresty/versions/1.25.3/install.sh +++ b/plugins/openresty/versions/1.25.3/install.sh @@ -112,24 +112,22 @@ Install_openresty() cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz fi OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}" + + fi - if [[ "$VERSION" =~ "1.25.3" ]]; then - OPTIONS="${OPTIONS} --with-http_v3_module" - - if [ ! -f ${openrestyDir}/libressl-${libresslVersion}.tar.gz ];then - wget --no-check-certificate -O ${openrestyDir}/libressl-${libresslVersion}.tar.gz https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${libresslVersion}.tar.gz - fi + if [[ "$VERSION" =~ "1.25.3" ]]; then + OPTIONS="${OPTIONS} --with-http_v3_module" - if [ ! -d ${openrestyDir}/libressl-${libresslVersion} ];then - cd ${openrestyDir} && tar -zxvf libressl-${libresslVersion}.tar.gz - fi - - OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/include" - OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/lib" + if [ ! -f ${openrestyDir}/libressl-${libresslVersion}.tar.gz ];then + wget --no-check-certificate -O ${openrestyDir}/libressl-${libresslVersion}.tar.gz https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${libresslVersion}.tar.gz + fi - # --with-cc-opt="-I../libressl/build/include" - # --with-ld-opt="-L../libressl/build/lib" + if [ ! -d ${openrestyDir}/libressl-${libresslVersion} ];then + cd ${openrestyDir} && tar -zxvf libressl-${libresslVersion}.tar.gz fi + + OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/include" + OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/lib" fi From db14ede309aff08b4caa400d7a3da42bc3e85794 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 14:04:37 +0800 Subject: [PATCH 021/146] Update install.sh --- plugins/openresty/versions/1.25.3/install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/openresty/versions/1.25.3/install.sh b/plugins/openresty/versions/1.25.3/install.sh index dbe439cd4c..9c52246622 100644 --- a/plugins/openresty/versions/1.25.3/install.sh +++ b/plugins/openresty/versions/1.25.3/install.sh @@ -112,7 +112,7 @@ Install_openresty() cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz fi OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}" - + fi if [[ "$VERSION" =~ "1.25.3" ]]; then @@ -131,7 +131,6 @@ Install_openresty() fi - # --with-openssl=$serverPath/source/lib/openssl-1.0.2q cd ${openrestyDir}/openresty-${VERSION} && ./configure \ --prefix=$serverPath/openresty \ $OPTIONS \ From 75d13f3cc731108f409629f12fa344a57e6b579d Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 14:12:53 +0800 Subject: [PATCH 022/146] Update install.sh --- plugins/mysql/versions/8.4/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mysql/versions/8.4/install.sh b/plugins/mysql/versions/8.4/install.sh index 4f214242b8..e126902e61 100755 --- a/plugins/mysql/versions/8.4/install.sh +++ b/plugins/mysql/versions/8.4/install.sh @@ -56,7 +56,7 @@ fi VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` -VERSION=8.4.0 +VERSION=8.4.2 # https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-${VERSION}.tar.gz # https://cdn.mysql.com//Downloads/MySQL-8.4/mysql-boost-${VERSION}.tar.gz Install_mysql() From 4ca64694ff0f44915b5a5c1a3c66afd61be96cff Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 14:17:28 +0800 Subject: [PATCH 023/146] Update install.sh --- plugins/mysql/versions/8.4/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/mysql/versions/8.4/install.sh b/plugins/mysql/versions/8.4/install.sh index e126902e61..f254a0c545 100755 --- a/plugins/mysql/versions/8.4/install.sh +++ b/plugins/mysql/versions/8.4/install.sh @@ -106,11 +106,11 @@ Install_mysql() fi #检测文件是否损坏. - md5_mysql_ok=8c2399782217f5391322751c66ea261b + md5_mysql_ok=a632063fdb1c7de2c5db47e1f66191cd if [ -f ${mysqlDir}/mysql-${VERSION}.tar.gz ];then md5_mysql=`md5sum ${mysqlDir}/mysql-${VERSION}.tar.gz | awk '{print $1}'` if [ "${md5_mysql_ok}" == "${md5_mysql}" ]; then - echo "mysql8.3 file check ok" + echo "mysql8.4 file check ok" else # 重新下载 rm -rf ${mysqlDir}/mysql-${VERSION} From 42119344905931c5ac8f04bd2da9a5aa72b81a2b Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 14:23:08 +0800 Subject: [PATCH 024/146] update --- plugins/mysql/info.json | 4 +- plugins/mysql/versions/9.0/install.sh | 228 ++++++++++++++++++++++++++ 2 files changed, 230 insertions(+), 2 deletions(-) create mode 100755 plugins/mysql/versions/9.0/install.sh diff --git a/plugins/mysql/info.json b/plugins/mysql/info.json index f0c0ef1c69..d649a36c81 100755 --- a/plugins/mysql/info.json +++ b/plugins/mysql/info.json @@ -10,8 +10,8 @@ "checks": "server/mysql/VERSION/bin/mysql", "path": "server/mysql/VERSION", "todo_versions":["5.6","5.7","8.0","8.2"], - "versions":["5.5", "5.6", "5.7","8.0","8.2","8.3","8.4"], - "updates":["5.5.62","5.6.50", "5.7.32","8.0.34","8.2.0","8.3.0"], + "versions":["5.5", "5.6", "5.7","8.0","8.2","8.3","8.4","9.0"], + "updates":["5.5.62","5.6.50", "5.7.32","8.0.34","8.2.0","8.3.0","9.0.1"], "shell":"install.sh", "checks":"server/mysql", "path":"server/mysql", diff --git a/plugins/mysql/versions/9.0/install.sh b/plugins/mysql/versions/9.0/install.sh new file mode 100755 index 0000000000..f422eb125d --- /dev/null +++ b/plugins/mysql/versions/9.0/install.sh @@ -0,0 +1,228 @@ +# -*- coding: utf-8 -*- +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin +export PATH + +#https://dev.mysql.com/downloads/mysql/5.7.html +#https://dev.mysql.com/downloads/file/?id=489855 + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sysName=`uname` + + +install_tmp=${rootPath}/tmp/mw_install.pl +mysqlDir=${serverPath}/source/mysql + +_os=`uname` +echo "use system: ${_os}" +if [ ${_os} == "Darwin" ]; then + OSNAME='macos' +elif grep -Eq "openSUSE" /etc/*-release; then + OSNAME='opensuse' + zypper refresh +elif grep -Eq "FreeBSD" /etc/*-release; then + OSNAME='freebsd' + pkg install -y wget unzip +elif grep -Eqi "Arch" /etc/issue || grep -Eq "Arch" /etc/*-release; then + OSNAME='arch' + echo y | pacman -Sy unzip +elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then + OSNAME='centos' + yum install -y wget zip unzip +elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then + OSNAME='fedora' + yum install -y wget zip unzip +elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then + OSNAME='rocky' + yum install -y wget zip unzip +elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then + OSNAME='alma' + yum install -y wget zip unzip +elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then + OSNAME='debian' + apt update -y + apt install -y devscripts + apt install -y wget zip unzip +elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then + OSNAME='ubuntu' + apt install -y wget zip unzip +else + OSNAME='unknow' +fi + +VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` + + +VERSION=9.0.1 +# https://dev.mysql.com/get/Downloads/MySQL-9.0/mysql-${VERSION}.tar.gz +# https://cdn.mysql.com//Downloads/MySQL-9.0/mysql-boost-${VERSION}.tar.gz +Install_mysql() +{ + mkdir -p ${mysqlDir} + echo '正在安装脚本文件...' > $install_tmp + + + # ----- cpu start ------ + if [ -z "${cpuCore}" ]; then + cpuCore="1" + fi + + if [ -f /proc/cpuinfo ];then + cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l` + fi + + MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}') + if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then + if [ "${cpuCore}" -gt "${MEM_INFO}" ];then + cpuCore="${MEM_INFO}" + fi + else + cpuCore="1" + fi + + if [ "$cpuCore" -gt "2" ];then + cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'` + else + cpuCore="1" + fi + # ----- cpu end ------ + + cd ${rootPath}/plugins/mysql/lib && /bin/bash rpcgen.sh + + INSTALL_CMD=cmake + # check cmake version + CMAKE_VERSION=`cmake -version | grep version | awk '{print $3}' | awk -F '.' '{print $1}'` + if [ "$CMAKE_VERSION" -eq "2" ];then + mkdir -p /var/log/mariadb + touch /var/log/mariadb/mariadb.log + INSTALL_CMD=cmake3 + fi + + if [ ! -f ${mysqlDir}/mysql-${VERSION}.tar.gz ];then + wget --no-check-certificate -O ${mysqlDir}/mysql-${VERSION}.tar.gz --tries=3 https://dev.mysql.com/get/Downloads/MySQL-9.0/mysql-${VERSION}.tar.gz + fi + + #检测文件是否损坏. + md5_mysql_ok=90dc27a8b64eee938a0bb045c580b80c + if [ -f ${mysqlDir}/mysql-${VERSION}.tar.gz ];then + md5_mysql=`md5sum ${mysqlDir}/mysql-${VERSION}.tar.gz | awk '{print $1}'` + if [ "${md5_mysql_ok}" == "${md5_mysql}" ]; then + echo "mysql9.0 file check ok" + else + # 重新下载 + rm -rf ${mysqlDir}/mysql-${VERSION} + wget --no-check-certificate -O ${mysqlDir}/mysql-${VERSION}.tar.gz --tries=3 https://dev.mysql.com/get/Downloads/MySQL-9.0/mysql-${VERSION}.tar.gz + fi + fi + + if [ ! -d ${mysqlDir}/mysql-${VERSION} ];then + cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-${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 ${rootPath}/plugins/php/lib && /bin/bash openssl.sh + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig + OPTIONS="-DWITH_SSL=${serverPath}/lib/openssl" + fi + + WHERE_DIR_GCC=/usr/bin/gcc + WHERE_DIR_GPP=/usr/bin/g++ + if [ "$OSNAME" == "centos" ] && [ "$VERSION_ID" == "7" ];then + yum install -y libudev-devel + yum install -y centos-release-scl + yum install -y devtoolset-11-gcc devtoolset-11-gcc-c++ devtoolset-11-binutils + + gcc --version + WHERE_DIR_GCC=/opt/rh/devtoolset-11/root/usr/bin/gcc + WHERE_DIR_GPP=/opt/rh/devtoolset-11/root/usr/bin/g++ + echo $WHERE_DIR_GCC + echo $WHERE_DIR_GPP + fi + + if [ "$OSNAME" == "ubuntu" ];then + apt install -y libudev-dev + apt install -y libtirpc-dev + apt install -y libssl-dev + apt install -y libgssglue-dev + apt install -y software-properties-common + add-apt-repository -y ppa:ubuntu-toolchain-r/test + + LIBTIRPC_VER=`pkg-config libtirpc --modversion` + if [ ! -f ${mysqlDir}/libtirpc_1.3.3.orig.tar.bz2 ];then + wget --no-check-certificate -O ${mysqlDir}/libtirpc_1.3.3.orig.tar.bz2 https://downloads.sourceforge.net/libtirpc/libtirpc-1.3.3.tar.bz2 + cd ${mysqlDir} && tar -jxvf libtirpc_1.3.3.orig.tar.bz2 + cd libtirpc-1.3.3 && ./configure + fi + + export PKG_CONFIG_PATH=/usr/lib/pkgconfig + apt install -y gcc-11 g++-11 + WHERE_DIR_GCC=/usr/bin/gcc-11 + WHERE_DIR_GPP=/usr/bin/g++-11 + fi + + + if [ "$OSNAME" == "opensuse" ];then + zypper install -y gcc11 + zypper install -y gcc11-c++ + + + WHERE_DIR_GCC=/usr/bin/gcc-11 + WHERE_DIR_GPP=/usr/bin/g++-11 + fi + + if [ ! -d $serverPath/mysql ];then + # -DCMAKE_CXX_STANDARD=17 \ + cd ${mysqlDir}/mysql-${VERSION} && ${INSTALL_CMD} \ + -DCMAKE_INSTALL_PREFIX=$serverPath/mysql \ + -DMYSQL_USER=mysql \ + -DMYSQL_TCP_PORT=3306 \ + -DMYSQL_UNIX_ADDR=/var/tmp/mysql.sock \ + -DWITH_MYISAM_STORAGE_ENGINE=1 \ + -DWITH_INNOBASE_STORAGE_ENGINE=1 \ + -DWITH_MEMORY_STORAGE_ENGINE=1 \ + -DENABLED_LOCAL_INFILE=1 \ + -DWITH_PARTITION_STORAGE_ENGINE=1 \ + -DWITH_READLINE=1 \ + -DEXTRA_CHARSETS=all \ + -DDEFAULT_CHARSET=utf8mb4 \ + -DDEFAULT_COLLATION=utf8mb4_general_ci \ + -DDOWNLOAD_BOOST=1 \ + -DFORCE_INSOURCE_BUILD=1 \ + $OPTIONS \ + -DCMAKE_C_COMPILER=$WHERE_DIR_GCC \ + -DCMAKE_CXX_COMPILER=$WHERE_DIR_GPP \ + -DDOWNLOAD_BOOST=0 \ + -DWITH_BOOST=${mysqlDir}/mysql-${VERSION}/boost/ + make -j${cpuCore} && make install && make clean + + if [ -d $serverPath/mysql ];then + rm -rf ${mysqlDir}/mysql-${VERSION} + echo '8.4' > $serverPath/mysql/version.pl + echo "${VERSION}安装完成" + else + # rm -rf ${mysqlDir}/mysql-${VERSION} + echo "${VERSION}安装失败" + exit 1 + fi + fi +} + +Uninstall_mysql() +{ + rm -rf $serverPath/mysql + echo '卸载完成' > $install_tmp +} + +action=$1 +if [ "${1}" == "install" ];then + Install_mysql +else + Uninstall_mysql +fi From fb83cb40dfeff6b37aa6a213e906436ec9f7c47d Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 14:28:09 +0800 Subject: [PATCH 025/146] update --- plugins/mysql-apt/info.json | 2 +- plugins/mysql-apt/versions/8.4/install.sh | 6 +- plugins/mysql-apt/versions/9.0/install.sh | 139 ++++++++++++++++++++++ plugins/mysql/versions/9.0/install.sh | 2 +- 4 files changed, 144 insertions(+), 5 deletions(-) create mode 100755 plugins/mysql-apt/versions/9.0/install.sh diff --git a/plugins/mysql-apt/info.json b/plugins/mysql-apt/info.json index 3e44183c91..d2b06cbd93 100755 --- a/plugins/mysql-apt/info.json +++ b/plugins/mysql-apt/info.json @@ -6,7 +6,7 @@ "type":"运行环境", "ps":"一种关系数据库管理系统[debian,ubuntu](极速安装)", "todo_versions":["5.7","8.0"], - "versions":["5.7","8.0","8.2","8.3","8.4"], + "versions":["5.7","8.0","8.2","8.3","8.4","9.0"], "shell":"install.sh", "install_pre_inspection":true, "uninstall_pre_inspection":true, diff --git a/plugins/mysql-apt/versions/8.4/install.sh b/plugins/mysql-apt/versions/8.4/install.sh index d70a9a9309..a3647de16e 100755 --- a/plugins/mysql-apt/versions/8.4/install.sh +++ b/plugins/mysql-apt/versions/8.4/install.sh @@ -45,7 +45,7 @@ if [ "$ARCH" != "amd64" ];then fi -MYSQL_VER=8.4.0 +MYSQL_VER=8.4.2 SUFFIX_NAME=${MYSQL_VER}-1${OSNAME}${VERSION_ID}_${ARCH} @@ -112,10 +112,10 @@ Install_mysql() if [ "$?" == "0" ];then mkdir -p $serverPath/mysql-apt echo '8.4' > $serverPath/mysql-apt/version.pl - echo '安装完成' > $install_tmp + echo '安装完成' > else echo '8.4' > $serverPath/mysql-apt/version.pl - echo "暂时不支持该系统" > $install_tmp + echo "暂时不支持该系统" fi } diff --git a/plugins/mysql-apt/versions/9.0/install.sh b/plugins/mysql-apt/versions/9.0/install.sh new file mode 100755 index 0000000000..766521900a --- /dev/null +++ b/plugins/mysql-apt/versions/9.0/install.sh @@ -0,0 +1,139 @@ +# -*- coding: utf-8 -*- +#!/bin/bash + +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH +export DEBIAN_FRONTEND=noninteractive + +# https://downloads.mysql.com/archives/community/ + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sysName=`uname` + +install_tmp=${rootPath}/tmp/mw_install.pl +myDir=${serverPath}/source/mysql-apt + +bash ${rootPath}/scripts/getos.sh +OSNAME=`cat ${rootPath}/data/osname.pl` +VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` + +# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 8.0 + +# 暂时debian12没有标准版,先用11使用 +# if [ "$OSNAME" == 'debian' ] && [ "$VERSION_ID" == '12' ] ;then +# echo "暂时不支持该${OSNAME}${VERSION_ID}" > $install_tmp +# exit 1 +# fi + + +ARCH="amd64" +TMP_ARCH=`arch` +if [ "$TMP_ARCH" == "x86_64" ];then + ARCH="amd64" +elif [ "$TMP_ARCH" == "aarch64" ];then + ARCH="arm64" +else + ARCH="amd64" +fi + +if [ "$ARCH" != "amd64" ];then + echo "暂时不支持该${ARCH}" > $install_tmp + exit 1 +fi + + +MYSQL_VER=9.0.1 +SUFFIX_NAME=${MYSQL_VER}-1${OSNAME}${VERSION_ID}_${ARCH} + + +# /lib/systemd/system/mysql.service +# /etc/mysql/my.cnf + +APT_INSTALL() +{ +######## +mkdir -p $myDir +mkdir -p $serverPath/mysql-apt/bin + +mkdir -p /var/run/mysqld +chown mysql -R /var/run/mysqld + +# https://cdn.mysql.com/archives/mysql-8.4/mysql-server_${SUFFIX_NAME}.deb-bundle.tar +# https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-server_${SUFFIX_NAME}.deb-bundle.tar + +wget --no-check-certificate -O ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-server_${SUFFIX_NAME}.deb-bundle.tar +chmod +x ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar +cd ${myDir} && tar vxf ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar + +apt update -y +apt install -y libnuma1 libaio1 libmecab2 + +# 安装 +dpkg -X mysql-common_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin + + + +dpkg -X mysql-community-client-plugins_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin +dpkg -X mysql-community-client-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin +dpkg -X mysql-community-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin +dpkg -X mysql-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin + +dpkg -X mysql-community-server-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin + +dpkg -X mysql-community-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin +dpkg -X mysql-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin + +# 测试时可关闭 +rm -rf $myDir +####### +} + +APT_UNINSTALL() +{ +### +rm -rf $myDir +# apt remove -y mysql-server +### +} + + +Install_mysql() +{ + echo '正在安装脚本文件...' > $install_tmp + + isApt=`which apt` + if [ "$isApt" != "" ];then + APT_INSTALL + fi + + if [ "$?" == "0" ];then + mkdir -p $serverPath/mysql-apt + echo '9.0' > $serverPath/mysql-apt/version.pl + echo '安装完成' + else + echo '9.0' > $serverPath/mysql-apt/version.pl + echo "暂时不支持该系统" + fi +} + +Uninstall_mysql() +{ + + isApt=`which apt` + if [ "$isApt" != "" ];then + APT_UNINSTALL + fi + + rm -rf $serverPath/mysql-apt + echo '卸载完成' +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_mysql +else + Uninstall_mysql +fi diff --git a/plugins/mysql/versions/9.0/install.sh b/plugins/mysql/versions/9.0/install.sh index f422eb125d..ac433a427b 100755 --- a/plugins/mysql/versions/9.0/install.sh +++ b/plugins/mysql/versions/9.0/install.sh @@ -204,7 +204,7 @@ Install_mysql() if [ -d $serverPath/mysql ];then rm -rf ${mysqlDir}/mysql-${VERSION} - echo '8.4' > $serverPath/mysql/version.pl + echo '9.0' > $serverPath/mysql/version.pl echo "${VERSION}安装完成" else # rm -rf ${mysqlDir}/mysql-${VERSION} From fcb5a44abea1da1ee89ea31e87ef8d6d04e847b0 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 14:33:31 +0800 Subject: [PATCH 026/146] Create my9.0.cnf --- plugins/mysql-apt/conf/my9.0.cnf | 103 +++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 plugins/mysql-apt/conf/my9.0.cnf diff --git a/plugins/mysql-apt/conf/my9.0.cnf b/plugins/mysql-apt/conf/my9.0.cnf new file mode 100644 index 0000000000..1b7ff7b943 --- /dev/null +++ b/plugins/mysql-apt/conf/my9.0.cnf @@ -0,0 +1,103 @@ +[client] +user = root +#password = your_password +port = 33206 +socket = {$SERVER_APP_PATH}/mysql.sock +default-character-set = UTF8MB4 + +[mysqld] +!include {$SERVER_APP_PATH}/etc/mode/classic.cnf + +authentication_policy=caching_sha2_password +pid-file = {$SERVER_APP_PATH}/data/mysql.pid +user = mysql +port = 33206 +mysqlx_port = 33260 +socket = {$SERVER_APP_PATH}/mysql.sock +datadir = {$SERVER_APP_PATH}/data +log-error = {$SERVER_APP_PATH}/data/error.log +server-id = {$SERVER_ID} + +default_storage_engine = InnoDB + +key_buffer_size = 8M +table_open_cache = 32 +sort_buffer_size = 256K +net_buffer_length = 4K +read_buffer_size = 128K +read_rnd_buffer_size = 256K +myisam_sort_buffer_size = 4M +thread_cache_size = 4 +lower_case_table_names=1 +tmp_table_size = 8M +character-set-server = UTF8MB4 + +max_connections = 500 +max_connect_errors = 100 +open_files_limit = 2560 +max_allowed_packet = 128M + +#skip-external-locking +#skip-grant-tables +#loose-skip-innodb +#skip-networking +#skip-name-resolve + +log-bin=mysql-bin +slow_query_log=1 +slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log +long_query_time=3 +#log_queries_not_using_indexes=on + +relay-log=mdserver +relay-log-index=mdserver + +#master +#sync_binlog=1 + +#binlog-do-db +binlog-ignore-db = test +binlog-ignore-db = mysql +binlog-ignore-db = information_schema +binlog-ignore-db = performance_schema + +#slave +log_replica_updates +#replicate-do-db +replica_skip_errors=1062,1396 +replicate-ignore-db = information_schema +replicate-ignore-db = performance_schema +replicate-ignore-db = mysql +replicate-ignore-db = test + +default_storage_engine = InnoDB +innodb_data_home_dir = {$SERVER_APP_PATH}/data +innodb_data_file_path = ibdata1:10M:autoextend +innodb_log_group_home_dir = {$SERVER_APP_PATH}/data +innodb_buffer_pool_size = 16M +innodb_redo_log_capacity=10485760 +innodb_log_buffer_size = 8M +innodb_flush_log_at_trx_commit = 1 +innodb_lock_wait_timeout = 120 +innodb_max_dirty_pages_pct = 90 +innodb_read_io_threads = 1 +innodb_write_io_threads = 1 +innodb_file_per_table=1 +binlog_expire_logs_seconds=2592000 + +secure-file-priv={$SERVER_APP_PATH}/tmp + +[mysqldump] +quick + +[mysql] +no-auto-rehash + +[myisamchk] +key_buffer_size = 20M +sort_buffer_size = 20M +read_buffer = 2M +write_buffer = 2M + +[mysqlhotcopy] +interactive-timeout \ No newline at end of file From 0fd5ef28e20798e75c12e283c6f55034e96fd8f4 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 14:42:57 +0800 Subject: [PATCH 027/146] Update index.py --- plugins/mysql-apt/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mysql-apt/index.py b/plugins/mysql-apt/index.py index f80c35f34c..c4dd294d8e 100755 --- a/plugins/mysql-apt/index.py +++ b/plugins/mysql-apt/index.py @@ -399,7 +399,7 @@ def getShowLogFile(): return tmp.groups()[0].strip() def getMdb8Ver(): - return ['8.0','8.1','8.2','8.3','8.4'] + return ['8.0','8.1','8.2','8.3','8.4','9.0'] def pGetDbUser(): if mw.isAppleSystem(): From 8a5e2a45dc266b536f5a4b28ec0c9e2cde2c5992 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 14:52:50 +0800 Subject: [PATCH 028/146] update --- plugins/mysql-apt/init.d/mysql8.4.service.tpl | 1 - plugins/mysql-apt/init.d/mysql9.0.service.tpl | 50 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 plugins/mysql-apt/init.d/mysql9.0.service.tpl diff --git a/plugins/mysql-apt/init.d/mysql8.4.service.tpl b/plugins/mysql-apt/init.d/mysql8.4.service.tpl index dcdca9d0e6..e6e6896925 100644 --- a/plugins/mysql-apt/init.d/mysql8.4.service.tpl +++ b/plugins/mysql-apt/init.d/mysql8.4.service.tpl @@ -35,7 +35,6 @@ WantedBy=multi-user.target User=mysql Group=mysql Type=notify -#ExecStartPre=+/usr/share/mysql-8.0/mysql-systemd-start pre ExecStart={$SERVER_PATH}/mysql-apt/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-apt/etc/my.cnf TimeoutSec=0 LimitNOFILE = 10000 diff --git a/plugins/mysql-apt/init.d/mysql9.0.service.tpl b/plugins/mysql-apt/init.d/mysql9.0.service.tpl new file mode 100644 index 0000000000..dcdca9d0e6 --- /dev/null +++ b/plugins/mysql-apt/init.d/mysql9.0.service.tpl @@ -0,0 +1,50 @@ +# Copyright (c) 2015, 2022, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, +# as published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an additional +# permission to link the program and your derivative works with the +# separately licensed software that they have included with MySQL. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# MySQL systemd service file + +[Unit] +Description=MySQL Community Server +Documentation=man:mysqld(8) +Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html +After=network.target + +[Install] +WantedBy=multi-user.target + +[Service] +User=mysql +Group=mysql +Type=notify +#ExecStartPre=+/usr/share/mysql-8.0/mysql-systemd-start pre +ExecStart={$SERVER_PATH}/mysql-apt/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-apt/etc/my.cnf +TimeoutSec=0 +LimitNOFILE = 10000 +Restart=on-failure +RestartPreventExitStatus=1 + +# Always restart when mysqld exits with exit code of 16. This special exit code +# is used by mysqld for RESTART SQL. +RestartForceExitStatus=16 + +# Set enviroment variable MYSQLD_PARENT_PID. This is required for restart. +Environment=MYSQLD_PARENT_PID=1 From c6b5a92e7d5422fbdff2a2de8bbb05af66475f02 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 14:54:47 +0800 Subject: [PATCH 029/146] Update mysql9.0.service.tpl --- plugins/mysql-apt/init.d/mysql9.0.service.tpl | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/mysql-apt/init.d/mysql9.0.service.tpl b/plugins/mysql-apt/init.d/mysql9.0.service.tpl index dcdca9d0e6..e6e6896925 100644 --- a/plugins/mysql-apt/init.d/mysql9.0.service.tpl +++ b/plugins/mysql-apt/init.d/mysql9.0.service.tpl @@ -35,7 +35,6 @@ WantedBy=multi-user.target User=mysql Group=mysql Type=notify -#ExecStartPre=+/usr/share/mysql-8.0/mysql-systemd-start pre ExecStart={$SERVER_PATH}/mysql-apt/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-apt/etc/my.cnf TimeoutSec=0 LimitNOFILE = 10000 From 3ba6d5c3c4feab82d4c117e251aea85c6dfaeb1f Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 15:04:00 +0800 Subject: [PATCH 030/146] Update index.py --- plugins/mysql-apt/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mysql-apt/index.py b/plugins/mysql-apt/index.py index c4dd294d8e..4af1d31db0 100755 --- a/plugins/mysql-apt/index.py +++ b/plugins/mysql-apt/index.py @@ -2501,7 +2501,7 @@ def updateSlaveSSH(version=''): def getSlaveList(version=''): query_status_cmd = 'show slave status' - mdb8 = ['8.0','8.1','8.2','8.3','8.4'] + mdb8 = mw.getMdb8Ver() if mw.inArray(mdb8, version): query_status_cmd = 'show replica status' From 83810a8dd8fde04a5142a96380393268b2242042 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 15:05:11 +0800 Subject: [PATCH 031/146] Update index.py --- plugins/mysql-apt/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mysql-apt/index.py b/plugins/mysql-apt/index.py index 4af1d31db0..feca1176b6 100755 --- a/plugins/mysql-apt/index.py +++ b/plugins/mysql-apt/index.py @@ -2501,7 +2501,7 @@ def updateSlaveSSH(version=''): def getSlaveList(version=''): query_status_cmd = 'show slave status' - mdb8 = mw.getMdb8Ver() + mdb8 = getMdb8Ver() if mw.inArray(mdb8, version): query_status_cmd = 'show replica status' From b26717eab3a245b56549ed2f45d2285e2b0eb830 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 15:08:54 +0800 Subject: [PATCH 032/146] Create my9.0.cnf --- plugins/mysql/conf/my9.0.cnf | 113 +++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 plugins/mysql/conf/my9.0.cnf diff --git a/plugins/mysql/conf/my9.0.cnf b/plugins/mysql/conf/my9.0.cnf new file mode 100644 index 0000000000..5a42de1cc9 --- /dev/null +++ b/plugins/mysql/conf/my9.0.cnf @@ -0,0 +1,113 @@ +[client] +user = root +#password = your_password +port = 3306 +socket = {$SERVER_APP_PATH}/mysql.sock +default-character-set = UTF8MB4 + +[mysqld] +!include {$SERVER_APP_PATH}/etc/mode/classic.cnf + +authentication_policy=caching_sha2_password +pid-file = {$SERVER_APP_PATH}/data/mysql.pid +user = mysql +port = 3306 +socket = {$SERVER_APP_PATH}/mysql.sock +basedir = {$SERVER_APP_PATH} +datadir = {$SERVER_APP_PATH}/data +log-error = {$SERVER_APP_PATH}/data/error.log +server-id = {$SERVER_ID} +#sql-mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES + +default_storage_engine = InnoDB + +key_buffer_size = 8M +table_open_cache = 32 +sort_buffer_size = 256K +net_buffer_length = 4K +read_buffer_size = 128K +read_rnd_buffer_size = 256K +myisam_sort_buffer_size = 4M +thread_cache_size = 4 +lower_case_table_names=0 +tmp_table_size = 8M +character-set-server = UTF8MB4 + +max_connections = 500 +max_connect_errors = 100 +open_files_limit = 2560 +max_allowed_packet = 128M + +skip_name_resolve=1 +#skip-networking +#skip-external-locking +#loose-skip-innodb +#skip-grant-tables + +log-bin=mysql-bin +slow_query_log=1 +slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log +long_query_time=10 +#log_queries_not_using_indexes=1 +#log_slow_admin_statements=1 +#log_slow_replica_statements=1 +binlog_expire_logs_seconds=2592000 + +relay-log=mdserver +relay-log-index=mdserver + +#多主设置 +#auto_increment_offset=2 +#auto_increment_increment=2 + +#master +#sync_binlog=1 + +#binlog-do-db +binlog-ignore-db = test +binlog-ignore-db = mysql +binlog-ignore-db = information_schema +binlog-ignore-db = performance_schema + +#slave +log_replica_updates = 1 +# Prevent replication from starting automatically with MySQL +#skip_replica_start = 1 +#replicate-do-db +replica_skip_errors=1062,1396 +replicate-ignore-db = information_schema +replicate-ignore-db = performance_schema +replicate-ignore-db = mysql +replicate-ignore-db = test + + +innodb_data_home_dir = {$SERVER_APP_PATH}/data +innodb_data_file_path = ibdata1:10M:autoextend +innodb_log_group_home_dir = {$SERVER_APP_PATH}/data +innodb_buffer_pool_size = 16M +#innodb_log_file_size = 5M +innodb_redo_log_capacity=10485760 +innodb_log_buffer_size = 8M +innodb_flush_log_at_trx_commit = 1 +innodb_lock_wait_timeout = 120 +innodb_max_dirty_pages_pct = 90 +innodb_read_io_threads = 1 +innodb_write_io_threads = 1 +innodb_file_per_table=1 + +secure-file-priv={$SERVER_APP_PATH}/tmp + +[mysqldump] +quick + +[mysql] +no-auto-rehash + +[myisamchk] +key_buffer_size = 20M +sort_buffer_size = 20M +read_buffer = 2M +write_buffer = 2M + +[mysqlhotcopy] +interactive-timeout \ No newline at end of file From 68e9ffffe329b55844a3e3450add6f21cdcd7c1c Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 15:14:13 +0800 Subject: [PATCH 033/146] Update index.py --- plugins/mysql-apt/index.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/mysql-apt/index.py b/plugins/mysql-apt/index.py index feca1176b6..f7107140c4 100755 --- a/plugins/mysql-apt/index.py +++ b/plugins/mysql-apt/index.py @@ -3499,6 +3499,10 @@ def installPreInspection(version): if sysName == 'debian' and sysId == '12' and version == '8.0': return 'debian12,暂时不支持8.0' + if version == '9.0': + if sysName == 'debian' and sysId != '12' + return '9.0 仅支持debian12' + if (sysName == 'ubuntu' and version == '5.7' and not sysId in ('18.04')): return "Ubuntu Apt MySQL[" + version + "] 仅支持18.04" From 258576963df0c1ddda93ad57c4a0219dfc45603b Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 15:14:52 +0800 Subject: [PATCH 034/146] Update index.py --- plugins/mysql/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index d77cb9cd24..7e469cc498 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -430,7 +430,7 @@ def getShowLogFile(): def getMdb8Ver(): - return ['8.0','8.1','8.2','8.3','8.4'] + return ['8.0','8.1','8.2','8.3','8.4','9.0'] def pGetDbUser(): if mw.isAppleSystem(): From 2dba6e68165c28adf1cc365d8d11fa4dc8de91e2 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 15:17:37 +0800 Subject: [PATCH 035/146] Update index.py --- plugins/mysql-apt/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mysql-apt/index.py b/plugins/mysql-apt/index.py index f7107140c4..e93821418f 100755 --- a/plugins/mysql-apt/index.py +++ b/plugins/mysql-apt/index.py @@ -3500,7 +3500,7 @@ def installPreInspection(version): return 'debian12,暂时不支持8.0' if version == '9.0': - if sysName == 'debian' and sysId != '12' + if sysName == 'debian' and sysId != '12': return '9.0 仅支持debian12' if (sysName == 'ubuntu' and version == '5.7' and not sysId in ('18.04')): From 79a44f4b151c398c98654ffe175a3d3ac7b9c162 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 15:21:48 +0800 Subject: [PATCH 036/146] Update index.py --- plugins/mysql-apt/index.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/mysql-apt/index.py b/plugins/mysql-apt/index.py index e93821418f..aa53f6400c 100755 --- a/plugins/mysql-apt/index.py +++ b/plugins/mysql-apt/index.py @@ -3502,6 +3502,8 @@ def installPreInspection(version): if version == '9.0': if sysName == 'debian' and sysId != '12': return '9.0 仅支持debian12' + if sysName == 'ubuntu' and sysId != '24.04': + return '9.0 仅支持ubuntu24.04' if (sysName == 'ubuntu' and version == '5.7' and not sysId in ('18.04')): return "Ubuntu Apt MySQL[" + version + "] 仅支持18.04" From 8427a0d9bec33834cae71af407a789b4672ccc40 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 16:00:07 +0800 Subject: [PATCH 037/146] update --- plugins/mysql-yum/conf/my9.0.cnf | 104 ++++++++++++ plugins/mysql-yum/index.py | 2 +- plugins/mysql-yum/init.d/mysql9.0.service.tpl | 63 +++++++ plugins/mysql-yum/versions/9.0/install.sh | 155 ++++++++++++++++++ 4 files changed, 323 insertions(+), 1 deletion(-) create mode 100644 plugins/mysql-yum/conf/my9.0.cnf create mode 100644 plugins/mysql-yum/init.d/mysql9.0.service.tpl create mode 100755 plugins/mysql-yum/versions/9.0/install.sh diff --git a/plugins/mysql-yum/conf/my9.0.cnf b/plugins/mysql-yum/conf/my9.0.cnf new file mode 100644 index 0000000000..fe2adacbcc --- /dev/null +++ b/plugins/mysql-yum/conf/my9.0.cnf @@ -0,0 +1,104 @@ +[client] +user = root +#password = your_password +port = 33206 +socket = {$SERVER_APP_PATH}/mysql.sock +default-character-set = UTF8MB4 + +[mysqld] +!include {$SERVER_APP_PATH}/etc/mode/classic.cnf +#mysql_native_password=ON +authentication_policy=caching_sha2_password +pid-file = {$SERVER_APP_PATH}/data/mysql.pid +user = mysql +port = 33206 +#mysqlx_port = 33260 +socket = {$SERVER_APP_PATH}/mysql.sock +datadir = {$SERVER_APP_PATH}/data +log-error = {$SERVER_APP_PATH}/data/error.log +server-id = {$SERVER_ID} + +default_storage_engine = InnoDB + +key_buffer_size = 8M +table_open_cache = 32 +sort_buffer_size = 256K +net_buffer_length = 4K +read_buffer_size = 128K +read_rnd_buffer_size = 256K +myisam_sort_buffer_size = 4M +thread_cache_size = 4 +lower_case_table_names=1 +tmp_table_size = 8M +character-set-server = UTF8MB4 + +max_connections = 500 +max_connect_errors = 100 +open_files_limit = 2560 +max_allowed_packet = 128M + +#skip-external-locking +#skip-grant-tables +#loose-skip-innodb +#skip-networking +#skip-name-resolve + +log-bin=mysql-bin +slow_query_log=1 +slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log +long_query_time=3 +#log_queries_not_using_indexes=on + +relay-log=mdserver +relay-log-index=mdserver + +#master +#binlog-do-db +#sync_binlog=1 + +binlog-ignore-db = test +binlog-ignore-db = mysql +binlog-ignore-db = information_schema +binlog-ignore-db = performance_schema + +#slave +log_replica_updates +#replicate-do-db +replica_skip_errors=1062,1396 +replicate-ignore-db = information_schema +replicate-ignore-db = performance_schema +replicate-ignore-db = mysql +replicate-ignore-db = test + + +default_storage_engine = InnoDB +innodb_data_home_dir = {$SERVER_APP_PATH}/data +innodb_data_file_path = ibdata1:10M:autoextend +innodb_log_group_home_dir = {$SERVER_APP_PATH}/data +innodb_buffer_pool_size = 16M +innodb_redo_log_capacity=10485760 +innodb_log_buffer_size = 8M +innodb_flush_log_at_trx_commit = 1 +innodb_lock_wait_timeout = 120 +innodb_max_dirty_pages_pct = 90 +innodb_read_io_threads = 1 +innodb_write_io_threads = 1 +innodb_file_per_table=1 +binlog_expire_logs_seconds=2592000 + +secure-file-priv={$SERVER_APP_PATH}/tmp + +[mysqldump] +quick + +[mysql] +no-auto-rehash + +[myisamchk] +key_buffer_size = 20M +sort_buffer_size = 20M +read_buffer = 2M +write_buffer = 2M + +[mysqlhotcopy] +interactive-timeout \ No newline at end of file diff --git a/plugins/mysql-yum/index.py b/plugins/mysql-yum/index.py index 16646fe528..2ce17b7b34 100755 --- a/plugins/mysql-yum/index.py +++ b/plugins/mysql-yum/index.py @@ -390,7 +390,7 @@ def getShowLogFile(): return tmp.groups()[0].strip() def getMdb8Ver(): - return ['8.0','8.1','8.2','8.3','8.4'] + return ['8.0','8.1','8.2','8.3','8.4','9.0'] def pGetDbUser(): if mw.isAppleSystem(): diff --git a/plugins/mysql-yum/init.d/mysql9.0.service.tpl b/plugins/mysql-yum/init.d/mysql9.0.service.tpl new file mode 100644 index 0000000000..a1a05ecf25 --- /dev/null +++ b/plugins/mysql-yum/init.d/mysql9.0.service.tpl @@ -0,0 +1,63 @@ +# It's not recommended to modify this file in-place, because it will be +# overwritten during package upgrades. If you want to customize, the +# best way is to use systemctl edit: +# +# $ systemctl edit mysqld.service +# +# this will create file +# +# /etc/systemd/system/mysqld.service.d/override.conf +# +# which be parsed after the file mysqld.service itself is parsed. +# +# For example, if you want to increase mysql's open-files-limit to 20000 +# add following when editing with command above: +# +# [Service] +# LimitNOFILE=20000 +# +# Or if you require to execute pre and post scripts in the unit file as root, set +# PermissionsStartOnly=true +# +# For more info about custom unit files, see systemd.unit(5) or +# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F +# +# Don't forget to reload systemd daemon after you change unit configuration: +# root> systemctl --system daemon-reload + +[Unit] +Description=MySQL 8.0 database server +After=syslog.target +After=network.target + +[Service] +Type=notify +User=mysql +Group=mysql + +#ExecStartPre=/usr/libexec/mysql-check-socket +#ExecStartPre=/usr/libexec/mysql-prepare-db-dir %n +# Note: we set --basedir to prevent probes that might trigger SELinux alarms, +# per bug #547485 +ExecStart={$SERVER_PATH}/mysql-yum/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-yum/etc/my.cnf --basedir={$SERVER_PATH}/mysql-yum/bin/usr --user=mysql +#ExecStartPost=/usr/libexec/mysql-check-upgrade +#ExecStopPost=/usr/libexec/mysql-wait-stop + +# Give a reasonable amount of time for the server to start up/shut down +TimeoutSec=300 + +# Place temp files in a secure directory, not /tmp +PrivateTmp=false + +Restart=on-failure + +RestartPreventExitStatus=1 + +# Sets open_files_limit +LimitNOFILE = 10000 + +# Set enviroment variable MYSQLD_PARENT_PID. This is required for SQL restart command. +Environment=MYSQLD_PARENT_PID=1 + +[Install] +WantedBy=multi-user.target diff --git a/plugins/mysql-yum/versions/9.0/install.sh b/plugins/mysql-yum/versions/9.0/install.sh new file mode 100755 index 0000000000..f5b96f676b --- /dev/null +++ b/plugins/mysql-yum/versions/9.0/install.sh @@ -0,0 +1,155 @@ +# -*- coding: utf-8 -*- +#!/bin/bash + +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +# https://downloads.mysql.com/archives/community/ + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sysName=`uname` + + +install_tmp=${rootPath}/tmp/mw_install.pl +myDir=${serverPath}/source/mysql-yum + +ARCH=`uname -m` +ARCH_NAME='' +case $(uname -m) in + i386) ARCH_NAME="386" ;; + i686) ARCH_NAME="386" ;; + x86_64) ARCH_NAME="amd64" ;; + arm) ARCH_NAME="arm64" ;; +esac + +bash ${rootPath}/scripts/getos.sh +OSNAME=`cat ${rootPath}/data/osname.pl` +VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` +echo "VERSION_ID:${VERSION_ID}" + +OS_SIGN=1.el9 +if [ "$OSNAME" == "centos" ];then + OS_SIGN=1.el${VERSION_ID} +elif [ "$OSNAME" == "fedora" ]; then + OS_SIGN=10.fc${VERSION_ID} +elif [ "$OSNAME" == "opensuse" ]; then + OS_SIGN=1.sl${VERSION_ID:0:2} +fi + +MYSQL_VER=9.0.1 +SUFFIX_NAME=${MYSQL_VER}-${OS_SIGN}.${ARCH} + +YUM_INSTALL() +{ + +mkdir -p /var/run/mysqld +chown mysql -R /var/run/mysqld + +####### +mkdir -p $myDir + +# https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar +# https://cdn.mysql.com/archives/mysql-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar + +wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar +cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar + +mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin + +rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.x86_64.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-common-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-debuginfo-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-devel-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-embedded-compat-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-icu-data-files-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-libs-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-libs-compat-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-server-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-server-debug-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-test-${SUFFIX_NAME}.rpm | cpio -div + +####### +} + +ZYPPER_INSTALL() +{ +zypper install -y libstdc++6 + +mkdir -p /var/run/mysqld +chown mysql -R /var/run/mysqld +####### +mkdir -p $myDir + +wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar +echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar" +cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar + +mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin + +rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.x86_64.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-common-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-debuginfo-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-devel-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-embedded-compat-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-icu-data-files-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-libs-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-libs-compat-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-server-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-server-debug-${SUFFIX_NAME}.rpm | cpio -div +rpm2cpio ${myDir}/mysql-community-test-${SUFFIX_NAME}.rpm | cpio -div + +####### +} + +YUM_UNINSTALL() +{ +### YUM卸载 START ######## +# yum -y remove mysql-server +rm -rf ${myDir} +### YUM卸载 END ######## +} + + +Install_mysql() +{ + + echo '正在安装脚本文件...' > $install_tmp + mkdir -p $serverPath/mysql-yum + + mkdir -p /var/lib/mysql + chown mysql -R /var/lib/mysql/ + + isYum=`which yum` + if [ "$isYum" != "" ];then + YUM_INSTALL + fi + + isZypper=`which zypper` + if [ "$isZypper" != "" ];then + ZYPPER_INSTALL + fi + + rm -rf $myDir + + echo '9.0' > $serverPath/mysql-yum/version.pl + echo '安装完成' +} + +Uninstall_mysql() +{ + YUM_UNINSTALL + rm -rf $serverPath/mysql-yum + echo '卸载完成' +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_mysql +else + Uninstall_mysql +fi From e08bea00eb08411caced1378a12fbaee5338374d Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 16:17:00 +0800 Subject: [PATCH 038/146] Update info.json --- plugins/postgresql/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/postgresql/info.json b/plugins/postgresql/info.json index 6bc549b70c..a501187f81 100755 --- a/plugins/postgresql/info.json +++ b/plugins/postgresql/info.json @@ -4,7 +4,7 @@ "tip":"soft", "name":"postgresql", "type":"运行环境", - "ps":"[DEV]功能强大的开源数据库", + "ps":"功能强大的开源数据库", "coexist": false, "install_pre_inspection":true, "uninstall_pre_inspection":true, From fa8b2aefb79e19c089bc75ce9e2c51ca4b468f2b Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 18:55:29 +0800 Subject: [PATCH 039/146] Update info.json --- plugins/mysql-yum/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mysql-yum/info.json b/plugins/mysql-yum/info.json index 847c185ec1..7730019a3c 100755 --- a/plugins/mysql-yum/info.json +++ b/plugins/mysql-yum/info.json @@ -5,7 +5,7 @@ "name":"mysql-yum", "type":"运行环境", "ps":"一种关系数据库管理系统[centos](极速安装)", - "versions":["5.7","8.0","8.2","8.3", "8.4"], + "versions":["5.7","8.0","8.2","8.3", "8.4", "9.0"], "shell":"install.sh", "install_pre_inspection":true, "uninstall_pre_inspection":true, From 3d12bbcdd13cc0d147526d5b65e915ad2cff2d62 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 20:43:06 +0800 Subject: [PATCH 040/146] Update info.json --- plugins/phpmyadmin/info.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/phpmyadmin/info.json b/plugins/phpmyadmin/info.json index 33307f86c6..aca67be2af 100755 --- a/plugins/phpmyadmin/info.json +++ b/plugins/phpmyadmin/info.json @@ -5,8 +5,8 @@ "type":"运行环境", "ps":"著名Web端MySQL管理工具", "to_ver":["4.8.4"], - "versions":["4.4.15","4.9.10","5.2.0"], - "updates":["4.4.15","4.9.10","5.2.0"], + "versions":["4.4.15","4.9.10","5.2.1"], + "updates":["4.4.15","4.9.10","5.2.1"], "shell":"install.sh", "checks":"server/phpmyadmin", "path": "server/phpmyadmin", From 4eb33806bf5ddb373d031c662055f5c7cdc540e5 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 20:43:32 +0800 Subject: [PATCH 041/146] Update info.json --- plugins/phpmyadmin/info.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/phpmyadmin/info.json b/plugins/phpmyadmin/info.json index aca67be2af..b21d911099 100755 --- a/plugins/phpmyadmin/info.json +++ b/plugins/phpmyadmin/info.json @@ -5,8 +5,8 @@ "type":"运行环境", "ps":"著名Web端MySQL管理工具", "to_ver":["4.8.4"], - "versions":["4.4.15","4.9.10","5.2.1"], - "updates":["4.4.15","4.9.10","5.2.1"], + "versions":["4.4.15","4.9.11","5.2.1"], + "updates":["4.4.15","4.9.11","5.2.1"], "shell":"install.sh", "checks":"server/phpmyadmin", "path": "server/phpmyadmin", From 9720cf7a693e69d77f5394099d7651f1dde58c8a Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 21:22:35 +0800 Subject: [PATCH 042/146] update --- plugins/php-apt/info.json | 2 +- plugins/php-apt/install.sh | 1 - plugins/php-apt/versions/84/install.sh | 49 +++++++++++++++ plugins/php-apt/versions/phplib.conf | 84 +++++++++++++++++--------- 4 files changed, 107 insertions(+), 29 deletions(-) create mode 100755 plugins/php-apt/versions/84/install.sh diff --git a/plugins/php-apt/info.json b/plugins/php-apt/info.json index d8fc8540d1..1859e1833f 100755 --- a/plugins/php-apt/info.json +++ b/plugins/php-apt/info.json @@ -5,7 +5,7 @@ "name": "php-apt", "title": "PHP[APT]", "coexist": true, - "versions": ["56","70","71","72","73","74","80","81","82","83"], + "versions": ["56","70","71","72","73","74","80","81","82","83","84"], "install_pre_inspection":true, "tip": "soft", "checks": "server/php-apt/VERSION", diff --git a/plugins/php-apt/install.sh b/plugins/php-apt/install.sh index 2784c20d59..071fe921e9 100755 --- a/plugins/php-apt/install.sh +++ b/plugins/php-apt/install.sh @@ -44,7 +44,6 @@ if [ ! -d $curPath/versions/$2 ];then fi - if [ "$OSNAME" == "ubuntu" ];then find_source=`ls /etc/apt/sources.list.d | grep ondrej-ubuntu-php` if [ "$find_source" == "" ];then diff --git a/plugins/php-apt/versions/84/install.sh b/plugins/php-apt/versions/84/install.sh new file mode 100755 index 0000000000..d1ee9485a6 --- /dev/null +++ b/plugins/php-apt/versions/84/install.sh @@ -0,0 +1,49 @@ +#!/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") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source +sysName=`uname` +install_tmp=${rootPath}/tmp/mw_install.pl + + +#获取信息和版本 +# bash /www/server/mdsever-web/scripts/getos.sh +bash ${rootPath}/scripts/getos.sh +OSNAME=`cat ${rootPath}/data/osname.pl` +VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` + +version=8.3 +PHP_VER=83 + + +Install_php() +{ +#------------------------ install start ------------------------------------# +apt -y install php${version} php${version}-fpm php${version}-dev +if [ "$?" == "0" ];then + mkdir -p $serverPath/php-apt/${PHP_VER} +fi + +#------------------------ install end ------------------------------------# +} + +Uninstall_php() +{ +#------------------------ uninstall start ------------------------------------# +apt -y remove php${version} php${version}-* +rm -rf $serverPath/php-apt/${PHP_VER} +echo "卸载php-${version}..." +#------------------------ uninstall start ------------------------------------# +} + +action=${1} +if [ "${1}" == 'install' ];then + Install_php +else + Uninstall_php +fi diff --git a/plugins/php-apt/versions/phplib.conf b/plugins/php-apt/versions/phplib.conf index 717d18842e..29650d8f95 100755 --- a/plugins/php-apt/versions/phplib.conf +++ b/plugins/php-apt/versions/phplib.conf @@ -11,7 +11,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "数据库", "msg": "数据库访问抽象模块!", @@ -30,7 +31,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "数据库", "msg": "用于使用MySQL数据库的模块!", @@ -49,7 +51,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "数据库", "msg": "用于使用MySQL数据库的模块!", @@ -68,7 +71,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "数据库", "msg": "用于使用sqlite3数据库的模块!", @@ -95,7 +99,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "数据库", "msg": "用于使用ODBC数据库的模块!", @@ -148,7 +153,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "缓存器", "msg": "用于加速PHP脚本!", @@ -163,7 +169,7 @@ "73", "74", "80", - "81" + "81", ], "type": "通用扩展", "msg": "加密软件!", @@ -182,7 +188,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "通用扩展", "msg": "高精度计算!", @@ -199,7 +206,10 @@ "73", "74", "80", - "81" + "81", + "82", + "83", + "84" ], "type": "通用扩展", "msg": "用于FILE!", @@ -216,7 +226,10 @@ "73", "74", "80", - "81" + "81", + "82", + "83", + "84" ], "type": "通用扩展", "msg": "用于图像文件格式!", @@ -235,7 +248,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "通用扩展", "msg": "序列化扩展!", @@ -266,7 +280,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "通用扩展", "msg": "通用CURL库!", @@ -280,7 +295,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "通用扩展", "msg": "通用GD库!", @@ -299,7 +315,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "通用扩展", "msg": "提供国际化支持", @@ -330,7 +347,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "缓存器", "msg": "强大的内容缓存器,支持集群", @@ -349,7 +367,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "缓存器", "msg": "更强大的内容缓存器,支持集群", @@ -368,7 +387,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "缓存器", "msg": "脚本缓存器", @@ -387,7 +407,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "通用扩展", "msg": "比GD更强大的图形库", @@ -406,7 +427,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "调试器", "msg": "不多说,不了解的不要安装", @@ -425,7 +447,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "性能分析", "msg": "不多说,不了解的不要安装!", @@ -444,7 +467,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "通用扩展", "msg": "异步、并行、高性能网络通信引擎", @@ -506,7 +530,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "框架", "msg": "Yar是一个RPC框架", @@ -535,7 +560,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "通用扩展", "msg": "Mongodb数据库连接驱动", @@ -588,7 +614,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "日志", "msg": "SeasLog高性能日志记录", @@ -607,7 +634,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "通用扩展", "msg": "用于需要多字节字符串处理的模块", @@ -626,7 +654,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "压缩", "msg": "压缩组件", @@ -644,7 +673,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "压缩", "msg": "压缩组件", From c7a8ca2ec959d9f8963d09228fd57d6ab3d57056 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 21:23:56 +0800 Subject: [PATCH 043/146] Update install.sh --- plugins/php-apt/versions/84/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/php-apt/versions/84/install.sh b/plugins/php-apt/versions/84/install.sh index d1ee9485a6..17027048bf 100755 --- a/plugins/php-apt/versions/84/install.sh +++ b/plugins/php-apt/versions/84/install.sh @@ -17,8 +17,8 @@ bash ${rootPath}/scripts/getos.sh OSNAME=`cat ${rootPath}/data/osname.pl` VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` -version=8.3 -PHP_VER=83 +version=8.4 +PHP_VER=84 Install_php() From b220628ca128d3b3f8663bc01ae7e8e741a637ce Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 21:28:12 +0800 Subject: [PATCH 044/146] Update phplib.conf --- plugins/php-apt/versions/phplib.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/php-apt/versions/phplib.conf b/plugins/php-apt/versions/phplib.conf index 29650d8f95..42b5f6ba2c 100755 --- a/plugins/php-apt/versions/phplib.conf +++ b/plugins/php-apt/versions/phplib.conf @@ -169,7 +169,7 @@ "73", "74", "80", - "81", + "81" ], "type": "通用扩展", "msg": "加密软件!", From 1d48010a0d66e2d76089d194fcfab010310404d2 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 21:31:47 +0800 Subject: [PATCH 045/146] Update phplib.conf --- plugins/php-apt/versions/phplib.conf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/php-apt/versions/phplib.conf b/plugins/php-apt/versions/phplib.conf index 42b5f6ba2c..dd1380baac 100755 --- a/plugins/php-apt/versions/phplib.conf +++ b/plugins/php-apt/versions/phplib.conf @@ -266,7 +266,10 @@ "73", "74", "80", - "81" + "81", + "82", + "83", + "84" ], "type": "通用扩展", "msg": "用于xml解析!", From a886359e9433cd30e446b21cee9eb612351e4f85 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 21:35:43 +0800 Subject: [PATCH 046/146] Update yar.sh --- plugins/php-apt/versions/common/yar.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/php-apt/versions/common/yar.sh b/plugins/php-apt/versions/common/yar.sh index a73a0a0680..686f1cce06 100755 --- a/plugins/php-apt/versions/common/yar.sh +++ b/plugins/php-apt/versions/common/yar.sh @@ -17,10 +17,18 @@ sysName=`uname` LIBNAME=yar LIBV=2.3.2 -if [ `echo "$version < 7.0"|bc` -eq 1 ];then +if [[ "$version" =~ "8.0" ]];then + LIBV=3.3.6 +fi + +if [[ "$version" =~ "5.0" ]];then LIBV=1.2.5 fi +if [[ "$version" =~ "7.0" ]];then + LIBV=2.3.2 +fi + extVer=`bash $curPath/lib.sh $version` extFile=/usr/lib/php/${extVer}/${LIBNAME}.so From 95dcd4c04dd3dd89a6d54100339f1af9e1f751a4 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 21:42:16 +0800 Subject: [PATCH 047/146] Update yaf.sh --- plugins/php-apt/versions/common/yaf.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/php-apt/versions/common/yaf.sh b/plugins/php-apt/versions/common/yaf.sh index 031923ec24..ccbca3c911 100755 --- a/plugins/php-apt/versions/common/yaf.sh +++ b/plugins/php-apt/versions/common/yaf.sh @@ -15,14 +15,12 @@ version=$2 sysName=`uname` LIBNAME=yaf -LIBV=3.3.5 - +LIBV=3.3.6 if [ `echo "$version < 7.0"|bc` -eq 1 ];then LIBV=2.3.5 fi - extVer=`bash $curPath/lib.sh $version` extFile=/usr/lib/php/${extVer}/${LIBNAME}.so From 93ddd3c2c48177d9673d76fb21d6da546f83e44b Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 21:42:42 +0800 Subject: [PATCH 048/146] Update yar.sh --- plugins/php-apt/versions/common/yar.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/plugins/php-apt/versions/common/yar.sh b/plugins/php-apt/versions/common/yar.sh index 686f1cce06..4e1aaa64af 100755 --- a/plugins/php-apt/versions/common/yar.sh +++ b/plugins/php-apt/versions/common/yar.sh @@ -15,18 +15,14 @@ version=$2 sysName=`uname` LIBNAME=yar -LIBV=2.3.2 - -if [[ "$version" =~ "8.0" ]];then - LIBV=3.3.6 -fi +LIBV=2.3.3 if [[ "$version" =~ "5.0" ]];then LIBV=1.2.5 fi if [[ "$version" =~ "7.0" ]];then - LIBV=2.3.2 + LIBV=2.3.3 fi extVer=`bash $curPath/lib.sh $version` From d26f840b689e529f9c86cbf6d65170ae5d7bcb48 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 21:43:52 +0800 Subject: [PATCH 049/146] Update phplib.conf --- plugins/php-apt/versions/phplib.conf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/php-apt/versions/phplib.conf b/plugins/php-apt/versions/phplib.conf index dd1380baac..26051a2fc8 100755 --- a/plugins/php-apt/versions/phplib.conf +++ b/plugins/php-apt/versions/phplib.conf @@ -499,7 +499,10 @@ "73", "74", "80", - "81" + "81", + "82", + "83", + "84" ], "type": "框架", "msg": "Yaf是一个C语言编写的PHP框架", From 2cd41b91f56038383d45fad400f14d1cd71f6abe Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 21:47:58 +0800 Subject: [PATCH 050/146] Create install.sh --- plugins/php/versions/84/install.sh | 157 +++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100755 plugins/php/versions/84/install.sh diff --git a/plugins/php/versions/84/install.sh b/plugins/php/versions/84/install.sh new file mode 100755 index 0000000000..8aa91203da --- /dev/null +++ b/plugins/php/versions/84/install.sh @@ -0,0 +1,157 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin +export PATH=$PATH:/opt/homebrew/bin + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source +sysName=`uname` +install_tmp=${rootPath}/tmp/mw_install.pl + +function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; } +function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" == "$1"; } +function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; } +function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; } + +version=8.4 +PHP_VER=84 +Install_php() +{ +#------------------------ install start ------------------------------------# +echo "安装php-${version} ..." > $install_tmp +mkdir -p $sourcePath/php +mkdir -p $serverPath/php + +cd ${rootPath}/plugins/php/lib && /bin/bash freetype_new.sh +cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh + +# redat ge 8 +which yum +if [ "$?" == "0" ];then + cd ${rootPath}/plugins/php/lib && /bin/bash oniguruma.sh +fi + +if [ ! -d $sourcePath/php/php${PHP_VER} ];then + + + if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then + wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://www.php.net/distributions/php-${version}.tar.xz + fi + + #检测文件是否损坏. + md5_file_ok=xxx + if [ -f $sourcePath/php/php-${version}.tar.xz ];then + md5_file=`sha256sum $sourcePath/php/php-${version}.tar.xz | awk '{print $1}'` + if [ "${md5_file}" != "${md5_file_ok}" ]; then + echo "PHP${version} 下载文件不完整,重新安装" + rm -rf $sourcePath/php/php-${version}.tar.xz + fi + fi + + cd $sourcePath/php && tar -Jxf $sourcePath/php/php-${version}.tar.xz + mv $sourcePath/php/php-${version} $sourcePath/php/php${PHP_VER} +fi + +cd $sourcePath/php/php${PHP_VER} + +OPTIONS='--without-iconv' +if [ $sysName == 'Darwin' ]; then + OPTIONS="${OPTIONS} --with-curl" +else + OPTIONS="${OPTIONS} --with-curl" + OPTIONS="${OPTIONS} --with-readline" +fi + +argon_version=`pkg-config libargon2 --modversion` +if [ "$?" == "0" ];then + OPTIONS="${OPTIONS} --with-password-argon2" +fi + +IS_64BIT=`getconf LONG_BIT` +if [ "$IS_64BIT" == "64" ];then + OPTIONS="${OPTIONS} --with-libdir=lib64" +fi + +# ----- cpu start ------ +if [ -z "${cpuCore}" ]; then + cpuCore="1" +fi + +if [ -f /proc/cpuinfo ];then + cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l` +fi + +MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}') +if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then + if [ "${cpuCore}" -gt "${MEM_INFO}" ];then + cpuCore="${MEM_INFO}" + fi +else + cpuCore="1" +fi + +if [ "$cpuCore" -gt "2" ];then + cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'` +else + cpuCore="1" +fi +# ----- cpu end ------ + +ZIP_OPTION='--with-zip' +libzip_version=`pkg-config libzip --modversion` +if version_lt "$libzip_version" "0.11.0" ;then + cd ${rootPath}/plugins/php/lib && /bin/bash libzip.sh + export PKG_CONFIG_PATH=$serverPath/lib/libzip/lib/pkgconfig + ZIP_OPTION="--with-zip=$serverPath/lib/libzip" +fi + + +echo "$sourcePath/php/php${PHP_VER}" + +if [ ! -d $serverPath/php/${PHP_VER} ];then + cd $sourcePath/php/php${PHP_VER} + ./buildconf --force + ./configure \ + --prefix=$serverPath/php/${PHP_VER} \ + --exec-prefix=$serverPath/php/${PHP_VER} \ + --with-config-file-path=$serverPath/php/${PHP_VER}/etc \ + --enable-mysqlnd \ + --with-mysqli=mysqlnd \ + --with-pdo-mysql=mysqlnd \ + --with-zlib-dir=$serverPath/lib/zlib \ + $ZIP_OPTION \ + --enable-mbstring \ + --enable-ftp \ + --enable-sockets \ + --enable-simplexml \ + --enable-soap \ + --enable-posix \ + --enable-sysvmsg \ + --enable-sysvsem \ + --enable-sysvshm \ + --disable-intl \ + --disable-fileinfo \ + $OPTIONS \ + --enable-fpm + make clean && make -j${cpuCore} && make install && make clean + + # rm -rf $sourcePath/php/php${PHP_VER} +fi +#------------------------ install end ------------------------------------# +} + +Uninstall_php() +{ + $serverPath/php/init.d/php${PHP_VER} stop + rm -rf $serverPath/php/${PHP_VER} + echo "卸载php-${version}..." > $install_tmp +} + +action=${1} +if [ "${1}" == 'install' ];then + Install_php +else + Uninstall_php +fi From 4d32683e66218dc1db3533e34375f41c4d3b2af6 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 21:48:30 +0800 Subject: [PATCH 051/146] 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 2f082d0c73..e18ee7292d 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -157,7 +157,7 @@ def contentReplace(content, version): def makeOpenrestyConf(): phpversions = ['00', '52', '53', '54', '55', '56', - '70', '71', '72', '73', '74', '80', '81', '82', '83'] + '70', '71', '72', '73', '74', '80', '81', '82', '83','84'] sdir = mw.getServerDir() From 552cab5632400cbe8d172f8999f82c316a4b7055 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 22:10:27 +0800 Subject: [PATCH 052/146] Update phplib.conf --- plugins/php-apt/versions/phplib.conf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/php-apt/versions/phplib.conf b/plugins/php-apt/versions/phplib.conf index 26051a2fc8..c1bc6c62b3 100755 --- a/plugins/php-apt/versions/phplib.conf +++ b/plugins/php-apt/versions/phplib.conf @@ -134,7 +134,10 @@ "71", "72", "73", - "74" + "74", + "81", + "82", + "83" ], "type": "脚本解密", "msg": "用于解密ionCube Encoder加密脚本!", From d7f710d3e02d3f3a0faba038b84771ff4401e076 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 22:12:11 +0800 Subject: [PATCH 053/146] Update phplib.conf --- plugins/php-apt/versions/phplib.conf | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/plugins/php-apt/versions/phplib.conf b/plugins/php-apt/versions/phplib.conf index c1bc6c62b3..6fd5a81479 100755 --- a/plugins/php-apt/versions/phplib.conf +++ b/plugins/php-apt/versions/phplib.conf @@ -535,12 +535,7 @@ "71", "72", "73", - "74", - "80", - "81", - "82", - "83", - "84" + "74" ], "type": "框架", "msg": "Yar是一个RPC框架", From efa989001990511df0849068dfb556653a747979 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 22:19:56 +0800 Subject: [PATCH 054/146] Update phplib.conf --- plugins/php-apt/versions/phplib.conf | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/php-apt/versions/phplib.conf b/plugins/php-apt/versions/phplib.conf index 6fd5a81479..d64cde6b07 100755 --- a/plugins/php-apt/versions/phplib.conf +++ b/plugins/php-apt/versions/phplib.conf @@ -504,8 +504,7 @@ "80", "81", "82", - "83", - "84" + "83" ], "type": "框架", "msg": "Yaf是一个C语言编写的PHP框架", @@ -520,7 +519,12 @@ "71", "72", "73", - "74" + "74", + "80", + "81", + "82", + "83", + "84" ], "type": "框架", "msg": "PHP框架", From 995fa234d9e27759ee05dc9dc6b18ed5a564e66d Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 22:24:31 +0800 Subject: [PATCH 055/146] Update phalcon.sh --- plugins/php-apt/versions/common/phalcon.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/php-apt/versions/common/phalcon.sh b/plugins/php-apt/versions/common/phalcon.sh index 0e5dbb376f..64b4003c6e 100755 --- a/plugins/php-apt/versions/common/phalcon.sh +++ b/plugins/php-apt/versions/common/phalcon.sh @@ -18,10 +18,10 @@ LIBNAME=phalcon LIBV=0 -if [ `echo "$version > 7.4"|bc` -eq 1 ];then - echo "I won't support it" - exit 0 -fi +# if [ `echo "$version > 7.4"|bc` -eq 1 ];then +# echo "I won't support it" +# exit 0 +# fi CMD='apt ' if [ "$actionType" == 'install' ];then @@ -46,6 +46,10 @@ elif [[ "$version" == '8.0' ]]; then CMD="${CMD}phalcon4" elif [[ "$version" == '8.1' ]]; then CMD="${CMD}phalcon4" +elif [[ "$version" == '8.2' ]]; then + CMD="${CMD}phalcon4" +elif [[ "$version" == '8.3' ]]; then + CMD="${CMD}phalcon4" fi $CMD From 3c6538565ec0b58d9cee05fc7be4ac062416c563 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 22:27:29 +0800 Subject: [PATCH 056/146] Update phalcon.sh --- plugins/php-apt/versions/common/phalcon.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/php-apt/versions/common/phalcon.sh b/plugins/php-apt/versions/common/phalcon.sh index 64b4003c6e..17d4b232cb 100755 --- a/plugins/php-apt/versions/common/phalcon.sh +++ b/plugins/php-apt/versions/common/phalcon.sh @@ -43,13 +43,13 @@ elif [[ "$version" == '7.3' ]]; then elif [[ "$version" == '7.4' ]]; then CMD="${CMD}phalcon4" elif [[ "$version" == '8.0' ]]; then - CMD="${CMD}phalcon4" + CMD="${CMD}phalcon5" elif [[ "$version" == '8.1' ]]; then - CMD="${CMD}phalcon4" + CMD="${CMD}phalcon5" elif [[ "$version" == '8.2' ]]; then - CMD="${CMD}phalcon4" + CMD="${CMD}phalcon5" elif [[ "$version" == '8.3' ]]; then - CMD="${CMD}phalcon4" + CMD="${CMD}phalcon5" fi $CMD From 4ce9a8cc0fbfcfa945d89106512340250808fb39 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 22:30:13 +0800 Subject: [PATCH 057/146] Update ioncube.sh --- plugins/php-apt/versions/common/ioncube.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/php-apt/versions/common/ioncube.sh b/plugins/php-apt/versions/common/ioncube.sh index dcaa6d8708..9beeb3cbf7 100755 --- a/plugins/php-apt/versions/common/ioncube.sh +++ b/plugins/php-apt/versions/common/ioncube.sh @@ -17,7 +17,7 @@ sysName=`uname` LIBNAME=ioncube LIBV=0 -if [ `echo "$version > 7.4"|bc` -eq 1 ];then +if [ `echo "$version > 8.3"|bc` -eq 1 ];then echo "I won't support it" exit 0 fi From 73f0ed73d4481465ecc6a19090a2860579bb7948 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 23 Jul 2024 23:17:02 +0800 Subject: [PATCH 058/146] update --- plugins/php-yum/info.json | 2 +- plugins/php-yum/versions/84/install.sh | 41 ++++++++++++++ plugins/php-yum/versions/phplib.conf | 78 +++++++++++++++++--------- 3 files changed, 94 insertions(+), 27 deletions(-) create mode 100755 plugins/php-yum/versions/84/install.sh diff --git a/plugins/php-yum/info.json b/plugins/php-yum/info.json index 0e96c60eda..e5c785ac44 100755 --- a/plugins/php-yum/info.json +++ b/plugins/php-yum/info.json @@ -5,7 +5,7 @@ "name": "php-yum", "title": "PHP[YUM]", "coexist": true, - "versions": ["74","80","81","82","83"], + "versions": ["74","80","81","82","83","84"], "install_pre_inspection":true, "tip": "soft", "checks": "server/php-yum/VERSION", diff --git a/plugins/php-yum/versions/84/install.sh b/plugins/php-yum/versions/84/install.sh new file mode 100755 index 0000000000..58df0b6d4c --- /dev/null +++ b/plugins/php-yum/versions/84/install.sh @@ -0,0 +1,41 @@ +#!/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") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source +sysName=`uname` +install_tmp=${rootPath}/tmp/mw_install.pl + + +version=8.4.x +PHP_VER=84 + + +Install_php() +{ +#------------------------ install start ------------------------------------# +yum install -y php83 php83-php-fpm +if [ "$?" == "0" ];then + mkdir -p $serverPath/php-yum/${PHP_VER} +fi + +#------------------------ install end ------------------------------------# +} + +Uninstall_php() +{ + yum remove -y php84 php84-php-fpm php84-* + rm -rf $serverPath/php-yum/${PHP_VER} + echo "卸载php-${version}..." > $install_tmp +} + +action=${1} +if [ "${1}" == 'install' ];then + Install_php +else + Uninstall_php +fi diff --git a/plugins/php-yum/versions/phplib.conf b/plugins/php-yum/versions/phplib.conf index c50c806256..b466e78b5c 100755 --- a/plugins/php-yum/versions/phplib.conf +++ b/plugins/php-yum/versions/phplib.conf @@ -6,7 +6,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "数据库", "msg": "数据库访问抽象模块!", @@ -20,7 +21,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "数据库", "msg": "用于使用MySQL数据库的模块!", @@ -34,7 +36,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "数据库", "msg": "用于使用MySQL数据库的模块!", @@ -48,7 +51,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "数据库", "msg": "用于使用OCI8数据库的模块!", @@ -62,7 +66,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "数据库", "msg": "用于使用ODBC数据库的模块!", @@ -106,7 +111,8 @@ "74", "80", "81", - "82" + "82", + "83" ], "type": "脚本解密", "msg": "用于解密ionCube Encoder加密脚本!", @@ -137,7 +143,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "缓存器", "msg": "用于加速PHP脚本!", @@ -184,7 +191,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "通用扩展", "msg": "用于FILE!", @@ -198,7 +206,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "通用扩展", "msg": "用于XML!", @@ -212,7 +221,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "通用扩展", "msg": "用于图像文件格式!", @@ -226,7 +236,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "通用扩展", "msg": "通用GD库!", @@ -240,7 +251,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "通用扩展", "msg": "提供国际化支持", @@ -266,7 +278,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "缓存器", "msg": "强大的内容缓存器,支持集群", @@ -280,7 +293,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "缓存器", "msg": "更强大的内容缓存器,支持集群", @@ -305,7 +319,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "通用扩展", "msg": "比GD更强大的图形库", @@ -319,7 +334,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "调试器", "msg": "不多说,不了解的不要安装", @@ -333,7 +349,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "性能分析", "msg": "不多说,不了解的不要安装!", @@ -347,7 +364,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "通用扩展", "msg": "异步、并行、高性能网络通信引擎", @@ -372,7 +390,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "框架", "msg": "Yaf是一个C语言编写的PHP框架", @@ -386,7 +405,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "框架", "msg": "Yar是一个RPC框架", @@ -413,7 +433,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "通用扩展", "msg": "Mongodb数据库连接驱动", @@ -427,7 +448,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "缓存器", "msg": "高性能无锁共享内存Cache", @@ -441,7 +463,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "大数据", "msg": "SOLR全文搜索服务", @@ -455,7 +478,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "日志", "msg": "SeasLog高性能日志记录", @@ -469,7 +493,8 @@ "80", "81", "82", - "83" + "83", + "84" ], "type": "通用扩展", "msg": "用于需要多字节字符串处理的模块", @@ -484,7 +509,8 @@ "81", "82", "82", - "83" + "83", + "84" ], "type": "压缩", "msg": "压缩组件", From 048df7e1e7fdae652e202ade3719efc8b3c7f8bc Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 00:16:21 +0800 Subject: [PATCH 059/146] Update install.sh --- plugins/php-yum/versions/84/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/php-yum/versions/84/install.sh b/plugins/php-yum/versions/84/install.sh index 58df0b6d4c..fcad714404 100755 --- a/plugins/php-yum/versions/84/install.sh +++ b/plugins/php-yum/versions/84/install.sh @@ -18,7 +18,7 @@ PHP_VER=84 Install_php() { #------------------------ install start ------------------------------------# -yum install -y php83 php83-php-fpm +yum install -y php84 php84-php-fpm if [ "$?" == "0" ];then mkdir -p $serverPath/php-yum/${PHP_VER} fi From e6ac37644b012bf03e359044d2be6811d1b6e240 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 00:32:43 +0800 Subject: [PATCH 060/146] Create yaf.sh --- plugins/php-yum/versions/common/yaf.sh | 94 ++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100755 plugins/php-yum/versions/common/yaf.sh diff --git a/plugins/php-yum/versions/common/yaf.sh b/plugins/php-yum/versions/common/yaf.sh new file mode 100755 index 0000000000..3eac1b3538 --- /dev/null +++ b/plugins/php-yum/versions/common/yaf.sh @@ -0,0 +1,94 @@ +#!/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 + +sysName=`uname` +LIBNAME=yaf +LIBV=3.3.6 + +cfgDir=/etc/opt/remi + +if [ `echo "$version < 7.0"|bc` -eq 1 ];then + LIBV=2.3.5 +fi + +extVer=`bash $curPath/lib.sh $version` +extFile=/usr/lib/php/${extVer}/${LIBNAME}.so + +ext_dir=${cfgDir}/php${version}/php.d +ext_file=${ext_dir}/30-yaf.ini + +Install_lib() +{ + + isInstall=`cat ${cfgDir}/php/${version}/php.d/* | grep -v '^;' |tr -s '\n' |grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-yum-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + + php_lib=$sourcePath/php_lib + mkdir -p $php_lib + if [ ! -d $php_lib/${LIBNAME}-${LIBV} ];then + wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz + cd $php_lib && tar xvf ${LIBNAME}-${LIBV}.tgz + fi + cd $php_lib/${LIBNAME}-${LIBV} + + /opt/remi/php${version}/root/usr/bin/phpize + ./configure + make && make install && make clean + + fi + echo "$extFile checking ..." + if [ ! -f "$extFile" ];then + echo "ERROR!" + return; + fi + + + echo "" >> $ext_file + echo "[${LIBNAME}]" >> $ext_file + echo "extension=${LIBNAME}.so" >> $ext_file + + systemctl restart php${version}-php-fpm + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "/usr/bin/php-config${version}" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ -f $ext_file ];then + rm -rf $ext_file + fi + + systemctl restart php${version}-php-fpm + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file From 8ca6c32a761590d9a982e6b5268395a9d940462d Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 00:35:43 +0800 Subject: [PATCH 061/146] Update yaf.sh --- plugins/php-yum/versions/common/yaf.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/php-yum/versions/common/yaf.sh b/plugins/php-yum/versions/common/yaf.sh index 3eac1b3538..d9a1d54a9c 100755 --- a/plugins/php-yum/versions/common/yaf.sh +++ b/plugins/php-yum/versions/common/yaf.sh @@ -24,7 +24,7 @@ if [ `echo "$version < 7.0"|bc` -eq 1 ];then fi extVer=`bash $curPath/lib.sh $version` -extFile=/usr/lib/php/${extVer}/${LIBNAME}.so +extFile=/opt/remi/php${version}/root/usr/lib64/php/modules/yaf.so ext_dir=${cfgDir}/php${version}/php.d ext_file=${ext_dir}/30-yaf.ini @@ -79,6 +79,7 @@ Uninstall_lib() if [ -f $ext_file ];then rm -rf $ext_file + rm -rf $extFile fi systemctl restart php${version}-php-fpm From f2c188b245045ceb52f7253de7e11ace523576ab Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 00:36:09 +0800 Subject: [PATCH 062/146] Update yaf.sh --- plugins/php-yum/versions/common/yaf.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plugins/php-yum/versions/common/yaf.sh b/plugins/php-yum/versions/common/yaf.sh index d9a1d54a9c..7eadb5e5a0 100755 --- a/plugins/php-yum/versions/common/yaf.sh +++ b/plugins/php-yum/versions/common/yaf.sh @@ -72,10 +72,6 @@ Install_lib() Uninstall_lib() { - if [ ! -f "/usr/bin/php-config${version}" ];then - echo "php-$version 未安装,请选择其它版本!" - return - fi if [ -f $ext_file ];then rm -rf $ext_file From 7b8ecd520cb66378a53899979bec6967d446837b Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 00:42:09 +0800 Subject: [PATCH 063/146] Delete yaf.sh --- plugins/php-yum/versions/common/yaf.sh | 91 -------------------------- 1 file changed, 91 deletions(-) delete mode 100755 plugins/php-yum/versions/common/yaf.sh diff --git a/plugins/php-yum/versions/common/yaf.sh b/plugins/php-yum/versions/common/yaf.sh deleted file mode 100755 index 7eadb5e5a0..0000000000 --- a/plugins/php-yum/versions/common/yaf.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/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 - -sysName=`uname` -LIBNAME=yaf -LIBV=3.3.6 - -cfgDir=/etc/opt/remi - -if [ `echo "$version < 7.0"|bc` -eq 1 ];then - LIBV=2.3.5 -fi - -extVer=`bash $curPath/lib.sh $version` -extFile=/opt/remi/php${version}/root/usr/lib64/php/modules/yaf.so - -ext_dir=${cfgDir}/php${version}/php.d -ext_file=${ext_dir}/30-yaf.ini - -Install_lib() -{ - - isInstall=`cat ${cfgDir}/php/${version}/php.d/* | grep -v '^;' |tr -s '\n' |grep "${LIBNAME}.so"` - if [ "${isInstall}" != "" ];then - echo "php-yum-$version 已安装${LIBNAME},请选择其它版本!" - return - fi - - if [ ! -f "$extFile" ];then - - php_lib=$sourcePath/php_lib - mkdir -p $php_lib - if [ ! -d $php_lib/${LIBNAME}-${LIBV} ];then - wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz - cd $php_lib && tar xvf ${LIBNAME}-${LIBV}.tgz - fi - cd $php_lib/${LIBNAME}-${LIBV} - - /opt/remi/php${version}/root/usr/bin/phpize - ./configure - make && make install && make clean - - fi - echo "$extFile checking ..." - if [ ! -f "$extFile" ];then - echo "ERROR!" - return; - fi - - - echo "" >> $ext_file - echo "[${LIBNAME}]" >> $ext_file - echo "extension=${LIBNAME}.so" >> $ext_file - - systemctl restart php${version}-php-fpm - echo '===========================================================' - echo 'successful!' -} - - -Uninstall_lib() -{ - - if [ -f $ext_file ];then - rm -rf $ext_file - rm -rf $extFile - fi - - systemctl restart php${version}-php-fpm - echo '===============================================' - echo 'successful!' -} - - -if [ "$actionType" == 'install' ];then - Install_lib -elif [ "$actionType" == 'uninstall' ];then - Uninstall_lib -fi \ No newline at end of file From d4679e2b5cf6b96422a1f0a043e30d0d3044fcfb Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 00:44:08 +0800 Subject: [PATCH 064/146] Update common.sh --- plugins/php-yum/versions/common.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/php-yum/versions/common.sh b/plugins/php-yum/versions/common.sh index 0ef2dc4cd4..032ab38964 100644 --- a/plugins/php-yum/versions/common.sh +++ b/plugins/php-yum/versions/common.sh @@ -32,6 +32,7 @@ if [ "$action" == 'install' ];then bash ${FILE_COMMON} install ${version} else yum install -y php${version}-php-${extName} + yum install -y php${version}-php-pecl-${extName} fi # if [ "${extName}" == "mysql" ];then @@ -48,11 +49,17 @@ if [ "$action" == 'uninstall' ];then bash ${FILE_COMMON} uninstall ${version} else yum remove -y php${version}-php-${extName} + yum remove -y php${version}-php-pecl-${extName} fi fi echo "yum install -y php${version}-php-${extName}" +echo "yum install -y php${version}-php-pecl-${extName}" +echo "-----------------------------------------------" echo "yum remove -y php${version}-php-${extName}" +echo "yum remove -y php${version}-php-pecl-${extName}" + + echo "systemctl restart php${version}-php-fpm" From 67178757c052f100cb59e18a1032257df744f82e Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 00:44:16 +0800 Subject: [PATCH 065/146] Update common.sh --- plugins/php-yum/versions/common.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plugins/php-yum/versions/common.sh b/plugins/php-yum/versions/common.sh index 032ab38964..7eb72bfd8b 100644 --- a/plugins/php-yum/versions/common.sh +++ b/plugins/php-yum/versions/common.sh @@ -60,8 +60,6 @@ echo "yum remove -y php${version}-php-${extName}" echo "yum remove -y php${version}-php-pecl-${extName}" - - echo "systemctl restart php${version}-php-fpm" php_status=`systemctl status php${version}-php-fpm | grep inactive` echo "php_status:${php_status}" @@ -69,5 +67,3 @@ if [ "$php_status" == "" ];then systemctl restart php${version}-php-fpm fi - - From ed4a58025bedd6ae24cacc5e52fc406d75cb5ef9 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 00:46:26 +0800 Subject: [PATCH 066/146] Update phplib.conf --- plugins/php-yum/versions/phplib.conf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/plugins/php-yum/versions/phplib.conf b/plugins/php-yum/versions/phplib.conf index b466e78b5c..b675ea1939 100755 --- a/plugins/php-yum/versions/phplib.conf +++ b/plugins/php-yum/versions/phplib.conf @@ -516,5 +516,20 @@ "msg": "压缩组件", "shell": "zip.sh", "check": "zip" + }, + { + "name": "zstd", + "versions": [ + "74", + "80", + "81", + "82", + "83", + "84" + ], + "type": "压缩", + "msg": "压缩组件", + "shell": "zstd.sh", + "check": "zstd" } ] \ No newline at end of file From 5bec8e0c38fc1a84c1548c9f05c4705092e1ff2f Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 01:04:16 +0800 Subject: [PATCH 067/146] Update install_dev.sh --- scripts/install_dev.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 364506ef55..608a2d5566 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -8,6 +8,8 @@ echo -e "您正在安装的是\033[31mmdserver-web测试版\033[0m,非开发 echo -e "You are installing\033[31m mdserver-web dev version\033[0m, normally use install.sh for production.\n" sleep 1 +LOG_FILE=/var/log/mw-install.log + { if [ -f /etc/motd ];then @@ -174,7 +176,7 @@ endTime=`date +%s` ((outTime=(${endTime}-${startTime})/60)) echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" -} 1> >(tee mw-install.log) 2>&1 +} 1> >(tee $LOG_FILE) 2>&1 echo -e "\nInstall completed. If error occurs, please contact us with the log file mw-install.log ." echo "安装完毕,如果出现错误,请带上同目录下的安装日志 mw-install.log 联系我们反馈." \ No newline at end of file From c187c36c510cff5bf0aab138e1e9bf0c8cd47288 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 01:07:56 +0800 Subject: [PATCH 068/146] Update update_dev.sh --- scripts/update_dev.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/update_dev.sh b/scripts/update_dev.sh index f0a77a9329..7c4d2ebd6b 100755 --- a/scripts/update_dev.sh +++ b/scripts/update_dev.sh @@ -10,14 +10,16 @@ _os=`uname` echo "use system: ${_os}" if [ "$EUID" -ne 0 ] - then echo "Please run as root!" - exit + then echo "Please run as root!" + exit fi if [ ${_os} != "Darwin" ] && [ ! -d /www/server/mdserver-web/logs ]; then mkdir -p /www/server/mdserver-web/logs fi +LOG_FILE=/var/log/mw-update.log + { if [ ${_os} == "Darwin" ]; then @@ -122,4 +124,4 @@ endTime=`date +%s` ((outTime=($endTime-$startTime)/60)) echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" -} 1> >(tee mw-update.log) 2>&1 \ No newline at end of file +} 1> >(tee $LOG_FILE) 2>&1 \ No newline at end of file From e15cb57c27adab9718510d44fa9b3dfc0553e98f Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 01:09:02 +0800 Subject: [PATCH 069/146] Update update.sh --- scripts/update.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/update.sh b/scripts/update.sh index 4bd142ebc4..ecf7ae0bb6 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -18,6 +18,8 @@ if [ ${_os} != "Darwin" ] && [ ! -d /www/server/mdserver-web/logs ]; then mkdir -p /www/server/mdserver-web/logs fi +LOG_FILE=/var/log/mw-update.log + { if [ ${_os} == "Darwin" ]; then @@ -110,4 +112,4 @@ endTime=`date +%s` ((outTime=($endTime-$startTime)/60)) echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" -} 1> >(tee mw-update.log) 2>&1 \ No newline at end of file +} 1> >(tee $LOG_FILE) 2>&1 \ No newline at end of file From d1a6c61bd81aee8fb9a9c5b57a4714a33244eb1f Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 01:15:47 +0800 Subject: [PATCH 070/146] Update install.sh --- scripts/install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index ceec11235f..9605304f19 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -4,6 +4,8 @@ export PATH # LANG=en_US.UTF-8 is64bit=`getconf LONG_BIT` +LOG_FILE=/var/log/mw-install.log + { if [ -f /etc/motd ];then @@ -168,7 +170,7 @@ endTime=`date +%s` ((outTime=(${endTime}-${startTime})/60)) echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" -} 1> >(tee mw-install.log) 2>&1 +} 1> >(tee $LOG_FILE) 2>&1 echo -e "\nInstall completed. If error occurs, please contact us with the log file mw-install.log ." echo "安装完毕,如果出现错误,请带上同目录下的安装日志 mw-install.log 联系我们反馈." \ No newline at end of file From 1cf77806bae5c1d8e345de46554c6c68cd7989fb Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 01:17:34 +0800 Subject: [PATCH 071/146] Update cert_api.py --- class/core/cert_api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/class/core/cert_api.py b/class/core/cert_api.py index f6107a1c59..0695ce0726 100644 --- a/class/core/cert_api.py +++ b/class/core/cert_api.py @@ -1410,6 +1410,7 @@ def renewCert(self, index): self.__config['orders'][i][ 'cert_timeout'] = int(time.time()) + # print(self.__config['orders'][i]['domains'][0],self.__config['orders'][i]['cert_timeout'] , start_time) if self.__config['orders'][i]['cert_timeout'] > start_time: msg = "|-本次跳过域名: {},未过期!".format( self.__config['orders'][i]['domains'][0]) From 8e5f1ae809a37e9a2f7d42a53f2ea2c80a5550ac Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 01:17:49 +0800 Subject: [PATCH 072/146] Update cert_api.py --- class/core/cert_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class/core/cert_api.py b/class/core/cert_api.py index 0695ce0726..9580a89352 100644 --- a/class/core/cert_api.py +++ b/class/core/cert_api.py @@ -1410,7 +1410,7 @@ def renewCert(self, index): self.__config['orders'][i][ 'cert_timeout'] = int(time.time()) - # print(self.__config['orders'][i]['domains'][0],self.__config['orders'][i]['cert_timeout'] , start_time) + # print(self.__config['orders'][i]['domains'][0], self.__config['orders'][i]['cert_timeout'], start_time) if self.__config['orders'][i]['cert_timeout'] > start_time: msg = "|-本次跳过域名: {},未过期!".format( self.__config['orders'][i]['domains'][0]) From 672ebb013f964ac58ee4614b39d28bf87f1f055f Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 01:20:47 +0800 Subject: [PATCH 073/146] Update cert_api.py --- class/core/cert_api.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/class/core/cert_api.py b/class/core/cert_api.py index 9580a89352..76c57a1271 100644 --- a/class/core/cert_api.py +++ b/class/core/cert_api.py @@ -1412,8 +1412,7 @@ def renewCert(self, index): # print(self.__config['orders'][i]['domains'][0], self.__config['orders'][i]['cert_timeout'], start_time) if self.__config['orders'][i]['cert_timeout'] > start_time: - msg = "|-本次跳过域名: {},未过期!".format( - self.__config['orders'][i]['domains'][0]) + msg = "|-本次跳过域名: {},未过期!".format(self.__config['orders'][i]['domains'][0]) writeLog(msg) continue From b4b14d2c28956db6f56805182bba7ca81e2db594 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 01:21:25 +0800 Subject: [PATCH 074/146] Update cert_api.py --- class/core/cert_api.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/class/core/cert_api.py b/class/core/cert_api.py index 76c57a1271..32323f845f 100644 --- a/class/core/cert_api.py +++ b/class/core/cert_api.py @@ -1403,12 +1403,10 @@ def renewCert(self, index): continue if 'cert' in self.__config['orders'][i]: - self.__config['orders'][i]['cert_timeout'] = self.__config[ - 'orders'][i]['cert']['cert_timeout'] + self.__config['orders'][i]['cert_timeout'] = self.__config['orders'][i]['cert']['cert_timeout'] if not 'cert_timeout' in self.__config['orders'][i]: - self.__config['orders'][i][ - 'cert_timeout'] = int(time.time()) + self.__config['orders'][i]['cert_timeout'] = int(time.time()) # print(self.__config['orders'][i]['domains'][0], self.__config['orders'][i]['cert_timeout'], start_time) if self.__config['orders'][i]['cert_timeout'] > start_time: From e8a72a0b7a9c4c13547b37b3459ddebf09d7e8cc Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 01:23:15 +0800 Subject: [PATCH 075/146] Update cert_api.py --- class/core/cert_api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/class/core/cert_api.py b/class/core/cert_api.py index 32323f845f..b89bb6aa71 100644 --- a/class/core/cert_api.py +++ b/class/core/cert_api.py @@ -1392,7 +1392,7 @@ def renewCert(self, index): order_index.append(index) else: # 测试一天过期 - start_time = time.time() - 89 * 86400 + now_time = time.time() # print(self.__config) if not 'orders' in self.__config: self.__config['orders'] = {} @@ -1408,8 +1408,8 @@ def renewCert(self, index): if not 'cert_timeout' in self.__config['orders'][i]: self.__config['orders'][i]['cert_timeout'] = int(time.time()) - # print(self.__config['orders'][i]['domains'][0], self.__config['orders'][i]['cert_timeout'], start_time) - if self.__config['orders'][i]['cert_timeout'] > start_time: + # print(self.__config['orders'][i]['domains'][0], self.__config['orders'][i]['cert_timeout'], now_time) + if self.__config['orders'][i]['cert_timeout'] - now_time > 1*86400: msg = "|-本次跳过域名: {},未过期!".format(self.__config['orders'][i]['domains'][0]) writeLog(msg) continue From f480cbeda4ffa654b6e2ca4fe40adaf5d82348f0 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 01:26:14 +0800 Subject: [PATCH 076/146] Update cert_api.py --- class/core/cert_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class/core/cert_api.py b/class/core/cert_api.py index b89bb6aa71..067808eaea 100644 --- a/class/core/cert_api.py +++ b/class/core/cert_api.py @@ -1409,7 +1409,7 @@ def renewCert(self, index): self.__config['orders'][i]['cert_timeout'] = int(time.time()) # print(self.__config['orders'][i]['domains'][0], self.__config['orders'][i]['cert_timeout'], now_time) - if self.__config['orders'][i]['cert_timeout'] - now_time > 1*86400: + if self.__config['orders'][i]['cert_timeout'] - now_time < 1*86400: msg = "|-本次跳过域名: {},未过期!".format(self.__config['orders'][i]['domains'][0]) writeLog(msg) continue From ffaac9553e5b1cbbdddfbaa51906cad972596578 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 01:26:50 +0800 Subject: [PATCH 077/146] Update cert_api.py --- class/core/cert_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class/core/cert_api.py b/class/core/cert_api.py index 067808eaea..a9978f07ab 100644 --- a/class/core/cert_api.py +++ b/class/core/cert_api.py @@ -1408,7 +1408,7 @@ def renewCert(self, index): if not 'cert_timeout' in self.__config['orders'][i]: self.__config['orders'][i]['cert_timeout'] = int(time.time()) - # print(self.__config['orders'][i]['domains'][0], self.__config['orders'][i]['cert_timeout'], now_time) + # print(self.__config['orders'][i]['domains'][0], (self.__config['orders'][i]['cert_timeout'] - now_time)/86400, now_time) if self.__config['orders'][i]['cert_timeout'] - now_time < 1*86400: msg = "|-本次跳过域名: {},未过期!".format(self.__config['orders'][i]['domains'][0]) writeLog(msg) From a43bfbebabebae804c0c2c3267f788d89fd22125 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 12:02:38 +0800 Subject: [PATCH 078/146] Update index.py --- plugins/mysql-apt/index.py | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/plugins/mysql-apt/index.py b/plugins/mysql-apt/index.py index aa53f6400c..6ef83cf118 100755 --- a/plugins/mysql-apt/index.py +++ b/plugins/mysql-apt/index.py @@ -94,21 +94,21 @@ def getConf(): def getDbPort(): file = getConf() content = mw.readFile(file) - rep = 'port\s*=\s*(.*)' + rep = r'port\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() def getDbServerId(): file = getConf() content = mw.readFile(file) - rep = 'server-id\s*=\s*(.*)' + rep = r'server-id\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() def getSocketFile(): file = getConf() content = mw.readFile(file) - rep = 'socket\s*=\s*(.*)' + rep = r'socket\s*=\s*(.*)' tmp = re.search(rep, content) socket = tmp.groups()[0].strip() @@ -118,14 +118,14 @@ def getSocketFile(): def getErrorLogsFile(): file = getConf() content = mw.readFile(file) - rep = 'log-error\s*=\s*(.*)' + rep = r'log-error\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() def getAuthPolicy(): file = getConf() content = mw.readFile(file) - rep = 'authentication_policy\s*=\s*(.*)' + rep = r'authentication_policy\s*=\s*(.*)' tmp = re.search(rep, content) if tmp: return tmp.groups()[0].strip() @@ -261,21 +261,21 @@ def status(version=''): def getDataDir(): file = getConf() content = mw.readFile(file) - rep = 'datadir\s*=\s*(.*)' + rep = r'datadir\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() def getLogBinName(): file = getConf() content = mw.readFile(file) - rep = 'log-bin\s*=\s*(.*)' + rep = r'log-bin\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() def getPidFile(): file = getConf() content = mw.readFile(file) - rep = 'pid-file\s*=\s*(.*)' + rep = r'pid-file\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -394,7 +394,7 @@ def getErrorLog(): def getShowLogFile(): file = getConf() content = mw.readFile(file) - rep = 'slow-query-log-file\s*=\s*(.*)' + rep = r'slow-query-log-file\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -403,8 +403,7 @@ def getMdb8Ver(): def pGetDbUser(): if mw.isAppleSystem(): - user = mw.execShell( - "who | sed -n '2, 1p' |awk '{print $1}'")[0].strip() + user = mw.execShell("who | sed -n '2, 1p' |awk '{print $1}'")[0].strip() return user return 'mysql' @@ -601,7 +600,7 @@ def initdUinstall(): def getMyDbPos(): file = getConf() content = mw.readFile(file) - rep = 'datadir\s*=\s*(.*)' + rep = r'datadir\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -652,7 +651,7 @@ def setMyDbPos(version=''): def getMyPort(): file = getConf() content = mw.readFile(file) - rep = 'port\s*=\s*(.*)' + rep = r'port\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -666,7 +665,7 @@ def setMyPort(): port = args['port'] file = getConf() content = mw.readFile(file) - rep = "port\s*=\s*([0-9]+)\s*\n" + rep = r"port\s*=\s*([0-9]+)\s*\n" content = re.sub(rep, 'port = ' + port + '\n', content) mw.writeFile(file, content) restart() @@ -1358,7 +1357,7 @@ def addDb(): dataAccess = args['dataAccess'].strip() ps = args['ps'].strip() - reg = "^[\w-]+$" + reg = r"^[\w-]+$" if not re.match(reg, args['name']): return mw.returnJson(False, '数据库名称不能带有特殊符号!') checks = ['root', 'mysql', 'test', 'sys', 'performance_schema','information_schema'] @@ -3508,8 +3507,8 @@ def installPreInspection(version): if (sysName == 'ubuntu' and version == '5.7' and not sysId in ('18.04')): return "Ubuntu Apt MySQL[" + version + "] 仅支持18.04" - if (sysName == 'ubuntu' and version == '8.0' and not sysId in ('18.04', '20.04', '22.04')): - return 'Ubuntu Apt MySQL[' + version + '] 仅支持18.04,20.04,22.04' + if (sysName == 'ubuntu' and version == '8.0' and not sysId in ('18.04', '20.04', '22.04','24.04')): + return 'Ubuntu Apt MySQL[' + version + '] 仅支持18.04,20.04,22.04,24.04' return 'ok' From 50e3173706cd80996c4531ffdd4b16e87a268854 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 12:06:53 +0800 Subject: [PATCH 079/146] Update index.py --- plugins/mysql-apt/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mysql-apt/index.py b/plugins/mysql-apt/index.py index 6ef83cf118..6a57ee734d 100755 --- a/plugins/mysql-apt/index.py +++ b/plugins/mysql-apt/index.py @@ -753,7 +753,7 @@ def setDbStatus(version): s = 'K' if g in emptys: s = '' - rep = '\s*' + g + '\s*=\s*\d+(M|K|k|m|G)?\n' + rep = r'\s*' + g + .r'\s*=\s*\d+(M|K|k|m|G)?\n' c = g + ' = ' + args[g] + s + '\n' if content.find(g) != -1: content = re.sub(rep, '\n' + c, content, 1) From 9f8af72c70ff6252a0813efa97031fe78d3c8bdf Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 12:07:00 +0800 Subject: [PATCH 080/146] Update index.py --- plugins/mysql-apt/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mysql-apt/index.py b/plugins/mysql-apt/index.py index 6a57ee734d..902d32bc15 100755 --- a/plugins/mysql-apt/index.py +++ b/plugins/mysql-apt/index.py @@ -753,7 +753,7 @@ def setDbStatus(version): s = 'K' if g in emptys: s = '' - rep = r'\s*' + g + .r'\s*=\s*\d+(M|K|k|m|G)?\n' + rep = r'\s*' + g + r'\s*=\s*\d+(M|K|k|m|G)?\n' c = g + ' = ' + args[g] + s + '\n' if content.find(g) != -1: content = re.sub(rep, '\n' + c, content, 1) From bd13bc8d68d6f94b9cad39330c3913a9921d50aa Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 12:08:18 +0800 Subject: [PATCH 081/146] Update index.py --- plugins/mysql-apt/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mysql-apt/index.py b/plugins/mysql-apt/index.py index 902d32bc15..280c5d5d23 100755 --- a/plugins/mysql-apt/index.py +++ b/plugins/mysql-apt/index.py @@ -2124,7 +2124,7 @@ def addMasterRepSlaveUser(version=''): # address = args['address'].strip() # dataAccess = args['dataAccess'].strip() - reg = "^[\w-]+$" + reg = r"^[\w-]+$" if not re.match(reg, username): return mw.returnJson(False, '用户名不能带有特殊符号!') checks = ['root', 'mysql', 'test', 'sys', 'performance_schema','information_schema'] From 843321dfe5289a777261de5f062ae49a65b80815 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 12:13:47 +0800 Subject: [PATCH 082/146] Update install.sh --- plugins/mysql-apt/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/mysql-apt/install.sh b/plugins/mysql-apt/install.sh index e454af55bd..99ec491e5e 100755 --- a/plugins/mysql-apt/install.sh +++ b/plugins/mysql-apt/install.sh @@ -31,12 +31,12 @@ fi if [ "${2}" == "" ];then - echo '缺少安装脚本...' > $install_tmp + echo '缺少安装脚本...' exit 0 fi if [ ! -d $curPath/versions/$2 ];then - echo '缺少安装脚本2...' > $install_tmp + echo '缺少安装脚本2...' exit 0 fi From 6118c4933585e6355647512a54beeaeb098a8b71 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 12:21:08 +0800 Subject: [PATCH 083/146] Update index.py --- plugins/mysql/index.py | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index 7e469cc498..03dbec2d70 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -88,7 +88,7 @@ def getConf(): def getDbPort(): file = getConf() content = mw.readFile(file) - rep = 'port\s*=\s*(.*)' + rep = r'port\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -96,7 +96,7 @@ def getDbPort(): def getDbServerId(): file = getConf() content = mw.readFile(file) - rep = 'server-id\s*=\s*(.*)' + rep = r'server-id\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -104,7 +104,7 @@ def getDbServerId(): def getSocketFile(): file = getConf() content = mw.readFile(file) - rep = 'socket\s*=\s*(.*)' + rep = r'socket\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -112,14 +112,14 @@ def getSocketFile(): def getErrorLogsFile(): file = getConf() content = mw.readFile(file) - rep = 'log-error\s*=\s*(.*)' + rep = r'log-error\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() def getAuthPolicy(): file = getConf() content = mw.readFile(file) - rep = 'authentication_policy\s*=\s*(.*)' + rep = r'authentication_policy\s*=\s*(.*)' tmp = re.search(rep, content) if tmp: return tmp.groups()[0].strip() @@ -302,7 +302,7 @@ def status(version=''): def getDataDir(): file = getConf() content = mw.readFile(file) - rep = 'datadir\s*=\s*(.*)' + rep = r'datadir\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -310,7 +310,7 @@ def getDataDir(): def getLogBinName(): file = getConf() content = mw.readFile(file) - rep = 'log-bin\s*=\s*(.*)' + rep = r'log-bin\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -318,7 +318,7 @@ def getLogBinName(): def getPidFile(): file = getConf() content = mw.readFile(file) - rep = 'pid-file\s*=\s*(.*)' + rep = r'pid-file\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -424,7 +424,7 @@ def getErrorLog(): def getShowLogFile(): file = getConf() content = mw.readFile(file) - rep = 'slow-query-log-file\s*=\s*(.*)' + rep = r'slow-query-log-file\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -743,7 +743,7 @@ def initdUinstall(): def getMyDbPos(): file = getConf() content = mw.readFile(file) - rep = 'datadir\s*=\s*(.*)' + rep = r'datadir\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -793,7 +793,7 @@ def setMyDbPos(version): def getMyPort(): file = getConf() content = mw.readFile(file) - rep = 'port\s*=\s*(.*)' + rep = r'port\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -807,7 +807,7 @@ def setMyPort(version): port = args['port'] file = getConf() content = mw.readFile(file) - rep = "port\s*=\s*([0-9]+)\s*\n" + rep = r"port\s*=\s*([0-9]+)\s*\n" content = re.sub(rep, 'port = ' + port + '\n', content) mw.writeFile(file, content) restart(version) @@ -898,7 +898,7 @@ def setDbStatus(version): s = 'K' if g in emptys: s = '' - rep = '\s*' + g + '\s*=\s*\d+(M|K|k|m|G)?\n' + rep = r'\s*' + g + r'\s*=\s*\d+(M|K|k|m|G)?\n' c = g + ' = ' + args[g] + s + '\n' if content.find(g) != -1: content = re.sub(rep, '\n' + c, content, 1) @@ -1571,7 +1571,7 @@ def addDb(): dataAccess = args['dataAccess'].strip() ps = args['ps'].strip() - reg = "^[\w-]+$" + reg = r"^[\w-]+$" if not re.match(reg, args['name']): return mw.returnJson(False, '数据库名称不能带有特殊符号!') checks = ['root', 'mysql', 'test', 'sys', 'performance_schema','information_schema'] @@ -2163,8 +2163,7 @@ def setDbMaster(version): if not isHas: prefix = '#binlog-do-db' - con = con.replace( - prefix, prefix + "\nbinlog-do-db=" + args['name']) + con = con.replace(prefix, prefix + "\nbinlog-do-db=" + args['name']) mw.writeFile(conf, con) restart(version) @@ -2326,7 +2325,7 @@ def addMasterRepSlaveUser(version=''): # address = args['address'].strip() # dataAccess = args['dataAccess'].strip() - reg = "^[\w-]+$" + reg = r"^[\w-]+$" if not re.match(reg, username): return mw.returnJson(False, '用户名不能带有特殊符号!') checks = ['root', 'mysql', 'test', 'sys', 'performance_schema','information_schema'] @@ -3392,7 +3391,7 @@ def doFullSyncUserImportContentForChannel(file, channel_name): content = content.replace('STOP SLAVE;', "STOP SLAVE for channel '{}';".format(channel_name)) content = content.replace('START SLAVE;', "START SLAVE for channel '{}';".format(channel_name)) - find_head = "CHANGE MASTER TO " + find_head = r"CHANGE MASTER TO " find_re = find_head+"(.*?);" find_r = re.search(find_re, content, re.I|re.M) if find_r: From e77b24a213630000bea550028c9bcdcbd06ad2fd Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 12:30:50 +0800 Subject: [PATCH 084/146] Update index.py --- plugins/openresty/index.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/openresty/index.py b/plugins/openresty/index.py index 6038b3c206..dc418d7290 100755 --- a/plugins/openresty/index.py +++ b/plugins/openresty/index.py @@ -106,7 +106,7 @@ def getInitDTpl(): def getPidFile(): file = getConf() content = mw.readFile(file) - rep = 'pid\s*(.*);' + rep = r'pid\s*(.*);' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -457,7 +457,7 @@ def getCfg(): # {"name": "client_body_buffer_size", "ps": "请求主体缓冲区"} rdata = [] for i in cfg_args: - rep = "(%s)\s+(\w+)" % i["name"] + rep = r"(%s)\s+(\w+)" % i["name"] k = re.search(rep, content) if not k: return mw.returnJson(False, "获取 key {} 失败".format(k)) @@ -516,12 +516,12 @@ def setCfg(): # print(args) for k, v in args.items(): # print(k, v) - rep = "%s\s+[^kKmMgG\;\n]+" % k + rep = r"%s\s+[^kKmMgG\;\n]+" % k if k == "worker_processes" or k == "gzip": if not re.search("auto|on|off|\d+", v): return mw.returnJson(False, '参数值错误') else: - if not re.search("\d+", v): + if not re.search(r"\d+", v): return mw.returnJson(False, '参数值错误,请输入数字整数') if re.search(rep, content): From 03ca9512a4eb9a7658268488453679b6c556d6d0 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 12:33:44 +0800 Subject: [PATCH 085/146] Update index.py --- plugins/openresty/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/openresty/index.py b/plugins/openresty/index.py index dc418d7290..b5e163e939 100755 --- a/plugins/openresty/index.py +++ b/plugins/openresty/index.py @@ -518,7 +518,7 @@ def setCfg(): # print(k, v) rep = r"%s\s+[^kKmMgG\;\n]+" % k if k == "worker_processes" or k == "gzip": - if not re.search("auto|on|off|\d+", v): + if not re.search(r"auto|on|off|\d+", v): return mw.returnJson(False, '参数值错误') else: if not re.search(r"\d+", v): From 267213efc14e7b6d70905f44ad85571881a9c72c Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 12:57:12 +0800 Subject: [PATCH 086/146] Update install.sh --- plugins/openresty/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/openresty/install.sh b/plugins/openresty/install.sh index 5812655111..3c72e5451d 100755 --- a/plugins/openresty/install.sh +++ b/plugins/openresty/install.sh @@ -48,7 +48,7 @@ fi sh -x $curPath/versions/$2/install.sh $1 -if [ "${action}" == "install" ] && [ -d $serverPath/postgresql ];then +if [ "${action}" == "install" ] && [ -d $serverPath/openresty ];then echo "${VERSION}" > $serverPath/openresty/version.pl mkdir -p $serverPath/web_conf/php/conf From 81e61a469e5e8a2433ed8eeafddc91cd664ffd2b Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 13:08:04 +0800 Subject: [PATCH 087/146] Update index.py --- plugins/sphinx/index.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/sphinx/index.py b/plugins/sphinx/index.py index 84011de8e0..4d56bf4570 100755 --- a/plugins/sphinx/index.py +++ b/plugins/sphinx/index.py @@ -111,7 +111,7 @@ def status(): def mkdirAll(): content = mw.readFile(getConf()) - rep = 'path\s*=\s*(.*)' + rep = r'path\s*=\s*(.*)' p = re.compile(rep) tmp = p.findall(content) @@ -163,7 +163,7 @@ def initDreplace(): def checkIndexSph(): content = mw.readFile(getConf()) - rep = 'path\s*=\s*(.*)' + rep = r'path\s*=\s*(.*)' p = re.compile(rep) tmp = p.findall(content) for x in tmp: @@ -250,7 +250,7 @@ def initdUinstall(): def runLog(): path = getConf() content = mw.readFile(path) - rep = 'log\s*=\s*(.*)' + rep = r'log\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0] @@ -258,7 +258,7 @@ def runLog(): def getPort(): path = getConf() content = mw.readFile(path) - rep = 'listen\s*=\s*(.*)' + rep = r'listen\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0] @@ -266,7 +266,7 @@ def getPort(): def queryLog(): path = getConf() content = mw.readFile(path) - rep = 'query_log\s*=\s*(.*)' + rep = r'query_log\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0] From 6b33cfe6bb5660f1b686a05a2e0d85da03327532 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 13:16:21 +0800 Subject: [PATCH 088/146] update --- plugins/php-apt/index.py | 48 +++++++++++++++--------------- plugins/php-apt/index_php_apt.py | 4 +-- plugins/php-yum/index.py | 38 ++++++++++++------------ plugins/php/index.py | 50 ++++++++++++++++---------------- plugins/phpmyadmin/index.py | 2 +- plugins/postgresql/index.py | 8 ++--- plugins/pureftp/index.py | 2 +- plugins/redis/index.py | 6 ++-- plugins/rsyncd/index.py | 4 +-- plugins/simpleping/index.py | 2 +- 10 files changed, 82 insertions(+), 82 deletions(-) diff --git a/plugins/php-apt/index.py b/plugins/php-apt/index.py index 2d2fe9306a..b3906c33d5 100755 --- a/plugins/php-apt/index.py +++ b/plugins/php-apt/index.py @@ -98,15 +98,15 @@ def contentReplace(content, version): content = content.replace('{$PHP_USER}', 'nobody') content = content.replace('{$PHP_GROUP}', 'nobody') - rep = 'listen.owner\s*=\s*(.+)\r?\n' + rep = r'listen.owner\s*=\s*(.+)\r?\n' val = ';listen.owner = nobody\n' content = re.sub(rep, val, content) - rep = 'listen.group\s*=\s*(.+)\r?\n' + rep = r'listen.group\s*=\s*(.+)\r?\n' val = ';listen.group = nobody\n' content = re.sub(rep, val, content) - rep = 'user\s*=\s*(.+)\r?\n' + rep = r'user\s*=\s*(.+)\r?\n' val = ';user = nobody\n' content = re.sub(rep, val, content) @@ -305,7 +305,7 @@ def getPhpConf(version): phpini = mw.readFile(getConf(version)) result = [] for g in gets: - rep = g['name'] + '\s*=\s*([0-9A-Za-z_& ~]+)(\s*;?|\r?\n)' + rep = g['name'] + r'\s*=\s*([0-9A-Za-z_& ~]+)(\s*;?|\r?\n)' tmp = re.search(rep, phpini) if not tmp: continue @@ -324,7 +324,7 @@ def submitPhpConf(version): phpini = mw.readFile(filename) for g in gets: if g in args: - rep = g + '\s*=\s*(.+)\r?\n' + rep = g + r'\s*=\s*(.+)\r?\n' val = g + ' = ' + args[g] + '\n' phpini = re.sub(rep, val, phpini) mw.writeFile(filename, phpini) @@ -341,14 +341,14 @@ def getLimitConf(version): # print fileini, filefpm data = {} try: - rep = "upload_max_filesize\s*=\s*([0-9]+)M" + rep = r"upload_max_filesize\s*=\s*([0-9]+)M" tmp = re.search(rep, phpini).groups() data['max'] = tmp[0] except: data['max'] = '50' try: - rep = "request_terminate_timeout\s*=\s*([0-9]+)\n" + rep = r"request_terminate_timeout\s*=\s*([0-9]+)\n" tmp = re.search(rep, phpfpm).groups() data['maxTime'] = tmp[0] except: @@ -380,15 +380,15 @@ def setMaxTime(version): filefpm = getFpmConfFile(version) conf = mw.readFile(filefpm) - rep = "request_terminate_timeout\s*=\s*([0-9]+)\n" + rep = r"request_terminate_timeout\s*=\s*([0-9]+)\n" conf = re.sub(rep, "request_terminate_timeout = " + time + "\n", conf) mw.writeFile(filefpm, conf) fileini = getConf(version) phpini = mw.readFile(fileini) - rep = "max_execution_time\s*=\s*([0-9]+)\r?\n" + rep = r"max_execution_time\s*=\s*([0-9]+)\r?\n" phpini = re.sub(rep, "max_execution_time = " + time + "\n", phpini) - rep = "max_input_time\s*=\s*([0-9]+)\r?\n" + rep = r"max_input_time\s*=\s*([0-9]+)\r?\n" phpini = re.sub(rep, "max_input_time = " + time + "\n", phpini) mw.writeFile(fileini, phpini) return mw.returnJson(True, '设置成功!') @@ -406,9 +406,9 @@ def setMaxSize(version): path = getConf(version) conf = mw.readFile(path) - rep = u"\nupload_max_filesize\s*=\s*[0-9]+M" + rep = r"\nupload_max_filesize\s*=\s*[0-9]+M" conf = re.sub(rep, u'\nupload_max_filesize = ' + maxVal + 'M', conf) - rep = u"\npost_max_size\s*=\s*[0-9]+M" + rep = r"\npost_max_size\s*=\s*[0-9]+M" conf = re.sub(rep, u'\npost_max_size = ' + maxVal + 'M', conf) mw.writeFile(path, conf) @@ -422,23 +422,23 @@ def getFpmConfig(version): filefpm = getFpmConfFile(version) conf = mw.readFile(filefpm) data = {} - rep = "\s*pm.max_children\s*=\s*([0-9]+)\s*" + rep = r"\s*pm.max_children\s*=\s*([0-9]+)\s*" tmp = re.search(rep, conf).groups() data['max_children'] = tmp[0] - rep = "\s*pm.start_servers\s*=\s*([0-9]+)\s*" + rep = r"\s*pm.start_servers\s*=\s*([0-9]+)\s*" tmp = re.search(rep, conf).groups() data['start_servers'] = tmp[0] - rep = "\s*pm.min_spare_servers\s*=\s*([0-9]+)\s*" + rep = r"\s*pm.min_spare_servers\s*=\s*([0-9]+)\s*" tmp = re.search(rep, conf).groups() data['min_spare_servers'] = tmp[0] - rep = "\s*pm.max_spare_servers \s*=\s*([0-9]+)\s*" + rep = r"\s*pm.max_spare_servers \s*=\s*([0-9]+)\s*" tmp = re.search(rep, conf).groups() data['max_spare_servers'] = tmp[0] - rep = "\s*pm\s*=\s*(\w+)\s*" + rep = r"\s*pm\s*=\s*(\w+)\s*" tmp = re.search(rep, conf).groups() data['pm'] = tmp[0] return mw.getJson(data) @@ -459,21 +459,21 @@ def setFpmConfig(version): filefpm = getFpmConfFile(version) conf = mw.readFile(filefpm) - rep = "\s*pm.max_children\s*=\s*([0-9]+)\s*" + rep = r"\s*pm.max_children\s*=\s*([0-9]+)\s*" conf = re.sub(rep, "\npm.max_children = " + max_children, conf) - rep = "\s*pm.start_servers\s*=\s*([0-9]+)\s*" + rep = r"\s*pm.start_servers\s*=\s*([0-9]+)\s*" conf = re.sub(rep, "\npm.start_servers = " + start_servers, conf) - rep = "\s*pm.min_spare_servers\s*=\s*([0-9]+)\s*" + rep = r"\s*pm.min_spare_servers\s*=\s*([0-9]+)\s*" conf = re.sub(rep, "\npm.min_spare_servers = " + min_spare_servers, conf) - rep = "\s*pm.max_spare_servers \s*=\s*([0-9]+)\s*" + rep = r"\s*pm.max_spare_servers \s*=\s*([0-9]+)\s*" conf = re.sub(rep, "\npm.max_spare_servers = " + max_spare_servers + "\n", conf) - rep = "\s*pm\s*=\s*(\w+)\s*" + rep = r"\s*pm\s*=\s*(\w+)\s*" conf = re.sub(rep, "\npm = " + pm + "\n", conf) mw.writeFile(filefpm, conf) @@ -709,7 +709,7 @@ def getDisableFunc(version): phpini = mw.readFile(filename) data = {} - rep = "disable_functions\s*=\s{0,1}(.*)\n" + rep = r"disable_functions\s*=\s{0,1}(.*)\n" tmp = re.search(rep, phpini).groups() data['disable_functions'] = tmp[0] return mw.getJson(data) @@ -724,7 +724,7 @@ def setDisableFunc(version): disable_functions = args['disable_functions'] phpini = mw.readFile(filename) - rep = "disable_functions\s*=\s*.*\n" + rep = r"disable_functions\s*=\s*.*\n" phpini = re.sub(rep, 'disable_functions = ' + disable_functions + "\n", phpini) diff --git a/plugins/php-apt/index_php_apt.py b/plugins/php-apt/index_php_apt.py index 37a68a0ce0..97ade4c7db 100755 --- a/plugins/php-apt/index_php_apt.py +++ b/plugins/php-apt/index_php_apt.py @@ -69,7 +69,7 @@ def status_progress(version): def getPhpSocket(version): path = getFpmConfFile(version) content = mw.readFile(path) - rep = 'listen\s*=\s*(.*)' + rep = r'listen\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -116,7 +116,7 @@ def getPhpinfo(version): return 'PHP[' + version + ']未启动,不可访问!!!' sock_file = getFpmAddress(version) - print(sock_file) + # print(sock_file) root_dir = mw.getRootDir() + '/phpinfo' mw.execShell("rm -rf " + root_dir) diff --git a/plugins/php-yum/index.py b/plugins/php-yum/index.py index 93c8f674f2..2d0c87ad38 100755 --- a/plugins/php-yum/index.py +++ b/plugins/php-yum/index.py @@ -345,14 +345,14 @@ def getLimitConf(version): # print fileini, filefpm data = {} try: - rep = "upload_max_filesize\s*=\s*([0-9]+)M" + rep = r"upload_max_filesize\s*=\s*([0-9]+)M" tmp = re.search(rep, phpini).groups() data['max'] = tmp[0] except: data['max'] = '50' try: - rep = "request_terminate_timeout\s*=\s*([0-9]+)\n" + rep = r"request_terminate_timeout\s*=\s*([0-9]+)\n" tmp = re.search(rep, phpfpm).groups() data['maxTime'] = tmp[0] except: @@ -384,15 +384,15 @@ def setMaxTime(version): filefpm = getFpmConfFile(version) conf = mw.readFile(filefpm) - rep = "request_terminate_timeout\s*=\s*([0-9]+)\n" + rep = r"request_terminate_timeout\s*=\s*([0-9]+)\n" conf = re.sub(rep, "request_terminate_timeout = " + time + "\n", conf) mw.writeFile(filefpm, conf) fileini = getConf(version) phpini = mw.readFile(fileini) - rep = "max_execution_time\s*=\s*([0-9]+)\r?\n" + rep = r"max_execution_time\s*=\s*([0-9]+)\r?\n" phpini = re.sub(rep, "max_execution_time = " + time + "\n", phpini) - rep = "max_input_time\s*=\s*([0-9]+)\r?\n" + rep = r"max_input_time\s*=\s*([0-9]+)\r?\n" phpini = re.sub(rep, "max_input_time = " + time + "\n", phpini) mw.writeFile(fileini, phpini) return mw.returnJson(True, '设置成功!') @@ -410,9 +410,9 @@ def setMaxSize(version): path = getConf(version) conf = mw.readFile(path) - rep = u"\nupload_max_filesize\s*=\s*[0-9]+M" + rep = r"\nupload_max_filesize\s*=\s*[0-9]+M" conf = re.sub(rep, u'\nupload_max_filesize = ' + maxVal + 'M', conf) - rep = u"\npost_max_size\s*=\s*[0-9]+M" + rep = r"\npost_max_size\s*=\s*[0-9]+M" conf = re.sub(rep, u'\npost_max_size = ' + maxVal + 'M', conf) mw.writeFile(path, conf) @@ -426,23 +426,23 @@ def getFpmConfig(version): filefpm = getFpmConfFile(version) conf = mw.readFile(filefpm) data = {} - rep = "\s*pm.max_children\s*=\s*([0-9]+)\s*" + rep = r"\s*pm.max_children\s*=\s*([0-9]+)\s*" tmp = re.search(rep, conf).groups() data['max_children'] = tmp[0] - rep = "\s*pm.start_servers\s*=\s*([0-9]+)\s*" + rep = r"\s*pm.start_servers\s*=\s*([0-9]+)\s*" tmp = re.search(rep, conf).groups() data['start_servers'] = tmp[0] - rep = "\s*pm.min_spare_servers\s*=\s*([0-9]+)\s*" + rep = r"\s*pm.min_spare_servers\s*=\s*([0-9]+)\s*" tmp = re.search(rep, conf).groups() data['min_spare_servers'] = tmp[0] - rep = "\s*pm.max_spare_servers \s*=\s*([0-9]+)\s*" + rep = r"\s*pm.max_spare_servers \s*=\s*([0-9]+)\s*" tmp = re.search(rep, conf).groups() data['max_spare_servers'] = tmp[0] - rep = "\s*pm\s*=\s*(\w+)\s*" + rep = r"\s*pm\s*=\s*(\w+)\s*" tmp = re.search(rep, conf).groups() data['pm'] = tmp[0] return mw.getJson(data) @@ -463,21 +463,21 @@ def setFpmConfig(version): filefpm = getFpmConfFile(version) conf = mw.readFile(filefpm) - rep = "\s*pm.max_children\s*=\s*([0-9]+)\s*" + rep = r"\s*pm.max_children\s*=\s*([0-9]+)\s*" conf = re.sub(rep, "\npm.max_children = " + max_children, conf) - rep = "\s*pm.start_servers\s*=\s*([0-9]+)\s*" + rep = r"\s*pm.start_servers\s*=\s*([0-9]+)\s*" conf = re.sub(rep, "\npm.start_servers = " + start_servers, conf) - rep = "\s*pm.min_spare_servers\s*=\s*([0-9]+)\s*" + rep = r"\s*pm.min_spare_servers\s*=\s*([0-9]+)\s*" conf = re.sub(rep, "\npm.min_spare_servers = " + min_spare_servers, conf) - rep = "\s*pm.max_spare_servers \s*=\s*([0-9]+)\s*" + rep = r"\s*pm.max_spare_servers \s*=\s*([0-9]+)\s*" conf = re.sub(rep, "\npm.max_spare_servers = " + max_spare_servers + "\n", conf) - rep = "\s*pm\s*=\s*(\w+)\s*" + rep = r"\s*pm\s*=\s*(\w+)\s*" conf = re.sub(rep, "\npm = " + pm + "\n", conf) mw.writeFile(filefpm, conf) @@ -713,7 +713,7 @@ def getDisableFunc(version): phpini = mw.readFile(filename) data = {} - rep = "disable_functions\s*=\s{0,1}(.*)\n" + rep = r"disable_functions\s*=\s{0,1}(.*)\n" tmp = re.search(rep, phpini).groups() data['disable_functions'] = tmp[0] return mw.getJson(data) @@ -728,7 +728,7 @@ def setDisableFunc(version): disable_functions = args['disable_functions'] phpini = mw.readFile(filename) - rep = "disable_functions\s*=\s*.*\n" + rep = r"disable_functions\s*=\s*.*\n" phpini = re.sub(rep, 'disable_functions = ' + disable_functions + "\n", phpini) msg = mw.getInfo('修改PHP-{1}的禁用函数为[{2}]', (version, disable_functions,)) diff --git a/plugins/php/index.py b/plugins/php/index.py index e18ee7292d..ac905c3589 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -101,7 +101,7 @@ def status_progress(version): def getPhpSocket(version): path = getFpmConfFile(version) content = mw.readFile(path) - rep = 'listen\s*=\s*(.*)' + rep = r'listen\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -133,15 +133,15 @@ def contentReplace(content, version): content = content.replace('{$PHP_USER}', 'nobody') content = content.replace('{$PHP_GROUP}', 'nobody') - rep = 'listen.owner\s*=\s*(.+)\r?\n' + rep = r'listen.owner\s*=\s*(.+)\r?\n' val = ';listen.owner = nobody\n' content = re.sub(rep, val, content) - rep = 'listen.group\s*=\s*(.+)\r?\n' + rep = r'listen.group\s*=\s*(.+)\r?\n' val = ';listen.group = nobody\n' content = re.sub(rep, val, content) - rep = 'user\s*=\s*(.+)\r?\n' + rep = r'user\s*=\s*(.+)\r?\n' val = ';user = nobody\n' content = re.sub(rep, val, content) @@ -449,7 +449,7 @@ def getPhpConf(version): phpini = mw.readFile(getConf(version)) result = [] for g in gets: - rep = g['name'] + '\s*=\s*([0-9A-Za-z_& ~]+)(\s*;?|\r?\n)' + rep = g['name'] + r'\s*=\s*([0-9A-Za-z_& ~]+)(\s*;?|\r?\n)' tmp = re.search(rep, phpini) if not tmp: continue @@ -468,7 +468,7 @@ def submitPhpConf(version): phpini = mw.readFile(filename) for g in gets: if g in args: - rep = g + '\s*=\s*(.+)\r?\n' + rep = g + r'\s*=\s*(.+)\r?\n' val = g + ' = ' + args[g] + '\n' phpini = re.sub(rep, val, phpini) mw.writeFile(filename, phpini) @@ -486,14 +486,14 @@ def getLimitConf(version): # print fileini, filefpm data = {} try: - rep = "upload_max_filesize\s*=\s*([0-9]+)M" + rep = r"upload_max_filesize\s*=\s*([0-9]+)M" tmp = re.search(rep, phpini).groups() data['max'] = tmp[0] except: data['max'] = '50' try: - rep = "request_terminate_timeout\s*=\s*([0-9]+)\n" + rep = r"request_terminate_timeout\s*=\s*([0-9]+)\n" tmp = re.search(rep, phpfpm).groups() data['maxTime'] = tmp[0] except: @@ -525,15 +525,15 @@ def setMaxTime(version): filefpm = getFpmConfFile(version) conf = mw.readFile(filefpm) - rep = "request_terminate_timeout\s*=\s*([0-9]+)\n" + rep = r"request_terminate_timeout\s*=\s*([0-9]+)\n" conf = re.sub(rep, "request_terminate_timeout = " + time + "\n", conf) mw.writeFile(filefpm, conf) fileini = getServerDir() + "/" + version + "/etc/php.ini" phpini = mw.readFile(fileini) - rep = "max_execution_time\s*=\s*([0-9]+)\r?\n" + rep = r"max_execution_time\s*=\s*([0-9]+)\r?\n" phpini = re.sub(rep, "max_execution_time = " + time + "\n", phpini) - rep = "max_input_time\s*=\s*([0-9]+)\r?\n" + rep = r"max_input_time\s*=\s*([0-9]+)\r?\n" phpini = re.sub(rep, "max_input_time = " + time + "\n", phpini) mw.writeFile(fileini, phpini) return mw.returnJson(True, '设置成功!') @@ -551,9 +551,9 @@ def setMaxSize(version): path = getConf(version) conf = mw.readFile(path) - rep = u"\nupload_max_filesize\s*=\s*[0-9]+M" + rep = r"\nupload_max_filesize\s*=\s*[0-9]+M" conf = re.sub(rep, u'\nupload_max_filesize = ' + maxVal + 'M', conf) - rep = u"\npost_max_size\s*=\s*[0-9]+M" + rep = r"\npost_max_size\s*=\s*[0-9]+M" conf = re.sub(rep, u'\npost_max_size = ' + maxVal + 'M', conf) mw.writeFile(path, conf) @@ -571,23 +571,23 @@ def getFpmConfig(version, pool = 'www'): filefpm = getServerDir() + '/' + version + '/etc/php-fpm.d/'+pool+'.conf' conf = mw.readFile(filefpm) data = {} - rep = "\s*pm.max_children\s*=\s*([0-9]+)\s*" + rep = r"\s*pm.max_children\s*=\s*([0-9]+)\s*" tmp = re.search(rep, conf).groups() data['max_children'] = tmp[0] - rep = "\s*pm.start_servers\s*=\s*([0-9]+)\s*" + rep = r"\s*pm.start_servers\s*=\s*([0-9]+)\s*" tmp = re.search(rep, conf).groups() data['start_servers'] = tmp[0] - rep = "\s*pm.min_spare_servers\s*=\s*([0-9]+)\s*" + rep = r"\s*pm.min_spare_servers\s*=\s*([0-9]+)\s*" tmp = re.search(rep, conf).groups() data['min_spare_servers'] = tmp[0] - rep = "\s*pm.max_spare_servers \s*=\s*([0-9]+)\s*" + rep = r"\s*pm.max_spare_servers \s*=\s*([0-9]+)\s*" tmp = re.search(rep, conf).groups() data['max_spare_servers'] = tmp[0] - rep = "\s*pm\s*=\s*(\w+)\s*" + rep = r"\s*pm\s*=\s*(\w+)\s*" tmp = re.search(rep, conf).groups() data['pm'] = tmp[0] return mw.getJson(data) @@ -610,21 +610,21 @@ def setFpmConfig(version): file = getServerDir() + '/' + version + '/etc/php-fpm.d/'+pool+'.conf' conf = mw.readFile(file) - rep = "\s*pm.max_children\s*=\s*([0-9]+)\s*" + rep = r"\s*pm.max_children\s*=\s*([0-9]+)\s*" conf = re.sub(rep, "\npm.max_children = " + max_children, conf) - rep = "\s*pm.start_servers\s*=\s*([0-9]+)\s*" + rep = r"\s*pm.start_servers\s*=\s*([0-9]+)\s*" conf = re.sub(rep, "\npm.start_servers = " + start_servers, conf) - rep = "\s*pm.min_spare_servers\s*=\s*([0-9]+)\s*" + rep = r"\s*pm.min_spare_servers\s*=\s*([0-9]+)\s*" conf = re.sub(rep, "\npm.min_spare_servers = " + min_spare_servers, conf) - rep = "\s*pm.max_spare_servers \s*=\s*([0-9]+)\s*" + rep = r"\s*pm.max_spare_servers \s*=\s*([0-9]+)\s*" conf = re.sub(rep, "\npm.max_spare_servers = " + max_spare_servers + "\n", conf) - rep = "\s*pm\s*=\s*(\w+)\s*" + rep = r"\s*pm\s*=\s*(\w+)\s*" conf = re.sub(rep, "\npm = " + pm + "\n", conf) mw.writeFile(file, conf) @@ -883,7 +883,7 @@ def getDisableFunc(version): phpini = mw.readFile(filename) data = {} - rep = "disable_functions\s*=\s{0,1}(.*)\n" + rep = r"disable_functions\s*=\s{0,1}(.*)\n" tmp = re.search(rep, phpini).groups() data['disable_functions'] = tmp[0] return mw.getJson(data) @@ -898,7 +898,7 @@ def setDisableFunc(version): disable_functions = args['disable_functions'] phpini = mw.readFile(filename) - rep = "disable_functions\s*=\s*.*\n" + rep = r"disable_functions\s*=\s*.*\n" phpini = re.sub(rep, 'disable_functions = ' + disable_functions + "\n", phpini) diff --git a/plugins/phpmyadmin/index.py b/plugins/phpmyadmin/index.py index 659292191f..eac12be559 100755 --- a/plugins/phpmyadmin/index.py +++ b/plugins/phpmyadmin/index.py @@ -355,7 +355,7 @@ def setPmaPort(): if not os.path.exists(file): return mw.returnJson(False, '插件未启动!') content = mw.readFile(file) - rep = 'listen\s*(.*);' + rep = r'listen\s*(.*);' content = re.sub(rep, "listen " + port + ';', content) mw.writeFile(file, content) diff --git a/plugins/postgresql/index.py b/plugins/postgresql/index.py index 307a2447a8..5ac2bab9f8 100755 --- a/plugins/postgresql/index.py +++ b/plugins/postgresql/index.py @@ -116,7 +116,7 @@ def readConfigTpl(): def getDbPort(): file = getConf() content = mw.readFile(file) - rep = 'port\s*=\s*(\d*)?' + rep = r'port\s*=\s*(\d*)?' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -400,7 +400,7 @@ def initdUinstall(): def getMyDbPos(): file = getConf() content = mw.readFile(file) - rep = 'datadir\s*=\s*(.*)' + rep = r'datadir\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -408,7 +408,7 @@ def getMyDbPos(): def getPgPort(): file = getConf() content = mw.readFile(file) - rep = 'port\s*=\s*(.*)' + rep = r'port\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -422,7 +422,7 @@ def setPgPort(): port = args['port'] file = getConf() content = mw.readFile(file) - rep = "port\s*=\s*([0-9]+)\s*\n" + rep = r"port\s*=\s*([0-9]+)\s*\n" content = re.sub(rep, 'port = ' + port + '\n', content) mw.writeFile(file, content) restart() diff --git a/plugins/pureftp/index.py b/plugins/pureftp/index.py index e5da432fc0..6bb40ff740 100755 --- a/plugins/pureftp/index.py +++ b/plugins/pureftp/index.py @@ -277,7 +277,7 @@ def getFtpPort(): try: file = getServerDir() + '/etc/pure-ftpd.conf' conf = mw.readFile(file) - rep = "\n#?\s*Bind\s+[0-9]+\.[0-9]+\.[0-9]+\.+[0-9]+,([0-9]+)" + rep = r"\n#?\s*Bind\s+[0-9]+\.[0-9]+\.[0-9]+\.+[0-9]+,([0-9]+)" port = re.search(rep, conf).groups()[0] except: port = '21' diff --git a/plugins/redis/index.py b/plugins/redis/index.py index d5113e8242..9224ae8f9c 100755 --- a/plugins/redis/index.py +++ b/plugins/redis/index.py @@ -100,7 +100,7 @@ def readConfigTpl(): def getPidFile(): file = getConf() content = mw.readFile(file) - rep = 'pidfile\s*(.*)' + rep = r'pidfile\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -220,7 +220,7 @@ def getPort(): conf = getServerDir() + '/redis.conf' content = mw.readFile(conf) - rep = "^(" + 'port' + ')\s*([.0-9A-Za-z_& ~]+)' + rep = r"^(" + 'port' + ')\s*([.0-9A-Za-z_& ~]+)' tmp = re.search(rep, content, re.M) if tmp: return tmp.groups()[1] @@ -232,7 +232,7 @@ def getRedisCmd(): requirepass = "" conf = getServerDir() + '/redis.conf' content = mw.readFile(conf) - rep = "^(requirepass" + ')\s*([.0-9A-Za-z_& ~]+)' + rep = r"^(requirepass" + ')\s*([.0-9A-Za-z_& ~]+)' tmp = re.search(rep, content, re.M) if tmp: requirepass = tmp.groups()[1] diff --git a/plugins/rsyncd/index.py b/plugins/rsyncd/index.py index 6018d984af..9423ab738a 100755 --- a/plugins/rsyncd/index.py +++ b/plugins/rsyncd/index.py @@ -96,7 +96,7 @@ def appAuthPwd(name): def getLog(): conf_path = appConf() conf = mw.readFile(conf_path) - rep = 'log file\s*=\s*(.*)' + rep = r'log file\s*=\s*(.*)' tmp = re.search(rep, conf) if not tmp: return '' @@ -106,7 +106,7 @@ def getLog(): def getLsyncdLog(): path = getServerDir() + "/lsyncd.conf" conf = mw.readFile(path) - rep = 'logfile\s*=\s*\"(.*)\"' + rep = r'logfile\s*=\s*\"(.*)\"' tmp = re.search(rep, conf) if not tmp: return '' diff --git a/plugins/simpleping/index.py b/plugins/simpleping/index.py index 89a8b16fbb..f27b2b3c28 100755 --- a/plugins/simpleping/index.py +++ b/plugins/simpleping/index.py @@ -117,7 +117,7 @@ def readConfigTpl(): def getPidFile(): file = getConf() content = mw.readFile(file) - rep = 'pidfile\s*(.*)' + rep = r'pidfile\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() From b8502c74591a62f68e503a6f78ed10bafa6bc264 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 13:22:26 +0800 Subject: [PATCH 089/146] update --- plugins/mariadb/index.py | 30 ++++++++++++++---------------- plugins/memcached/index.py | 2 +- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/plugins/mariadb/index.py b/plugins/mariadb/index.py index b30be6fdf3..d92360821d 100755 --- a/plugins/mariadb/index.py +++ b/plugins/mariadb/index.py @@ -86,21 +86,21 @@ def getConf(): def getDataDir(): file = getConf() content = mw.readFile(file) - rep = 'datadir\s*=\s*(.*)' + rep = r'datadir\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() def getLogBinName(): file = getConf() content = mw.readFile(file) - rep = 'log-bin\s*=\s*(.*)' + rep = r'log-bin\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() def getPidFile(): file = getConf() content = mw.readFile(file) - rep = 'pid-file\s*=\s*(.*)' + rep = r'pid-file\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -108,7 +108,7 @@ def getPidFile(): def getDbPort(): file = getConf() content = mw.readFile(file) - rep = 'port\s*=\s*(.*)' + rep = r'port\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -116,7 +116,7 @@ def getDbPort(): def getDbServerId(): file = getConf() content = mw.readFile(file) - rep = 'server-id\s*=\s*(.*)' + rep = r'server-id\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -124,7 +124,7 @@ def getDbServerId(): def getSocketFile(): file = getConf() content = mw.readFile(file) - rep = 'socket\s*=\s*(.*)' + rep = r'socket\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -378,7 +378,7 @@ def getErrorLog(): def getShowLogFile(): file = getConf() content = mw.readFile(file) - rep = 'slow-query-log-file\s*=\s*(.*)' + rep = r'slow-query-log-file\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -547,7 +547,7 @@ def initdUinstall(): def getMyDbPos(): file = getConf() content = mw.readFile(file) - rep = 'datadir\s*=\s*(.*)' + rep = r'datadir\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -597,7 +597,7 @@ def setMyDbPos(): def getMyPort(): file = getConf() content = mw.readFile(file) - rep = 'port\s*=\s*(.*)' + rep = r'port\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -611,7 +611,7 @@ def setMyPort(): port = args['port'] file = getConf() content = mw.readFile(file) - rep = "port\s*=\s*([0-9]+)\s*\n" + rep = r"port\s*=\s*([0-9]+)\s*\n" content = re.sub(rep, 'port = ' + port + '\n', content) mw.writeFile(file, content) restart() @@ -688,7 +688,7 @@ def setDbStatus(): s = 'K' if g in emptys: s = '' - rep = '\s*' + g + '\s*=\s*\d+(M|K|k|m|G)?\n' + rep = r'\s*' + g + r'\s*=\s*\d+(M|K|k|m|G)?\n' c = g + ' = ' + args[g] + s + '\n' if content.find(g) != -1: content = re.sub(rep, '\n' + c, content, 1) @@ -1280,7 +1280,7 @@ def addDb(): dataAccess = args['dataAccess'].strip() ps = args['ps'].strip() - reg = "^[\w\.-]+$" + reg = r"^[\w\.-]+$" if not re.match(reg, args['name']): return mw.returnJson(False, '数据库名称不能带有特殊符号!') checks = ['root', 'mysql', 'test', 'sys', 'panel_logs'] @@ -1846,8 +1846,7 @@ def setDbMaster(version): if not isHas: prefix = '#binlog-do-db' - con = con.replace( - prefix, prefix + "\nbinlog-do-db=" + args['name']) + con = con.replace(prefix, prefix + "\nbinlog-do-db=" + args['name']) mw.writeFile(conf, con) restart(version) @@ -1876,8 +1875,7 @@ def setDbSlave(version): if not isHas: prefix = '#replicate-do-db' - con = con.replace( - prefix, prefix + "\nreplicate-do-db=" + args['name']) + con = con.replace(prefix, prefix + "\nreplicate-do-db=" + args['name']) mw.writeFile(conf, con) restart(version) diff --git a/plugins/memcached/index.py b/plugins/memcached/index.py index 6ea7ab6080..d9f957ba1f 100755 --- a/plugins/memcached/index.py +++ b/plugins/memcached/index.py @@ -59,7 +59,7 @@ def getConfTpl(): def getMemPort(): path = getServerDir() + '/memcached.env' content = mw.readFile(path) - rep = 'PORT\s*=\s*(\d*)' + rep = r'PORT\s*=\s*(\d*)' tmp = re.search(rep, content) return tmp.groups()[0] From 72367c40fe5474020e49729a4ae1525835cf9dd6 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 13:29:14 +0800 Subject: [PATCH 090/146] update --- plugins/gitea/index.py | 12 ++++++------ plugins/gogs/index.py | 14 +++++++------- plugins/keepalived/index.py | 2 +- plugins/webstats/index.py | 4 ++-- plugins/xhprof/index.py | 4 ++-- plugins/zabbix/index.py | 12 ++++++------ plugins/zabbix_agent/index.py | 4 ++-- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/plugins/gitea/index.py b/plugins/gitea/index.py index b16b39a5fa..1f480729d1 100755 --- a/plugins/gitea/index.py +++ b/plugins/gitea/index.py @@ -170,12 +170,12 @@ def initDreplace(): def getRootUrl(): content = mw.readFile(getConf()) - rep = 'ROOT_URL\s*=\s*(.*)' + rep = r'ROOT_URL\s*=\s*(.*)' tmp = re.search(rep, content) if tmp: return tmp.groups()[0] - rep = 'EXTERNAL_URL\s*=\s*(.*)' + rep = r'EXTERNAL_URL\s*=\s*(.*)' tmp = re.search(rep, content) if tmp: return tmp.groups()[0] @@ -184,7 +184,7 @@ def getRootUrl(): def getSshPort(): content = mw.readFile(getConf()) - rep = 'SSH_PORT\s*=\s*(.*)' + rep = r'SSH_PORT\s*=\s*(.*)' tmp = re.search(rep, content) if not tmp: return '' @@ -193,7 +193,7 @@ def getSshPort(): def getHttpPort(): content = mw.readFile(getConf()) - rep = 'HTTP_PORT\s*=\s*(.*)' + rep = r'HTTP_PORT\s*=\s*(.*)' tmp = re.search(rep, content) if not tmp: return '' @@ -202,7 +202,7 @@ def getHttpPort(): def getRootPath(): content = mw.readFile(getConf()) - rep = 'ROOT\s*=\s*(.*)' + rep = r'ROOT\s*=\s*(.*)' tmp = re.search(rep, content) if not tmp: return '' @@ -215,7 +215,7 @@ def getDbConfValue(): return {} content = mw.readFile(conf) - rep_scope = "\[database\](.*?)\[" + rep_scope = r"\[database\](.*?)\[" tmp = re.findall(rep_scope, content, re.S) rep = '(\w*)\s*=\s*(.*)' diff --git a/plugins/gogs/index.py b/plugins/gogs/index.py index ef103e29c7..2424250dc2 100755 --- a/plugins/gogs/index.py +++ b/plugins/gogs/index.py @@ -173,12 +173,12 @@ def initDreplace(): def getRootUrl(): content = mw.readFile(getConf()) - rep = 'ROOT_URL\s*=\s*(.*)' + rep = r'ROOT_URL\s*=\s*(.*)' tmp = re.search(rep, content) if tmp: return tmp.groups()[0] - rep = 'EXTERNAL_URL\s*=\s*(.*)' + rep = r'EXTERNAL_URL\s*=\s*(.*)' tmp = re.search(rep, content) if tmp: return tmp.groups()[0] @@ -187,7 +187,7 @@ def getRootUrl(): def getSshPort(): content = mw.readFile(getConf()) - rep = 'SSH_PORT\s*=\s*(.*)' + rep = r'SSH_PORT\s*=\s*(.*)' tmp = re.search(rep, content) if not tmp: return '' @@ -196,7 +196,7 @@ def getSshPort(): def getHttpPort(): content = mw.readFile(getConf()) - rep = 'HTTP_PORT\s*=\s*(.*)' + rep = r'HTTP_PORT\s*=\s*(.*)' tmp = re.search(rep, content) if not tmp: return '' @@ -205,7 +205,7 @@ def getHttpPort(): def getRootPath(): content = mw.readFile(getConf()) - rep = 'ROOT\s*=\s*(.*)' + rep = r'ROOT\s*=\s*(.*)' tmp = re.search(rep, content) if not tmp: return '' @@ -218,10 +218,10 @@ def getDbConfValue(): return {} content = mw.readFile(conf) - rep_scope = "\[database\](.*?)\[" + rep_scope = r"\[database\](.*?)\[" tmp = re.findall(rep_scope, content, re.S) - rep = '(\w*)\s*=\s*(.*)' + rep = r'(\w*)\s*=\s*(.*)' tmp = re.findall(rep, tmp[0]) r = {} for x in range(len(tmp)): diff --git a/plugins/keepalived/index.py b/plugins/keepalived/index.py index d1d3a2d243..12455677b5 100755 --- a/plugins/keepalived/index.py +++ b/plugins/keepalived/index.py @@ -253,7 +253,7 @@ def getPort(): conf = getServerDir() + '/keepalived.conf' content = mw.readFile(conf) - rep = "^(" + 'port' + ')\s*([.0-9A-Za-z_& ~]+)' + rep = r"^(" + 'port' + r')\s*([.0-9A-Za-z_& ~]+)' tmp = re.search(rep, content, re.M) if tmp: return tmp.groups()[1] diff --git a/plugins/webstats/index.py b/plugins/webstats/index.py index 674dcd53df..3c272cce5a 100755 --- a/plugins/webstats/index.py +++ b/plugins/webstats/index.py @@ -331,7 +331,7 @@ def getGlobalConf(): def openLuaNeedRequestBody(): conf = luaConf() content = mw.readFile(conf) - content = re.sub("lua_need_request_body (.*);", + content = re.sub(r"lua_need_request_body (.*);", 'lua_need_request_body on;', content) mw.writeFile(conf, content) @@ -339,7 +339,7 @@ def openLuaNeedRequestBody(): def closeLuaNeedRequestBody(): conf = luaConf() content = mw.readFile(conf) - content = re.sub("lua_need_request_body (.*);", + content = re.sub(r"lua_need_request_body (.*);", 'lua_need_request_body off;', content) mw.writeFile(conf, content) diff --git a/plugins/xhprof/index.py b/plugins/xhprof/index.py index 40711dd8f3..cbe06fd73e 100755 --- a/plugins/xhprof/index.py +++ b/plugins/xhprof/index.py @@ -51,7 +51,7 @@ def getConf(): def getPort(): file = getConf() content = mw.readFile(file) - rep = 'listen\s*(.*);' + rep = r'listen\s*(.*);' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -193,7 +193,7 @@ def setXhPort(): if not os.path.exists(file): return mw.returnJson(False, '插件未启动!') content = mw.readFile(file) - rep = 'listen\s*(.*);' + rep = r'listen\s*(.*);' content = re.sub(rep, "listen " + port + ';', content) mw.writeFile(file, content) mw.restartWeb() diff --git a/plugins/zabbix/index.py b/plugins/zabbix/index.py index 493d3d764e..e7901729b5 100755 --- a/plugins/zabbix/index.py +++ b/plugins/zabbix/index.py @@ -75,7 +75,7 @@ def checkArgs(data, ck=[]): def getPidFile(): file = getConf() content = mw.readFile(file) - rep = 'pidfile\s*(.*)' + rep = r'pidfile\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -131,14 +131,14 @@ def getMySQLConf(): def getMySQLPort(): file = getMySQLConf() content = mw.readFile(file) - rep = 'port\s*=\s*(.*)' + rep = r'port\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() def getMySQLSocketFile(): file = getMySQLConf() content = mw.readFile(file) - rep = 'socket\s*=\s*(.*)' + rep = r'socket\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -201,7 +201,7 @@ def getInstalledPhpConfDir(): return 'php-80' def isInstalledPhp(): - phpver = ["80","81","82","83","84"] + phpver = ["80","81","82","83","84","85"] php_type = ['php-apt','php-yum', 'php']; for pt in php_type: @@ -438,7 +438,7 @@ def runLog(): zs_conf = zabbixServerConf() content = mw.readFile(zs_conf) - rep = 'LogFile=\s*(.*)' + rep = r'LogFile=\s*(.*)' tmp = re.search(rep, content) if tmp.groups(): @@ -449,7 +449,7 @@ def zabbixAgentLog(): za_conf = zabbixAgentConf() content = mw.readFile(za_conf) - rep = 'LogFile=\s*(.*)' + rep = r'LogFile=\s*(.*)' tmp = re.search(rep, content) if tmp.groups(): diff --git a/plugins/zabbix_agent/index.py b/plugins/zabbix_agent/index.py index 0597d465b4..2b48cd4444 100755 --- a/plugins/zabbix_agent/index.py +++ b/plugins/zabbix_agent/index.py @@ -66,7 +66,7 @@ def checkArgs(data, ck=[]): def getPidFile(): file = getConf() content = mw.readFile(file) - rep = 'pidfile\s*(.*)' + rep = r'pidfile\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -90,7 +90,7 @@ def runLog(): za_conf = zabbixAgentConf() content = mw.readFile(za_conf) - rep = 'LogFile=\s*(.*)' + rep = r'LogFile=\s*(.*)' tmp = re.search(rep, content) if tmp.groups() == 0: From 82a0fde37ccfcea30e04571629502ddb937fdf0a Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 13:40:53 +0800 Subject: [PATCH 091/146] Update index.py --- plugins/redis/index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/redis/index.py b/plugins/redis/index.py index 9224ae8f9c..fc39f3997c 100755 --- a/plugins/redis/index.py +++ b/plugins/redis/index.py @@ -220,7 +220,7 @@ def getPort(): conf = getServerDir() + '/redis.conf' content = mw.readFile(conf) - rep = r"^(" + 'port' + ')\s*([.0-9A-Za-z_& ~]+)' + rep = r"^(" + r'port' + r')\s*([.0-9A-Za-z_& ~]+)' tmp = re.search(rep, content, re.M) if tmp: return tmp.groups()[1] @@ -232,7 +232,7 @@ def getRedisCmd(): requirepass = "" conf = getServerDir() + '/redis.conf' content = mw.readFile(conf) - rep = r"^(requirepass" + ')\s*([.0-9A-Za-z_& ~]+)' + rep = r"^(requirepass" + r')\s*([.0-9A-Za-z_& ~]+)' tmp = re.search(rep, content, re.M) if tmp: requirepass = tmp.groups()[1] From 5e9b5466a6fc80761e44490f3e09524af73421b2 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 13:43:15 +0800 Subject: [PATCH 092/146] Update ubuntu.sh --- scripts/install/ubuntu.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/install/ubuntu.sh b/scripts/install/ubuntu.sh index 1cfbcc31d7..8fe85debaa 100644 --- a/scripts/install/ubuntu.sh +++ b/scripts/install/ubuntu.sh @@ -26,9 +26,21 @@ apt install -y libncurses5 apt install -y libncurses5-dev apt install -y software-properties-common -apt install -y locate -locale-gen en_US.UTF-8 -localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 +# choose lang cmd +# dpkg-reconfigure --frontend=noninteractive locales +# dpkg-reconfigure locales +if [ ! -f /usr/sbin/locale-gen ];then + apt install -y locales + sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen + locale-gen en_US.UTF-8 + locale-gen zh_CN.UTF-8 + localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 > /dev/null 2>&1 + update-locale LANG=en_US.UTF-8 +else + locale-gen en_US.UTF-8 + locale-gen zh_CN.UTF-8 + localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 > /dev/null 2>&1 +fi SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'` if [ "$SSH_PORT" == "" ];then From fd8bda7f485c98bcb15b140d3e205ca53d458303 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 13:44:51 +0800 Subject: [PATCH 093/146] Update index.py --- plugins/redis/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/redis/index.py b/plugins/redis/index.py index fc39f3997c..f9c7fa4f4f 100755 --- a/plugins/redis/index.py +++ b/plugins/redis/index.py @@ -482,7 +482,7 @@ def getRedisConfInfo(): result = [] for g in gets: - rep = "^(" + g['name'] + ')\s*([.0-9A-Za-z_& ~]+)' + rep = "^(" + g['name'] + r')\s*([.0-9A-Za-z_& ~]+)' tmp = re.search(rep, content, re.M) if not tmp: if g['must_show'] == 0: From f5f9064c52b8678bb26ae399986810fc9ed3c734 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 13:45:08 +0800 Subject: [PATCH 094/146] Update index.py --- plugins/redis/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/redis/index.py b/plugins/redis/index.py index f9c7fa4f4f..243bcfcc53 100755 --- a/plugins/redis/index.py +++ b/plugins/redis/index.py @@ -482,7 +482,7 @@ def getRedisConfInfo(): result = [] for g in gets: - rep = "^(" + g['name'] + r')\s*([.0-9A-Za-z_& ~]+)' + rep = r"^(" + g['name'] + r')\s*([.0-9A-Za-z_& ~]+)' tmp = re.search(rep, content, re.M) if not tmp: if g['must_show'] == 0: From 36189407131925d475d63b47fecea51814a83ffa Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 13:45:17 +0800 Subject: [PATCH 095/146] Update index.py --- plugins/redis/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/redis/index.py b/plugins/redis/index.py index 243bcfcc53..b38adcd32c 100755 --- a/plugins/redis/index.py +++ b/plugins/redis/index.py @@ -512,7 +512,7 @@ def submitRedisConf(): content = mw.readFile(conf) for g in gets: if g in args: - rep = g + '\s*([.0-9A-Za-z_& ~]+)' + rep = g + r'\s*([.0-9A-Za-z_& ~]+)' val = g + ' ' + args[g] if g == 'maxmemory': From 63349ce33b7b26baaa1510ba69370fcbd98acf5a Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 13:48:03 +0800 Subject: [PATCH 096/146] Update index.py --- plugins/mariadb/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mariadb/index.py b/plugins/mariadb/index.py index d92360821d..8e9c75f7af 100755 --- a/plugins/mariadb/index.py +++ b/plugins/mariadb/index.py @@ -1995,7 +1995,7 @@ def addMasterRepSlaveUser(version=''): # address = args['address'].strip() # dataAccess = args['dataAccess'].strip() - reg = "^[\w-]+$" + reg = r"^[\w-]+$" if not re.match(reg, username): return mw.returnJson(False, '用户名不能带有特殊符号!') checks = ['root', 'mysql', 'test', 'sys', 'panel_logs'] From bf95d50cfd575da1c4acb53ea2b422f9bad8aa43 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 14:03:22 +0800 Subject: [PATCH 097/146] Update install.sh --- plugins/mysql-yum/versions/9.0/install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/mysql-yum/versions/9.0/install.sh b/plugins/mysql-yum/versions/9.0/install.sh index f5b96f676b..3f24537f49 100755 --- a/plugins/mysql-yum/versions/9.0/install.sh +++ b/plugins/mysql-yum/versions/9.0/install.sh @@ -54,7 +54,7 @@ mkdir -p $myDir # https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar # https://cdn.mysql.com/archives/mysql-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar -wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar +wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://dev.mysql.com/get/Downloads/MySQL-9.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin @@ -84,8 +84,8 @@ chown mysql -R /var/run/mysqld ####### mkdir -p $myDir -wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar -echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar" +wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-9.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar +echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-9.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar" cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin From 044f1306719702769b96231f7ab014545fde59fb Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 14:04:38 +0800 Subject: [PATCH 098/146] update --- plugins/mysql-yum/versions/5.7/install.sh | 4 ++-- plugins/mysql-yum/versions/8.2/install.sh | 4 ++-- plugins/mysql-yum/versions/8.3/install.sh | 4 ++-- plugins/mysql-yum/versions/8.4/install.sh | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/mysql-yum/versions/5.7/install.sh b/plugins/mysql-yum/versions/5.7/install.sh index 17e5203b99..9e31a9e957 100755 --- a/plugins/mysql-yum/versions/5.7/install.sh +++ b/plugins/mysql-yum/versions/5.7/install.sh @@ -83,8 +83,8 @@ chown mysql -R /var/run/mysqld ####### mkdir -p $myDir -wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar -echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar" +wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-5.7/mysql-${SUFFIX_NAME}.rpm-bundle.tar +echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-5.7/mysql-${SUFFIX_NAME}.rpm-bundle.tar" cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin diff --git a/plugins/mysql-yum/versions/8.2/install.sh b/plugins/mysql-yum/versions/8.2/install.sh index d8477b191a..9985fbc5a1 100755 --- a/plugins/mysql-yum/versions/8.2/install.sh +++ b/plugins/mysql-yum/versions/8.2/install.sh @@ -81,8 +81,8 @@ chown mysql -R /var/run/mysqld ####### mkdir -p $myDir -wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar -echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar" +wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.2/mysql-${SUFFIX_NAME}.rpm-bundle.tar +echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.2/mysql-${SUFFIX_NAME}.rpm-bundle.tar" cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin diff --git a/plugins/mysql-yum/versions/8.3/install.sh b/plugins/mysql-yum/versions/8.3/install.sh index c3a676aab9..53dc0a377c 100755 --- a/plugins/mysql-yum/versions/8.3/install.sh +++ b/plugins/mysql-yum/versions/8.3/install.sh @@ -81,8 +81,8 @@ chown mysql -R /var/run/mysqld ####### mkdir -p $myDir -wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar -echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar" +wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.3/mysql-${SUFFIX_NAME}.rpm-bundle.tar +echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.3/mysql-${SUFFIX_NAME}.rpm-bundle.tar" cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin diff --git a/plugins/mysql-yum/versions/8.4/install.sh b/plugins/mysql-yum/versions/8.4/install.sh index ad97de8e50..da2bd3fb6a 100755 --- a/plugins/mysql-yum/versions/8.4/install.sh +++ b/plugins/mysql-yum/versions/8.4/install.sh @@ -84,8 +84,8 @@ chown mysql -R /var/run/mysqld ####### mkdir -p $myDir -wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar -echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar" +wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar +echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar" cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin From 36e7085ce0da62ac0a43ddcc1378a3f5a85a86f2 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 14:10:30 +0800 Subject: [PATCH 099/146] update --- plugins/mysql-yum/versions/5.7/install.sh | 1 + plugins/mysql-yum/versions/8.0/install.sh | 4 ++-- plugins/mysql-yum/versions/8.2/install.sh | 4 ++-- plugins/mysql-yum/versions/8.3/install.sh | 4 ++-- plugins/mysql-yum/versions/8.4/install.sh | 4 ++-- plugins/mysql-yum/versions/9.0/install.sh | 5 +++-- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/plugins/mysql-yum/versions/5.7/install.sh b/plugins/mysql-yum/versions/5.7/install.sh index 9e31a9e957..734b30d65b 100755 --- a/plugins/mysql-yum/versions/5.7/install.sh +++ b/plugins/mysql-yum/versions/5.7/install.sh @@ -85,6 +85,7 @@ mkdir -p $myDir wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-5.7/mysql-${SUFFIX_NAME}.rpm-bundle.tar echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-5.7/mysql-${SUFFIX_NAME}.rpm-bundle.tar" + cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin diff --git a/plugins/mysql-yum/versions/8.0/install.sh b/plugins/mysql-yum/versions/8.0/install.sh index 04c211d1df..dac00d780f 100755 --- a/plugins/mysql-yum/versions/8.0/install.sh +++ b/plugins/mysql-yum/versions/8.0/install.sh @@ -80,8 +80,8 @@ chown mysql -R /var/run/mysqld ####### mkdir -p $myDir -wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar -echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar" +wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar +echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar" cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin diff --git a/plugins/mysql-yum/versions/8.2/install.sh b/plugins/mysql-yum/versions/8.2/install.sh index 9985fbc5a1..711c88942d 100755 --- a/plugins/mysql-yum/versions/8.2/install.sh +++ b/plugins/mysql-yum/versions/8.2/install.sh @@ -81,8 +81,8 @@ chown mysql -R /var/run/mysqld ####### mkdir -p $myDir -wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.2/mysql-${SUFFIX_NAME}.rpm-bundle.tar -echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.2/mysql-${SUFFIX_NAME}.rpm-bundle.tar" +wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-8.2/mysql-${SUFFIX_NAME}.rpm-bundle.tar +echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-8.2/mysql-${SUFFIX_NAME}.rpm-bundle.tar" cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin diff --git a/plugins/mysql-yum/versions/8.3/install.sh b/plugins/mysql-yum/versions/8.3/install.sh index 53dc0a377c..33b2f30d84 100755 --- a/plugins/mysql-yum/versions/8.3/install.sh +++ b/plugins/mysql-yum/versions/8.3/install.sh @@ -81,8 +81,8 @@ chown mysql -R /var/run/mysqld ####### mkdir -p $myDir -wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.3/mysql-${SUFFIX_NAME}.rpm-bundle.tar -echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.3/mysql-${SUFFIX_NAME}.rpm-bundle.tar" +wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-8.3/mysql-${SUFFIX_NAME}.rpm-bundle.tar +echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-8.3/mysql-${SUFFIX_NAME}.rpm-bundle.tar" cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin diff --git a/plugins/mysql-yum/versions/8.4/install.sh b/plugins/mysql-yum/versions/8.4/install.sh index da2bd3fb6a..90e06b4b84 100755 --- a/plugins/mysql-yum/versions/8.4/install.sh +++ b/plugins/mysql-yum/versions/8.4/install.sh @@ -84,8 +84,8 @@ chown mysql -R /var/run/mysqld ####### mkdir -p $myDir -wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar -echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar" +wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar +echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar" cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin diff --git a/plugins/mysql-yum/versions/9.0/install.sh b/plugins/mysql-yum/versions/9.0/install.sh index 3f24537f49..69c82c0013 100755 --- a/plugins/mysql-yum/versions/9.0/install.sh +++ b/plugins/mysql-yum/versions/9.0/install.sh @@ -84,8 +84,9 @@ chown mysql -R /var/run/mysqld ####### mkdir -p $myDir -wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-9.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar -echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-9.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar" + +wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-9.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar +echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-9.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar" cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin From 6f02ccf6e7ec4e1de3cee9f603088fd8f2b19e89 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 14:21:36 +0800 Subject: [PATCH 100/146] update --- plugins/mysql-yum/versions/8.0/install.sh | 4 ++-- plugins/mysql-yum/versions/8.2/install.sh | 4 ++-- plugins/mysql-yum/versions/8.3/install.sh | 4 ++-- plugins/mysql-yum/versions/8.4/install.sh | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/mysql-yum/versions/8.0/install.sh b/plugins/mysql-yum/versions/8.0/install.sh index dac00d780f..1a3319f3d7 100755 --- a/plugins/mysql-yum/versions/8.0/install.sh +++ b/plugins/mysql-yum/versions/8.0/install.sh @@ -80,9 +80,9 @@ chown mysql -R /var/run/mysqld ####### mkdir -p $myDir -wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar -echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar" +wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar +echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar" mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin diff --git a/plugins/mysql-yum/versions/8.2/install.sh b/plugins/mysql-yum/versions/8.2/install.sh index 711c88942d..242b0f9a16 100755 --- a/plugins/mysql-yum/versions/8.2/install.sh +++ b/plugins/mysql-yum/versions/8.2/install.sh @@ -81,8 +81,8 @@ chown mysql -R /var/run/mysqld ####### mkdir -p $myDir -wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-8.2/mysql-${SUFFIX_NAME}.rpm-bundle.tar -echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-8.2/mysql-${SUFFIX_NAME}.rpm-bundle.tar" +wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.2/mysql-${SUFFIX_NAME}.rpm-bundle.tar +echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.2/mysql-${SUFFIX_NAME}.rpm-bundle.tar" cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin diff --git a/plugins/mysql-yum/versions/8.3/install.sh b/plugins/mysql-yum/versions/8.3/install.sh index 33b2f30d84..50ffd5bdd3 100755 --- a/plugins/mysql-yum/versions/8.3/install.sh +++ b/plugins/mysql-yum/versions/8.3/install.sh @@ -81,8 +81,8 @@ chown mysql -R /var/run/mysqld ####### mkdir -p $myDir -wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-8.3/mysql-${SUFFIX_NAME}.rpm-bundle.tar -echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-8.3/mysql-${SUFFIX_NAME}.rpm-bundle.tar" +wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.3/mysql-${SUFFIX_NAME}.rpm-bundle.tar +echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.3/mysql-${SUFFIX_NAME}.rpm-bundle.tar" cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin diff --git a/plugins/mysql-yum/versions/8.4/install.sh b/plugins/mysql-yum/versions/8.4/install.sh index 90e06b4b84..9c80cb9bc3 100755 --- a/plugins/mysql-yum/versions/8.4/install.sh +++ b/plugins/mysql-yum/versions/8.4/install.sh @@ -84,8 +84,8 @@ chown mysql -R /var/run/mysqld ####### mkdir -p $myDir -wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar -echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar" +wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar +echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar" cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin From bfc2a82384d56c408f003508e27d6d04df610be8 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 14:26:08 +0800 Subject: [PATCH 101/146] Update install.sh --- plugins/mysql/versions/9.0/install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/mysql/versions/9.0/install.sh b/plugins/mysql/versions/9.0/install.sh index ac433a427b..af191bc268 100755 --- a/plugins/mysql/versions/9.0/install.sh +++ b/plugins/mysql/versions/9.0/install.sh @@ -163,8 +163,8 @@ Install_mysql() export PKG_CONFIG_PATH=/usr/lib/pkgconfig apt install -y gcc-11 g++-11 - WHERE_DIR_GCC=/usr/bin/gcc-11 - WHERE_DIR_GPP=/usr/bin/g++-11 + WHERE_DIR_GCC=/usr/bin/gcc-13 + WHERE_DIR_GPP=/usr/bin/g++-13 fi @@ -173,8 +173,8 @@ Install_mysql() zypper install -y gcc11-c++ - WHERE_DIR_GCC=/usr/bin/gcc-11 - WHERE_DIR_GPP=/usr/bin/g++-11 + WHERE_DIR_GCC=/usr/bin/gcc-13 + WHERE_DIR_GPP=/usr/bin/g++-13 fi if [ ! -d $serverPath/mysql ];then From 0912360794b292720ef4018d866159b9e78fadd3 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 14:30:42 +0800 Subject: [PATCH 102/146] Update index.py --- plugins/postgresql/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/postgresql/index.py b/plugins/postgresql/index.py index 5ac2bab9f8..2c5a2a79e0 100755 --- a/plugins/postgresql/index.py +++ b/plugins/postgresql/index.py @@ -866,7 +866,7 @@ def addDb(): if listen_ip not in ["127.0.0.1/32", "localhost", "127.0.0.1"]: sedConf("listen_addresses", "'*'") - reg = "^[\w\.-]+$" + reg = r"^[\w\.-]+$" if not re.match(reg, dbname): return mw.returnJson(False, '数据库名称不能带有特殊符号!') From 97a07b49551f06866bbe388e15127ccb1dd367ca Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 14:32:35 +0800 Subject: [PATCH 103/146] Update index.py --- plugins/postgresql/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/postgresql/index.py b/plugins/postgresql/index.py index 2c5a2a79e0..8d4704b6dd 100755 --- a/plugins/postgresql/index.py +++ b/plugins/postgresql/index.py @@ -1337,7 +1337,7 @@ def addMasterRepSlaveUser(version=''): if len(password) < 1: password = mw.md5(time.time())[0:8] - if not re.match("^[\w\.-]+$", username): + if not re.match(r"^[\w\.-]+$", username): return mw.returnJson(False, '用户名不能带有特殊符号!') checks = ['root', 'mysql', 'test', 'sys', 'panel_logs'] if username in checks or len(username) < 1: From 875db69bcfe4657cd3ed6cc514c003b6a7b3e0f2 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 14:33:47 +0800 Subject: [PATCH 104/146] Update index.py --- plugins/sphinx/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sphinx/index.py b/plugins/sphinx/index.py index 4d56bf4570..041ec35391 100755 --- a/plugins/sphinx/index.py +++ b/plugins/sphinx/index.py @@ -295,7 +295,7 @@ def sphinxConfParse(): file = getConf() bin_dir = getServerDir() content = mw.readFile(file) - rep = 'index\s(.*)' + rep = r'index\s(.*)' sindex = re.findall(rep, content) indexlen = len(sindex) cmd = {} From f622ea67791cd504469e11873281f4874e8a3734 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 14:46:10 +0800 Subject: [PATCH 105/146] update --- plugins/sphinx/index.py | 8 ++++++++ plugins/sphinx/info.json | 1 + 2 files changed, 9 insertions(+) diff --git a/plugins/sphinx/index.py b/plugins/sphinx/index.py index 041ec35391..ed97c2e3de 100755 --- a/plugins/sphinx/index.py +++ b/plugins/sphinx/index.py @@ -423,6 +423,12 @@ def updateDelta(): return '' +def installPreInspection(): + data = mw.execShell('arch') + if data[0].strip().startswith('aarch'): + return '不支持aarch架构' + return 'ok' + if __name__ == "__main__": func = sys.argv[1] if func == 'status': @@ -443,6 +449,8 @@ def updateDelta(): print(initdInstall()) elif func == 'initd_uninstall': print(initdUinstall()) + elif func == 'install_pre_inspection': + print(installPreInspection(version)) elif func == 'conf': print(getConf()) elif func == 'config_tpl': diff --git a/plugins/sphinx/info.json b/plugins/sphinx/info.json index 9150c8822d..db7ab082e1 100755 --- a/plugins/sphinx/info.json +++ b/plugins/sphinx/info.json @@ -6,6 +6,7 @@ "shell": "install.sh", "versions":["3.1.1","3.2.1","3.3.1","3.4.1","3.5.1","3.6.1","3.7.1"], "tip": "soft", + "install_pre_inspection":true, "checks": "server/sphinx", "path": "server/sphinx", "display": 1, From 5a71ec8d6cfb09a95abf8efd94f4b455a5ab10f8 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 14:48:47 +0800 Subject: [PATCH 106/146] Update index.py --- plugins/sphinx/index.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/sphinx/index.py b/plugins/sphinx/index.py index ed97c2e3de..ade4fca3dd 100755 --- a/plugins/sphinx/index.py +++ b/plugins/sphinx/index.py @@ -423,13 +423,18 @@ def updateDelta(): return '' -def installPreInspection(): +def installPreInspection(version): data = mw.execShell('arch') if data[0].strip().startswith('aarch'): return '不支持aarch架构' return 'ok' if __name__ == "__main__": + version = "3.1.1" + version_pl = getServerDir() + "/version.pl" + if os.path.exists(version_pl): + version = mw.readFile(version_pl).strip() + func = sys.argv[1] if func == 'status': print(status()) From 4bda6ab1b1102a53463b996270b4392af3658dbc Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 20:53:58 +0800 Subject: [PATCH 107/146] Update cert_api.py --- class/core/cert_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class/core/cert_api.py b/class/core/cert_api.py index a9978f07ab..8acac8f591 100644 --- a/class/core/cert_api.py +++ b/class/core/cert_api.py @@ -1279,7 +1279,7 @@ def getSitePath(self, siteName): file = self.getHostConf(siteName) if os.path.exists(file): conf = mw.readFile(file) - rep = '\s*root\s*(.+);' + rep = r'\s*root\s*(.+);' path = re.search(rep, conf).groups()[0] return path return '' From 517c65b790225d8531eaa7f1cb15e12ed83c5edc Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 20:55:42 +0800 Subject: [PATCH 108/146] Update plugins_api.py --- class/core/plugins_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class/core/plugins_api.py b/class/core/plugins_api.py index 9579c5facd..761dbf2187 100755 --- a/class/core/plugins_api.py +++ b/class/core/plugins_api.py @@ -480,7 +480,7 @@ def inputZipApi(self): plugin_path = mw.getPluginDir() + '/' + plugin_name if not os.path.exists(plugin_path): print(mw.execShell('mkdir -p ' + plugin_path)) - mw.execShell("\cp -rf " + tmp_path + '/* ' + plugin_path + '/') + mw.execShell("\\cp -rf " + tmp_path + '/* ' + plugin_path + '/') mw.execShell('chmod -R 755 ' + plugin_path) p_info = mw.readFile(plugin_path + '/info.json') if p_info: From 0bcf0465a6f6ee53e297f10f727565ccf18fdd9c Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 20:56:15 +0800 Subject: [PATCH 109/146] Update plugins_api.py --- class/core/plugins_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class/core/plugins_api.py b/class/core/plugins_api.py index 761dbf2187..afdd1c4806 100755 --- a/class/core/plugins_api.py +++ b/class/core/plugins_api.py @@ -480,7 +480,7 @@ def inputZipApi(self): plugin_path = mw.getPluginDir() + '/' + plugin_name if not os.path.exists(plugin_path): print(mw.execShell('mkdir -p ' + plugin_path)) - mw.execShell("\\cp -rf " + tmp_path + '/* ' + plugin_path + '/') + mw.execShell("cp -rf " + tmp_path + '/* ' + plugin_path + '/') mw.execShell('chmod -R 755 ' + plugin_path) p_info = mw.readFile(plugin_path + '/info.json') if p_info: From dfaa04184384b370bbb47c422a8f875cb26894ce Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 21:03:48 +0800 Subject: [PATCH 110/146] update --- plugins/mysql-apt/index.py | 4 +++- plugins/mysql-apt/versions/9.0/install.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/mysql-apt/index.py b/plugins/mysql-apt/index.py index 280c5d5d23..a157ec7c4c 100755 --- a/plugins/mysql-apt/index.py +++ b/plugins/mysql-apt/index.py @@ -3474,7 +3474,9 @@ def fullSync(version=''): def installPreInspection(version): - + arch_data = mw.execShell('arch') + if arch_data[0].strip().startswith('aarch'): + return '不支持aarch架构' cmd = "cat /etc/*-release | grep PRETTY_NAME |awk -F = '{print $2}' | awk -F '\"' '{print $2}'| awk '{print $1}'" sys = mw.execShell(cmd) diff --git a/plugins/mysql-apt/versions/9.0/install.sh b/plugins/mysql-apt/versions/9.0/install.sh index 766521900a..9c6073b0cf 100755 --- a/plugins/mysql-apt/versions/9.0/install.sh +++ b/plugins/mysql-apt/versions/9.0/install.sh @@ -20,7 +20,7 @@ bash ${rootPath}/scripts/getos.sh OSNAME=`cat ${rootPath}/data/osname.pl` VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` -# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 8.0 +# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 9.0 # 暂时debian12没有标准版,先用11使用 # if [ "$OSNAME" == 'debian' ] && [ "$VERSION_ID" == '12' ] ;then From 55f6a3189ca41fbb9ddbcd332e985bf76f6b02a3 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 22:19:31 +0800 Subject: [PATCH 111/146] Update install.sh --- plugins/mysql/versions/5.5/install.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugins/mysql/versions/5.5/install.sh b/plugins/mysql/versions/5.5/install.sh index b8bc62d73c..0b4fa7d427 100755 --- a/plugins/mysql/versions/5.5/install.sh +++ b/plugins/mysql/versions/5.5/install.sh @@ -69,6 +69,20 @@ Install_mysql() WHERE_DIR_GPP=`which g++` fi + if [ "$OSNAME" == "ubuntu" ];then + apt install -y libudev-dev + apt install -y libtirpc-dev + apt install -y libssl-dev + apt install -y libgssglue-dev + apt install -y software-properties-common + add-apt-repository -y ppa:ubuntu-toolchain-r/test + + export PKG_CONFIG_PATH=/usr/lib/pkgconfig + apt install -y gcc-11 g++-11 + WHERE_DIR_GCC=/usr/bin/gcc-13 + WHERE_DIR_GPP=/usr/bin/g++-13 + fi + if [ ! -d $serverPath/mysql ];then cd ${mysqlDir}/mysql-5.5.62 && cmake \ -DCMAKE_INSTALL_PREFIX=$serverPath/mysql \ From c6e491a9bcc4040949b53a632d8d94a0fada8602 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 22:19:39 +0800 Subject: [PATCH 112/146] Update install.sh --- plugins/mysql/versions/5.5/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/mysql/versions/5.5/install.sh b/plugins/mysql/versions/5.5/install.sh index 0b4fa7d427..6c2aa7870f 100755 --- a/plugins/mysql/versions/5.5/install.sh +++ b/plugins/mysql/versions/5.5/install.sh @@ -79,8 +79,8 @@ Install_mysql() export PKG_CONFIG_PATH=/usr/lib/pkgconfig apt install -y gcc-11 g++-11 - WHERE_DIR_GCC=/usr/bin/gcc-13 - WHERE_DIR_GPP=/usr/bin/g++-13 + WHERE_DIR_GCC=/usr/bin/gcc-11 + WHERE_DIR_GPP=/usr/bin/g++-11 fi if [ ! -d $serverPath/mysql ];then From 8d4b5e84038286ab28b6aee8c74f67d2c3c88a6d Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 22:31:25 +0800 Subject: [PATCH 113/146] Update install.sh --- plugins/mysql/versions/5.5/install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/mysql/versions/5.5/install.sh b/plugins/mysql/versions/5.5/install.sh index 6c2aa7870f..d561f64d90 100755 --- a/plugins/mysql/versions/5.5/install.sh +++ b/plugins/mysql/versions/5.5/install.sh @@ -78,9 +78,9 @@ Install_mysql() add-apt-repository -y ppa:ubuntu-toolchain-r/test export PKG_CONFIG_PATH=/usr/lib/pkgconfig - apt install -y gcc-11 g++-11 - WHERE_DIR_GCC=/usr/bin/gcc-11 - WHERE_DIR_GPP=/usr/bin/g++-11 + apt install -y gcc-10 g++-10 + WHERE_DIR_GCC=/usr/bin/gcc-10 + WHERE_DIR_GPP=/usr/bin/g++-10 fi if [ ! -d $serverPath/mysql ];then From 53dd0d81e7ad96c1777179509c666a45d33d46ad Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 23:07:08 +0800 Subject: [PATCH 114/146] update --- .../mysql-5.5-fix-arm-client_plugin.patch | 37 ++++++++++++++ plugins/mysql/versions/5.5/install.sh | 48 +++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 plugins/mysql/patch/mysql-5.5-fix-arm-client_plugin.patch diff --git a/plugins/mysql/patch/mysql-5.5-fix-arm-client_plugin.patch b/plugins/mysql/patch/mysql-5.5-fix-arm-client_plugin.patch new file mode 100644 index 0000000000..6c6f30ec2b --- /dev/null +++ b/plugins/mysql/patch/mysql-5.5-fix-arm-client_plugin.patch @@ -0,0 +1,37 @@ +diff -ruN mysql-5.5.42.orig/sql-common/client_plugin.c mysql-5.5.42/sql-common/client_plugin.c +--- mysql-5.5.42.orig/sql-common/client_plugin.c 2015-01-07 04:39:40.000000000 +0800 ++++ mysql-5.5.42/sql-common/client_plugin.c 2015-03-24 10:36:45.682700014 +0800 +@@ -233,6 +233,7 @@ + { + MYSQL mysql; + struct st_mysql_client_plugin **builtin; ++ va_list dummy; + + if (initialized) + return 0; +@@ -249,7 +250,7 @@ + pthread_mutex_lock(&LOCK_load_client_plugin); + + for (builtin= mysql_client_builtins; *builtin; builtin++) +- add_plugin(&mysql, *builtin, 0, 0, 0); ++ add_plugin(&mysql, *builtin, 0, 0, dummy); + + pthread_mutex_unlock(&LOCK_load_client_plugin); + +@@ -293,6 +294,7 @@ + mysql_client_register_plugin(MYSQL *mysql, + struct st_mysql_client_plugin *plugin) + { ++ va_list dummy; + if (is_not_initialized(mysql, plugin->name)) + return NULL; + +@@ -307,7 +309,7 @@ + plugin= NULL; + } + else +- plugin= add_plugin(mysql, plugin, 0, 0, 0); ++ plugin= add_plugin(mysql, plugin, 0, 0, dummy); + + pthread_mutex_unlock(&LOCK_load_client_plugin); + return plugin; diff --git a/plugins/mysql/versions/5.5/install.sh b/plugins/mysql/versions/5.5/install.sh index d561f64d90..b7be4c2b95 100755 --- a/plugins/mysql/versions/5.5/install.sh +++ b/plugins/mysql/versions/5.5/install.sh @@ -10,12 +10,53 @@ rootPath=$(dirname "$curPath") rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") sysName=`uname` +sysArch=`arch` install_tmp=${rootPath}/tmp/mw_install.pl mysqlDir=${serverPath}/source/mysql VERSION=5.5.62 +_os=`uname` +echo "use system: ${_os}" +if [ ${_os} == "Darwin" ]; then + OSNAME='macos' +elif grep -Eq "openSUSE" /etc/*-release; then + OSNAME='opensuse' + zypper refresh +elif grep -Eq "FreeBSD" /etc/*-release; then + OSNAME='freebsd' + pkg install -y wget unzip +elif grep -Eqi "Arch" /etc/issue || grep -Eq "Arch" /etc/*-release; then + OSNAME='arch' + echo y | pacman -Sy unzip +elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then + OSNAME='centos' + yum install -y wget zip unzip +elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then + OSNAME='fedora' + yum install -y wget zip unzip +elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then + OSNAME='rocky' + yum install -y wget zip unzip +elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then + OSNAME='alma' + yum install -y wget zip unzip +elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then + OSNAME='debian' + apt update -y + apt install -y devscripts + apt install -y wget zip unzip +elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then + OSNAME='ubuntu' + apt install -y wget zip unzip +else + OSNAME='unknow' +fi + +VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` + + Install_mysql() { mkdir -p ${mysqlDir} @@ -69,6 +110,13 @@ Install_mysql() WHERE_DIR_GPP=`which g++` fi + # https://blog.whsir.com/post-7748.html + # arm架构编译MySQL5.5报错 + if [[ "$sysArch" =~ "aarch" ]];then + # wget --no-check-certificate -O ${mysqlDir}/mysql-5.5-fix-arm-client_plugin.patch https://down.whsir.com/downloads/mysql-5.5-fix-arm-client_plugin.patch + cd ${mysqlDir}/mysql-5.5.62 && patch -p1 < ${rootPath}/plugins/mysql/patch/mysql-5.5-fix-arm-client_plugin.patch + fi + if [ "$OSNAME" == "ubuntu" ];then apt install -y libudev-dev apt install -y libtirpc-dev From 01a76ff5ded0b314725e8caaedd9d86ac18ba772 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 24 Jul 2024 23:16:36 +0800 Subject: [PATCH 115/146] Update install.sh --- plugins/memcached/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/memcached/install.sh b/plugins/memcached/install.sh index 155916cac8..0cbbfcaf6e 100755 --- a/plugins/memcached/install.sh +++ b/plugins/memcached/install.sh @@ -9,7 +9,7 @@ serverPath=$(dirname "$rootPath") install_tmp=${rootPath}/tmp/mw_install.pl sys_os=`uname` -VERSION=1.6.22 +VERSION=1.6.29 echo $sys_os From 58068a06dd9ba496b34c580a2a1f4996cf8b0045 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 25 Jul 2024 00:34:59 +0800 Subject: [PATCH 116/146] Update install.sh --- plugins/mysql/versions/5.6/install.sh | 75 ++++++++++++++++++++++++--- 1 file changed, 69 insertions(+), 6 deletions(-) diff --git a/plugins/mysql/versions/5.6/install.sh b/plugins/mysql/versions/5.6/install.sh index fe7fbb7269..b76ad07c3b 100755 --- a/plugins/mysql/versions/5.6/install.sh +++ b/plugins/mysql/versions/5.6/install.sh @@ -11,12 +11,52 @@ rootPath=$(dirname "$curPath") rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") sysName=`uname` +sysArch=`arch` + +_os=`uname` +echo "use system: ${_os}" +if [ ${_os} == "Darwin" ]; then + OSNAME='macos' +elif grep -Eq "openSUSE" /etc/*-release; then + OSNAME='opensuse' + zypper refresh +elif grep -Eq "FreeBSD" /etc/*-release; then + OSNAME='freebsd' + pkg install -y wget unzip +elif grep -Eqi "Arch" /etc/issue || grep -Eq "Arch" /etc/*-release; then + OSNAME='arch' + echo y | pacman -Sy unzip +elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then + OSNAME='centos' + yum install -y wget zip unzip +elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then + OSNAME='fedora' + yum install -y wget zip unzip +elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then + OSNAME='rocky' + yum install -y wget zip unzip +elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then + OSNAME='alma' + yum install -y wget zip unzip +elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then + OSNAME='debian' + apt update -y + apt install -y devscripts + apt install -y wget zip unzip +elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then + OSNAME='ubuntu' + apt install -y wget zip unzip +else + OSNAME='unknow' +fi + +VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` install_tmp=${rootPath}/tmp/mw_install.pl mysqlDir=${serverPath}/source/mysql -VERSION=5.6.50 +VERSION=5.6.51 Install_mysql() { mkdir -p ${mysqlDir} @@ -61,6 +101,29 @@ Install_mysql() cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-${VERSION}.tar.gz fi + WHERE_DIR_GCC=/usr/bin/gcc + WHERE_DIR_GPP=/usr/bin/g++ + if [ ! -f $WHERE_DIR_GCC ];then + WHERE_DIR_GCC=`which gcc` + fi + + if [ ! -f $WHERE_DIR_GPP ];then + WHERE_DIR_GPP=`which g++` + fi + + if [ "$OSNAME" == "ubuntu" ];then + apt install -y libudev-dev + apt install -y libtirpc-dev + apt install -y libssl-dev + apt install -y libgssglue-dev + apt install -y software-properties-common + add-apt-repository -y ppa:ubuntu-toolchain-r/test + + export PKG_CONFIG_PATH=/usr/lib/pkgconfig + apt install -y gcc-10 g++-10 + WHERE_DIR_GCC=/usr/bin/gcc-10 + WHERE_DIR_GPP=/usr/bin/g++-10 + fi OPTIONS='' ##check openssl version @@ -68,8 +131,8 @@ Install_mysql() if [ "${OPENSSL_VERSION}" -ge "3" ];then #openssl version to high cd ${rootPath}/plugins/php/lib && /bin/bash openssl10.sh - export PKG_CONFIG_PATH=$serverPath/lib/openssl10/lib/pkgconfig - OPTIONS="-DWITH_SSL=${serverPath}/lib/openssl10" + export PKG_CONFIG_PATH=$serverPath/lib/openssl11/lib/pkgconfig + OPTIONS="-DWITH_SSL=${serverPath}/lib/openssl11" fi if [ ! -d $serverPath/mysql ];then @@ -88,8 +151,8 @@ Install_mysql() -DDEFAULT_CHARSET=utf8mb4 \ -DDEFAULT_COLLATION=utf8mb4_general_ci \ $OPTIONS \ - -DCMAKE_C_COMPILER=/usr/bin/gcc \ - -DCMAKE_CXX_COMPILER=/usr/bin/g++ \ + -DCMAKE_C_COMPILER=$WHERE_DIR_GCC \ + -DCMAKE_CXX_COMPILER=$WHERE_DIR_GPP \ -DCMAKE_CXX_STANDARD=11 make -j${cpuCore} && make install && make clean @@ -100,7 +163,7 @@ Install_mysql() echo '5.6' > $serverPath/mysql/version.pl echo "${VERSION}安装完成" else - # rm -rf ${mysqlDir}/mysql-5.6.50 + # rm -rf ${mysqlDir}/mysql-5.6.* echo "${VERSION}安装失败" echo 'install fail'>&2 exit 1 From 55d0f2fad8eaa000343da6574bdfeb8bf3cc894c Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 25 Jul 2024 00:35:43 +0800 Subject: [PATCH 117/146] Update install.sh --- plugins/mysql/versions/5.6/install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/mysql/versions/5.6/install.sh b/plugins/mysql/versions/5.6/install.sh index b76ad07c3b..76f536f67f 100755 --- a/plugins/mysql/versions/5.6/install.sh +++ b/plugins/mysql/versions/5.6/install.sh @@ -120,9 +120,9 @@ Install_mysql() add-apt-repository -y ppa:ubuntu-toolchain-r/test export PKG_CONFIG_PATH=/usr/lib/pkgconfig - apt install -y gcc-10 g++-10 - WHERE_DIR_GCC=/usr/bin/gcc-10 - WHERE_DIR_GPP=/usr/bin/g++-10 + apt install -y gcc-11 g++-11 + WHERE_DIR_GCC=/usr/bin/gcc-11 + WHERE_DIR_GPP=/usr/bin/g++-11 fi OPTIONS='' From f2d5e166daaeb8081dcce738be46409704401583 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 25 Jul 2024 00:36:11 +0800 Subject: [PATCH 118/146] Update install.sh --- plugins/mysql/versions/5.6/install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/mysql/versions/5.6/install.sh b/plugins/mysql/versions/5.6/install.sh index 76f536f67f..e05648ccb6 100755 --- a/plugins/mysql/versions/5.6/install.sh +++ b/plugins/mysql/versions/5.6/install.sh @@ -165,7 +165,6 @@ Install_mysql() else # rm -rf ${mysqlDir}/mysql-5.6.* echo "${VERSION}安装失败" - echo 'install fail'>&2 exit 1 fi fi @@ -174,7 +173,7 @@ Install_mysql() Uninstall_mysql() { rm -rf $serverPath/mysql - echo '卸载完成' > $install_tmp + echo '卸载完成' } action=$1 From e4223a7a58a0606fa74d4cf2903b9fd11d5b2975 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 25 Jul 2024 00:36:34 +0800 Subject: [PATCH 119/146] Update install.sh --- plugins/mysql/versions/5.5/install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/mysql/versions/5.5/install.sh b/plugins/mysql/versions/5.5/install.sh index b7be4c2b95..22fc66e218 100755 --- a/plugins/mysql/versions/5.5/install.sh +++ b/plugins/mysql/versions/5.5/install.sh @@ -156,7 +156,6 @@ Install_mysql() else # rm -rf ${mysqlDir}/mysql-5.5.62 echo "${VERSION}安装失败" - echo 'install fail'>&2 exit 1 fi fi From 5c335045824e43df1b8024cf97a365517548f00c Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 25 Jul 2024 00:39:04 +0800 Subject: [PATCH 120/146] Update install.sh --- plugins/mysql/versions/5.7/install.sh | 31 +++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/plugins/mysql/versions/5.7/install.sh b/plugins/mysql/versions/5.7/install.sh index a01da89676..4ba180d847 100755 --- a/plugins/mysql/versions/5.7/install.sh +++ b/plugins/mysql/versions/5.7/install.sh @@ -77,6 +77,30 @@ Install_mysql() cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-boost-${VERSION}.tar.gz fi + WHERE_DIR_GCC=/usr/bin/gcc + WHERE_DIR_GPP=/usr/bin/g++ + if [ ! -f $WHERE_DIR_GCC ];then + WHERE_DIR_GCC=`which gcc` + fi + + if [ ! -f $WHERE_DIR_GPP ];then + WHERE_DIR_GPP=`which g++` + fi + + if [ "$OSNAME" == "ubuntu" ];then + apt install -y libudev-dev + apt install -y libtirpc-dev + apt install -y libssl-dev + apt install -y libgssglue-dev + apt install -y software-properties-common + add-apt-repository -y ppa:ubuntu-toolchain-r/test + + export PKG_CONFIG_PATH=/usr/lib/pkgconfig + apt install -y gcc-11 g++-11 + WHERE_DIR_GCC=/usr/bin/gcc-11 + WHERE_DIR_GPP=/usr/bin/g++-11 + fi + OPTIONS='' ##check openssl version OPENSSL_VERSION=`openssl version|awk '{print $2}'|awk -F '.' '{print $1}'` @@ -103,8 +127,8 @@ Install_mysql() -DDEFAULT_COLLATION=utf8mb4_general_ci \ -DDOWNLOAD_BOOST=1 \ $OPTIONS \ - -DCMAKE_C_COMPILER=/usr/bin/gcc \ - -DCMAKE_CXX_COMPILER=/usr/bin/g++ \ + -DCMAKE_C_COMPILER=${WHERE_DIR_GCC} \ + -DCMAKE_CXX_COMPILER=${WHERE_DIR_GPP} \ -DWITH_BOOST=${mysqlDir}/mysql-${VERSION}/boost/ make -j${cpuCore} && make install && make clean @@ -115,7 +139,6 @@ Install_mysql() else # rm -rf ${mysqlDir}/mysql-${VERSION} echo "${VERSION}安装失败" - echo 'install fail'>&2 exit 1 fi fi @@ -124,7 +147,7 @@ Install_mysql() Uninstall_mysql() { rm -rf $serverPath/mysql - echo '卸载完成' > $install_tmp + echo '卸载完成' } action=$1 From 7d70fdcd1da05726644480ce9638ad4bf3fbfa32 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 25 Jul 2024 00:39:29 +0800 Subject: [PATCH 121/146] Update install.sh --- plugins/mysql/versions/5.7/install.sh | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/plugins/mysql/versions/5.7/install.sh b/plugins/mysql/versions/5.7/install.sh index 4ba180d847..798fe6b188 100755 --- a/plugins/mysql/versions/5.7/install.sh +++ b/plugins/mysql/versions/5.7/install.sh @@ -18,6 +18,45 @@ mysqlDir=${serverPath}/source/mysql VERSION=5.7.39 +_os=`uname` +echo "use system: ${_os}" +if [ ${_os} == "Darwin" ]; then + OSNAME='macos' +elif grep -Eq "openSUSE" /etc/*-release; then + OSNAME='opensuse' + zypper refresh +elif grep -Eq "FreeBSD" /etc/*-release; then + OSNAME='freebsd' + pkg install -y wget unzip +elif grep -Eqi "Arch" /etc/issue || grep -Eq "Arch" /etc/*-release; then + OSNAME='arch' + echo y | pacman -Sy unzip +elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then + OSNAME='centos' + yum install -y wget zip unzip +elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then + OSNAME='fedora' + yum install -y wget zip unzip +elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then + OSNAME='rocky' + yum install -y wget zip unzip +elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then + OSNAME='alma' + yum install -y wget zip unzip +elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then + OSNAME='debian' + apt update -y + apt install -y devscripts + apt install -y wget zip unzip +elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then + OSNAME='ubuntu' + apt install -y wget zip unzip +else + OSNAME='unknow' +fi + +VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` + Install_mysql() { From 398165d832b93dea1daf03beffde557f5bd31bee Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 25 Jul 2024 00:49:00 +0800 Subject: [PATCH 122/146] update --- plugins/mysql/versions/8.0/install.sh | 3 +-- plugins/mysql/versions/8.2/install.sh | 3 +-- plugins/mysql/versions/8.3/install.sh | 3 +-- plugins/mysql/versions/8.4/install.sh | 2 +- plugins/mysql/versions/9.0/install.sh | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/plugins/mysql/versions/8.0/install.sh b/plugins/mysql/versions/8.0/install.sh index c76faa71d0..a407718c29 100755 --- a/plugins/mysql/versions/8.0/install.sh +++ b/plugins/mysql/versions/8.0/install.sh @@ -207,7 +207,6 @@ Install_mysql() else # rm -rf ${mysqlDir}/mysql-${VERSION} echo "${VERSION}安装失败" - echo 'install fail'>&2 exit 1 fi fi @@ -216,7 +215,7 @@ Install_mysql() Uninstall_mysql() { rm -rf $serverPath/mysql - echo '卸载完成' > $install_tmp + echo '卸载完成' } action=$1 diff --git a/plugins/mysql/versions/8.2/install.sh b/plugins/mysql/versions/8.2/install.sh index 8b0f788cc9..5bb6b6f88a 100755 --- a/plugins/mysql/versions/8.2/install.sh +++ b/plugins/mysql/versions/8.2/install.sh @@ -207,7 +207,6 @@ Install_mysql() else # rm -rf ${mysqlDir}/mysql-${VERSION} echo "${VERSION}安装失败" - echo 'install fail'>&2 exit 1 fi fi @@ -216,7 +215,7 @@ Install_mysql() Uninstall_mysql() { rm -rf $serverPath/mysql - echo '卸载完成' > $install_tmp + echo '卸载完成' } action=$1 diff --git a/plugins/mysql/versions/8.3/install.sh b/plugins/mysql/versions/8.3/install.sh index cfd0daa62e..20e9b9dff9 100755 --- a/plugins/mysql/versions/8.3/install.sh +++ b/plugins/mysql/versions/8.3/install.sh @@ -206,7 +206,6 @@ Install_mysql() else # rm -rf ${mysqlDir}/mysql-${VERSION} echo "${VERSION}安装失败" - echo 'install fail'>&2 exit 1 fi fi @@ -215,7 +214,7 @@ Install_mysql() Uninstall_mysql() { rm -rf $serverPath/mysql - echo '卸载完成' > $install_tmp + echo '卸载完成' } action=$1 diff --git a/plugins/mysql/versions/8.4/install.sh b/plugins/mysql/versions/8.4/install.sh index f254a0c545..b930819739 100755 --- a/plugins/mysql/versions/8.4/install.sh +++ b/plugins/mysql/versions/8.4/install.sh @@ -217,7 +217,7 @@ Install_mysql() Uninstall_mysql() { rm -rf $serverPath/mysql - echo '卸载完成' > $install_tmp + echo '卸载完成' } action=$1 diff --git a/plugins/mysql/versions/9.0/install.sh b/plugins/mysql/versions/9.0/install.sh index af191bc268..31f88599ef 100755 --- a/plugins/mysql/versions/9.0/install.sh +++ b/plugins/mysql/versions/9.0/install.sh @@ -217,7 +217,7 @@ Install_mysql() Uninstall_mysql() { rm -rf $serverPath/mysql - echo '卸载完成' > $install_tmp + echo '卸载完成' } action=$1 From be4cdd194d38aab1baf45bbfe667d63dff514886 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 25 Jul 2024 00:52:07 +0800 Subject: [PATCH 123/146] Update install.sh --- plugins/mysql/versions/5.7/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/mysql/versions/5.7/install.sh b/plugins/mysql/versions/5.7/install.sh index 798fe6b188..98ac7954d1 100755 --- a/plugins/mysql/versions/5.7/install.sh +++ b/plugins/mysql/versions/5.7/install.sh @@ -16,7 +16,7 @@ sysName=`uname` install_tmp=${rootPath}/tmp/mw_install.pl mysqlDir=${serverPath}/source/mysql -VERSION=5.7.39 +VERSION=5.7.44 _os=`uname` echo "use system: ${_os}" @@ -100,7 +100,7 @@ Install_mysql() fi #检测文件是否损坏. - md5_mysql_ok=d949b0ef81c3f52f7ef0874066244221 + md5_mysql_ok=1a637fce4599d9bf5f1c81699f086274 if [ -f ${mysqlDir}/mysql-boost-${VERSION}.tar.gz ];then md5_mysql=`md5sum ${mysqlDir}/mysql-boost-${VERSION}.tar.gz | awk '{print $1}'` if [ "${md5_mysql_ok}" == "${md5_mysql}" ]; then From fb4e16790e5ce3af3e77eef3bb737651ee0ce135 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 25 Jul 2024 00:53:35 +0800 Subject: [PATCH 124/146] Update install.sh --- plugins/mysql/versions/9.0/install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/mysql/versions/9.0/install.sh b/plugins/mysql/versions/9.0/install.sh index 31f88599ef..c6829a4ecc 100755 --- a/plugins/mysql/versions/9.0/install.sh +++ b/plugins/mysql/versions/9.0/install.sh @@ -162,7 +162,7 @@ Install_mysql() fi export PKG_CONFIG_PATH=/usr/lib/pkgconfig - apt install -y gcc-11 g++-11 + apt install -y gcc-13 g++-13 WHERE_DIR_GCC=/usr/bin/gcc-13 WHERE_DIR_GPP=/usr/bin/g++-13 fi @@ -173,8 +173,8 @@ Install_mysql() zypper install -y gcc11-c++ - WHERE_DIR_GCC=/usr/bin/gcc-13 - WHERE_DIR_GPP=/usr/bin/g++-13 + WHERE_DIR_GCC=/usr/bin/gcc-11 + WHERE_DIR_GPP=/usr/bin/g++-11 fi if [ ! -d $serverPath/mysql ];then From d5c232201b2858365e2a6725a535593cf83ecd86 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 25 Jul 2024 01:27:44 +0800 Subject: [PATCH 125/146] update --- scripts/install/alma.sh | 2 ++ scripts/install/amazon.sh | 2 ++ scripts/install/arch.sh | 1 + scripts/install/centos.sh | 2 ++ scripts/install/debian.sh | 1 + scripts/install/euler.sh | 2 ++ scripts/install/fedora.sh | 5 ++++- scripts/install/freebsd.sh | 2 ++ scripts/install/opensuse.sh | 1 + scripts/install/rocky.sh | 2 ++ scripts/install/ubuntu.sh | 1 + 11 files changed, 20 insertions(+), 1 deletion(-) diff --git a/scripts/install/alma.sh b/scripts/install/alma.sh index b51abb40a9..06f71a7cf3 100755 --- a/scripts/install/alma.sh +++ b/scripts/install/alma.sh @@ -15,6 +15,8 @@ dnf install -y python-devel dnf install -y crontabs dnf install -y mysql-devel dnf install -y pv +yum install -y bzip2 +yum install -y bzip2-devel SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'` if [ "$SSH_PORT" == "" ];then diff --git a/scripts/install/amazon.sh b/scripts/install/amazon.sh index 4bde2afb21..378580fbf6 100755 --- a/scripts/install/amazon.sh +++ b/scripts/install/amazon.sh @@ -23,6 +23,8 @@ yum install -y mysql-devel yum install -y expect yum install -y pv yum install -y bc +yum install -y bzip2 +yum install -y bzip2-devel SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'` if [ "$SSH_PORT" == "" ];then diff --git a/scripts/install/arch.sh b/scripts/install/arch.sh index f68a85533f..30e8efc0a0 100644 --- a/scripts/install/arch.sh +++ b/scripts/install/arch.sh @@ -20,6 +20,7 @@ echo y | pacman -Sy libevent echo y | pacman -Sy libzip echo y | pacman -Sy libxml2 echo y | pacman -Sy libtirpc +echo y | pacman -Sy bzip2 echo y | pacman -Sy cronie echo y | pacman -Sy vi diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index caca759ca0..57a8aa90b5 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -33,6 +33,8 @@ yum install -y mysql-devel yum install -y expect yum install -y pv yum install -y bc +yum install -y bzip2 +yum install -y bzip2-devel # if [ -f /usr/sbin/iptables ];then diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index 658e14a238..49151743eb 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -68,6 +68,7 @@ apt install -y bc apt install -y python3-pip python3-dev python3-venv apt install -y libncurses5 apt install -y libncurses5-dev +apt install -y bzip2 if [ -f /usr/sbin/ufw ];then # look diff --git a/scripts/install/euler.sh b/scripts/install/euler.sh index 320ab0700c..a1b997e22d 100755 --- a/scripts/install/euler.sh +++ b/scripts/install/euler.sh @@ -33,6 +33,8 @@ yum install -y mysql-devel yum install -y expect yum install -y pv yum install -y bc +yum install -y bzip2 +yum install -y bzip2-devel # if [ -f /usr/sbin/iptables ];then diff --git a/scripts/install/fedora.sh b/scripts/install/fedora.sh index 29f4228e84..3ed2a102e7 100644 --- a/scripts/install/fedora.sh +++ b/scripts/install/fedora.sh @@ -78,7 +78,7 @@ yum install -y bc yum install -y gcc libffi-devel python-devel openssl-devel yum install -y libmcrypt libmcrypt-devel python3-devel -yum install -y wget python-devel python-imaging libicu-devel unzip bzip2-devel gcc libxml2 libxml2-devel libjpeg-devel libpng-devel libwebp libwebp-devel pcre pcre-devel crontabs +yum install -y wget python-devel python-imaging libicu-devel unzip gcc libxml2 libxml2-devel libjpeg-devel libpng-devel libwebp libwebp-devel pcre pcre-devel crontabs yum install -y net-tools yum install -y ncurses-devel yum install -y python-devel @@ -86,6 +86,9 @@ yum install -y MySQL-python yum install -y python3-devel yum install -y mysql-devel +yum install -y bzip2 +yum install -y bzip2-devel + yum install -y libtirpc libtirpc-devel yum install -y rpcgen yum install -y openldap openldap-devel diff --git a/scripts/install/freebsd.sh b/scripts/install/freebsd.sh index 9474dbe109..fbbd863ef9 100644 --- a/scripts/install/freebsd.sh +++ b/scripts/install/freebsd.sh @@ -62,6 +62,8 @@ pkg install -y pidof pkg install -y pstree pkg install -y pv pkg install -y bc +pkg install -y bzip2 +pkg install -y bzip2-devel # curl https://sh.rustup.rs -sSf | sh pkg install -y rust diff --git a/scripts/install/opensuse.sh b/scripts/install/opensuse.sh index 1b9cdb6878..2017bcdcff 100644 --- a/scripts/install/opensuse.sh +++ b/scripts/install/opensuse.sh @@ -31,6 +31,7 @@ zypper install -y libstdc++6 zypper install -y expect zypper install -y pv zypper install -y bc +zypper install -y bzip2 zypper install -y libzip libzip-devel zypper install -y unrar rar diff --git a/scripts/install/rocky.sh b/scripts/install/rocky.sh index 0a3a1c5662..5867dfb255 100644 --- a/scripts/install/rocky.sh +++ b/scripts/install/rocky.sh @@ -21,6 +21,8 @@ yum install -y python3-devel yum install -y crontabs yum install -y expect yum install -y curl curl-devel libcurl libcurl-devel +yum install -y bzip2 +yum install -y bzip2-devel if [ -f /usr/sbin/iptables ];then diff --git a/scripts/install/ubuntu.sh b/scripts/install/ubuntu.sh index 8fe85debaa..e9f13a8d1f 100644 --- a/scripts/install/ubuntu.sh +++ b/scripts/install/ubuntu.sh @@ -25,6 +25,7 @@ apt install -y net-tools apt install -y libncurses5 apt install -y libncurses5-dev apt install -y software-properties-common +apt install -y bzip2 # choose lang cmd # dpkg-reconfigure --frontend=noninteractive locales From 8ff13fac5b017a7c150c4a270a4fcda934d60ce3 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 25 Jul 2024 02:43:57 +0800 Subject: [PATCH 126/146] Update install.sh --- plugins/swap/install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/swap/install.sh b/plugins/swap/install.sh index c950051bcb..875345c3d1 100755 --- a/plugins/swap/install.sh +++ b/plugins/swap/install.sh @@ -12,6 +12,8 @@ install_tmp=${rootPath}/tmp/mw_install.pl VERSION=$2 +# cd /www/server/mdserver-web/plugins/swap && /bin/bash install.sh install 1.1 + Install_swap() { if [ -d $serverPath/swap ];then From d3ce4a1aac87dd2367b2dc09452a5c5e6307bded Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 25 Jul 2024 12:23:00 +0800 Subject: [PATCH 127/146] Update firewall_api.py --- class/core/firewall_api.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/class/core/firewall_api.py b/class/core/firewall_api.py index e79ed4ea80..04d48f06b3 100755 --- a/class/core/firewall_api.py +++ b/class/core/firewall_api.py @@ -50,7 +50,7 @@ def addDropAddressApi(self): port = request.form.get('port', '').strip() ps = request.form.get('ps', '').strip() - rep = "^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(\/\d{1,2})?$" + rep = r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(\/\d{1,2})?$" if not re.search(rep, port): return mw.returnJson(False, '您输入的IP地址不合法!') address = port @@ -97,7 +97,7 @@ def addAcceptPortArgs(self, port, ps, stype, protocol='tcp'): if not self.getFwStatus(): self.setFw(0) - rep = "^\d{1,5}(:\d{1,5})?$" + rep = r"^\d{1,5}(:\d{1,5})?$" if not re.search(rep, port): return mw.returnData(False, '端口范围不正确!') @@ -217,7 +217,7 @@ def getSshInfoApi(self): file = '/etc/ssh/sshd_config' conf = mw.readFile(file) - rep = "#*Port\s+([0-9]+)\s*\n" + rep = r"#*Port\s+([0-9]+)\s*\n" port = re.search(rep, conf).groups(0)[0] isPing = True @@ -227,7 +227,7 @@ def getSshInfoApi(self): else: file = '/etc/sysctl.conf' sys_conf = mw.readFile(file) - rep = "#*net\.ipv4\.icmp_echo_ignore_all\s*=\s*([0-9]+)" + rep = r"#*net\.ipv4\.icmp_echo_ignore_all\s*=\s*([0-9]+)" tmp = re.search(rep, sys_conf).groups(0)[0] if tmp == '1': isPing = False @@ -248,7 +248,7 @@ def getSshInfoApi(self): data['pass_prohibit_status'] = False # 密码登陆配置检查 - pass_rep = "PasswordAuthentication\s+(\w*)\s*\n" + pass_rep = r"PasswordAuthentication\s+(\w*)\s*\n" pass_status = re.search(pass_rep, conf) if pass_status: if pass_status and pass_status.groups(0)[0].strip() == 'no': @@ -277,7 +277,7 @@ def setSshPortApi(self): file = '/etc/ssh/sshd_config' conf = mw.readFile(file) - rep = "#*Port\s+([0-9]+)\s*\n" + rep = r"#*Port\s+([0-9]+)\s*\n" conf = re.sub(rep, "Port " + port + "\n", conf) mw.writeFile(file, conf) @@ -330,17 +330,17 @@ def setSshPassStatusApi(self): conf = mw.readFile(file) - pass_rep = "PasswordAuthentication\s+(\w*)\s*\n" + pass_rep = r"PasswordAuthentication\s+(\w*)\s*\n" pass_status = re.search(pass_rep, conf) if not pass_status: - rep = "(#)?PasswordAuthentication\s+(\w*)\s*\n" + rep = r"(#)?PasswordAuthentication\s+(\w*)\s*\n" conf = re.sub(rep, "PasswordAuthentication yes\n", conf) if status == '1': - rep = "PasswordAuthentication\s+(\w*)\s*\n" + rep = r"PasswordAuthentication\s+(\w*)\s*\n" conf = re.sub(rep, "PasswordAuthentication yes\n", conf) else: - rep = "PasswordAuthentication\s+(\w*)\s*\n" + rep = r"PasswordAuthentication\s+(\w*)\s*\n" conf = re.sub(rep, "PasswordAuthentication no\n", conf) mw.writeFile(file, conf) mw.execShell("systemctl restart sshd.service") @@ -355,7 +355,7 @@ def setPingApi(self): filename = '/etc/sysctl.conf' conf = mw.readFile(filename) if conf.find('net.ipv4.icmp_echo') != -1: - rep = u"net\.ipv4\.icmp_echo.*" + rep = r"net\.ipv4\.icmp_echo.*" conf = re.sub(rep, 'net.ipv4.icmp_echo_ignore_all=' + status, conf) else: conf += "\nnet.ipv4.icmp_echo_ignore_all=" + status From a629eeac556c7c65d42d1da73f80823c3d5b6692 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 25 Jul 2024 12:29:28 +0800 Subject: [PATCH 128/146] Update ubuntu.sh --- plugins/zabbix/versions/7.0/ubuntu.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/zabbix/versions/7.0/ubuntu.sh b/plugins/zabbix/versions/7.0/ubuntu.sh index 1a41eef6f5..01ea17a36c 100644 --- a/plugins/zabbix/versions/7.0/ubuntu.sh +++ b/plugins/zabbix/versions/7.0/ubuntu.sh @@ -9,9 +9,10 @@ rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source sysName=`uname` +sysArch=`arch` install_tmp=${rootPath}/tmp/mw_install.pl ubuntu_suffix= -if [ "$SYS_ARCH" == "aarch64" ];then +if [ "$sysArch" == "aarch64" ];then ubuntu_suffix="-arm64" fi SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` From 011d3dccaa729ae2b2095e1116cd9ebb3a33f3d0 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 25 Jul 2024 12:30:09 +0800 Subject: [PATCH 129/146] update --- plugins/zabbix/versions/7.0/debian.sh | 5 ++++- plugins/zabbix/versions/7.0/ubuntu.sh | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/zabbix/versions/7.0/debian.sh b/plugins/zabbix/versions/7.0/debian.sh index f8144bf118..a7abe09cd0 100644 --- a/plugins/zabbix/versions/7.0/debian.sh +++ b/plugins/zabbix/versions/7.0/debian.sh @@ -8,9 +8,12 @@ rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source sysName=`uname` +sysArch=`arch` + install_tmp=${rootPath}/tmp/mw_install.pl + debian_suffix= -if [ "$SYS_ARCH" == "aarch64" ];then +if [ "$sysArch" == "aarch64" ];then debian_suffix="-arm64" fi diff --git a/plugins/zabbix/versions/7.0/ubuntu.sh b/plugins/zabbix/versions/7.0/ubuntu.sh index 01ea17a36c..cf40bca71b 100644 --- a/plugins/zabbix/versions/7.0/ubuntu.sh +++ b/plugins/zabbix/versions/7.0/ubuntu.sh @@ -10,6 +10,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source sysName=`uname` sysArch=`arch` + install_tmp=${rootPath}/tmp/mw_install.pl ubuntu_suffix= if [ "$sysArch" == "aarch64" ];then From 185c5cb45b76fe7b1b064048bb9b1164b619eaab Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 25 Jul 2024 12:34:37 +0800 Subject: [PATCH 130/146] Update ubuntu.sh --- plugins/zabbix/versions/7.0/ubuntu.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/zabbix/versions/7.0/ubuntu.sh b/plugins/zabbix/versions/7.0/ubuntu.sh index cf40bca71b..7bc4eb8518 100644 --- a/plugins/zabbix/versions/7.0/ubuntu.sh +++ b/plugins/zabbix/versions/7.0/ubuntu.sh @@ -36,13 +36,15 @@ Install_App() cd $serverPath/source/zabbix && dpkg -i ${ZABBIX_NAME} apt update -y - apt install -y zabbix-server-mysql zabbix-frontend-php zabbix-sql-scripts zabbix-get + apt install -y zabbix-server-mysql + apt install -y zabbix-frontend-php zabbix-sql-scripts apt install -y zabbix-agent } Uninstall_App() { - apt remove -y zabbix-server-mysql zabbix-frontend-php zabbix-sql-scripts zabbix-get + apt remove -y zabbix-server-mysql + apt remove -y zabbix-frontend-php zabbix-sql-scripts apt remove -y zabbix-agent rm -rf /etc/zabbix From 7021015a664882d8a48b7bce4d3143112924cf2f Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 25 Jul 2024 13:33:00 +0800 Subject: [PATCH 131/146] Update install.sh --- plugins/mysql/versions/9.0/install.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/mysql/versions/9.0/install.sh b/plugins/mysql/versions/9.0/install.sh index c6829a4ecc..9770ce8a6a 100755 --- a/plugins/mysql/versions/9.0/install.sh +++ b/plugins/mysql/versions/9.0/install.sh @@ -162,9 +162,12 @@ Install_mysql() fi export PKG_CONFIG_PATH=/usr/lib/pkgconfig - apt install -y gcc-13 g++-13 - WHERE_DIR_GCC=/usr/bin/gcc-13 - WHERE_DIR_GPP=/usr/bin/g++-13 + apt install -y gcc-11 g++-11 + WHERE_DIR_GCC=/usr/bin/gcc-11 + WHERE_DIR_GPP=/usr/bin/g++-11 + + + OPTIONS="${OPTIONS} -DFORCE_INSOURCE_BUILD=1" fi From 4f6a626e3ecb27572fad8bb926c1e2c03ba91f8a Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 25 Jul 2024 13:57:48 +0800 Subject: [PATCH 132/146] Update install.sh --- plugins/mysql/versions/9.0/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/mysql/versions/9.0/install.sh b/plugins/mysql/versions/9.0/install.sh index 9770ce8a6a..9699b7e3c2 100755 --- a/plugins/mysql/versions/9.0/install.sh +++ b/plugins/mysql/versions/9.0/install.sh @@ -168,6 +168,7 @@ Install_mysql() OPTIONS="${OPTIONS} -DFORCE_INSOURCE_BUILD=1" + OPTIONS="${OPTIONS} -D_FORTIFY_SOURCE=2" fi From 6fb3a52e31645465b2efff9f74f3da085ad5620d Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 25 Jul 2024 15:37:06 +0800 Subject: [PATCH 133/146] Update my.cnf --- plugins/mariadb/conf/my.cnf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mariadb/conf/my.cnf b/plugins/mariadb/conf/my.cnf index 4fcba7081f..30f6a32c1a 100644 --- a/plugins/mariadb/conf/my.cnf +++ b/plugins/mariadb/conf/my.cnf @@ -38,7 +38,7 @@ max_connections = 500 max_connect_errors = 100 open_files_limit = 65535 -skip-name-resolve = on +skip-name-resolve = 1 #skip-networking #skip-external-locking #loose-skip-innodb From 3c99f171580b5e51e1c3b7779b704b279c371582 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 26 Jul 2024 12:18:04 +0800 Subject: [PATCH 134/146] Update cert_api.py --- class/core/cert_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class/core/cert_api.py b/class/core/cert_api.py index 8acac8f591..774a8d7e93 100644 --- a/class/core/cert_api.py +++ b/class/core/cert_api.py @@ -1409,7 +1409,7 @@ def renewCert(self, index): self.__config['orders'][i]['cert_timeout'] = int(time.time()) # print(self.__config['orders'][i]['domains'][0], (self.__config['orders'][i]['cert_timeout'] - now_time)/86400, now_time) - if self.__config['orders'][i]['cert_timeout'] - now_time < 1*86400: + if self.__config['orders'][i]['cert_timeout'] - now_time > 1*86400: msg = "|-本次跳过域名: {},未过期!".format(self.__config['orders'][i]['domains'][0]) writeLog(msg) continue From fc7609874d7ce0b1fb17ebadcdb577cb3e5e49b0 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 26 Jul 2024 12:43:32 +0800 Subject: [PATCH 135/146] Update cert_api.py --- class/core/cert_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class/core/cert_api.py b/class/core/cert_api.py index 774a8d7e93..016f971a24 100644 --- a/class/core/cert_api.py +++ b/class/core/cert_api.py @@ -377,7 +377,7 @@ def requestsPost(self, url, data, timeout): return response except Exception as ex: # self.getError() - raise Exception("requestsPost: {}".format(self.getError(str(ex)))) + raise Exception("异常: {}".format(self.getError(str(ex)))) def getRequestJson(self, response): try: From 209ae03e634285514673c1b504c3f11296d01e97 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 26 Jul 2024 12:44:52 +0800 Subject: [PATCH 136/146] Update cert_api.py --- class/core/cert_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class/core/cert_api.py b/class/core/cert_api.py index 016f971a24..e5626f3c53 100644 --- a/class/core/cert_api.py +++ b/class/core/cert_api.py @@ -1409,7 +1409,7 @@ def renewCert(self, index): self.__config['orders'][i]['cert_timeout'] = int(time.time()) # print(self.__config['orders'][i]['domains'][0], (self.__config['orders'][i]['cert_timeout'] - now_time)/86400, now_time) - if self.__config['orders'][i]['cert_timeout'] - now_time > 1*86400: + if self.__config['orders'][i]['cert_timeout'] - now_time < 88*86400: msg = "|-本次跳过域名: {},未过期!".format(self.__config['orders'][i]['domains'][0]) writeLog(msg) continue From 3770ebc0f33fa978d3267d34d91709eab059e1e0 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 26 Jul 2024 12:58:52 +0800 Subject: [PATCH 137/146] Update cert_api.py --- class/core/cert_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class/core/cert_api.py b/class/core/cert_api.py index e5626f3c53..1e665af54f 100644 --- a/class/core/cert_api.py +++ b/class/core/cert_api.py @@ -1409,7 +1409,7 @@ def renewCert(self, index): self.__config['orders'][i]['cert_timeout'] = int(time.time()) # print(self.__config['orders'][i]['domains'][0], (self.__config['orders'][i]['cert_timeout'] - now_time)/86400, now_time) - if self.__config['orders'][i]['cert_timeout'] - now_time < 88*86400: + if self.__config['orders'][i]['cert_timeout'] - now_time > 88*86400: msg = "|-本次跳过域名: {},未过期!".format(self.__config['orders'][i]['domains'][0]) writeLog(msg) continue From 5419a01b5ce2f4c4036b80597d5ad4754e2022ba Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 26 Jul 2024 12:59:59 +0800 Subject: [PATCH 138/146] Update cert_api.py --- class/core/cert_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class/core/cert_api.py b/class/core/cert_api.py index 1e665af54f..c68d5d293d 100644 --- a/class/core/cert_api.py +++ b/class/core/cert_api.py @@ -1409,7 +1409,7 @@ def renewCert(self, index): self.__config['orders'][i]['cert_timeout'] = int(time.time()) # print(self.__config['orders'][i]['domains'][0], (self.__config['orders'][i]['cert_timeout'] - now_time)/86400, now_time) - if self.__config['orders'][i]['cert_timeout'] - now_time > 88*86400: + if self.__config['orders'][i]['cert_timeout'] - now_time > 89*86400: msg = "|-本次跳过域名: {},未过期!".format(self.__config['orders'][i]['domains'][0]) writeLog(msg) continue From 46a3591019bfb84ed52417638145bc0e1f2209ae Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 26 Jul 2024 17:00:52 +0800 Subject: [PATCH 139/146] Update index.py --- plugins/supervisor/index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/supervisor/index.py b/plugins/supervisor/index.py index 3cfcaca1e3..efc9c6293a 100755 --- a/plugins/supervisor/index.py +++ b/plugins/supervisor/index.py @@ -257,7 +257,7 @@ def confDlistTraceLog(): confd_dir = getServerDir() + '/conf.d/' + args['name'] content = mw.readFile(confd_dir) - rep = 'stdout_logfile\s*=\s*(.*)' + rep = r'stdout_logfile\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -270,7 +270,7 @@ def confDlistErrorLog(): confd_dir = getServerDir() + '/conf.d/' + args['name'] content = mw.readFile(confd_dir) - rep = 'stderr_logfile\s*=\s*(.*)' + rep = r'stderr_logfile\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() From 9e099524710318c89d41da9d9a13e85613b1136c Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 26 Jul 2024 19:22:57 +0800 Subject: [PATCH 140/146] update --- plugins/redis/config/redis.conf | 6 +++--- plugins/redis/tpl/redis_cluster.conf | 6 +++--- plugins/redis/tpl/redis_slave.conf | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/redis/config/redis.conf b/plugins/redis/config/redis.conf index e0d8066680..d32b11ee62 100644 --- a/plugins/redis/config/redis.conf +++ b/plugins/redis/config/redis.conf @@ -15,9 +15,9 @@ databases 16 ################################ SNAPSHOTTING ################################# -save 900 1 -save 300 10 -save 60 10000 +save 900 100 +save 300 1000 +save 60 1000000 stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes diff --git a/plugins/redis/tpl/redis_cluster.conf b/plugins/redis/tpl/redis_cluster.conf index ed09521568..8cf018c78b 100644 --- a/plugins/redis/tpl/redis_cluster.conf +++ b/plugins/redis/tpl/redis_cluster.conf @@ -13,9 +13,9 @@ port 6379 ################################ SNAPSHOTTING ################################# -save 900 1 -save 300 10 -save 60 10000 +save 900 100 +save 300 1000 +save 60 1000000 stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes diff --git a/plugins/redis/tpl/redis_slave.conf b/plugins/redis/tpl/redis_slave.conf index ddc9ab2a0c..9acff69854 100644 --- a/plugins/redis/tpl/redis_slave.conf +++ b/plugins/redis/tpl/redis_slave.conf @@ -15,9 +15,9 @@ databases 16 ################################ SNAPSHOTTING ################################# -save 900 1 -save 300 10 -save 60 10000 +save 900 100 +save 300 1000 +save 60 1000000 stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes From eed5c91435f416a69faa5f9b40a0b144e9ea3961 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 26 Jul 2024 22:52:55 +0800 Subject: [PATCH 141/146] Update redis_simple.conf --- plugins/redis/tpl/redis_simple.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/redis/tpl/redis_simple.conf b/plugins/redis/tpl/redis_simple.conf index aa0945783d..f8d5ce16d9 100644 --- a/plugins/redis/tpl/redis_simple.conf +++ b/plugins/redis/tpl/redis_simple.conf @@ -15,9 +15,9 @@ databases 16 ################################ SNAPSHOTTING ################################# -save 900 1 -save 300 10 -save 60 10000 +save 900 100 +save 300 1000 +save 60 1000000 stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes From eae61c827dde38b17f72b8dfadad0714e7246f0c Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 26 Jul 2024 22:58:38 +0800 Subject: [PATCH 142/146] Update cert_api.py --- class/core/cert_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class/core/cert_api.py b/class/core/cert_api.py index c68d5d293d..f1972210eb 100644 --- a/class/core/cert_api.py +++ b/class/core/cert_api.py @@ -1409,7 +1409,7 @@ def renewCert(self, index): self.__config['orders'][i]['cert_timeout'] = int(time.time()) # print(self.__config['orders'][i]['domains'][0], (self.__config['orders'][i]['cert_timeout'] - now_time)/86400, now_time) - if self.__config['orders'][i]['cert_timeout'] - now_time > 89*86400: + if self.__config['orders'][i]['cert_timeout'] - now_time > 83*86400: msg = "|-本次跳过域名: {},未过期!".format(self.__config['orders'][i]['domains'][0]) writeLog(msg) continue From 6df248ec22d69e83a08b4a7812054d851c1e41c3 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 26 Jul 2024 22:59:43 +0800 Subject: [PATCH 143/146] Update config_api.py --- class/core/config_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class/core/config_api.py b/class/core/config_api.py index 02688fa957..7f58c50d29 100755 --- a/class/core/config_api.py +++ b/class/core/config_api.py @@ -28,7 +28,7 @@ class config_api: - __version = '0.17.1' + __version = '0.17.2' __api_addr = 'data/api.json' # 统一默认配置文件 From bbaa00a4790f9620684cb5cab16ef3fad4d8fd1e Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 26 Jul 2024 23:03:43 +0800 Subject: [PATCH 144/146] Update README.md --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 621d321c01..5da6e18743 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Talk is cheap, show me the code. -- linus ### 主要插件介绍 * OpenResty - 轻量级,占有内存少,并发能力强。 -* PHP[53-83] - PHP是世界上最好的编程语言。 +* PHP[53-84] - PHP是世界上最好的编程语言。 * MySQL - 一种关系数据库管理系统。 * MariaDB - 是MySQL的一个重要分支。 * MySQL[APT/YUM] - 一种关系数据库管理系统。 @@ -75,10 +75,10 @@ Talk is cheap, show me the code. -- linus ``` phpMyAdmin[4.4.15]支持MySQL[5.5-5.7] -phpMyAdmin[5.2.0]支持MySQL[8.0] +phpMyAdmin[5.2.1]支持MySQL[8.0+] PHP[53-72]支持phpMyAdmin[4.4.15] -PHP[72-83]支持phpMyAdmin[5.2.0] +PHP[72-84]支持phpMyAdmin[5.2.1] ``` # 郑重声明 @@ -110,9 +110,11 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443: ``` -### 版本更新 0.17.1 +### 版本更新 0.17.2 + +- MySQL9.0。 +- zabbix,zabbix-agent测试。 -- 任务管理器-插件。 ### JSDelivr安装地址 From f0f491fa86a46668db172eebbdeff24b7862f792 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 26 Jul 2024 23:05:02 +0800 Subject: [PATCH 145/146] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5da6e18743..1ebd7e4a17 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443: - MySQL9.0。 - zabbix,zabbix-agent测试。 - +- 常规更新。 ### JSDelivr安装地址 From d5f5287ca3ca03fc1aaccb5bed7ed2891e7e4094 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 26 Jul 2024 23:06:46 +0800 Subject: [PATCH 146/146] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1ebd7e4a17..3dea2975a5 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,7 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443: - MySQL9.0。 - zabbix,zabbix-agent测试。 +- 正则匹配修复(兼容)。 - 常规更新。 ### JSDelivr安装地址