From dcd4527c759c9d25d7ca729abc9bb190f7147652 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 6 Mar 2025 20:34:57 +0800 Subject: [PATCH 01/31] update --- .gitignore | 1 + plugins/tgbot/startup/extend/push_ad.py | 5 ----- plugins/tgbot/startup/extend/push_notice_msg.py | 5 ----- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index f4c3accfa..96c5f14ac 100644 --- a/.gitignore +++ b/.gitignore @@ -191,3 +191,4 @@ plugins/goedge-happy /logs /data +/plugins/flexcdn diff --git a/plugins/tgbot/startup/extend/push_ad.py b/plugins/tgbot/startup/extend/push_ad.py index 9de6c0315..9c53f4865 100644 --- a/plugins/tgbot/startup/extend/push_ad.py +++ b/plugins/tgbot/startup/extend/push_ad.py @@ -51,12 +51,7 @@ def send_msg(bot, tag='ad', trigger_time=300): # 综合包网/NG接口开户 | 28/m | 6m | next,4/28 | x # 实名认证/过人脸🕵️‍♀️各种账号处理✅ | 30/m| next,6/30 | @nngzs # 桃花资源采集| 13/m| next,7/13 | @xiaolizi1122 - # D0抗投诉| 5/m | @lebo665544 keyboard = [ - [ - types.InlineKeyboardButton( - text="D0抗投诉微信支付宝不限行业支付", url='https://www.ymzf.org?mw') - ], [ types.InlineKeyboardButton( text="SJ资源网播放计费", url='https://sjzy.tv?mw') diff --git a/plugins/tgbot/startup/extend/push_notice_msg.py b/plugins/tgbot/startup/extend/push_notice_msg.py index c4d9a962b..e30e24048 100644 --- a/plugins/tgbot/startup/extend/push_notice_msg.py +++ b/plugins/tgbot/startup/extend/push_notice_msg.py @@ -60,12 +60,7 @@ def send_msg(bot, tag='ad', trigger_time=300): # 综合包网/NG接口开户 | 28/m | 6m | next,4/28 | x # 实名认证/过人脸🕵️‍♀️各种账号处理✅ | 30/m| next,6/30 | @nngzs # 桃花资源采集| 13/m| next,7/13 | @xiaolizi1122 - # D0抗投诉| 5/m | @lebo665544 keyboard = [ - [ - types.InlineKeyboardButton( - text="D0抗投诉微信支付宝不限行业支付", url='https://www.ymzf.org?mw') - ], [ types.InlineKeyboardButton( text="SJ资源网播放计费", url='https://sjzy.tv?mw') From f40cfb7d25bc2afc06f1953051e9ce67e13ccaaa Mon Sep 17 00:00:00 2001 From: dami Date: Sat, 8 Mar 2025 14:37:05 +0800 Subject: [PATCH 02/31] Update index.py --- plugins/clean/index.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/clean/index.py b/plugins/clean/index.py index 9425316ea..8d39563a6 100755 --- a/plugins/clean/index.py +++ b/plugins/clean/index.py @@ -131,6 +131,7 @@ def initConf(): "/var/log/wtmp", "/var/log/secure", "/var/log/lastlog", + "/var/log/syslog" "/var/log/cron", "/www/wwwlogs", "/www/server/rsyncd", From bf491539736390563dec0560759ba8b46a6f13f4 Mon Sep 17 00:00:00 2001 From: dami Date: Sat, 8 Mar 2025 14:43:55 +0800 Subject: [PATCH 03/31] Update index.py --- plugins/clean/index.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/clean/index.py b/plugins/clean/index.py index 8d39563a6..9425316ea 100755 --- a/plugins/clean/index.py +++ b/plugins/clean/index.py @@ -131,7 +131,6 @@ def initConf(): "/var/log/wtmp", "/var/log/secure", "/var/log/lastlog", - "/var/log/syslog" "/var/log/cron", "/www/wwwlogs", "/www/server/rsyncd", From a06c98d52f703d1366317a61e2c38a453eed6375 Mon Sep 17 00:00:00 2001 From: dami Date: Sat, 8 Mar 2025 14:46:22 +0800 Subject: [PATCH 04/31] Revert "Update index.py" This reverts commit bf491539736390563dec0560759ba8b46a6f13f4. --- plugins/clean/index.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/clean/index.py b/plugins/clean/index.py index 9425316ea..8d39563a6 100755 --- a/plugins/clean/index.py +++ b/plugins/clean/index.py @@ -131,6 +131,7 @@ def initConf(): "/var/log/wtmp", "/var/log/secure", "/var/log/lastlog", + "/var/log/syslog" "/var/log/cron", "/www/wwwlogs", "/www/server/rsyncd", From c1e758c9df725f9b4471d2ffe6497c89762361af Mon Sep 17 00:00:00 2001 From: dami Date: Sat, 8 Mar 2025 14:46:29 +0800 Subject: [PATCH 05/31] Revert "Update index.py" This reverts commit f40cfb7d25bc2afc06f1953051e9ce67e13ccaaa. --- plugins/clean/index.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/clean/index.py b/plugins/clean/index.py index 8d39563a6..9425316ea 100755 --- a/plugins/clean/index.py +++ b/plugins/clean/index.py @@ -131,7 +131,6 @@ def initConf(): "/var/log/wtmp", "/var/log/secure", "/var/log/lastlog", - "/var/log/syslog" "/var/log/cron", "/www/wwwlogs", "/www/server/rsyncd", From fcef7ec3caa41e02d294f4c05d708847d7bc18af Mon Sep 17 00:00:00 2001 From: dami Date: Sat, 8 Mar 2025 14:47:35 +0800 Subject: [PATCH 06/31] Update index.py --- plugins/clean/index.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/clean/index.py b/plugins/clean/index.py index 9425316ea..f6457ad3e 100755 --- a/plugins/clean/index.py +++ b/plugins/clean/index.py @@ -131,6 +131,7 @@ def initConf(): "/var/log/wtmp", "/var/log/secure", "/var/log/lastlog", + "/var/log/syslog", "/var/log/cron", "/www/wwwlogs", "/www/server/rsyncd", From 178cfb17f302534e1ae1d3bab3ec16ff6b6da3d0 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 10 Mar 2025 17:43:02 +0800 Subject: [PATCH 07/31] Update index.py --- plugins/phpmyadmin/index.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/phpmyadmin/index.py b/plugins/phpmyadmin/index.py index adb56aa4a..69f593a18 100755 --- a/plugins/phpmyadmin/index.py +++ b/plugins/phpmyadmin/index.py @@ -496,6 +496,12 @@ def pluginsDbSupport(): return mw.returnJson(True, 'ok', data) +def installPreInspection(): + php_confdir = mw.getServerDir()+'/web_conf/php/conf' + if os.path.exists(php_confdir): + return "必须先安装一个php版本!" + return 'ok' + if __name__ == "__main__": func = sys.argv[1] if func == 'status': @@ -508,6 +514,8 @@ if __name__ == "__main__": print(restart()) elif func == 'reload': print(reload()) + elif func == 'install_pre_inspection': + print(installPreInspection()) elif func == 'conf': print(getConf()) elif func == 'version': From df84ad25d6dc1fd702f9d3b02b4c258a947fb246 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 10 Mar 2025 17:47:42 +0800 Subject: [PATCH 08/31] Update info.json --- plugins/phpmyadmin/info.json | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/phpmyadmin/info.json b/plugins/phpmyadmin/info.json index b21d91109..5f021cf76 100755 --- a/plugins/phpmyadmin/info.json +++ b/plugins/phpmyadmin/info.json @@ -5,6 +5,7 @@ "type":"运行环境", "ps":"著名Web端MySQL管理工具", "to_ver":["4.8.4"], + "install_pre_inspection":true, "versions":["4.4.15","4.9.11","5.2.1"], "updates":["4.4.15","4.9.11","5.2.1"], "shell":"install.sh", From 909ba46f666ba241c8216c4fd2dab87db50af098 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 10 Mar 2025 17:55:03 +0800 Subject: [PATCH 09/31] Update index.py --- plugins/phpmyadmin/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/phpmyadmin/index.py b/plugins/phpmyadmin/index.py index 69f593a18..72c0de66c 100755 --- a/plugins/phpmyadmin/index.py +++ b/plugins/phpmyadmin/index.py @@ -498,7 +498,7 @@ def pluginsDbSupport(): def installPreInspection(): php_confdir = mw.getServerDir()+'/web_conf/php/conf' - if os.path.exists(php_confdir): + if not os.path.exists(php_confdir): return "必须先安装一个php版本!" return 'ok' From 7d7df745001f406d63a36c36e3c685acb540fcea Mon Sep 17 00:00:00 2001 From: dami Date: Thu, 20 Mar 2025 00:14:55 +0800 Subject: [PATCH 10/31] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 96c5f14ac..4f61e1f8b 100644 --- a/.gitignore +++ b/.gitignore @@ -192,3 +192,4 @@ plugins/goedge-happy /logs /data /plugins/flexcdn +/plugins/tools From fb7c5d9d47a327be4103ba3a32580dd46a0849cf Mon Sep 17 00:00:00 2001 From: dami Date: Thu, 20 Mar 2025 11:48:12 +0800 Subject: [PATCH 11/31] update --- web/admin/setup/__init__.py | 2 ++ web/admin/setup/init_cron.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 web/admin/setup/init_cron.py diff --git a/web/admin/setup/__init__.py b/web/admin/setup/__init__.py index f7eb6eab2..76126be74 100644 --- a/web/admin/setup/__init__.py +++ b/web/admin/setup/__init__.py @@ -14,6 +14,7 @@ from .user import init_admin_user from .option import init_option from .init_db_system import init_db_system from .init_cmd import init_cmd +from .init_cron import init_cron from utils.firewall import Firewall as MwFirewall @@ -30,6 +31,7 @@ def init(): init_db_system() init_cmd() + init_cron() # 自动识别防火墙配置 firewall_port = thisdb.getOption('setpu_auto_identify_firewall_port', default='no') diff --git a/web/admin/setup/init_cron.py b/web/admin/setup/init_cron.py new file mode 100644 index 000000000..01b33e70f --- /dev/null +++ b/web/admin/setup/init_cron.py @@ -0,0 +1,15 @@ +# coding:utf-8 + +# --------------------------------------------------------------------------------- +# MW-Linux面板 +# --------------------------------------------------------------------------------- +# copyright (c) 2018-∞(https://github.com/midoks/mdserver-web) All rights reserved. +# --------------------------------------------------------------------------------- +# Author: midoks +# --------------------------------------------------------------------------------- + + +# 识别linux计划任务 +def init_cron(): + print("开始识别cron") + print("结束识别cron") \ No newline at end of file From db04b3f98aebbb9f492c8f746927df5477f7ead3 Mon Sep 17 00:00:00 2001 From: dami Date: Sun, 23 Mar 2025 16:50:30 +0800 Subject: [PATCH 12/31] update --- .gitignore | 1 + web/admin/setup/init_cron.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 4f61e1f8b..50f4e1cbc 100644 --- a/.gitignore +++ b/.gitignore @@ -193,3 +193,4 @@ plugins/goedge-happy /data /plugins/flexcdn /plugins/tools +/plugins/choose-linux-python diff --git a/web/admin/setup/init_cron.py b/web/admin/setup/init_cron.py index 01b33e70f..ae5cfe75b 100644 --- a/web/admin/setup/init_cron.py +++ b/web/admin/setup/init_cron.py @@ -8,8 +8,10 @@ # Author: midoks # --------------------------------------------------------------------------------- +import core.mw as mw # 识别linux计划任务 def init_cron(): - print("开始识别cron") - print("结束识别cron") \ No newline at end of file + + content = mw.execShell("crontab -l") + print(content) \ No newline at end of file From ed732232f2c913266e2c782d3fa845f2859fec02 Mon Sep 17 00:00:00 2001 From: dami Date: Sun, 23 Mar 2025 16:52:14 +0800 Subject: [PATCH 13/31] Update mw.tpl --- scripts/init.d/mw.tpl | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 8772d2356..2fe28b5d1 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -322,17 +322,18 @@ mw_update_venv() mw_mirror() { - LOCAL_ADDR=common - cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") - if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then - LOCAL_ADDR=cn - fi - - if [ "$LOCAL_ADDR" == "common" ];then - bash <(curl --insecure -sSL https://raw.githubusercontent.com/midoks/change-linux-mirrors/main/change-mirrors.sh) - else - bash <(curl --insecure -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh) - fi + # LOCAL_ADDR=common + # cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") + # if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then + # LOCAL_ADDR=cn + # fi + + # if [ "$LOCAL_ADDR" == "common" ];then + # bash <(curl --insecure -sSL https://raw.githubusercontent.com/midoks/change-linux-mirrors/main/change-mirrors.sh) + # else + # bash <(curl -sSL https://linuxmirrors.cn/main.sh) + # fi + bash <(curl -sSL https://linuxmirrors.cn/main.sh) cd ${ROOT_PATH} } From edc45d5d3b40f2c2552f7a379b32bf6d43285b09 Mon Sep 17 00:00:00 2001 From: dami Date: Sun, 23 Mar 2025 17:03:31 +0800 Subject: [PATCH 14/31] Update mw.tpl --- scripts/init.d/mw.tpl | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 2fe28b5d1..2875f8652 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -322,18 +322,17 @@ mw_update_venv() mw_mirror() { - # LOCAL_ADDR=common - # cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") - # if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then - # LOCAL_ADDR=cn - # fi - - # if [ "$LOCAL_ADDR" == "common" ];then - # bash <(curl --insecure -sSL https://raw.githubusercontent.com/midoks/change-linux-mirrors/main/change-mirrors.sh) - # else - # bash <(curl -sSL https://linuxmirrors.cn/main.sh) - # fi - bash <(curl -sSL https://linuxmirrors.cn/main.sh) + LOCAL_ADDR=common + cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") + if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then + LOCAL_ADDR=cn + fi + + if [ "$LOCAL_ADDR" == "common" ];then + bash <(curl --insecure -sSL https://raw.githubusercontent.com/midoks/change-linux-mirrors/main/change-mirrors.sh) + else + bash <(curl -sSL https://linuxmirrors.cn/main.sh) + fi cd ${ROOT_PATH} } From aa92699562523b7269db096bce4998008fb51a47 Mon Sep 17 00:00:00 2001 From: dami Date: Sun, 23 Mar 2025 17:14:23 +0800 Subject: [PATCH 15/31] Update requirements.txt --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index bfe497e60..65baed2fd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -42,3 +42,4 @@ supervisor pyTelegramBotAPI telebot pyyaml +croniter From 9664609bbdeec1118ed5e56c42995859fc1c1353 Mon Sep 17 00:00:00 2001 From: dami Date: Sun, 23 Mar 2025 17:14:49 +0800 Subject: [PATCH 16/31] Update init_cron.py --- web/admin/setup/init_cron.py | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/web/admin/setup/init_cron.py b/web/admin/setup/init_cron.py index ae5cfe75b..eb3efdf06 100644 --- a/web/admin/setup/init_cron.py +++ b/web/admin/setup/init_cron.py @@ -8,10 +8,33 @@ # Author: midoks # --------------------------------------------------------------------------------- +import os import core.mw as mw +from utils.crontab import crontab +from croniter import croniter +from datetime import datetime # 识别linux计划任务 def init_cron(): + file = '' + cron_file = [ + '/var/spool/cron/crontabs/root', + '/var/spool/cron/root', + ] + for i in cron_file: + if os.path.exists(i): + file = i - content = mw.execShell("crontab -l") - print(content) \ No newline at end of file + if file == "": + return True + + # content = mw.execShell("crontab -l") + with open(file) as f: + for line in f.readlines(): + cron_line = line.strip() + if cron_line.startswith("#"): + continue + print(cron_line) + + # cron_list = content.split("\n") + # print(cron_list) \ No newline at end of file From 5f4622fdcd5f16b538d600805029459206bd8b64 Mon Sep 17 00:00:00 2001 From: dami Date: Sun, 23 Mar 2025 17:27:43 +0800 Subject: [PATCH 17/31] Update init_cron.py --- web/admin/setup/init_cron.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/web/admin/setup/init_cron.py b/web/admin/setup/init_cron.py index eb3efdf06..d0fb8d4a4 100644 --- a/web/admin/setup/init_cron.py +++ b/web/admin/setup/init_cron.py @@ -27,14 +27,22 @@ def init_cron(): if file == "": return True - - # content = mw.execShell("crontab -l") + with open(file) as f: for line in f.readlines(): cron_line = line.strip() if cron_line.startswith("#"): continue - print(cron_line) + + cron_expression = cron_line.split(maxsplit=5)[0] # 提取前 5 个字段(* * * * *) + command = cron_line.split(maxsplit=5)[5] # 提取命令部分 + + # 面板计划任务过滤 + if command.startswith("/www/server/cron"): + continue + + + print(command) # cron_list = content.split("\n") # print(cron_list) \ No newline at end of file From 778d595e6ea00de32a9a7d410164561569069532 Mon Sep 17 00:00:00 2001 From: dami Date: Sun, 23 Mar 2025 18:24:41 +0800 Subject: [PATCH 18/31] Update crontab.py --- web/utils/crontab.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/utils/crontab.py b/web/utils/crontab.py index 9e0d37b73..093ec822e 100644 --- a/web/utils/crontab.py +++ b/web/utils/crontab.py @@ -157,7 +157,7 @@ class crontab(object): cmd, title = self.getCrondCycle(data) cron_path = mw.getServerDir() + '/cron' - cron_name = self.getShell(data) + cron_shell = self.getShell(data) cmd += ' ' + cron_path + '/' + cron_name + ' >> ' + cron_path + '/' + cron_name + '.log 2>&1' @@ -178,7 +178,7 @@ class crontab(object): add_dbdata['sname'] = data['sname'] add_dbdata['sbody'] = data['sbody'] add_dbdata['stype'] = data['stype'] - add_dbdata['echo'] = cron_name + add_dbdata['echo'] = cron_shell add_dbdata['url_address'] = data['url_address'] tid = thisdb.addCrontab(add_dbdata) From 39cd3d1f4d7e3bb74780c2e5dcc6b661e927e176 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 24 Mar 2025 00:06:42 +0800 Subject: [PATCH 19/31] Update init_cron.py --- web/admin/setup/init_cron.py | 47 +++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/web/admin/setup/init_cron.py b/web/admin/setup/init_cron.py index d0fb8d4a4..48223df8d 100644 --- a/web/admin/setup/init_cron.py +++ b/web/admin/setup/init_cron.py @@ -13,6 +13,26 @@ import core.mw as mw from utils.crontab import crontab from croniter import croniter from datetime import datetime +import thisdb + +def cron_todb(data): + # print("------") + rdata = {} + if data[3] == "*" and data[2] != "*" : + rdata['type'] = 'month' + elif data[3] == "*" and data[4] != "*" : + rdata['type'] = 'week' + elif data[3] == "*" and data[4] == "*" and data[2] == "*" : + rdata['type'] = 'day' + elif data[1].find("/") > -1 : + rdata['type'] = 'hour-n' + elif data[0].find("/") > -1 : + rdata['type'] = 'minute-n' + + # print(rdata) + # print(data) + return rdata + # print("------") # 识别linux计划任务 def init_cron(): @@ -27,22 +47,43 @@ def init_cron(): if file == "": return True - + with open(file) as f: for line in f.readlines(): cron_line = line.strip() if cron_line.startswith("#"): continue - cron_expression = cron_line.split(maxsplit=5)[0] # 提取前 5 个字段(* * * * *) + cron_expression = cron_line.split(maxsplit=5) # 提取前 5 个字段(* * * * *) command = cron_line.split(maxsplit=5)[5] # 提取命令部分 # 面板计划任务过滤 if command.startswith("/www/server/cron"): continue + if command.startswith("\"/root/.acme.sh\""): + # print(cron_expression, command) + info = cron_todb(cron_expression) + + # print(info) + + # add_dbdata = {} + # add_dbdata['name'] = "ACME" + # add_dbdata['type'] = data['type'] + # add_dbdata['where1'] = data['where1'] + # add_dbdata['where_hour'] = data['hour'] + # add_dbdata['where_minute'] = data['minute'] + # add_dbdata['save'] = "" + # add_dbdata['backup_to'] = "" + # add_dbdata['sname'] = "" + # add_dbdata['sbody'] = data['sbody'] + # add_dbdata['stype'] = "toShell" + # add_dbdata['echo'] = command + # add_dbdata['url_address'] = '' + + # thisdb.addCrontab(add_dbdata) - print(command) + # print(command) # cron_list = content.split("\n") # print(cron_list) \ No newline at end of file From 6e754f2f7b297891cca52c641be7afd69965cec5 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 24 Mar 2025 10:38:37 +0800 Subject: [PATCH 20/31] Update __init__.py --- web/admin/setup/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/admin/setup/__init__.py b/web/admin/setup/__init__.py index 76126be74..f9fb75aa2 100644 --- a/web/admin/setup/__init__.py +++ b/web/admin/setup/__init__.py @@ -31,7 +31,7 @@ def init(): init_db_system() init_cmd() - init_cron() + # init_cron() # 自动识别防火墙配置 firewall_port = thisdb.getOption('setpu_auto_identify_firewall_port', default='no') From ebe761b1cfa5011e8df8240c833ddcef50ada456 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 24 Mar 2025 11:18:01 +0800 Subject: [PATCH 21/31] Update linux.conf --- plugins/sys-opt/tpl/linux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sys-opt/tpl/linux.conf b/plugins/sys-opt/tpl/linux.conf index e95c54ff6..c6b1cd8a4 100755 --- a/plugins/sys-opt/tpl/linux.conf +++ b/plugins/sys-opt/tpl/linux.conf @@ -32,7 +32,7 @@ net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_mem = 94500000 915000000 927000000 net.ipv4.tcp_fin_timeout = 1 net.ipv4.tcp_keepalive_time = 30 -net.ipv4.ip_local_port_range = 1024 65000 +net.ipv4.ip_local_port_range = 1024 65001 vm.overcommit_memory=1 vm.max_map_count = 262144 From f5a4f1b275273691c1e4546ca06c59f387b30dad Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 24 Mar 2025 23:40:11 +0800 Subject: [PATCH 22/31] ad --- plugins/tgbot/startup/extend/push_ad.py | 2 +- plugins/tgbot/startup/extend/push_notice_msg.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/tgbot/startup/extend/push_ad.py b/plugins/tgbot/startup/extend/push_ad.py index 9c53f4865..dd9b0672f 100644 --- a/plugins/tgbot/startup/extend/push_ad.py +++ b/plugins/tgbot/startup/extend/push_ad.py @@ -70,7 +70,7 @@ def send_msg(bot, tag='ad', trigger_time=300): ], [ types.InlineKeyboardButton( - text="实卡接码🙎‍♂️代实名/过人脸🅾️开飞机会员", url='https://t.me/gjgzs2022') + text="代付-代实名-备案域名-国际云服务器", url='https://t.me/gjgzs2022') ], # [ # types.InlineKeyboardButton( diff --git a/plugins/tgbot/startup/extend/push_notice_msg.py b/plugins/tgbot/startup/extend/push_notice_msg.py index e30e24048..0ede7c75f 100644 --- a/plugins/tgbot/startup/extend/push_notice_msg.py +++ b/plugins/tgbot/startup/extend/push_notice_msg.py @@ -79,7 +79,7 @@ def send_msg(bot, tag='ad', trigger_time=300): ], [ types.InlineKeyboardButton( - text="实卡接码🙎‍♂️代实名/过人脸🅾️开飞机会员", url='https://t.me/gjgzs2022') + text="代付-代实名-备案域名-国际云服务器", url='https://t.me/gjgzs2022') ], # [ # types.InlineKeyboardButton( From 62d78dbed88fb1307bc2edb2810b5677003b5c08 Mon Sep 17 00:00:00 2001 From: dami Date: Tue, 25 Mar 2025 11:55:05 +0800 Subject: [PATCH 23/31] update --- plugins/mysql/versions/9.1/install.sh | 10 +- plugins/mysql/versions/9.2/install.sh | 230 ++++++++++++++++++++++++++ 2 files changed, 235 insertions(+), 5 deletions(-) create mode 100755 plugins/mysql/versions/9.2/install.sh diff --git a/plugins/mysql/versions/9.1/install.sh b/plugins/mysql/versions/9.1/install.sh index 50f4ccab1..f1af11b05 100755 --- a/plugins/mysql/versions/9.1/install.sh +++ b/plugins/mysql/versions/9.1/install.sh @@ -55,8 +55,8 @@ VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk - 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 +# https://dev.mysql.com/get/Downloads/MySQL-9.1/mysql-${VERSION}.tar.gz +# https://cdn.mysql.com//Downloads/MySQL-9.1/mysql-boost-${VERSION}.tar.gz Install_mysql() { mkdir -p ${mysqlDir} @@ -104,11 +104,11 @@ Install_mysql() fi #检测文件是否损坏. - md5_mysql_ok=90dc27a8b64eee938a0bb045c580b80c + md5_mysql_ok=eb2c6bbd20569d2690bc7e34312f5210 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" + echo "mysql9.1 file check ok" else # 重新下载 rm -rf ${mysqlDir}/mysql-${VERSION} @@ -206,7 +206,7 @@ Install_mysql() if [ -d $serverPath/mysql ];then rm -rf ${mysqlDir}/mysql-${VERSION} - echo '9.0' > $serverPath/mysql/version.pl + echo '9.1' > $serverPath/mysql/version.pl echo "${VERSION}安装完成" else # rm -rf ${mysqlDir}/mysql-${VERSION} diff --git a/plugins/mysql/versions/9.2/install.sh b/plugins/mysql/versions/9.2/install.sh new file mode 100755 index 000000000..2f9adbd3d --- /dev/null +++ b/plugins/mysql/versions/9.2/install.sh @@ -0,0 +1,230 @@ +# -*- 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/ + +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.2.0 +# https://dev.mysql.com/get/Downloads/MySQL-9.2/mysql-${VERSION}.tar.gz +# https://cdn.mysql.com//Downloads/MySQL-9.2/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.2/mysql-${VERSION}.tar.gz + fi + + #检测文件是否损坏. + md5_mysql_ok=acabc8aa764a94a8b10f90284c6e60c5 + 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.2 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.2/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.2' > $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 eab13531d42a093efd29940af21f19b2f0af062e Mon Sep 17 00:00:00 2001 From: dami Date: Tue, 25 Mar 2025 12:06:48 +0800 Subject: [PATCH 24/31] 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 0cdc59f5c..0dac5550f 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -432,7 +432,7 @@ def getShowLogFile(): def getMdb8Ver(): - return ['8.0','8.1','8.2','8.3','8.4','9.0'] + return ['8.0','8.1','8.2','8.3','8.4','9.0',"9.1","9.2"] def pGetDbUser(): if mw.isAppleSystem(): From c4ba4b4702f8e99e4679ce954cd961bad92fe468 Mon Sep 17 00:00:00 2001 From: dami Date: Tue, 25 Mar 2025 12:19:43 +0800 Subject: [PATCH 25/31] Create my9.2.cnf --- plugins/mysql/conf/my9.2.cnf | 113 +++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 plugins/mysql/conf/my9.2.cnf diff --git a/plugins/mysql/conf/my9.2.cnf b/plugins/mysql/conf/my9.2.cnf new file mode 100644 index 000000000..5a42de1cc --- /dev/null +++ b/plugins/mysql/conf/my9.2.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 2f38ecf505b07cf36854d901b4d8766e4b55474e Mon Sep 17 00:00:00 2001 From: dami Date: Tue, 25 Mar 2025 12:21:18 +0800 Subject: [PATCH 26/31] update --- plugins/mysql/conf/my8.0.cnf | 2 +- plugins/mysql/conf/my8.2.cnf | 2 +- plugins/mysql/conf/my8.3.cnf | 2 +- plugins/mysql/conf/my8.4.cnf | 2 +- plugins/mysql/conf/my9.0.cnf | 2 +- plugins/mysql/conf/my9.1.cnf | 2 +- plugins/mysql/conf/my9.2.cnf | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/mysql/conf/my8.0.cnf b/plugins/mysql/conf/my8.0.cnf index 8ccfde4fe..767031541 100644 --- a/plugins/mysql/conf/my8.0.cnf +++ b/plugins/mysql/conf/my8.0.cnf @@ -54,7 +54,7 @@ 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 +binlog_expire_logs_seconds=604800 relay-log=mdserver relay-log-index=mdserver diff --git a/plugins/mysql/conf/my8.2.cnf b/plugins/mysql/conf/my8.2.cnf index c3232898a..799bfd496 100644 --- a/plugins/mysql/conf/my8.2.cnf +++ b/plugins/mysql/conf/my8.2.cnf @@ -54,7 +54,7 @@ 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 +binlog_expire_logs_seconds=604800 relay-log=mdserver relay-log-index=mdserver diff --git a/plugins/mysql/conf/my8.3.cnf b/plugins/mysql/conf/my8.3.cnf index c3232898a..799bfd496 100644 --- a/plugins/mysql/conf/my8.3.cnf +++ b/plugins/mysql/conf/my8.3.cnf @@ -54,7 +54,7 @@ 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 +binlog_expire_logs_seconds=604800 relay-log=mdserver relay-log-index=mdserver diff --git a/plugins/mysql/conf/my8.4.cnf b/plugins/mysql/conf/my8.4.cnf index 5a42de1cc..edbbb5ad1 100644 --- a/plugins/mysql/conf/my8.4.cnf +++ b/plugins/mysql/conf/my8.4.cnf @@ -51,7 +51,7 @@ 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 +binlog_expire_logs_seconds=604800 relay-log=mdserver relay-log-index=mdserver diff --git a/plugins/mysql/conf/my9.0.cnf b/plugins/mysql/conf/my9.0.cnf index 5a42de1cc..edbbb5ad1 100644 --- a/plugins/mysql/conf/my9.0.cnf +++ b/plugins/mysql/conf/my9.0.cnf @@ -51,7 +51,7 @@ 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 +binlog_expire_logs_seconds=604800 relay-log=mdserver relay-log-index=mdserver diff --git a/plugins/mysql/conf/my9.1.cnf b/plugins/mysql/conf/my9.1.cnf index 5a42de1cc..edbbb5ad1 100644 --- a/plugins/mysql/conf/my9.1.cnf +++ b/plugins/mysql/conf/my9.1.cnf @@ -51,7 +51,7 @@ 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 +binlog_expire_logs_seconds=604800 relay-log=mdserver relay-log-index=mdserver diff --git a/plugins/mysql/conf/my9.2.cnf b/plugins/mysql/conf/my9.2.cnf index 5a42de1cc..edbbb5ad1 100644 --- a/plugins/mysql/conf/my9.2.cnf +++ b/plugins/mysql/conf/my9.2.cnf @@ -51,7 +51,7 @@ 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 +binlog_expire_logs_seconds=604800 relay-log=mdserver relay-log-index=mdserver From 6fe6f55df835108be38011de74048d79049d57ea Mon Sep 17 00:00:00 2001 From: dami Date: Tue, 25 Mar 2025 12:26:05 +0800 Subject: [PATCH 27/31] 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 4469f86fc..f32b83ddd 100755 --- a/plugins/mysql/info.json +++ b/plugins/mysql/info.json @@ -11,8 +11,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","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"], + "versions":["5.5", "5.6", "5.7","8.0","8.2","8.3","8.4","9.0","9.1","9.2"], + "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","9.2.0"], "shell":"install.sh", "checks":"server/mysql", "path":"server/mysql", From 89d13494c09646a65399d8c938bee6b450d3c8a1 Mon Sep 17 00:00:00 2001 From: dami Date: Tue, 25 Mar 2025 12:43:24 +0800 Subject: [PATCH 28/31] Update index.py --- plugins/mysql-community/index.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/mysql-community/index.py b/plugins/mysql-community/index.py index eded6c1be..a8d3c4247 100755 --- a/plugins/mysql-community/index.py +++ b/plugins/mysql-community/index.py @@ -288,12 +288,13 @@ def binLog(version=''): args = getArgs() conf = getConf() con = mw.readFile(conf) - + if con.find('#log-bin=mysql-bin') != -1: if 'status' in args: return mw.returnJson(False, '0') con = con.replace('#log-bin=mysql-bin', 'log-bin=mysql-bin') con = con.replace('#binlog_format=mixed', 'binlog_format=mixed') + mw.writeFile(conf, con) mw.execShell('sync') restart(version) else: @@ -308,11 +309,10 @@ def binLog(version=''): return mw.returnJson(True, dsize) con = con.replace('log-bin=mysql-bin', '#log-bin=mysql-bin') con = con.replace('binlog_format=mixed', '#binlog_format=mixed') + mw.writeFile(conf, con) mw.execShell('sync') restart(version) mw.execShell('rm -f ' + path + '/mysql-bin.*') - - mw.writeFile(conf, con) return mw.returnJson(True, '设置成功!') From c5dc755cb662d67956f72595c8cb14926d0f559a Mon Sep 17 00:00:00 2001 From: dami Date: Tue, 25 Mar 2025 12:45:00 +0800 Subject: [PATCH 29/31] Update index.py --- plugins/mysql/index.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index 0dac5550f..db1cb8c2c 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -335,6 +335,7 @@ def binLog(version = ''): return mw.returnJson(False, '0') con = con.replace('#log-bin=mysql-bin', 'log-bin=mysql-bin') con = con.replace('#binlog_format=mixed', 'binlog_format=mixed') + mw.writeFile(conf, con) mw.execShell('sync') restart(version) else: @@ -349,11 +350,12 @@ def binLog(version = ''): return mw.returnJson(True, dsize) con = con.replace('log-bin=mysql-bin', '#log-bin=mysql-bin') con = con.replace('binlog_format=mixed', '#binlog_format=mixed') + mw.writeFile(conf, con) mw.execShell('sync') restart(version) mw.execShell('rm -f ' + path + '/mysql-bin.*') - mw.writeFile(conf, con) + return mw.returnJson(True, '设置成功!') From 3cdd7027d6dadc408d1f4b6427dfca144fc07d99 Mon Sep 17 00:00:00 2001 From: dami Date: Tue, 25 Mar 2025 12:45:42 +0800 Subject: [PATCH 30/31] Update index.py --- plugins/mariadb/index.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/mariadb/index.py b/plugins/mariadb/index.py index 4fd9ed3b5..dad563e5b 100755 --- a/plugins/mariadb/index.py +++ b/plugins/mariadb/index.py @@ -280,6 +280,7 @@ def binLog(): return mw.returnJson(False, '0') con = con.replace('#log-bin=mysql-bin', 'log-bin=mysql-bin') con = con.replace('#binlog_format=mixed', 'binlog_format=mixed') + mw.writeFile(conf, con) mw.execShell('sync') restart() else: @@ -294,11 +295,12 @@ def binLog(): return mw.returnJson(True, dsize) con = con.replace('log-bin=mysql-bin', '#log-bin=mysql-bin') con = con.replace('binlog_format=mixed', '#binlog_format=mixed') + mw.writeFile(conf, con) mw.execShell('sync') restart() mw.execShell('rm -f ' + path + '/mysql-bin.*') - mw.writeFile(conf, con) + return mw.returnJson(True, '设置成功!') def binLogList(): From 717d2b1ad059f0a892227af2f33aa75c86bca302 Mon Sep 17 00:00:00 2001 From: dami Date: Tue, 25 Mar 2025 12:48:32 +0800 Subject: [PATCH 31/31] =?UTF-8?q?mariadb=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/mariadb/info.json | 2 +- plugins/mariadb/versions/10.11/install.sh | 2 +- plugins/mariadb/versions/10.6/install.sh | 2 +- plugins/mariadb/versions/11.4/install.sh | 2 +- plugins/mariadb/versions/11.7/install.sh | 120 ++++++++++++++++++++++ 5 files changed, 124 insertions(+), 4 deletions(-) create mode 100755 plugins/mariadb/versions/11.7/install.sh diff --git a/plugins/mariadb/info.json b/plugins/mariadb/info.json index 5cbe1c638..ffa4b0556 100755 --- a/plugins/mariadb/info.json +++ b/plugins/mariadb/info.json @@ -9,7 +9,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","11.4","11.5","11.6"], + "versions":["10.6","10.7","10.8","10.9","10.11","11.0","11.1","11.2","11.3","11.4","11.5","11.6","11.7"], "shell":"install.sh", "checks":"server/mariadb", "path":"server/mariadb", diff --git a/plugins/mariadb/versions/10.11/install.sh b/plugins/mariadb/versions/10.11/install.sh index b76f7d90d..1ec8f6216 100755 --- a/plugins/mariadb/versions/10.11/install.sh +++ b/plugins/mariadb/versions/10.11/install.sh @@ -13,7 +13,7 @@ sysName=`uname` mariadbDir=${serverPath}/source/mariadb -MY_VER=10.11.10 +MY_VER=10.11.11 Install_app() { diff --git a/plugins/mariadb/versions/10.6/install.sh b/plugins/mariadb/versions/10.6/install.sh index 93d5c34ab..38637dab1 100755 --- a/plugins/mariadb/versions/10.6/install.sh +++ b/plugins/mariadb/versions/10.6/install.sh @@ -12,7 +12,7 @@ sysName=`uname` mariadbDir=${serverPath}/source/mariadb -MY_VER=10.6.20 +MY_VER=10.6.21 Install_app() { diff --git a/plugins/mariadb/versions/11.4/install.sh b/plugins/mariadb/versions/11.4/install.sh index 1dd951772..cb63ee500 100755 --- a/plugins/mariadb/versions/11.4/install.sh +++ b/plugins/mariadb/versions/11.4/install.sh @@ -13,7 +13,7 @@ sysName=`uname` mariadbDir=${serverPath}/source/mariadb -MY_VER=11.4.4 +MY_VER=11.4.5 Install_app() { diff --git a/plugins/mariadb/versions/11.7/install.sh b/plugins/mariadb/versions/11.7/install.sh new file mode 100755 index 000000000..b3f7bfc59 --- /dev/null +++ b/plugins/mariadb/versions/11.7/install.sh @@ -0,0 +1,120 @@ +#!/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` + +mariadbDir=${serverPath}/source/mariadb + +MY_VER=11.7.2 + +Install_app() +{ + mkdir -p ${mariadbDir} + echo '正在安装脚本文件...' + + 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.7' > $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 '卸载完成' +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_app +else + Uninstall_app +fi