From 84b7d1123e51ad589bc8c3e8cf1d5ebefa582c51 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 04:49:21 +0800 Subject: [PATCH 01/20] Update sql_mysql.py --- plugins/data_query/sql_mysql.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/data_query/sql_mysql.py b/plugins/data_query/sql_mysql.py index 6179f00e39..38205e6ab0 100755 --- a/plugins/data_query/sql_mysql.py +++ b/plugins/data_query/sql_mysql.py @@ -23,6 +23,8 @@ def inner(): @singleton class nosqlMySQL(): + __sid = None + __DB_PASS = None __DB_USER = None __DB_PORT = 3306 @@ -40,6 +42,15 @@ def setSid(self, sid): self.__config = self.get_options(sid=sid) def conn(self): + + if self.__sid is not: + return False + + if self.__sid is not None: + mycnf_path = "{}/{}/etc/my.cnf".format(mw.getServerDir(),sid) + if not os.path.exists(mycnf_path): + return False + self.__DB_PORT = int(self.__config['port']) self.__DB_USER = self.__config['username'] self.__DB_PASS = self.__config['password'] @@ -74,6 +85,8 @@ def get_options(self, sid=None): if sid in ['mysql', 'mysql-apt', 'mysql-yum']: my_cnf_path = "{}/{}/etc/my.cnf".format(mw.getServerDir(),sid) + if not os.path.exists(my_cnf_path): + return False mydb_content = mw.readFile(my_cnf_path) if not mydb_content: return False From 5c01f36fe740ae15e0c27ec55f3020a2c995b7de Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 04:49:44 +0800 Subject: [PATCH 02/20] Update sql_mysql.py --- plugins/data_query/sql_mysql.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/data_query/sql_mysql.py b/plugins/data_query/sql_mysql.py index 38205e6ab0..62e453df40 100755 --- a/plugins/data_query/sql_mysql.py +++ b/plugins/data_query/sql_mysql.py @@ -39,6 +39,7 @@ def __init__(self): pass def setSid(self, sid): + self.__sid = sid self.__config = self.get_options(sid=sid) def conn(self): From 5bcae1b00cb7b1c9674e7146ee3d22dc2a32a384 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 04:51:09 +0800 Subject: [PATCH 03/20] Update sql_mysql.py --- plugins/data_query/sql_mysql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/data_query/sql_mysql.py b/plugins/data_query/sql_mysql.py index 62e453df40..7e7d01af23 100755 --- a/plugins/data_query/sql_mysql.py +++ b/plugins/data_query/sql_mysql.py @@ -44,7 +44,7 @@ def setSid(self, sid): def conn(self): - if self.__sid is not: + if self.__sid is None: return False if self.__sid is not None: From a4414d2083b86914a232f4a9df1646b5c65653e1 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 04:52:14 +0800 Subject: [PATCH 04/20] Update sql_mysql.py --- plugins/data_query/sql_mysql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/data_query/sql_mysql.py b/plugins/data_query/sql_mysql.py index 7e7d01af23..93cc6c0ed2 100755 --- a/plugins/data_query/sql_mysql.py +++ b/plugins/data_query/sql_mysql.py @@ -48,7 +48,7 @@ def conn(self): return False if self.__sid is not None: - mycnf_path = "{}/{}/etc/my.cnf".format(mw.getServerDir(),sid) + mycnf_path = "{}/{}/etc/my.cnf".format(mw.getServerDir(),self.__sid) if not os.path.exists(mycnf_path): return False From cb6d9762d545ae627cad1e08da58ab2156229e31 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 05:01:43 +0800 Subject: [PATCH 05/20] Update setting.py --- web/admin/setting/setting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/admin/setting/setting.py b/web/admin/setting/setting.py index b0d3cca6db..7e78a9edfb 100644 --- a/web/admin/setting/setting.py +++ b/web/admin/setting/setting.py @@ -68,9 +68,9 @@ def set_backup_dir(): @panel_login_required def set_www_dir(): sites_path = request.form.get('sites_path', '') - src_sites_path = thisdb.getOption('sites_path') + src_sites_path = thisdb.getOption('site_path') if sites_path != src_sites_path: - thisdb.setOption('sites_path', sites_path) + thisdb.setOption('site_path', sites_path) return mw.returnData(True, '修改默认建站目录成功!') From 0d6c4010ff75acfb3258f3ae79a83069716406c7 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 05:14:12 +0800 Subject: [PATCH 06/20] update --- plugins/php/conf/php5.ini | 2 +- plugins/php/conf/php7.ini | 2 +- plugins/php/conf/php8.ini | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/php/conf/php5.ini b/plugins/php/conf/php5.ini index 6ba50e12fd..4745ed05ef 100644 --- a/plugins/php/conf/php5.ini +++ b/plugins/php/conf/php5.ini @@ -47,7 +47,7 @@ allow_url_fopen = On allow_url_include = Off default_socket_timeout = 60 -disable_functions = exec,passthru,shell_exec,system,popen,show_source +disable_functions = exec,passthru,shell_exec,system,popen,show_source,fastcgi_finish_request [CLI Server] cli_server.color = On diff --git a/plugins/php/conf/php7.ini b/plugins/php/conf/php7.ini index 1a5289b238..f9c056eb0b 100644 --- a/plugins/php/conf/php7.ini +++ b/plugins/php/conf/php7.ini @@ -46,7 +46,7 @@ allow_url_fopen = On allow_url_include = Off default_socket_timeout = 60 -disable_functions = exec,passthru,shell_exec,system,popen,show_source +disable_functions = exec,passthru,shell_exec,system,popen,show_source,fastcgi_finish_request [CLI Server] cli_server.color = On diff --git a/plugins/php/conf/php8.ini b/plugins/php/conf/php8.ini index ea2581eeda..eaafadf072 100644 --- a/plugins/php/conf/php8.ini +++ b/plugins/php/conf/php8.ini @@ -46,7 +46,7 @@ allow_url_fopen = On allow_url_include = Off default_socket_timeout = 60 -disable_functions = exec,passthru,shell_exec,system,popen,show_source +disable_functions = exec,passthru,shell_exec,system,popen,show_source,fastcgi_finish_request [CLI Server] cli_server.color = On From 7c9ca83b468e36beb604f9284c16037bcd2eda2d Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 12:22:50 +0800 Subject: [PATCH 07/20] Update install.sh --- scripts/old/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/old/install.sh b/scripts/old/install.sh index 6bd55eaa9b..33ec455210 100644 --- a/scripts/old/install.sh +++ b/scripts/old/install.sh @@ -106,7 +106,7 @@ if [ $OSNAME != "macos" ];then rm -rf /tmp/mdserver-web-master else # curl --insecure -sSLo /tmp/master.zip https://code.midoks.icu/midoks/mdserver-web/archive/master.zip - wget --no-check-certificate -O /tmp/master.zip https://code.midoks.icu/midoks/mdserver-web/archive/master.zip + wget --no-check-certificate -O /tmp/master.zip https://code.midoks.icu/midoks/mdserver-web/archive/${VERSION}.zip cd /tmp && unzip /tmp/master.zip mv -f /tmp/mdserver-web /www/server/mdserver-web rm -rf /tmp/master.zip From 575f3c9ce4e9567594e35113e75cd6bc279f557d Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 12:47:20 +0800 Subject: [PATCH 08/20] update --- scripts/install/debian.sh | 1 + scripts/install/ubuntu.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index 37e4d97bad..5bf39008c9 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -70,6 +70,7 @@ apt update -y apt autoremove -y apt install -y wget curl lsof unzip tar cron expect locate lrzsz +apt install -y xz-utils apt install -y rar apt install -y unrar apt install -y pv diff --git a/scripts/install/ubuntu.sh b/scripts/install/ubuntu.sh index 37f8ef8bfc..8dbccc416b 100644 --- a/scripts/install/ubuntu.sh +++ b/scripts/install/ubuntu.sh @@ -25,6 +25,7 @@ apt autoremove -y apt install -y wget curl lsof unzip apt install -y rar unrar +apt install -y xz-utils apt install -y python3-pip apt install -y python3-venv apt install -y python3-dev From fc28136936e9fe934c722bb44c8d5314305c067f Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 13:01:31 +0800 Subject: [PATCH 09/20] Update panel_tools.py --- panel_tools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/panel_tools.py b/panel_tools.py index cfc765bdc3..4d32344777 100755 --- a/panel_tools.py +++ b/panel_tools.py @@ -244,7 +244,8 @@ def mwcli(mw_input=0): mw.writeFile(php_conf, cont) mw.echoInfo("执行PHP52隐藏成功!") elif mw_input == 200: - os.system(INIT_CMD + " mirror") + os.system("bash <(curl -sSL https://linuxmirrors.cn/main.sh)") + # os.system(INIT_CMD + " mirror") elif mw_input == 201: os.system('curl -Lso- bench.sh | bash') From 1ad16b2b941087761eb49134c29f4fd0bc97a57d Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 14:51:37 +0800 Subject: [PATCH 10/20] Create install.sh --- plugins/mysql/versions/9.1/install.sh | 231 ++++++++++++++++++++++++++ 1 file changed, 231 insertions(+) create mode 100755 plugins/mysql/versions/9.1/install.sh diff --git a/plugins/mysql/versions/9.1/install.sh b/plugins/mysql/versions/9.1/install.sh new file mode 100755 index 0000000000..29ada447e7 --- /dev/null +++ b/plugins/mysql/versions/9.1/install.sh @@ -0,0 +1,231 @@ +# -*- 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` + + +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.1.0 +# 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 '正在安装脚本文件...' + + + # ----- 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 + + + OPTIONS="${OPTIONS} -DFORCE_INSOURCE_BUILD=1" + OPTIONS="${OPTIONS} -D_FORTIFY_SOURCE=2" + 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 '9.0' > $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 '卸载完成' +} + +action=$1 +if [ "${1}" == "install" ];then + Install_mysql +else + Uninstall_mysql +fi From eb52d1a79ab91ccfabe605deb8a1f3a43294ab31 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 14:54:22 +0800 Subject: [PATCH 11/20] Update install.sh --- plugins/mysql/versions/9.1/install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/mysql/versions/9.1/install.sh b/plugins/mysql/versions/9.1/install.sh index 29ada447e7..7eb87b5071 100755 --- a/plugins/mysql/versions/9.1/install.sh +++ b/plugins/mysql/versions/9.1/install.sh @@ -3,8 +3,7 @@ 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 +# https://dev.mysql.com/downloads/mysql/ curPath=`pwd` rootPath=$(dirname "$curPath") From 258b3495a1a95d93d7cb0fe8753b69258b4e23cc Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 14:56:40 +0800 Subject: [PATCH 12/20] Update install.sh --- plugins/mysql/versions/9.1/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/mysql/versions/9.1/install.sh b/plugins/mysql/versions/9.1/install.sh index 7eb87b5071..50f4ccab1d 100755 --- a/plugins/mysql/versions/9.1/install.sh +++ b/plugins/mysql/versions/9.1/install.sh @@ -100,7 +100,7 @@ Install_mysql() 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 + wget --no-check-certificate -O ${mysqlDir}/mysql-${VERSION}.tar.gz --tries=3 https://dev.mysql.com/get/Downloads/MySQL-9.1/mysql-${VERSION}.tar.gz fi #检测文件是否损坏. @@ -112,7 +112,7 @@ Install_mysql() 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 + wget --no-check-certificate -O ${mysqlDir}/mysql-${VERSION}.tar.gz --tries=3 https://dev.mysql.com/get/Downloads/MySQL-9.1/mysql-${VERSION}.tar.gz fi fi From aecd0726e51801d01215f2ab3128838295cdf203 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 15:05:33 +0800 Subject: [PATCH 13/20] Update info.json --- plugins/mysql/info.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/mysql/info.json b/plugins/mysql/info.json index d649a36c81..849b2b3ccb 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","9.0"], - "updates":["5.5.62","5.6.50", "5.7.32","8.0.34","8.2.0","8.3.0","9.0.1"], + "versions":["5.5", "5.6", "5.7","8.0","8.2","8.3","8.4","9.0","9.1"], + "updates":["5.5.62","5.6.50", "5.7.32","8.0.34","8.2.0","8.3.0","9.0.1","9.1.0"], "shell":"install.sh", "checks":"server/mysql", "path":"server/mysql", From 0f99cdb11545692a2f65128bf3b7b08e0d2348b4 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 15:06:45 +0800 Subject: [PATCH 14/20] Create install.sh --- plugins/mysql-apt/versions/9.1/install.sh | 138 ++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100755 plugins/mysql-apt/versions/9.1/install.sh diff --git a/plugins/mysql-apt/versions/9.1/install.sh b/plugins/mysql-apt/versions/9.1/install.sh new file mode 100755 index 0000000000..fb1a18a25e --- /dev/null +++ b/plugins/mysql-apt/versions/9.1/install.sh @@ -0,0 +1,138 @@ +# -*- 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` + +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 9.0 + +# 暂时debian12没有标准版,先用11使用 +# if [ "$OSNAME" == 'debian' ] && [ "$VERSION_ID" == '12' ] ;then +# echo "暂时不支持该${OSNAME}${VERSION_ID}" +# 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}" + exit 1 +fi + + +MYSQL_VER=9.1.0 +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 '正在安装脚本文件...' + + 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 From 3dd77715d8859a61f599abe521442f166efd59aa Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 15:09:51 +0800 Subject: [PATCH 15/20] update --- plugins/mysql-apt/versions/9.0/install.sh | 5 +++-- plugins/mysql-apt/versions/9.1/install.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/mysql-apt/versions/9.0/install.sh b/plugins/mysql-apt/versions/9.0/install.sh index e3cf77baed..8d8109861c 100755 --- a/plugins/mysql-apt/versions/9.0/install.sh +++ b/plugins/mysql-apt/versions/9.0/install.sh @@ -62,8 +62,9 @@ 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 +# https://cdn.mysql.com/archives/mysql-9.0/mysql-server_9.0.1-1debian12_amd64.deb-bundle.tar +wget --no-check-certificate -O ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar https://cdn.mysql.com/archives/mysql-9.0/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-9.1/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 diff --git a/plugins/mysql-apt/versions/9.1/install.sh b/plugins/mysql-apt/versions/9.1/install.sh index fb1a18a25e..d78a492a38 100755 --- a/plugins/mysql-apt/versions/9.1/install.sh +++ b/plugins/mysql-apt/versions/9.1/install.sh @@ -63,7 +63,7 @@ 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 +wget --no-check-certificate -O ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar https://dev.mysql.com/get/Downloads/MySQL-9.1/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 From 9a6c02dd9ae60be5869036ff15cde02dec723f3e Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 15:10:31 +0800 Subject: [PATCH 16/20] Update install.sh --- plugins/mysql-apt/versions/9.0/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/mysql-apt/versions/9.0/install.sh b/plugins/mysql-apt/versions/9.0/install.sh index 8d8109861c..d3325da981 100755 --- a/plugins/mysql-apt/versions/9.0/install.sh +++ b/plugins/mysql-apt/versions/9.0/install.sh @@ -60,9 +60,9 @@ 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 +# https://dev.mysql.com/get/Downloads/MySQL-9.0/mysql-server_${SUFFIX_NAME}.deb-bundle.tar # https://cdn.mysql.com/archives/mysql-9.0/mysql-server_9.0.1-1debian12_amd64.deb-bundle.tar + wget --no-check-certificate -O ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar https://cdn.mysql.com/archives/mysql-9.0/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-9.1/mysql-server_${SUFFIX_NAME}.deb-bundle.tar chmod +x ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar From 32ee0cf14cc0525e02f20bf8160dc72a8f1e1622 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 15:10:54 +0800 Subject: [PATCH 17/20] Update install.sh --- plugins/mysql-apt/versions/9.1/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/mysql-apt/versions/9.1/install.sh b/plugins/mysql-apt/versions/9.1/install.sh index d78a492a38..523960aa0c 100755 --- a/plugins/mysql-apt/versions/9.1/install.sh +++ b/plugins/mysql-apt/versions/9.1/install.sh @@ -60,8 +60,8 @@ 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 +# https://cdn.mysql.com/archives/mysql-9.1/mysql-server_${SUFFIX_NAME}.deb-bundle.tar +# https://dev.mysql.com/get/Downloads/MySQL-9.1/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-9.1/mysql-server_${SUFFIX_NAME}.deb-bundle.tar chmod +x ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar From ccd8c056b1c4b9105a0f7723723cb972099046a8 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 15:12:17 +0800 Subject: [PATCH 18/20] Update install.sh --- plugins/mysql-apt/versions/8.4/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mysql-apt/versions/8.4/install.sh b/plugins/mysql-apt/versions/8.4/install.sh index 04124e5b9c..39f2195e3c 100755 --- a/plugins/mysql-apt/versions/8.4/install.sh +++ b/plugins/mysql-apt/versions/8.4/install.sh @@ -63,7 +63,7 @@ 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 +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 From e07e8391e109dc9a9c44d37926ac3bce2a722276 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 16:05:49 +0800 Subject: [PATCH 19/20] Update gdrive.js --- plugins/gdrive/js/gdrive.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/gdrive/js/gdrive.js b/plugins/gdrive/js/gdrive.js index 08aa336a13..029d7ff4f3 100644 --- a/plugins/gdrive/js/gdrive.js +++ b/plugins/gdrive/js/gdrive.js @@ -189,7 +189,7 @@ function gdList(file_id){ if(rdata.status === false){ showMsg(rdata.msg,function(){ authApi(); - },{icon:2},2000); + },{icon:2}); return; } From 6fb93b19c926855aa0f94b4a4ce387bd24263d13 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 14 Dec 2024 16:50:36 +0800 Subject: [PATCH 20/20] Update info.json --- plugins/mysql-apt/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mysql-apt/info.json b/plugins/mysql-apt/info.json index d2b06cbd93..ea19db4d49 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","9.0"], + "versions":["5.7","8.0","8.2","8.3","8.4","9.0","9.1"], "shell":"install.sh", "install_pre_inspection":true, "uninstall_pre_inspection":true,