From 24d08f8f83fb63ec47c8b6a18ad0de447b0ca754 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 22 Jun 2022 18:19:31 +0800 Subject: [PATCH 01/55] Update lib.sh --- scripts/lib.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/lib.sh b/scripts/lib.sh index 7f33fc0e7..4574326a9 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -303,8 +303,9 @@ elif [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "debian" ]; then apt install -y libxml2 libxml2-dev libbz2-dev libmcrypt-dev libpspell-dev librecode-dev apt install -y libgmp-dev libgmp3-dev libreadline-dev libxpm-dev apt install -y zlib1g-dev dia pkg-config - apt install -y libjpeg62-turbo-dev libjpeg-dev libpng-dev + apt install -y libjpeg-dev libpng-dev apt install -y libfreetype6 + apt install -y libjpeg62-turbo-dev apt install -y libfreetype6-dev apt install -y libevent-dev libncurses5-dev libldap2-dev From d96c3105a4683fc2cfdd18e4127e4d4287698d2a Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 22 Jun 2022 18:30:19 +0800 Subject: [PATCH 02/55] =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E4=BF=AE=E6=94=B9servi?= =?UTF-8?q?ce=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/varnish/index.html | 1 + plugins/varnish/index.py | 6 ++++ plugins/varnish/js/varnish.js | 61 +++++++++++++++++++++++++++++++++-- 3 files changed, 66 insertions(+), 2 deletions(-) diff --git a/plugins/varnish/index.html b/plugins/varnish/index.html index df23818be..d250b0686 100755 --- a/plugins/varnish/index.html +++ b/plugins/varnish/index.html @@ -4,6 +4,7 @@

服务

自启动

VCL

+

服务配置

日志

状态

diff --git a/plugins/varnish/index.py b/plugins/varnish/index.py index 21cfa828a..78f3df281 100755 --- a/plugins/varnish/index.py +++ b/plugins/varnish/index.py @@ -172,6 +172,10 @@ def initdUinstall(): def runLog(): return "/var/log/varnish/varnishncsa.log" + +def confService(): + return '/lib/systemd/system/varnish.service' + if __name__ == "__main__": func = sys.argv[1] if func == 'status': @@ -194,6 +198,8 @@ if __name__ == "__main__": print(runInfo()) elif func == 'conf': print(getConf()) + elif func == 'conf_service': + print(confService()) elif func == 'run_log': print(runLog()) elif func == 'config_tpl': diff --git a/plugins/varnish/js/varnish.js b/plugins/varnish/js/varnish.js index 607289aca..5a0ffbcec 100644 --- a/plugins/varnish/js/varnish.js +++ b/plugins/varnish/js/varnish.js @@ -9,7 +9,7 @@ function pRead(){ } -//redis负载状态 start +//varnish负载状态 start function varnishStatus() { var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 }); $.post('/plugins/run', {name:'varnish', func:'run_info'}, function(data) { @@ -41,4 +41,61 @@ function varnishStatus() { $(".soft-man-con").html(Con); },'json'); } -//redis负载状态 end \ No newline at end of file +//varnish负载状态 end + + +//varnish service --- +function varnishPluginConfig(_name, version, func){ + if ( typeof(version) == 'undefined' ){ + version = ''; + } + + var func_name = 'conf'; + if ( typeof(func) != 'undefined' ){ + func_name = func; + } + + var con = '

提示:Ctrl+F 搜索关键字,Ctrl+G 查找下一个,Ctrl+S 保存,Ctrl+Shift+R 查找替换!

\ + \ + \ + '; + $(".soft-man-con").html(con); + + var loadT = layer.msg('配置文件路径获取中...',{icon:16,time:0,shade: [0.3, '#000']}); + $.post('/plugins/run', {name:_name, func:func_name,version:version},function (data) { + layer.close(loadT); + + var loadT2 = layer.msg('文件内容获取中...',{icon:16,time:0,shade: [0.3, '#000']}); + var fileName = data.data; + $.post('/files/get_body', 'path=' + fileName, function(rdata) { + layer.close(loadT2); + if (!rdata.status){ + layer.msg(rdata.msg,{icon:0,time:2000,shade: [0.3, '#000']}); + return; + } + $("#textBody").empty().text(rdata.data.data); + $(".CodeMirror").remove(); + var editor = CodeMirror.fromTextArea(document.getElementById("textBody"), { + extraKeys: { + "Ctrl-Space": "autocomplete", + "Ctrl-F": "findPersistent", + "Ctrl-H": "replaceAll", + "Ctrl-S": function() { + $("#textBody").text(editor.getValue()); + pluginConfigSave(fileName); + } + }, + lineNumbers: true, + matchBrackets:true, + }); + editor.focus(); + $(".CodeMirror-scroll").css({"height":"300px","margin":0,"padding":0}); + $("#onlineEditFileBtn").click(function(){ + $("#textBody").text(editor.getValue()); + pluginConfigSave(fileName); + }); + },'json'); + },'json'); +} From 3a24753299ec70d04ed48e22327c86f32b6b14f3 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 22 Jun 2022 19:13:25 +0800 Subject: [PATCH 03/55] =?UTF-8?q?PHP5.2=20=E9=AB=98=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E6=A3=80=E6=9F=A5,=E6=97=A0=E6=B3=95=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/php/versions/52/install.sh | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/plugins/php/versions/52/install.sh b/plugins/php/versions/52/install.sh index 5bacea599..9cdb35703 100755 --- a/plugins/php/versions/52/install.sh +++ b/plugins/php/versions/52/install.sh @@ -11,6 +11,46 @@ sysName=`uname` install_tmp=${rootPath}/tmp/mw_install.pl + +_os=`uname` +echo "use system: ${_os}" + +if [ ${_os} == "Darwin" ]; then + OSNAME='macos' +elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then + OSNAME='centos' +elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then + OSNAME='fedora' +elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then + OSNAME='rocky' +elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then + OSNAME='alma' +elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then + OSNAME='debian' +elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then + OSNAME='ubuntu' +elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then + OSNAME='raspbian' +else + OSNAME='unknow' +fi + + +if [ "$OSNAME" == 'ubuntu' ] || [ "$OSNAME" == 'debian' ] ;then + apt install bison=2.4.1 + if [ "$?" != "0" ]; then + echo 'The system version is too high to install' + exit 1 + fi + + apt install flex=2.5.4 + if [ "$?" != "0" ]; then + echo 'The system version is too high to install' + exit 1 + fi +fi + + version=5.2.17 PHP_VER=52 Install_php() From fb358f18486373a9bd4d2bfb8862da532d9cbf20 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 22 Jun 2022 20:01:43 +0800 Subject: [PATCH 04/55] debian11 mysqlclient remove --- scripts/install/debian.sh | 2 ++ scripts/update/debian.sh | 1 + 2 files changed, 3 insertions(+) diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index e5338111f..d7744973b 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -70,6 +70,8 @@ fi pip install --upgrade pip pip install --upgrade setuptools + +sed -i "/mysqlclient/d" /www/server/mdserver-web/requirements.txt cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt pip3 install gunicorn==20.1.0 diff --git a/scripts/update/debian.sh b/scripts/update/debian.sh index 5029b36ca..1e2d8156c 100644 --- a/scripts/update/debian.sh +++ b/scripts/update/debian.sh @@ -21,6 +21,7 @@ fi pip install --upgrade pip pip install --upgrade setuptools +sed -i "/mysqlclient/d" /www/server/mdserver-web/requirements.txt cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt pip3 install gunicorn==20.1.0 From dde66366edd692f00a568a100fb2b493250bdb4c Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 22 Jun 2022 20:02:25 +0800 Subject: [PATCH 05/55] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 9f607da48..4b1870f88 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,6 +22,6 @@ zmq==0.0.0 pymongo pillow Jinja2>=2.11.2 -mysqlclient>=2.0.3 flask-caching>=1.10.1 mysql-connector-python +mysqlclient>=2.0.3 From 373b7ebadac5668424a2df9c70586a503d6b98e6 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 22 Jun 2022 20:05:39 +0800 Subject: [PATCH 06/55] Update requirements.txt --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4b1870f88..818b46e69 100644 --- a/requirements.txt +++ b/requirements.txt @@ -24,4 +24,3 @@ pillow Jinja2>=2.11.2 flask-caching>=1.10.1 mysql-connector-python -mysqlclient>=2.0.3 From b23a8ebef3b3efdf398646d6e7a7adbe95e87825 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 22 Jun 2022 20:06:59 +0800 Subject: [PATCH 07/55] Update debian.sh --- scripts/install/debian.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index d7744973b..b9ebed2ab 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -80,6 +80,7 @@ pip3 install gevent-websocket==0.10.1 pip3 install requests==2.20.0 pip3 install flask-caching==1.10.1 pip3 install flask-socketio==5.2.0 +pip3 install mysqlclient==2.0.3 pip3 install pymongo pip3 install psutil @@ -95,6 +96,7 @@ if [ ! -f /www/server/mdserver-web/bin/activate ];then pip3 install requests==2.20.0 pip3 install flask-caching==1.10.1 pip3 install flask-socketio==5.2.0 + pip3 install mysqlclient==2.0.3 pip3 install pymongo pip3 install psutil fi From 833ce4583430e1de48fee9ca16d4d0c9bd5d4d08 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 22 Jun 2022 20:08:08 +0800 Subject: [PATCH 08/55] Update debian.sh --- scripts/install/debian.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index b9ebed2ab..031467152 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -79,10 +79,10 @@ pip3 install gevent==21.1.2 pip3 install gevent-websocket==0.10.1 pip3 install requests==2.20.0 pip3 install flask-caching==1.10.1 -pip3 install flask-socketio==5.2.0 pip3 install mysqlclient==2.0.3 pip3 install pymongo pip3 install psutil +pip3 install flask-socketio==5.2.0 if [ ! -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && python3 -m venv . @@ -95,10 +95,10 @@ if [ ! -f /www/server/mdserver-web/bin/activate ];then pip3 install gevent-websocket==0.10.1 pip3 install requests==2.20.0 pip3 install flask-caching==1.10.1 - pip3 install flask-socketio==5.2.0 pip3 install mysqlclient==2.0.3 pip3 install pymongo - pip3 install psutil + pip3 install psutil + pip3 install flask-socketio==5.2.0 fi From 96201fb21d83d69c1d6a346dde461385fd34187f Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 22 Jun 2022 20:08:31 +0800 Subject: [PATCH 09/55] Update debian.sh --- scripts/install/debian.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index 031467152..5a8199ec2 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -68,8 +68,6 @@ if [ ! -f /usr/local/bin/pip3 ];then fi pip install --upgrade pip -pip install --upgrade setuptools - sed -i "/mysqlclient/d" /www/server/mdserver-web/requirements.txt cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt @@ -89,7 +87,6 @@ if [ ! -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate pip install --upgrade pip pip3 install -r /www/server/mdserver-web/requirements.txt - pip install --upgrade setuptools pip3 install gunicorn==20.1.0 pip3 install gevent==21.1.2 pip3 install gevent-websocket==0.10.1 From b52cd332860124f7b4da746eaa0962b46bcec433 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 22 Jun 2022 20:24:23 +0800 Subject: [PATCH 10/55] Update zlib.sh --- plugins/php/lib/zlib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/php/lib/zlib.sh b/plugins/php/lib/zlib.sh index 56e159a18..ab6b4c50a 100644 --- a/plugins/php/lib/zlib.sh +++ b/plugins/php/lib/zlib.sh @@ -13,7 +13,7 @@ rootPath=$(dirname "$rootPath") SERVER_ROOT=$rootPath/lib SOURCE_ROOT=$rootPath/source/lib -if [ ! -d ${SERVER_ROOT}/libiconv ];then +if [ ! -d ${SERVER_ROOT}/zlib ];then cd $SOURCE_ROOT if [ ! -f ${SOURCE_ROOT}/zlib-1.2.11.tar.gz ];then From 655e239ecf811e642e3abd456ebb14e7ff4f8123 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 22 Jun 2022 20:34:02 +0800 Subject: [PATCH 11/55] =?UTF-8?q?openresty=20zlib=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E8=87=AA=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/openresty/install.sh | 10 ++++++++-- plugins/openresty/lib/zlib.sh | 31 +++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 plugins/openresty/lib/zlib.sh diff --git a/plugins/openresty/install.sh b/plugins/openresty/install.sh index 53ae30979..409d2be2a 100755 --- a/plugins/openresty/install.sh +++ b/plugins/openresty/install.sh @@ -24,11 +24,14 @@ else useradd -g www -s /bin/bash www fi +# cd /www/server/mdserver-web/plugins/openresty && /bin/bash install.sh install 1.21.4.1 Install_openresty() { mkdir -p ${openrestyDir} echo '正在安装脚本文件...' > $install_tmp + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash zlib.sh + if [ ! -f ${openrestyDir}/openresty-${VERSION}.tar.gz ];then wget -O ${openrestyDir}/openresty-${VERSION}.tar.gz https://openresty.org/download/openresty-${VERSION}.tar.gz fi @@ -41,9 +44,12 @@ Install_openresty() --with-http_v2_module \ --with-http_ssl_module \ --with-http_slice_module \ - --with-http_stub_status_module && make && make install && \ + --with-http_stub_status_module \ + --with-zlib=$serverPath/lib/zlib + + make && make install && make clean echo "${VERSION}" > $serverPath/openresty/version.pl - echo "" > $serverPath/web_conf/nginx/enable-php-00.conf + echo "" > $serverPath/openresty/nginx/conf/enable-php-00.conf echo '安装完成' > $install_tmp } diff --git a/plugins/openresty/lib/zlib.sh b/plugins/openresty/lib/zlib.sh new file mode 100644 index 000000000..ab6b4c50a --- /dev/null +++ b/plugins/openresty/lib/zlib.sh @@ -0,0 +1,31 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") + +# echo $rootPath + +SERVER_ROOT=$rootPath/lib +SOURCE_ROOT=$rootPath/source/lib + +if [ ! -d ${SERVER_ROOT}/zlib ];then + + cd $SOURCE_ROOT + if [ ! -f ${SOURCE_ROOT}/zlib-1.2.11.tar.gz ];then + wget -O zlib-1.2.11.tar.gz --no-check-certificate https://github.com/madler/zlib/archive/v1.2.11.tar.gz -T 20 + fi + + tar -zxvf zlib-1.2.11.tar.gz + cd zlib-1.2.11 + + ./configure --prefix=${SERVER_ROOT}/zlib && make && make install + + #cd $SOURCE_ROOT + #rm -rf zlib-1.2.11 + #rm -rf zlib-1.2.11.tar.gz +fi \ No newline at end of file From c126f87322e31d0f2772fa48348cf00f99797131 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 22 Jun 2022 20:46:10 +0800 Subject: [PATCH 12/55] Update install.sh --- plugins/openresty/install.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/openresty/install.sh b/plugins/openresty/install.sh index 409d2be2a..e2c0fb068 100755 --- a/plugins/openresty/install.sh +++ b/plugins/openresty/install.sh @@ -46,10 +46,13 @@ Install_openresty() --with-http_slice_module \ --with-http_stub_status_module \ --with-zlib=$serverPath/lib/zlib - + make && make install && make clean echo "${VERSION}" > $serverPath/openresty/version.pl - echo "" > $serverPath/openresty/nginx/conf/enable-php-00.conf + + if [ -d $serverPath/openresty/nginx/conf ];then + echo "" > $serverPath/openresty/nginx/conf/enable-php-00.conf + fi echo '安装完成' > $install_tmp } From 53a7761b10978e1db757d27e0404ffeb76b71e79 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 22 Jun 2022 22:12:52 +0800 Subject: [PATCH 13/55] #87 --- plugins/redis/index.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/redis/index.py b/plugins/redis/index.py index 0a7f24910..5c57d2fef 100755 --- a/plugins/redis/index.py +++ b/plugins/redis/index.py @@ -96,9 +96,12 @@ def initDreplace(): # config replace dst_conf = getServerDir() + '/redis.conf' - conf_content = mw.readFile(getConfTpl()) - conf_content = conf_content.replace('{$SERVER_PATH}', service_path) - mw.writeFile(dst_conf, conf_content) + dst_conf_init = getServerDir() + '/init.pl' + if not os.path.exists(dst_conf_init): + conf_content = mw.readFile(getConfTpl()) + conf_content = conf_content.replace('{$SERVER_PATH}', service_path) + mw.writeFile(dst_conf, conf_content) + mw.writeFile(dst_conf_init, 'ok') # systemd systemDir = '/lib/systemd/system' From 79d6fd3a2b66443d7ca78fa2565a8265d44aec98 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 00:48:52 +0800 Subject: [PATCH 14/55] debug zlib1g --- plugins/openresty/install.sh | 16 +++++++--------- plugins/openresty/lib/zlib.sh | 31 ------------------------------- scripts/install/debian.sh | 22 ++++++++++++++++++++++ scripts/install_dev.sh | 1 + scripts/lib.sh | 3 ++- 5 files changed, 32 insertions(+), 41 deletions(-) delete mode 100644 plugins/openresty/lib/zlib.sh diff --git a/plugins/openresty/install.sh b/plugins/openresty/install.sh index e2c0fb068..92954192e 100755 --- a/plugins/openresty/install.sh +++ b/plugins/openresty/install.sh @@ -30,8 +30,6 @@ Install_openresty() mkdir -p ${openrestyDir} echo '正在安装脚本文件...' > $install_tmp - cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash zlib.sh - if [ ! -f ${openrestyDir}/openresty-${VERSION}.tar.gz ];then wget -O ${openrestyDir}/openresty-${VERSION}.tar.gz https://openresty.org/download/openresty-${VERSION}.tar.gz fi @@ -40,19 +38,19 @@ Install_openresty() cd ${openrestyDir} && tar -zxvf openresty-${VERSION}.tar.gz # --with-openssl=$serverPath/source/lib/openssl-1.0.2q - cd ${openrestyDir}/openresty-${VERSION} && ./configure --prefix=$serverPath/openresty \ + cd ${openrestyDir}/openresty-${VERSION} && ./configure \ + --prefix=$serverPath/openresty \ --with-http_v2_module \ --with-http_ssl_module \ --with-http_slice_module \ - --with-http_stub_status_module \ - --with-zlib=$serverPath/lib/zlib + --with-http_stub_status_module - make && make install && make clean - echo "${VERSION}" > $serverPath/openresty/version.pl + gmake && gmake install && make clean - if [ -d $serverPath/openresty/nginx/conf ];then + if [ -d $serverPath/openresty ];then + echo "${VERSION}" > $serverPath/openresty/version.pl echo "" > $serverPath/openresty/nginx/conf/enable-php-00.conf - fi + fi echo '安装完成' > $install_tmp } diff --git a/plugins/openresty/lib/zlib.sh b/plugins/openresty/lib/zlib.sh deleted file mode 100644 index ab6b4c50a..000000000 --- a/plugins/openresty/lib/zlib.sh +++ /dev/null @@ -1,31 +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") - -# echo $rootPath - -SERVER_ROOT=$rootPath/lib -SOURCE_ROOT=$rootPath/source/lib - -if [ ! -d ${SERVER_ROOT}/zlib ];then - - cd $SOURCE_ROOT - if [ ! -f ${SOURCE_ROOT}/zlib-1.2.11.tar.gz ];then - wget -O zlib-1.2.11.tar.gz --no-check-certificate https://github.com/madler/zlib/archive/v1.2.11.tar.gz -T 20 - fi - - tar -zxvf zlib-1.2.11.tar.gz - cd zlib-1.2.11 - - ./configure --prefix=${SERVER_ROOT}/zlib && make && make install - - #cd $SOURCE_ROOT - #rm -rf zlib-1.2.11 - #rm -rf zlib-1.2.11.tar.gz -fi \ No newline at end of file diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index 5a8199ec2..d792c083e 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -3,6 +3,14 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH LANG=en_US.UTF-8 +# RED='\e[1;31m' # 红色 +# GREEN='\e[1;32m' # 绿色 +# YELLOW='\e[1;33m' # 黄色 +# BLUE='\e[1;34m' # 蓝色 +# PURPLE='\e[1;35m' # 紫色 +# CYAN='\e[1;36m' # 蓝绿色 +# WHITE='\e[1;37m' # 白色 +# NC='\e[0m' # 没有颜色 apt update -y @@ -63,6 +71,20 @@ systemctl stop firewalld cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data + +#fix zlib1g-dev fail +echo -e "\e[0;32mfix zlib1g-dev install question\e[0m" +Install_TmpFile=/tmp/debian-fix-zlib1g-dev.txt +apt install -y zlib1g-dev > ${Install_TmpFile} +if [ "$?" != "0" ];then + ZLIB1G_BASE_VER=$(cat ${Install_TmpFile} | grep zlib1g | awk -F "=" '{print $2}' | awk -F ")" '{print $1}') + echo "1${ZLIB1G_BASE_VER}1" +# apt install zlib1g=1:1.2.11.dfsg-2 zlib1g-dev +fi +echo "\e[0;32mfix zlib1g-dev install question\e[0m" + + + if [ ! -f /usr/local/bin/pip3 ];then python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple fi diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 4b914988f..37462fa8b 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -44,6 +44,7 @@ elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; th yum install -y wget zip unzip elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then OSNAME='debian' + apt install -y devscripts apt install -y wget zip unzip elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then OSNAME='ubuntu' diff --git a/scripts/lib.sh b/scripts/lib.sh index 4574326a9..38bcda714 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -302,7 +302,8 @@ elif [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "debian" ]; then apt install -y libxml2 libxml2-dev libbz2-dev libmcrypt-dev libpspell-dev librecode-dev apt install -y libgmp-dev libgmp3-dev libreadline-dev libxpm-dev - apt install -y zlib1g-dev dia pkg-config + apt install -y dia pkg-config + apt install -y zlib1g-dev apt install -y libjpeg-dev libpng-dev apt install -y libfreetype6 apt install -y libjpeg62-turbo-dev From bfa1fd2d88f0f8d9dc5e2eab6be3f60f5be4398a Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 00:50:32 +0800 Subject: [PATCH 15/55] Update debian.sh --- scripts/install/debian.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index d792c083e..5b03b264c 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -81,7 +81,7 @@ if [ "$?" != "0" ];then echo "1${ZLIB1G_BASE_VER}1" # apt install zlib1g=1:1.2.11.dfsg-2 zlib1g-dev fi -echo "\e[0;32mfix zlib1g-dev install question\e[0m" +echo -e "\e[0;32mfix zlib1g-dev install question\e[0m" From d9d7939fe98ff3f951e46864021b3cacefb5bc98 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 00:54:01 +0800 Subject: [PATCH 16/55] Update debian.sh --- scripts/install/debian.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index 5b03b264c..41d8e9b5a 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -78,6 +78,7 @@ Install_TmpFile=/tmp/debian-fix-zlib1g-dev.txt apt install -y zlib1g-dev > ${Install_TmpFile} if [ "$?" != "0" ];then ZLIB1G_BASE_VER=$(cat ${Install_TmpFile} | grep zlib1g | awk -F "=" '{print $2}' | awk -F ")" '{print $1}') + ZLIB1G_BASE_VER=`echo ${ZLIB1G_BASE_VER} | sed "s/^[ \s]\{1,\}//g;s/[ \s]\{1,\}$//g"` echo "1${ZLIB1G_BASE_VER}1" # apt install zlib1g=1:1.2.11.dfsg-2 zlib1g-dev fi From a1a154cc5223231faa712efa75678b3388c53ed6 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 00:57:10 +0800 Subject: [PATCH 17/55] Update debian.sh --- scripts/install/debian.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index 41d8e9b5a..563d47e4a 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -68,10 +68,6 @@ fi systemctl stop firewalld -cd /www/server/mdserver-web/scripts && bash lib.sh -chmod 755 /www/server/mdserver-web/data - - #fix zlib1g-dev fail echo -e "\e[0;32mfix zlib1g-dev install question\e[0m" Install_TmpFile=/tmp/debian-fix-zlib1g-dev.txt @@ -79,12 +75,17 @@ apt install -y zlib1g-dev > ${Install_TmpFile} if [ "$?" != "0" ];then ZLIB1G_BASE_VER=$(cat ${Install_TmpFile} | grep zlib1g | awk -F "=" '{print $2}' | awk -F ")" '{print $1}') ZLIB1G_BASE_VER=`echo ${ZLIB1G_BASE_VER} | sed "s/^[ \s]\{1,\}//g;s/[ \s]\{1,\}$//g"` - echo "1${ZLIB1G_BASE_VER}1" -# apt install zlib1g=1:1.2.11.dfsg-2 zlib1g-dev + # echo "1${ZLIB1G_BASE_VER}1" + apt install zlib1g=${ZLIB1G_BASE_VER} zlib1g-dev fi +rm -rf ${Install_TmpFile} echo -e "\e[0;32mfix zlib1g-dev install question\e[0m" +cd /www/server/mdserver-web/scripts && bash lib.sh +chmod 755 /www/server/mdserver-web/data + + if [ ! -f /usr/local/bin/pip3 ];then python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple From c7daaf939709422d351a8b5c143dc370d6f3d5b7 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 01:00:46 +0800 Subject: [PATCH 18/55] Update debian.sh --- scripts/install/debian.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index 563d47e4a..f3b14d382 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -76,7 +76,7 @@ if [ "$?" != "0" ];then ZLIB1G_BASE_VER=$(cat ${Install_TmpFile} | grep zlib1g | awk -F "=" '{print $2}' | awk -F ")" '{print $1}') ZLIB1G_BASE_VER=`echo ${ZLIB1G_BASE_VER} | sed "s/^[ \s]\{1,\}//g;s/[ \s]\{1,\}$//g"` # echo "1${ZLIB1G_BASE_VER}1" - apt install zlib1g=${ZLIB1G_BASE_VER} zlib1g-dev + apt install -y zlib1g=${ZLIB1G_BASE_VER} zlib1g-dev fi rm -rf ${Install_TmpFile} echo -e "\e[0;32mfix zlib1g-dev install question\e[0m" From c8d092636268e79043b38e255d5fce727b0880e1 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 01:02:31 +0800 Subject: [PATCH 19/55] Update debian.sh --- scripts/install/debian.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index f3b14d382..8f354878e 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -69,7 +69,7 @@ systemctl stop firewalld #fix zlib1g-dev fail -echo -e "\e[0;32mfix zlib1g-dev install question\e[0m" +echo -e "\e[0;32mfix zlib1g-dev install question start\e[0m" Install_TmpFile=/tmp/debian-fix-zlib1g-dev.txt apt install -y zlib1g-dev > ${Install_TmpFile} if [ "$?" != "0" ];then @@ -79,7 +79,7 @@ if [ "$?" != "0" ];then apt install -y zlib1g=${ZLIB1G_BASE_VER} zlib1g-dev fi rm -rf ${Install_TmpFile} -echo -e "\e[0;32mfix zlib1g-dev install question\e[0m" +echo -e "\e[0;32mfix zlib1g-dev install question end\e[0m" cd /www/server/mdserver-web/scripts && bash lib.sh From b56d15c2f9cb3e6b6fa75b4e4d98ae1f5447107c Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 01:03:39 +0800 Subject: [PATCH 20/55] Update debian.sh --- scripts/install/debian.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index 8f354878e..0a5768639 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -76,6 +76,7 @@ if [ "$?" != "0" ];then ZLIB1G_BASE_VER=$(cat ${Install_TmpFile} | grep zlib1g | awk -F "=" '{print $2}' | awk -F ")" '{print $1}') ZLIB1G_BASE_VER=`echo ${ZLIB1G_BASE_VER} | sed "s/^[ \s]\{1,\}//g;s/[ \s]\{1,\}$//g"` # echo "1${ZLIB1G_BASE_VER}1" + echo -e "\e[1;31mapt install -y zlib1g=${ZLIB1G_BASE_VER} zlib1g-dev\e[0m" apt install -y zlib1g=${ZLIB1G_BASE_VER} zlib1g-dev fi rm -rf ${Install_TmpFile} From a7801cb5bdc93b8041e15030444a3091b202af50 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 01:08:31 +0800 Subject: [PATCH 21/55] Update debian.sh --- scripts/install/debian.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index 0a5768639..a2a4eae1d 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -76,8 +76,8 @@ if [ "$?" != "0" ];then ZLIB1G_BASE_VER=$(cat ${Install_TmpFile} | grep zlib1g | awk -F "=" '{print $2}' | awk -F ")" '{print $1}') ZLIB1G_BASE_VER=`echo ${ZLIB1G_BASE_VER} | sed "s/^[ \s]\{1,\}//g;s/[ \s]\{1,\}$//g"` # echo "1${ZLIB1G_BASE_VER}1" - echo -e "\e[1;31mapt install -y zlib1g=${ZLIB1G_BASE_VER} zlib1g-dev\e[0m" - apt install -y zlib1g=${ZLIB1G_BASE_VER} zlib1g-dev + echo -e "\e[1;31mapt install zlib1g=${ZLIB1G_BASE_VER} zlib1g-dev\e[0m" + apt install zlib1g=${ZLIB1G_BASE_VER} zlib1g-dev fi rm -rf ${Install_TmpFile} echo -e "\e[0;32mfix zlib1g-dev install question end\e[0m" From e0c18b74083260c0e0760b48e2f41b3fd61ec80f Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 01:16:25 +0800 Subject: [PATCH 22/55] Update debian.sh --- scripts/install/debian.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index a2a4eae1d..672a2af12 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -77,7 +77,7 @@ if [ "$?" != "0" ];then ZLIB1G_BASE_VER=`echo ${ZLIB1G_BASE_VER} | sed "s/^[ \s]\{1,\}//g;s/[ \s]\{1,\}$//g"` # echo "1${ZLIB1G_BASE_VER}1" echo -e "\e[1;31mapt install zlib1g=${ZLIB1G_BASE_VER} zlib1g-dev\e[0m" - apt install zlib1g=${ZLIB1G_BASE_VER} zlib1g-dev + echo "Y" | apt install zlib1g=${ZLIB1G_BASE_VER} zlib1g-dev fi rm -rf ${Install_TmpFile} echo -e "\e[0;32mfix zlib1g-dev install question end\e[0m" From 43fafcdc00e91d4890b048a375141b2c6a9d1d1a Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 01:26:33 +0800 Subject: [PATCH 23/55] up --- scripts/install/debian.sh | 1 + scripts/install/ubuntu.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index 672a2af12..95ffafc1f 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -17,6 +17,7 @@ apt update -y apt install -y wget curl lsof unzip apt install -y python3-pip +apt install -y python3-dev apt install -y python3-venv apt install -y cron diff --git a/scripts/install/ubuntu.sh b/scripts/install/ubuntu.sh index 9bec0dbdd..adf835437 100644 --- a/scripts/install/ubuntu.sh +++ b/scripts/install/ubuntu.sh @@ -9,6 +9,8 @@ apt update -y apt install -y wget curl lsof unzip apt install -y python3-pip apt install -y python3-venv +apt install -y python3-dev + apt install -y cron From 56d042431b346ff9ef3334714f80dc923a47f01e Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 02:49:49 +0800 Subject: [PATCH 24/55] =?UTF-8?q?=E5=85=BC=E5=AE=B9debian=E6=97=A0127.0.0.?= =?UTF-8?q?1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/openresty/index.py | 18 +++++++++++++++++- plugins/php/index.py | 14 ++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/plugins/openresty/index.py b/plugins/openresty/index.py index 8875bb4e7..3fd4fc2af 100755 --- a/plugins/openresty/index.py +++ b/plugins/openresty/index.py @@ -265,9 +265,12 @@ def initdUinstall(): def runInfo(): + # 取Openresty负载状态 + try: - result = mw.httpGet('http://127.0.0.1/nginx_status') + url = 'http://' + mw.GetLocalIp() + '/nginx_status' + result = mw.httpGet(url) tmp = result.split() data = {} data['active'] = tmp[2] @@ -279,6 +282,19 @@ def runInfo(): data['Waiting'] = tmp[15] return mw.getJson(data) except Exception as e: + url = 'http://127.0.0.1/nginx_status' + result = mw.httpGet(url) + tmp = result.split() + data = {} + data['active'] = tmp[2] + data['accepts'] = tmp[9] + data['handled'] = tmp[7] + data['requests'] = tmp[8] + data['Reading'] = tmp[11] + data['Writing'] = tmp[13] + data['Waiting'] = tmp[15] + return mw.getJson(data) + else return 'oprenresty not started' diff --git a/plugins/php/index.py b/plugins/php/index.py index d23cfdff6..9bc5f19b2 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -534,8 +534,18 @@ def checkFpmStatusFile(version): def getFpmStatus(version): checkFpmStatusFile(version) - result = mw.httpGet( - 'http://127.0.0.1/phpfpm_status_' + version + '?json') + + try: + url = 'http://' + mw.getLocalIp() + '/phpfpm_status_' + version + '?json' + result = mw.httpGet(url) + except Exception as e: + url = 'http://127.0.0.1/phpfpm_status_' + version + '?json' + result = mw.httpGet(url) + else: + tmp = {} + tmp['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime) + return mw.getJson(tmp) + tmp = json.loads(result) fTime = time.localtime(int(tmp['start time'])) tmp['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime) From 4a6ec1a9b4dc6651ebfbea4013cabcd0e9d929a4 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 02:55:35 +0800 Subject: [PATCH 25/55] 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 3fd4fc2af..f48dc73f0 100755 --- a/plugins/openresty/index.py +++ b/plugins/openresty/index.py @@ -294,7 +294,7 @@ def runInfo(): data['Writing'] = tmp[13] data['Waiting'] = tmp[15] return mw.getJson(data) - else + else: return 'oprenresty not started' From a638354d2cb9bc1e45d09a47ad2836eb34a4e410 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 02:56:31 +0800 Subject: [PATCH 26/55] Update index.py --- plugins/php/index.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/php/index.py b/plugins/php/index.py index 9bc5f19b2..8d496fb36 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -542,9 +542,7 @@ def getFpmStatus(version): url = 'http://127.0.0.1/phpfpm_status_' + version + '?json' result = mw.httpGet(url) else: - tmp = {} - tmp['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime) - return mw.getJson(tmp) + return mw.getJson({}) tmp = json.loads(result) fTime = time.localtime(int(tmp['start time'])) From cd0a2df91a34998de5621877e245dd63b189b388 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 03:01:30 +0800 Subject: [PATCH 27/55] up --- plugins/openresty/index.py | 2 +- plugins/php/index.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/openresty/index.py b/plugins/openresty/index.py index f48dc73f0..18a398605 100755 --- a/plugins/openresty/index.py +++ b/plugins/openresty/index.py @@ -269,7 +269,7 @@ def runInfo(): # 取Openresty负载状态 try: - url = 'http://' + mw.GetLocalIp() + '/nginx_status' + url = 'http://' + mw.getHostAddr() + '/nginx_status' result = mw.httpGet(url) tmp = result.split() data = {} diff --git a/plugins/php/index.py b/plugins/php/index.py index 8d496fb36..a7b9acf38 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -536,7 +536,7 @@ def getFpmStatus(version): checkFpmStatusFile(version) try: - url = 'http://' + mw.getLocalIp() + '/phpfpm_status_' + version + '?json' + url = 'http://' + mw.getHostAddr() + '/phpfpm_status_' + version + '?json' result = mw.httpGet(url) except Exception as e: url = 'http://127.0.0.1/phpfpm_status_' + version + '?json' From 3301c68b273d52c81a03c03f2dfeaaed272b5042 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 03:08:09 +0800 Subject: [PATCH 28/55] Update index.py --- plugins/php/index.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/php/index.py b/plugins/php/index.py index a7b9acf38..219b53104 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -538,15 +538,18 @@ def getFpmStatus(version): try: url = 'http://' + mw.getHostAddr() + '/phpfpm_status_' + version + '?json' result = mw.httpGet(url) + tmp = json.loads(result) + fTime = time.localtime(int(tmp['start time'])) + tmp['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime) except Exception as e: url = 'http://127.0.0.1/phpfpm_status_' + version + '?json' result = mw.httpGet(url) + tmp = json.loads(result) + fTime = time.localtime(int(tmp['start time'])) + tmp['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime) else: - return mw.getJson({}) + tmp = {} - tmp = json.loads(result) - fTime = time.localtime(int(tmp['start time'])) - tmp['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime) return mw.getJson(tmp) From 2f2ab82a7d5fd74bc5ca6f2295f48acaaa387f34 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 03:14:35 +0800 Subject: [PATCH 29/55] Update index.py --- plugins/php/index.py | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/plugins/php/index.py b/plugins/php/index.py index 219b53104..4213da845 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -521,15 +521,16 @@ def setFpmConfig(version): def checkFpmStatusFile(version): - if mw.isInstalledWeb(): - sdir = mw.getServerDir() - dfile = sdir + '/openresty/nginx/conf/php_status/phpfpm_status_' + version + '.conf' - if not os.path.exists(dfile): - tpl = getPluginDir() + '/conf/phpfpm_status.conf' - content = mw.readFile(tpl) - content = contentReplace(content, version) - mw.writeFile(dfile, content) - mw.restartWeb() + if not mw.isInstalledWeb(): + return False + + dfile = getServerDir() + '/nginx/conf/php_status/phpfpm_status_' + version + '.conf' + if not os.path.exists(dfile): + tpl = getPluginDir() + '/conf/phpfpm_status.conf' + content = mw.readFile(tpl) + content = contentReplace(content, version) + mw.writeFile(dfile, content) + mw.restartWeb() def getFpmStatus(version): @@ -538,19 +539,19 @@ def getFpmStatus(version): try: url = 'http://' + mw.getHostAddr() + '/phpfpm_status_' + version + '?json' result = mw.httpGet(url) - tmp = json.loads(result) - fTime = time.localtime(int(tmp['start time'])) - tmp['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime) + data = json.loads(result) + fTime = time.localtime(int(data['start time'])) + data['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime) except Exception as e: url = 'http://127.0.0.1/phpfpm_status_' + version + '?json' result = mw.httpGet(url) - tmp = json.loads(result) - fTime = time.localtime(int(tmp['start time'])) - tmp['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime) + data = json.loads(result) + fTime = time.localtime(int(data['start time'])) + data['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime) else: - tmp = {} + data = {} - return mw.getJson(tmp) + return mw.getJson(data) def getDisableFunc(version): From d782d79f460eab9fc185eb74da34e83c39f8d10f Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 03:15:00 +0800 Subject: [PATCH 30/55] Update index.py --- plugins/php/index.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/php/index.py b/plugins/php/index.py index 4213da845..c4b189bf9 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -531,6 +531,7 @@ def checkFpmStatusFile(version): content = contentReplace(content, version) mw.writeFile(dfile, content) mw.restartWeb() + return True def getFpmStatus(version): From bb470e2876bb0e99d928af7e8d1b0b2c1331752d Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 03:20:45 +0800 Subject: [PATCH 31/55] up --- plugins/openresty/index.py | 4 +--- plugins/php/index.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/openresty/index.py b/plugins/openresty/index.py index 18a398605..121190493 100755 --- a/plugins/openresty/index.py +++ b/plugins/openresty/index.py @@ -265,9 +265,7 @@ def initdUinstall(): def runInfo(): - # 取Openresty负载状态 - try: url = 'http://' + mw.getHostAddr() + '/nginx_status' result = mw.httpGet(url) @@ -294,7 +292,7 @@ def runInfo(): data['Writing'] = tmp[13] data['Waiting'] = tmp[15] return mw.getJson(data) - else: + except Exception as e: return 'oprenresty not started' diff --git a/plugins/php/index.py b/plugins/php/index.py index c4b189bf9..fe6be8eca 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -549,7 +549,7 @@ def getFpmStatus(version): data = json.loads(result) fTime = time.localtime(int(data['start time'])) data['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime) - else: + except Exception as e: data = {} return mw.getJson(data) From f159cd9e5eaebf2966aefbd41c1a1a6c0633867d Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 03:39:23 +0800 Subject: [PATCH 32/55] fix libunwind-dev fail --- requirements.txt | 1 + scripts/install/debian.sh | 16 ++++++++++++++-- scripts/lib.sh | 3 ++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 818b46e69..4b1870f88 100644 --- a/requirements.txt +++ b/requirements.txt @@ -24,3 +24,4 @@ pillow Jinja2>=2.11.2 flask-caching>=1.10.1 mysql-connector-python +mysqlclient>=2.0.3 diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index 95ffafc1f..426b9c0ac 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -84,6 +84,20 @@ rm -rf ${Install_TmpFile} echo -e "\e[0;32mfix zlib1g-dev install question end\e[0m" +#fix libunwind-dev fail +echo -e "\e[0;32mfix libunwind-dev install question start\e[0m" +Install_TmpFile=/tmp/debian-fix-libunwind-dev.txt +apt install -y zlib1g-dev > ${Install_TmpFile} +if [ "$?" != "0" ];then + liblzma5_BASE_VER=$(cat ${Install_TmpFile} | grep liblzma-dev | awk -F "=" '{print $2}' | awk -F ")" '{print $1}') + liblzma5_BASE_VER=`echo ${liblzma5_BASE_VER} | sed "s/^[ \s]\{1,\}//g;s/[ \s]\{1,\}$//g"` + echo -e "\e[1;31mapt install liblzma5=${liblzma5_BASE_VER} libunwind-dev\e[0m" + echo "Y" | apt install liblzma5=${liblzma5_BASE_VER} libunwind-dev +fi +rm -rf ${Install_TmpFile} +echo -e "\e[0;32mfix libunwind-dev install question end\e[0m" + + cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data @@ -103,7 +117,6 @@ pip3 install gevent==21.1.2 pip3 install gevent-websocket==0.10.1 pip3 install requests==2.20.0 pip3 install flask-caching==1.10.1 -pip3 install mysqlclient==2.0.3 pip3 install pymongo pip3 install psutil pip3 install flask-socketio==5.2.0 @@ -118,7 +131,6 @@ if [ ! -f /www/server/mdserver-web/bin/activate ];then pip3 install gevent-websocket==0.10.1 pip3 install requests==2.20.0 pip3 install flask-caching==1.10.1 - pip3 install mysqlclient==2.0.3 pip3 install pymongo pip3 install psutil pip3 install flask-socketio==5.2.0 diff --git a/scripts/lib.sh b/scripts/lib.sh index 38bcda714..cc8afa54d 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -295,7 +295,8 @@ elif [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "debian" ]; then apt install -y cmake automake make apt install -y webp scons - apt install -y lzma lzma-dev libunwind-dev + apt install -y lzma lzma-dev + apt install -y libunwind-dev apt install -y libpcre3 libpcre3-dev apt install -y openssl From 6f456bfd7f942d297477b3d5d7d1f3dac33d4d8d Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 04:23:12 +0800 Subject: [PATCH 33/55] Update soft.js --- route/static/app/soft.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/route/static/app/soft.js b/route/static/app/soft.js index 34b3f3c37..020a19933 100755 --- a/route/static/app/soft.js +++ b/route/static/app/soft.js @@ -33,7 +33,7 @@ function getSList(isdisplay) { var loadT = layer.msg('正在获取列表...', { icon: 16, time: 0, shade: [0.3, '#000'] }) } if (!isdisplay || isdisplay === true) - isdisplay = getCookie('p' + getCookie('softType')); + isdisplay = getCookie('p' + getCookie('soft_type')); if (isdisplay == true || isdisplay == 'true') isdisplay = 1; var search = $("#SearchValue").val(); @@ -41,7 +41,7 @@ function getSList(isdisplay) { search = '&search=' + search; } var type = ''; - var istype = getCookie('softType'); + var istype = getCookie('soft_type'); if (istype == 'undefined' || istype == 'null' || !istype) { istype = '0'; } @@ -50,7 +50,7 @@ function getSList(isdisplay) { var page = ''; if (isdisplay) { page = '&p=' + isdisplay; - setCookie('p' + getCookie('softType'), isdisplay); + setCookie('p' + getCookie('soft_type'), isdisplay); } var condition = (search + type + page).slice(1); @@ -162,7 +162,7 @@ function getSList(isdisplay) { sBody += pBody; $("#softList").html(sBody); $(".menu-sub span").click(function() { - setCookie('softType', $(this).attr('typeid')); + setCookie('soft_type', $(this).attr('typeid')); $(this).addClass("on").siblings().removeClass("on"); getSList(); }); From 08b402d5168ec24aa98cc9820c45d175f2479838 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 04:40:48 +0800 Subject: [PATCH 34/55] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- class/core/mw.py | 17 +++++++++++++++++ class/core/plugins_api.py | 7 +++++++ 2 files changed, 24 insertions(+) diff --git a/class/core/mw.py b/class/core/mw.py index 5629d57ac..f8fa5ccf7 100755 --- a/class/core/mw.py +++ b/class/core/mw.py @@ -98,6 +98,23 @@ def isAppleSystem(): return False +def isNumber(s): + try: + float(s) + return True + except ValueError: + pass + + try: + import unicodedata + unicodedata.numeric(s) + return True + except (TypeError, ValueError): + pass + + return False + + def deleteFile(file): if os.path.exists(file): os.remove(file) diff --git a/class/core/plugins_api.py b/class/core/plugins_api.py index 3a22894f6..26f70906e 100755 --- a/class/core/plugins_api.py +++ b/class/core/plugins_api.py @@ -48,6 +48,13 @@ class plugins_api: def listApi(self): sType = request.args.get('type', '0') sPage = request.args.get('p', '1') + + if not mw.isNumber(sPage): + sPage = 1 + + if not mw.isNumber(sType): + sType = 0 + # print sPage data = self.getPluginList(sType, int(sPage)) return mw.getJson(data) From 087531a4147e43a8e29d18331e42f340cfe50ecc Mon Sep 17 00:00:00 2001 From: xcsoft Date: Thu, 23 Jun 2022 09:43:38 +0800 Subject: [PATCH 35/55] remove unused import --- tools.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools.py b/tools.py index 5f65f621e..9eef50e1a 100755 --- a/tools.py +++ b/tools.py @@ -13,7 +13,6 @@ cmd = 'ls /usr/local/lib/ | grep python | cut -d \\ -f 1 | awk \'END {print}\' info = mw.execShell(cmd) p = "/usr/local/lib/" + info[0].strip() + "/site-packages" sys.path.append(p) -import psutil def set_mysql_root(password): From e24c8ac03ee65ae5482a4c8418b5f734ec96061f Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 10:46:59 +0800 Subject: [PATCH 36/55] Update install_dev.sh --- scripts/install_dev.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 37462fa8b..3a0049449 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -44,6 +44,7 @@ elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; th 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 From f169ef6334df42fc5f4d59ed8a22401e93913c56 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 11:06:26 +0800 Subject: [PATCH 37/55] Update debian.sh --- scripts/install/debian.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index 426b9c0ac..9d51fdde4 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -87,7 +87,7 @@ echo -e "\e[0;32mfix zlib1g-dev install question end\e[0m" #fix libunwind-dev fail echo -e "\e[0;32mfix libunwind-dev install question start\e[0m" Install_TmpFile=/tmp/debian-fix-libunwind-dev.txt -apt install -y zlib1g-dev > ${Install_TmpFile} +apt install -y libunwind-dev > ${Install_TmpFile} if [ "$?" != "0" ];then liblzma5_BASE_VER=$(cat ${Install_TmpFile} | grep liblzma-dev | awk -F "=" '{print $2}' | awk -F ")" '{print $1}') liblzma5_BASE_VER=`echo ${liblzma5_BASE_VER} | sed "s/^[ \s]\{1,\}//g;s/[ \s]\{1,\}$//g"` From abf1eeef9b2325f55991b325b20b4f142d46f0c6 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 11:28:51 +0800 Subject: [PATCH 38/55] Update README.md --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2c908a929..a0dec4acc 100644 --- a/README.md +++ b/README.md @@ -122,11 +122,9 @@ curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/up [![Stargazers over time](https://starchart.cc/midoks/mdserver-web.svg)](https://starchart.cc/midoks/mdserver-web) -### 感谢 +### 感谢开发赞助 -- 开发赞助 - -[digitalvirt](https://digitalvirt.com/) +[![digitalvirt](https://digitalvirt.com/templates/BlueWhite/img/logo-dark.svg)](https://digitalvirt.com/) ### 授权许可 From 8e0d809c5e8b09870e28654d7fa9b1569a5c59d1 Mon Sep 17 00:00:00 2001 From: xcsoft Date: Thu, 23 Jun 2022 11:40:06 +0800 Subject: [PATCH 39/55] fix: v4 & v6 --- scripts/init.d/mw.tpl | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index c59f86a7f..4eacd0304 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -185,14 +185,38 @@ case "$1" in if [ -f $mw_path/data/admin_path.pl ];then auth_path=$(cat $mw_path/data/admin_path.pl) fi - if [ "$address" = "" ];then - address=$(curl -sS --connect-timeout 10 -m 60 https://v6r.ipip.net/?format=text) + + if [ "$address" = "" ];then + v4_available=true + v6_available=true + { + v4=$(curl -4 -sS --connect-timeout 5 -m 60 https://v6r.ipip.net/?format=text) + } || { + v4_available=false + } + { + v6=$(curl -6 -sS --connect-timeout 5 -m 60 https://v6r.ipip.net/?format=text) + } || { + v6_available=false + } + + if [ $v4_available = true ] && [ $v6_available = true ]; then + address="MW-Panel-Url: http://$v4:$port$auth_path \nMW-Panel-Url: http://[$v6]:$port$auth_path" + elif [ $v4_available = true ]; then + address="MW-Panel-Url: http://$v4:$port$auth_path" + elif [ $v6_available = true ]; then + address="MW-Panel-Url: http://[$v6]:$port$auth_path" + else + address="No v4 or v6 available" + fi + else + address="MW-Panel-Url: http://$address:$port$auth_path" fi echo -e "==================================================================" echo -e "\033[32mMW-Panel default info!\033[0m" echo -e "==================================================================" - echo -e "MW-Panel-URL: http://$address:$port$auth_path" + echo -e "$address" echo -e `python3 $mw_path/tools.py username` echo -e "password: $password" echo -e "\033[33mWarning:\033[0m" From 672a9af6202d65565fbb5f29520354720732212a Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 11:57:42 +0800 Subject: [PATCH 40/55] =?UTF-8?q?3306=E7=AB=AF=E5=8F=A3=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install/alma.sh | 4 ++-- scripts/install/centos.sh | 4 ++-- scripts/install/debian.sh | 4 ++-- scripts/install/fedora.sh | 4 ++-- scripts/install/rocky.sh | 4 ++-- scripts/install/ubuntu.sh | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/install/alma.sh b/scripts/install/alma.sh index da07497cf..87ed5dbae 100755 --- a/scripts/install/alma.sh +++ b/scripts/install/alma.sh @@ -26,7 +26,7 @@ if [ -f /etc/init.d/iptables ];then iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 888 -j ACCEPT iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7200 -j ACCEPT - iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT + # iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT # iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT service iptables save @@ -50,7 +50,7 @@ if [ ! -f /etc/init.d/iptables ];then firewall-cmd --permanent --zone=public --add-port=443/tcp firewall-cmd --permanent --zone=public --add-port=888/tcp firewall-cmd --permanent --zone=public --add-port=7200/tcp - firewall-cmd --permanent --zone=public --add-port=3306/tcp + # firewall-cmd --permanent --zone=public --add-port=3306/tcp # firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index 99fec794a..b93800cf1 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -30,7 +30,7 @@ if [ -f /etc/init.d/iptables ];then iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 888 -j ACCEPT iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7200 -j ACCEPT - iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT + # iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT # iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT service iptables save @@ -54,7 +54,7 @@ if [ ! -f /etc/init.d/iptables ];then firewall-cmd --permanent --zone=public --add-port=443/tcp firewall-cmd --permanent --zone=public --add-port=888/tcp firewall-cmd --permanent --zone=public --add-port=7200/tcp - firewall-cmd --permanent --zone=public --add-port=3306/tcp + # firewall-cmd --permanent --zone=public --add-port=3306/tcp # firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index 9d51fdde4..6a437af46 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -33,7 +33,7 @@ if [ -f /usr/sbin/ufw ];then ufw allow 443/tcp ufw allow 888/tcp ufw allow 7200/tcp - ufw allow 3306/tcp + # ufw allow 3306/tcp # ufw allow 30000:40000/tcp fi @@ -55,7 +55,7 @@ if [ ! -f /usr/sbin/ufw ];then firewall-cmd --permanent --zone=public --add-port=443/tcp firewall-cmd --permanent --zone=public --add-port=888/tcp firewall-cmd --permanent --zone=public --add-port=7200/tcp - firewall-cmd --permanent --zone=public --add-port=3306/tcp + # firewall-cmd --permanent --zone=public --add-port=3306/tcp # firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp # fix:debian10 firewalld faq diff --git a/scripts/install/fedora.sh b/scripts/install/fedora.sh index 9074e7eef..2eec600ce 100644 --- a/scripts/install/fedora.sh +++ b/scripts/install/fedora.sh @@ -29,7 +29,7 @@ if [ -f /etc/init.d/iptables ];then iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 888 -j ACCEPT iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7200 -j ACCEPT - iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT + # iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT # iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT service iptables save @@ -55,7 +55,7 @@ if [ "${isVersion}" == '' ];then firewall-cmd --permanent --zone=public --add-port=443/tcp firewall-cmd --permanent --zone=public --add-port=888/tcp firewall-cmd --permanent --zone=public --add-port=7200/tcp - firewall-cmd --permanent --zone=public --add-port=3306/tcp + # firewall-cmd --permanent --zone=public --add-port=3306/tcp # firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp firewall-cmd --reload fi diff --git a/scripts/install/rocky.sh b/scripts/install/rocky.sh index b4621abeb..557919b60 100644 --- a/scripts/install/rocky.sh +++ b/scripts/install/rocky.sh @@ -31,7 +31,7 @@ if [ -f /etc/init.d/iptables ];then iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 888 -j ACCEPT iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7200 -j ACCEPT - iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT + # iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT # iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT service iptables save @@ -55,7 +55,7 @@ if [ ! -f /etc/init.d/iptables ];then firewall-cmd --permanent --zone=public --add-port=443/tcp firewall-cmd --permanent --zone=public --add-port=888/tcp firewall-cmd --permanent --zone=public --add-port=7200/tcp - firewall-cmd --permanent --zone=public --add-port=3306/tcp + # firewall-cmd --permanent --zone=public --add-port=3306/tcp # firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp diff --git a/scripts/install/ubuntu.sh b/scripts/install/ubuntu.sh index adf835437..476a63de2 100644 --- a/scripts/install/ubuntu.sh +++ b/scripts/install/ubuntu.sh @@ -26,7 +26,7 @@ if [ -f /usr/sbin/ufw ];then ufw allow 443/tcp ufw allow 888/tcp ufw allow 7200/tcp - ufw allow 3306/tcp + # ufw allow 3306/tcp # ufw allow 30000:40000/tcp fi @@ -46,7 +46,7 @@ if [ ! -f /usr/sbin/ufw ];then firewall-cmd --permanent --zone=public --add-port=443/tcp firewall-cmd --permanent --zone=public --add-port=888/tcp firewall-cmd --permanent --zone=public --add-port=7200/tcp - firewall-cmd --permanent --zone=public --add-port=3306/tcp + # firewall-cmd --permanent --zone=public --add-port=3306/tcp # firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp # fix:debian10 firewalld faq From df7a9ce44635fe7f3a69f8ccdc1b1ff8342d2322 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 11:57:49 +0800 Subject: [PATCH 41/55] Update mw.tpl --- scripts/init.d/mw.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 4eacd0304..e60ba4095 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -221,7 +221,7 @@ case "$1" in echo -e "password: $password" echo -e "\033[33mWarning:\033[0m" echo -e "\033[33mIf you cannot access the panel, \033[0m" - echo -e "\033[33mrelease the following port (7200|888|80|443|20|21) in the security group\033[0m" + echo -e "\033[33mrelease the following port (7200|888|80|443|22) in the security group\033[0m" echo -e "==================================================================" ;; esac From fa86fbefdb680d4dd2c1ceac71b06f945f16f41a Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 11:58:47 +0800 Subject: [PATCH 42/55] Update default.sql --- data/sql/default.sql | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/sql/default.sql b/data/sql/default.sql index ab168862e..158206c9d 100755 --- a/data/sql/default.sql +++ b/data/sql/default.sql @@ -48,8 +48,7 @@ INSERT INTO `firewall` (`id`, `port`, `ps`, `addtime`) VALUES (1, '80', '网站默认端口', '0000-00-00 00:00:00'), (2, '7200', 'WEB面板', '0000-00-00 00:00:00'), (3, '22', 'SSH远程管理服务', '0000-00-00 00:00:00'), -(4, '888', 'phpMyAdmin默认端口', '0000-00-00 00:00:00'), -(5, '3306', 'MySQL端口', '0000-00-00 00:00:00'); +(4, '888', 'phpMyAdmin默认端口', '0000-00-00 00:00:00'); From 83c2aedf1ac744272d62f2c804bcdd8f5922330a Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 12:02:11 +0800 Subject: [PATCH 43/55] Update install.sh --- plugins/php/versions/53/install.sh | 9 --------- 1 file changed, 9 deletions(-) diff --git a/plugins/php/versions/53/install.sh b/plugins/php/versions/53/install.sh index dc424ac7f..1f0cb2beb 100755 --- a/plugins/php/versions/53/install.sh +++ b/plugins/php/versions/53/install.sh @@ -34,15 +34,6 @@ if [ ! -d $sourcePath/php/php${PHP_VER} ];then fi -if [ -f $serverPath/php/53/bin/php.dSYM ];then - mv $serverPath/php/53/bin/php.dSYM $serverPath/php/53/bin/php -fi - -if [ -f $serverPath/php/53/sbin/php-fpm.dSYM ];then - mv $serverPath/php/53/sbin/php-fpm.dSYM $serverPath/php/53/sbin/php-fpm -fi - - if [ -f $serverPath/php/53/bin/php ];then return fi From 811be6fa711c6cb33a5456d119e8555d4fea9159 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 12:50:37 +0800 Subject: [PATCH 44/55] up --- plugins/php/versions/53/install.sh | 1 + scripts/install.sh | 3 +++ scripts/install_cn.sh | 3 +++ 3 files changed, 7 insertions(+) diff --git a/plugins/php/versions/53/install.sh b/plugins/php/versions/53/install.sh index 1f0cb2beb..e41edd4ed 100755 --- a/plugins/php/versions/53/install.sh +++ b/plugins/php/versions/53/install.sh @@ -11,6 +11,7 @@ sysName=`uname` install_tmp=${rootPath}/tmp/mw_install.pl + version=5.3.29 PHP_VER=53 Install_php() diff --git a/scripts/install.sh b/scripts/install.sh index c2de403f3..f7de91cea 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -44,6 +44,9 @@ elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; th 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 apt install -y wget zip unzip elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then OSNAME='ubuntu' diff --git a/scripts/install_cn.sh b/scripts/install_cn.sh index 15e878001..990c862d7 100755 --- a/scripts/install_cn.sh +++ b/scripts/install_cn.sh @@ -44,6 +44,9 @@ elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; th 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 apt install -y wget zip unzip elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then OSNAME='ubuntu' From 164d20b609352c91aa4df39b25c97677669abe2d Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 12:55:57 +0800 Subject: [PATCH 45/55] Update mw.tpl --- scripts/init.d/mw.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index e60ba4095..ed08ee0f9 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -175,7 +175,7 @@ case "$1" in if [ ! -f $mw_path/data/default.pl ];then echo -e "\033[33mInstall Failed\033[0m" - exit 0 + exit 1 fi password=$(cat $mw_path/data/default.pl) From d66b144ccb854a72ab792210be6171032cc2c52b Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 13:07:44 +0800 Subject: [PATCH 46/55] =?UTF-8?q?debian=20php52=E6=9A=82=E4=B8=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index a0dec4acc..a11a7da8c 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,6 @@ systemd 支持 CentOS,Ubuntu,Debian,Fedora... ### 问题 - Ubuntu 20 无法安装mysql5.7 && mysql 80. - Ftp debian无法安装成功。 -- php52,在debian无法安装成功。 ### GW使用 From bb2849467dbf11e211c02fbd67233aeb843c81da Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 13:23:53 +0800 Subject: [PATCH 47/55] =?UTF-8?q?=E9=80=9A=E7=94=A8=E5=BF=AB=E6=8D=B7?= =?UTF-8?q?=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++++++ scripts/quick/app.sh | 30 ++++++++++++++++++++++++++++++ scripts/quick/debug.sh | 30 ++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100755 scripts/quick/app.sh create mode 100755 scripts/quick/debug.sh diff --git a/README.md b/README.md index a11a7da8c..d28c3a909 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,14 @@ curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/update_cn.s ``` + +### 通用安装 + +``` +curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/quick/app.sh | bash +``` + + ### DEV使用 - 自动安装 diff --git a/scripts/quick/app.sh b/scripts/quick/app.sh new file mode 100755 index 000000000..162d9e7b7 --- /dev/null +++ b/scripts/quick/app.sh @@ -0,0 +1,30 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +echo "welcome to mdserver-web panel" + +startTime=`date +%s` + +if [ ! -f /www/server/mdserver-web ];then + echo "mdserver-web not exist!" + exit 1 +fi + +# openresty +cd /www/server/mdserver-web/plugins/openresty && bash install.sh 1.21.4.1 +cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/openresty/index.py start + +# php +cd /www/server/mdserver-web/plugins/php && bash install.sh 71 +cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start + +# mysql +cd /www/server/mdserver-web/plugins/mysql && bash install.sh 5.5 +cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 5.5 + + +endTime=`date +%s` +((outTime=(${endTime}-${startTime})/60)) +echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" + diff --git a/scripts/quick/debug.sh b/scripts/quick/debug.sh new file mode 100755 index 000000000..162d9e7b7 --- /dev/null +++ b/scripts/quick/debug.sh @@ -0,0 +1,30 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +echo "welcome to mdserver-web panel" + +startTime=`date +%s` + +if [ ! -f /www/server/mdserver-web ];then + echo "mdserver-web not exist!" + exit 1 +fi + +# openresty +cd /www/server/mdserver-web/plugins/openresty && bash install.sh 1.21.4.1 +cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/openresty/index.py start + +# php +cd /www/server/mdserver-web/plugins/php && bash install.sh 71 +cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start + +# mysql +cd /www/server/mdserver-web/plugins/mysql && bash install.sh 5.5 +cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 5.5 + + +endTime=`date +%s` +((outTime=(${endTime}-${startTime})/60)) +echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" + From e165deecd0db48dcba5ffd962ed462ffc4f9d149 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 13:25:43 +0800 Subject: [PATCH 48/55] Update debian.sh --- scripts/update/debian.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/update/debian.sh b/scripts/update/debian.sh index 1e2d8156c..5029b36ca 100644 --- a/scripts/update/debian.sh +++ b/scripts/update/debian.sh @@ -21,7 +21,6 @@ fi pip install --upgrade pip pip install --upgrade setuptools -sed -i "/mysqlclient/d" /www/server/mdserver-web/requirements.txt cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt pip3 install gunicorn==20.1.0 From ab13fead5c38abf35cef402981fd4e798f0df69c Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 13:30:59 +0800 Subject: [PATCH 49/55] Update app.sh --- scripts/quick/app.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/quick/app.sh b/scripts/quick/app.sh index 162d9e7b7..29eeac9dd 100755 --- a/scripts/quick/app.sh +++ b/scripts/quick/app.sh @@ -6,7 +6,7 @@ echo "welcome to mdserver-web panel" startTime=`date +%s` -if [ ! -f /www/server/mdserver-web ];then +if [ ! -d /www/server/mdserver-web ];then echo "mdserver-web not exist!" exit 1 fi From 82dd6f32bcebefa010242c3252aa065c092077c1 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 13:32:59 +0800 Subject: [PATCH 50/55] Update app.sh --- scripts/quick/app.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/quick/app.sh b/scripts/quick/app.sh index 29eeac9dd..722df5126 100755 --- a/scripts/quick/app.sh +++ b/scripts/quick/app.sh @@ -17,7 +17,7 @@ cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/openrest # php cd /www/server/mdserver-web/plugins/php && bash install.sh 71 -cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start +cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 71 # mysql cd /www/server/mdserver-web/plugins/mysql && bash install.sh 5.5 From 4a356e9bbe032e72331bb7c74f89a20911d8c00b Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 13:38:28 +0800 Subject: [PATCH 51/55] Update app.sh --- scripts/quick/app.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/quick/app.sh b/scripts/quick/app.sh index 722df5126..a51ed973a 100755 --- a/scripts/quick/app.sh +++ b/scripts/quick/app.sh @@ -12,15 +12,17 @@ if [ ! -d /www/server/mdserver-web ];then fi # openresty -cd /www/server/mdserver-web/plugins/openresty && bash install.sh 1.21.4.1 +cd /www/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4.1 cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/openresty/index.py start + + # php -cd /www/server/mdserver-web/plugins/php && bash install.sh 71 +cd /www/server/mdserver-web/plugins/php && bash install.sh install 71 cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 71 # mysql -cd /www/server/mdserver-web/plugins/mysql && bash install.sh 5.5 +cd /www/server/mdserver-web/plugins/mysql && bash install.sh install 5.5 cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 5.5 From b2007d3d9abf4434a36b6a02077455b52a649fb8 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 13:42:31 +0800 Subject: [PATCH 52/55] 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 92954192e..627e70cfb 100755 --- a/plugins/openresty/install.sh +++ b/plugins/openresty/install.sh @@ -45,7 +45,7 @@ Install_openresty() --with-http_slice_module \ --with-http_stub_status_module - gmake && gmake install && make clean + make && make install && make clean if [ -d $serverPath/openresty ];then echo "${VERSION}" > $serverPath/openresty/version.pl From 9785e64a63c8f7b18f3dd3add87819667dbb1463 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 14:28:12 +0800 Subject: [PATCH 53/55] Update app.sh --- scripts/quick/app.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/scripts/quick/app.sh b/scripts/quick/app.sh index a51ed973a..473a323d1 100755 --- a/scripts/quick/app.sh +++ b/scripts/quick/app.sh @@ -12,19 +12,23 @@ if [ ! -d /www/server/mdserver-web ];then fi # openresty -cd /www/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4.1 -cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/openresty/index.py start - +if [ ! -d /www/server/openresty ];then + cd /www/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4.1 + cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/openresty/index.py start +fi # php -cd /www/server/mdserver-web/plugins/php && bash install.sh install 71 -cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 71 +if [ ! -d /www/server/php/71 ];then + cd /www/server/mdserver-web/plugins/php && bash install.sh install 71 + cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 71 +fi # mysql -cd /www/server/mdserver-web/plugins/mysql && bash install.sh install 5.5 -cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 5.5 - +if [ ! -d /www/server/mysql ];then + cd /www/server/mdserver-web/plugins/mysql && bash install.sh install 5.5 + cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 5.5 +fi endTime=`date +%s` ((outTime=(${endTime}-${startTime})/60)) From 6899297213c2567bc27f2671b747423500d173f8 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 14:28:31 +0800 Subject: [PATCH 54/55] Update debug.sh --- scripts/quick/debug.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/scripts/quick/debug.sh b/scripts/quick/debug.sh index 162d9e7b7..473a323d1 100755 --- a/scripts/quick/debug.sh +++ b/scripts/quick/debug.sh @@ -6,23 +6,29 @@ echo "welcome to mdserver-web panel" startTime=`date +%s` -if [ ! -f /www/server/mdserver-web ];then +if [ ! -d /www/server/mdserver-web ];then echo "mdserver-web not exist!" exit 1 fi # openresty -cd /www/server/mdserver-web/plugins/openresty && bash install.sh 1.21.4.1 -cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/openresty/index.py start +if [ ! -d /www/server/openresty ];then + cd /www/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4.1 + cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/openresty/index.py start +fi + # php -cd /www/server/mdserver-web/plugins/php && bash install.sh 71 -cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start +if [ ! -d /www/server/php/71 ];then + cd /www/server/mdserver-web/plugins/php && bash install.sh install 71 + cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 71 +fi # mysql -cd /www/server/mdserver-web/plugins/mysql && bash install.sh 5.5 -cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 5.5 - +if [ ! -d /www/server/mysql ];then + cd /www/server/mdserver-web/plugins/mysql && bash install.sh install 5.5 + cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 5.5 +fi endTime=`date +%s` ((outTime=(${endTime}-${startTime})/60)) From ece3bd90394fe846d5a9987dc88ff141e40d8f07 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 23 Jun 2022 14:32:30 +0800 Subject: [PATCH 55/55] Update app.sh --- scripts/quick/app.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/quick/app.sh b/scripts/quick/app.sh index 473a323d1..f411bab40 100755 --- a/scripts/quick/app.sh +++ b/scripts/quick/app.sh @@ -15,6 +15,8 @@ fi if [ ! -d /www/server/openresty ];then cd /www/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4.1 cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/openresty/index.py start +else + echo "openresty alreay exist!" fi @@ -22,12 +24,16 @@ fi if [ ! -d /www/server/php/71 ];then cd /www/server/mdserver-web/plugins/php && bash install.sh install 71 cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 71 +else + echo "php71 alreay exist!" fi # mysql if [ ! -d /www/server/mysql ];then cd /www/server/mdserver-web/plugins/mysql && bash install.sh install 5.5 cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 5.5 +else + echo "mysql alreay exist!" fi endTime=`date +%s`