From 6ed6705a23df045847f80bcacf60642ce66f93b1 Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 20 Jun 2022 22:51:41 +0800 Subject: [PATCH 01/19] https://github.com/mw-plugin/v2ray --- plugins/v2ray/ico.png | Bin 439 -> 0 bytes plugins/v2ray/index.html | 20 ---- plugins/v2ray/index.py | 173 -------------------------------- plugins/v2ray/info.json | 15 --- plugins/v2ray/install.sh | 48 --------- plugins/v2ray/js/shadowsocks.js | 92 ----------------- plugins/v2ray/tmp/v2ray.json | 54 ---------- 7 files changed, 402 deletions(-) delete mode 100644 plugins/v2ray/ico.png delete mode 100755 plugins/v2ray/index.html delete mode 100755 plugins/v2ray/index.py delete mode 100755 plugins/v2ray/info.json delete mode 100755 plugins/v2ray/install.sh delete mode 100755 plugins/v2ray/js/shadowsocks.js delete mode 100644 plugins/v2ray/tmp/v2ray.json diff --git a/plugins/v2ray/ico.png b/plugins/v2ray/ico.png deleted file mode 100644 index b5047906b31a71e0002fe03f7a541e9f7c9cd8b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 439 zcmV;o0Z9IdP)9`0O)xI!XhP`>F)qgheZmq zW~+%ZT0L~8`!{Al_37n&-U=aR&w>wvV5Zgq6^IIe@~iv5=aj!FMm`9Fg~|!6rd|a~ z08OG!40KW60^q#{{GLL#;=J9jYbm63dKnsv7-}J>#CtMAzlpJVm{buH1Drw_=gO7= z02Taw2L67X{)#c$j51!QEk~Nk1Or9v#WKh1v}J3wucJR`pj}84F|X4$Wc4m$o8XVT zyiRxj7zW3vQ`I#ilQzJ_U;t3{n1RoK4;)TaG8sZlxt^120JBb;fT9Ork_F-p13(n7 h7gJ`Smog%pTmh~{RzS5%{H_21002ovPDHLkV1gq#yLbQq diff --git a/plugins/v2ray/index.html b/plugins/v2ray/index.html deleted file mode 100755 index 821690d51..000000000 --- a/plugins/v2ray/index.html +++ /dev/null @@ -1,20 +0,0 @@ -
-
-
-

服务

-

自启动

-

配置修改

-

运行日志

-

错误日志

-

说明

-
-
-
-
-
-
- \ No newline at end of file diff --git a/plugins/v2ray/index.py b/plugins/v2ray/index.py deleted file mode 100755 index d8d1102a7..000000000 --- a/plugins/v2ray/index.py +++ /dev/null @@ -1,173 +0,0 @@ -# coding:utf-8 - -import sys -import io -import os -import time -import shutil - -sys.path.append(os.getcwd() + "/class/core") -import mw - -app_debug = False -if mw.isAppleSystem(): - app_debug = True - - -def getPluginName(): - return 'v2ray' - - -def getPluginDir(): - return mw.getPluginDir() + '/' + getPluginName() - - -def getServerDir(): - return mw.getServerDir() + '/' + getPluginName() - - -def getArgs(): - args = sys.argv[2:] - tmp = {} - args_len = len(args) - - if args_len == 1: - t = args[0].strip('{').strip('}') - t = t.split(':') - tmp[t[0]] = t[1] - elif args_len > 1: - for i in range(len(args)): - t = args[i].split(':') - tmp[t[0]] = t[1] - - return tmp - - -def checkArgs(data, ck=[]): - for i in range(len(ck)): - if not ck[i] in data: - return (False, mw.returnJson(False, '参数:(' + ck[i] + ')没有!')) - return (True, mw.returnJson(True, 'ok')) - - -def status(): - cmd = "ps -ef|grep v2ray |grep -v grep | grep -v 'mdserver-web'| awk '{print $2}'" - data = mw.execShell(cmd) - if data[0] == '': - return 'stop' - return 'start' - - -def start(): - - shell_cmd = 'service ' + getPluginName() + ' start' - data = mw.execShell(shell_cmd) - - if data[0] == '': - return 'ok' - return data[1] - - -def stop(): - shell_cmd = 'service ' + getPluginName() + ' stop' - - data = mw.execShell(shell_cmd) - if data[0] == '': - return 'ok' - return data[1] - - -def restart(): - shell_cmd = 'service ' + getPluginName() + ' restart' - data = mw.execShell(shell_cmd) - - log_file = getLog() - if os.path.exists(log_file): - clear_log_cmd = "echo '' > " + log_file - mw.execShell(clear_log_cmd) - - if data[0] == '': - return 'ok' - return data[1] - - -def reload(): - shell_cmd = 'service ' + getPluginName() + ' reload' - data = mw.execShell(shell_cmd) - if data[0] == '': - return 'ok' - return data[1] - - -def getPathFile(): - if mw.isAppleSystem(): - return getServerDir() + '/config.json' - return '/usr/local/etc/v2ray/config.json' - - -def getInitDFile(): - if app_debug: - return '/tmp/' + getPluginName() - return '/etc/init.d/' + getPluginName() - - -def initdStatus(): - shell_cmd = 'systemctl status v2ray.service | grep loaded | grep "enabled;"' - data = mw.execShell(shell_cmd) - if data[0] == '': - return 'fail' - return 'ok' - - -def initdInstall(): - import shutil - if not app_debug: - if mw.isAppleSystem(): - return "Apple Computer does not support" - - mw.execShell('systemctl enable ' + getPluginName()) - return 'ok' - - -def initdUinstall(): - if not app_debug: - if mw.isAppleSystem(): - return "Apple Computer does not support" - - mw.execShell('systemctl disable ' + getPluginName()) - return 'ok' - - -def getLog(): - return '/var/log/v2ray/access.log' - - -def getErrLog(): - return '/var/log/v2ray/error.log' - -if __name__ == "__main__": - func = sys.argv[1] - if func == 'status': - print(status()) - elif func == 'start': - print(start()) - elif func == 'stop': - print(stop()) - elif func == 'restart': - print(restart()) - elif func == 'reload': - print(reload()) - elif func == 'conf': - print(getPathFile()) - elif func == 'initd_status': - print(initdStatus()) - elif func == 'initd_install': - print(initdInstall()) - elif func == 'initd_uninstall': - print(initdUinstall()) - elif func == 'run_log': - print(getLog()) - elif func == 'error_log': - print(getErrLog()) - else: - print('error') diff --git a/plugins/v2ray/info.json b/plugins/v2ray/info.json deleted file mode 100755 index 3998b0d9f..000000000 --- a/plugins/v2ray/info.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "title":"v2ray", - "tip":"soft", - "name":"v2ray", - "type":"运行环境", - "ps":"v2ray", - "versions":"1.0", - "shell":"install.sh", - "checks":"server/v2ray", - "path": "server/v2ray", - "author":"midoks", - "home":"https://github.com/v2ray/v2ray-core", - "date":"2020-06-08", - "pid": "5" -} \ No newline at end of file diff --git a/plugins/v2ray/install.sh b/plugins/v2ray/install.sh deleted file mode 100755 index 4711b0ac7..000000000 --- a/plugins/v2ray/install.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin -export PATH - -# case1 https://toutyrater.github.io/advanced/wss_and_web.html - - -curPath=`pwd` -rootPath=$(dirname "$curPath") -rootPath=$(dirname "$rootPath") -serverPath=$(dirname "$rootPath") - - -install_tmp=${rootPath}/tmp/mw_install.pl - -SYSOS=`uname` - -Install_v2ray() -{ - isStart="" - echo '正在安装脚本文件...' > $install_tmp - mkdir -p $serverPath/v2ray - echo '1.0' > $serverPath/v2ray/version.pl - - if [ "Darwin" == "$SYSOS" ];then - echo 'macosx unavailable' > $install_tmp - cat $curPath/tmp/v2ray.json > /usr/local/etc/v2ray/config.json - exit 0 - fi - - bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh) - cat $curPath/tmp/v2ray.json > /usr/local/etc/v2ray/config.json - - echo 'install complete' > $install_tmp -} - -Uninstall_v2ray() -{ - rm -rf $serverPath/v2ray - echo "Uninstall completed" > $install_tmp -} - -action=$1 -if [ "${1}" == 'install' ];then - Install_v2ray -else - Uninstall_v2ray -fi diff --git a/plugins/v2ray/js/shadowsocks.js b/plugins/v2ray/js/shadowsocks.js deleted file mode 100755 index ebfaed948..000000000 --- a/plugins/v2ray/js/shadowsocks.js +++ /dev/null @@ -1,92 +0,0 @@ -function str2Obj(str){ - var data = {}; - kv = str.split('&'); - for(i in kv){ - v = kv[i].split('='); - data[v[0]] = v[1]; - } - return data; -} - -function lpPost(method,args,callback, title){ - - var _args = null; - if (typeof(args) == 'string'){ - _args = JSON.stringify(str2Obj(args)); - } else { - _args = JSON.stringify(args); - } - - var _title = '正在获取...'; - if (typeof(title) != 'undefined'){ - _title = title; - } - - var loadT = layer.msg(_title, { icon: 16, time: 0, shade: 0.3 }); - $.post('/plugins/run', {name:'shadowsocks', func:method, args:_args}, function(data) { - layer.close(loadT); - if (!data.status){ - layer.msg(data.msg,{icon:0,time:2000,shade: [0.3, '#000']}); - return; - } - - if(typeof(callback) == 'function'){ - callback(data); - } - },'json'); -} - -function lpAsyncPost(method,args){ - var _args = null; - if (typeof(args) == 'string'){ - _args = JSON.stringify(str2Obj(args)); - } else { - _args = JSON.stringify(args); - } - - var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 }); - return syncPost('/plugins/run', {name:'l2tp', func:method, args:_args}); -} - -function userList(){ - lpPost('user_list', '' ,function(data){ - var rdata = $.parseJSON(data['data']); - - if (!rdata['status']){ - layer.msg(rdata.msg,{icon:0,time:2000,shade: [0.3, '#000']}); - return; - } - var list = rdata['data']; - - var con = ''; - con += '
'; - con += ''; - con += ''; - con += ''; - con += ''; - con += ''; - - con += ''; - - for (var i = 0; i < list.length; i++) { - con += ''+ - '' + - '' + - ''; - } - - con += ''; - con += '
用户密码操作(添加)
' + list[i]['user']+'' + list[i]['pwd']+'改密|删除
'; - - $(".soft-man-con").html(con); - }); -} - - - -function readme(){ - var readme = '
    '; - readme += '
  • 需开放配置文件[port_password]端口
  • '; - readme += '
'; - $('.soft-man-con').html(readme); -} diff --git a/plugins/v2ray/tmp/v2ray.json b/plugins/v2ray/tmp/v2ray.json deleted file mode 100644 index 8b0c7dde3..000000000 --- a/plugins/v2ray/tmp/v2ray.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "log" : { - "access" : "/var/log/v2ray/access.log", - "error" : "/var/log/v2ray/error.log", - "loglevel":"warning" - }, - "inbounds": [{ - "port": 34861, - "listen": "127.0.0.1", - "protocol": "vmess", - "settings": { - "clients": [ - { - "id": "6e1e5234-05ee-45fe-b28d-80e91edb7f30", - "alterId": 64 - } - ] - }, - "streamSettings":{ - "network": "ws", - "wsSettings": { - "path": "/ws" - } - } - }], - "outbounds": [{ - "protocol": "freedom", - "settings": {} - },{ - "protocol": "blackhole", - "settings": {}, - "tag": "blocked" - }], - "routing": { - "rules": [ - { - "type": "field", - "ip": ["geoip:private"], - "outboundTag": "blocked" - } - ] - }, - "inboundDetour": [ - { - "protocol": "shadowsocks", - "port": 30008, - "settings": { - "method": "aes-128-gcm", - "password": "123123123", - "udp": false - } - } - ] -} From 380e8f11de101ae764eb52f97275565536b2aee8 Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 20 Jun 2022 23:09:59 +0800 Subject: [PATCH 02/19] Update centos.sh --- scripts/install/centos.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index 591e37696..abe61ee96 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -23,6 +23,7 @@ yum install -y wget lsof crontabs yum install -y python3-devel yum install -y python-devel yum install -y vixie-cron +yum install -y curl-devel libmcrypt libmcrypt-devel #https need From 16f1dcfb463dc6067448b7feca1c27db552ef65c Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 20 Jun 2022 23:15:48 +0800 Subject: [PATCH 03/19] Update info.json --- plugins/clean/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/clean/info.json b/plugins/clean/info.json index aa65a65fb..d88831914 100755 --- a/plugins/clean/info.json +++ b/plugins/clean/info.json @@ -12,5 +12,5 @@ "author":"clean", "home":"https://github.com/midoks", "date":"2021-11-23", - "pid": "4" + "pid": "5" } \ No newline at end of file From 143174eab5a716ce192a2ddd89ad2f7f46fb6845 Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 20 Jun 2022 23:17:01 +0800 Subject: [PATCH 04/19] Update info.json --- plugins/sys-opt/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sys-opt/info.json b/plugins/sys-opt/info.json index b1e7138c2..b8acc16ab 100755 --- a/plugins/sys-opt/info.json +++ b/plugins/sys-opt/info.json @@ -12,5 +12,5 @@ "author":"midoks", "home":"", "date":"2018-12-20", - "pid":"4" + "pid":"5" } \ No newline at end of file From 8c0698c298192d7e1132b31c8649fa92bde878a7 Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 20 Jun 2022 23:55:33 +0800 Subject: [PATCH 05/19] =?UTF-8?q?=E8=B0=83=E6=95=B4,=E4=B8=BA=E5=9B=BD?= =?UTF-8?q?=E5=86=85=E5=AE=89=E8=A3=85=E5=81=9A=E5=87=86=E5=A4=87=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install.sh | 17 +++++++++++++++++ scripts/install/alma.sh | 5 ----- scripts/install/centos.sh | 25 ++----------------------- scripts/install/debian.sh | 15 --------------- scripts/install/fedora.sh | 16 +--------------- scripts/install/rocky.sh | 14 -------------- scripts/install/ubuntu.sh | 15 --------------- scripts/update.sh | 6 ++++++ scripts/update/alma.sh | 8 +------- scripts/update/centos.sh | 7 +------ scripts/update/debian.sh | 7 ------- scripts/update/rocky.sh | 5 ----- scripts/update/ubuntu.sh | 7 ------- 13 files changed, 28 insertions(+), 119 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index a2aff5817..bb25c5079 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -48,6 +48,23 @@ else OSNAME='unknow' fi + +if [ $OSNAME != "macos" ];then + mkdir -p /www/server + mkdir -p /www/wwwroot + mkdir -p /www/wwwlogs + mkdir -p /www/backup/database + mkdir -p /www/backup/site + + if [ ! -d /www/server/mdserver-web ];then + wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master + cd /tmp && unzip /tmp/master.zip + mv /tmp/mdserver-web-master /www/server/mdserver-web + rm -rf /tmp/master.zip + rm -rf /tmp/mdserver-web-master + fi +fi + echo "use system version: ${OSNAME}" curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install/${OSNAME}.sh | bash diff --git a/scripts/install/alma.sh b/scripts/install/alma.sh index afb286868..c4d890e00 100755 --- a/scripts/install/alma.sh +++ b/scripts/install/alma.sh @@ -3,11 +3,6 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH LANG=C.UTF-8 -mkdir -p /www/server -mkdir -p /www/wwwroot -mkdir -p /www/wwwlogs -mkdir -p /www/backup/database -mkdir -p /www/backup/site if [ ! -f /usr/bin/applydeltarpm ];then diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index abe61ee96..e307d6dda 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -3,13 +3,6 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH LANG=en_US.UTF-8 -mkdir -p /www/server -mkdir -p /www/wwwroot -mkdir -p /www/wwwlogs -mkdir -p /www/backup/database -mkdir -p /www/backup/site - - if [ ! -f /usr/bin/applydeltarpm ];then yum -y provides '*/applydeltarpm' yum -y install deltarpm @@ -26,7 +19,6 @@ yum install -y vixie-cron yum install -y curl-devel libmcrypt libmcrypt-devel #https need - if [ ! -d /root/.acme.sh ];then curl https://get.acme.sh | sh fi @@ -83,27 +75,14 @@ yum install -y ncurses-devel mysql-devel cmake yum install -y MySQL-python yum install -y epel-release -if [ ! -d /www/server/mdserver-web ];then - wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master - cd /tmp && unzip /tmp/master.zip - mv /tmp/mdserver-web-master /www/server/mdserver-web - rm -rf /tmp/master.zip - rm -rf /tmp/mdserver-web-master -fi - -#if [ ! -f '/usr/bin/pip' ];then -# wget https://bootstrap.pypa.io/pip/2.7/get-pip.py -# python get-pip.py -# pip install --upgrade pip -# pip install pillow==6.2.2 -#fi - if [ ! -f /usr/local/bin/pip3 ];then python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple fi + + cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index 769e2fbc0..d1a7d884c 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -4,12 +4,6 @@ export PATH LANG=en_US.UTF-8 -mkdir -p /www/server -mkdir -p /www/wwwroot -mkdir -p /www/wwwlogs -mkdir -p /www/backup/database -mkdir -p /www/backup/site - apt update -y @@ -66,15 +60,6 @@ fi systemctl stop firewalld -if [ ! -d /www/server/mdserver-web ];then - wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master - cd /tmp && unzip /tmp/master.zip - mv /tmp/mdserver-web-master /www/server/mdserver-web - rm -rf /tmp/master.zip - rm -rf /tmp/mdserver-web-master -fi - - cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data diff --git a/scripts/install/fedora.sh b/scripts/install/fedora.sh index 44b9ba7c5..3b647208b 100644 --- a/scripts/install/fedora.sh +++ b/scripts/install/fedora.sh @@ -3,12 +3,6 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH LANG=en_US.UTF-8 -mkdir -p /www/server -mkdir -p /www/wwwroot -mkdir -p /www/wwwlogs -mkdir -p /www/backup/database -mkdir -p /www/backup/site - if [ ! -f /usr/bin/applydeltarpm ];then yum -y provides '*/applydeltarpm' @@ -82,15 +76,7 @@ yum -y install ncurses-devel mysql-devel cmake yum -y install python-devel yum -y install MySQL-python yum -y install epel-release -yum -y install python36-devel - -if [ ! -d /www/server/mdserver-web ];then - wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master - cd /tmp && unzip /tmp/master.zip - mv /tmp/mdserver-web-master /www/server/mdserver-web - rm -rf /tmp/master.zip - rm -rf /tmp/mdserver-web-master -fi +yum -y install python3-devel diff --git a/scripts/install/rocky.sh b/scripts/install/rocky.sh index 591e37696..5056eef20 100644 --- a/scripts/install/rocky.sh +++ b/scripts/install/rocky.sh @@ -3,12 +3,6 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH LANG=en_US.UTF-8 -mkdir -p /www/server -mkdir -p /www/wwwroot -mkdir -p /www/wwwlogs -mkdir -p /www/backup/database -mkdir -p /www/backup/site - if [ ! -f /usr/bin/applydeltarpm ];then yum -y provides '*/applydeltarpm' @@ -82,14 +76,6 @@ yum install -y ncurses-devel mysql-devel cmake yum install -y MySQL-python yum install -y epel-release -if [ ! -d /www/server/mdserver-web ];then - wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master - cd /tmp && unzip /tmp/master.zip - mv /tmp/mdserver-web-master /www/server/mdserver-web - rm -rf /tmp/master.zip - rm -rf /tmp/mdserver-web-master -fi - #if [ ! -f '/usr/bin/pip' ];then # wget https://bootstrap.pypa.io/pip/2.7/get-pip.py # python get-pip.py diff --git a/scripts/install/ubuntu.sh b/scripts/install/ubuntu.sh index 282efe9c0..c31c99d45 100644 --- a/scripts/install/ubuntu.sh +++ b/scripts/install/ubuntu.sh @@ -4,13 +4,6 @@ export PATH LANG=en_US.UTF-8 - -mkdir -p /www/server -mkdir -p /www/wwwroot -mkdir -p /www/wwwlogs -mkdir -p /www/backup/database -mkdir -p /www/backup/site - apt update -y apt install -y wget curl lsof unzip @@ -64,14 +57,6 @@ fi #安装时不开启 systemctl stop firewalld -if [ ! -d /www/server/mdserver-web ];then - wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master - cd /tmp && unzip /tmp/master.zip - mv /tmp/mdserver-web-master /www/server/mdserver-web - rm -rf /tmp/master.zip - rm -rf /tmp/mdserver-web-master -fi - cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data diff --git a/scripts/update.sh b/scripts/update.sh index 12ba7f503..a6207ac58 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -38,6 +38,12 @@ else OSNAME='unknow' fi +wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master +cd /tmp && unzip /tmp/master.zip +/usr/bin/cp -rf /tmp/mdserver-web-master/* /www/server/mdserver-web +rm -rf /tmp/master.zip +rm -rf /tmp/mdserver-web-master + #pip uninstall public echo "use system version: ${OSNAME}" curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update/${OSNAME}.sh | bash diff --git a/scripts/update/alma.sh b/scripts/update/alma.sh index e5c18ec48..a5f2cf78f 100755 --- a/scripts/update/alma.sh +++ b/scripts/update/alma.sh @@ -10,14 +10,8 @@ fi sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config -wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master -cd /tmp && unzip /tmp/master.zip -/usr/bin/cp -rf /tmp/mdserver-web-master/* /www/server/mdserver-web -rm -rf /tmp/master.zip -rm -rf /tmp/mdserver-web-master - -yum install -y curl-devel libmcrypt libmcrypt-devel python36-devel +yum install -y curl-devel libmcrypt libmcrypt-devel python3-devel cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data diff --git a/scripts/update/centos.sh b/scripts/update/centos.sh index 5cf933a59..6f1f75252 100755 --- a/scripts/update/centos.sh +++ b/scripts/update/centos.sh @@ -10,14 +10,9 @@ fi sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config -wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master -cd /tmp && unzip /tmp/master.zip -/usr/bin/cp -rf /tmp/mdserver-web-master/* /www/server/mdserver-web -rm -rf /tmp/master.zip -rm -rf /tmp/mdserver-web-master +yum install -y curl-devel libmcrypt libmcrypt-devel python3-devel -yum install -y curl-devel libmcrypt libmcrypt-devel python36-devel cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data diff --git a/scripts/update/debian.sh b/scripts/update/debian.sh index 28de6f74b..a3eb1d282 100644 --- a/scripts/update/debian.sh +++ b/scripts/update/debian.sh @@ -5,13 +5,6 @@ LANG=en_US.UTF-8 -wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master -rm -rf /tmp/mdserver-web-master -cd /tmp && unzip /tmp/master.zip -cp -rf /tmp/mdserver-web-master/* /www/server/mdserver-web -rm -rf /tmp/master.zip -rm -rf /tmp/mdserver-web-master - cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data diff --git a/scripts/update/rocky.sh b/scripts/update/rocky.sh index 5cf933a59..bca02d51a 100755 --- a/scripts/update/rocky.sh +++ b/scripts/update/rocky.sh @@ -10,11 +10,6 @@ fi sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config -wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master -cd /tmp && unzip /tmp/master.zip -/usr/bin/cp -rf /tmp/mdserver-web-master/* /www/server/mdserver-web -rm -rf /tmp/master.zip -rm -rf /tmp/mdserver-web-master yum install -y curl-devel libmcrypt libmcrypt-devel python36-devel diff --git a/scripts/update/ubuntu.sh b/scripts/update/ubuntu.sh index cd89065cc..1fb1bf7cc 100644 --- a/scripts/update/ubuntu.sh +++ b/scripts/update/ubuntu.sh @@ -4,13 +4,6 @@ export PATH LANG=en_US.UTF-8 -wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master -rm -rf /tmp/mdserver-web-master -cd /tmp && unzip /tmp/master.zip -cp -rf /tmp/mdserver-web-master/* /www/server/mdserver-web -rm -rf /tmp/master.zip -rm -rf /tmp/mdserver-web-master - cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data From c380b8f3e31a486cdb14fc5b7749346df15caf1f Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 00:09:51 +0800 Subject: [PATCH 06/19] debug.. --- README.md | 21 ++++++++++-- scripts/install_cn.sh | 74 +++++++++++++++++++++++++++++++++++++++++++ scripts/update_cn.sh | 53 +++++++++++++++++++++++++++++++ 3 files changed, 146 insertions(+), 2 deletions(-) create mode 100755 scripts/install_cn.sh create mode 100755 scripts/update_cn.sh diff --git a/README.md b/README.md index 0af3bec42..1ff566deb 100644 --- a/README.md +++ b/README.md @@ -52,18 +52,35 @@ systemd 支持 CentOS,Ubuntu,Debian,Fedora... - Ftp debian无法安装成功。 - php52,在debian无法安装成功。 -### 自动安装 + +### GW使用 + +- 自动安装 ``` curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh | bash ``` -### 脚本更新 +- 脚本更新 ``` curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh | bash ``` +### GN使用[DEBUG...] + +- 自动安装 + +``` +curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/install_cn.sh | bash +``` + +- 脚本更新 + +``` +curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/update_cn.sh | bash +``` + ### 无图不真相 [![截图](/route/static/mdw.jpg)](/route/static/mdw.jpg) diff --git a/scripts/install_cn.sh b/scripts/install_cn.sh new file mode 100755 index 000000000..2d90f9b6b --- /dev/null +++ b/scripts/install_cn.sh @@ -0,0 +1,74 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH +LANG=en_US.UTF-8 +is64bit=`getconf LONG_BIT` + +if [ -f /etc/motd ];then + echo "welcome to mdserver-web panel" > /etc/motd +fi + +startTime=`date +%s` + +_os=`uname` +echo "use system: ${_os}" + +if [ "$EUID" -ne 0 ] + then echo "Please run as root!" + exit +fi + +if grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then + ln -sf /bin/bash /bin/sh + #sudo dpkg-reconfigure dash +fi + +if grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then + ln -sf /bin/bash /bin/sh +fi + + +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 != "macos" ];then + mkdir -p /www/server + mkdir -p /www/wwwroot + mkdir -p /www/wwwlogs + mkdir -p /www/backup/database + mkdir -p /www/backup/site + + if [ ! -d /www/server/mdserver-web ];then + wget -O /tmp/master.zip https://gitee.com/midoks/mdserver-web/repository/archive/master.zip + cd /tmp && unzip /tmp/master.zip + mv /tmp/mdserver-web-master /www/server/mdserver-web + rm -rf /tmp/master.zip + rm -rf /tmp/mdserver-web-master + fi +fi + +echo "use system version: ${OSNAME}" +curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/install/${OSNAME}.sh | bash + + +endTime=`date +%s` +((outTime=(${endTime}-${startTime})/60)) +echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" \ No newline at end of file diff --git a/scripts/update_cn.sh b/scripts/update_cn.sh new file mode 100755 index 000000000..502974ba4 --- /dev/null +++ b/scripts/update_cn.sh @@ -0,0 +1,53 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH +LANG=en_US.UTF-8 +is64bit=`getconf LONG_BIT` + +startTime=`date +%s` + +_os=`uname` +echo "use system: ${_os}" + +if grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then + sudo ln -sf /bin/bash /bin/sh + #sudo dpkg-reconfigure dash +fi + +if grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then + sudo ln -sf /bin/bash /bin/sh +fi + +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 + +wget -O /tmp/master.zip https://gitee.com/midoks/mdserver-web/repository/archive/master.zip +cd /tmp && unzip /tmp/master.zip +mv /tmp/mdserver-web-master /www/server/mdserver-web +rm -rf /tmp/master.zip +rm -rf /tmp/mdserver-web-master + +#pip uninstall public +echo "use system version: ${OSNAME}" +curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/update/${OSNAME}.sh | bash + +endTime=`date +%s` +((outTime=($endTime-$startTime)/60)) +echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" \ No newline at end of file From f1e2baa145098f536ba591b87e3d06d3376094d5 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 00:14:18 +0800 Subject: [PATCH 07/19] up --- scripts/install.sh | 6 ++++++ scripts/install_cn.sh | 6 ++++++ scripts/update.sh | 6 ++++++ scripts/update_cn.sh | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/scripts/install.sh b/scripts/install.sh index bb25c5079..44552dddb 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -32,16 +32,22 @@ if [ ${_os} == "Darwin" ]; then OSNAME='macos' 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 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 elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then OSNAME='raspbian' else diff --git a/scripts/install_cn.sh b/scripts/install_cn.sh index 2d90f9b6b..eae9bc696 100755 --- a/scripts/install_cn.sh +++ b/scripts/install_cn.sh @@ -32,16 +32,22 @@ if [ ${_os} == "Darwin" ]; then OSNAME='macos' 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 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 elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then OSNAME='raspbian' else diff --git a/scripts/update.sh b/scripts/update.sh index a6207ac58..00fa5321d 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -22,16 +22,22 @@ if [ ${_os} == "Darwin" ]; then OSNAME='macos' 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 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 elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then OSNAME='raspbian' else diff --git a/scripts/update_cn.sh b/scripts/update_cn.sh index 502974ba4..76cf4ac30 100755 --- a/scripts/update_cn.sh +++ b/scripts/update_cn.sh @@ -22,16 +22,22 @@ if [ ${_os} == "Darwin" ]; then OSNAME='macos' 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 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 elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then OSNAME='raspbian' else From 6e546f729c47e27b92e3bd8925de56affb588977 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 00:16:01 +0800 Subject: [PATCH 08/19] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1ff566deb..19d8cea38 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh | bash ``` -### GN使用[DEBUG...] +### GN使用 - 自动安装 @@ -99,7 +99,7 @@ curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/update_cn.s -## Stargazers over time +### Stargazers over time [![Stargazers over time](https://starchart.cc/midoks/mdserver-web.svg)](https://starchart.cc/midoks/mdserver-web) @@ -110,7 +110,7 @@ curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/update_cn.s [digitalvirt](https://digitalvirt.com/) -## 授权许可 +### 授权许可 本项目采用 Apache 开源授权许可证,完整的授权说明已放置在 [LICENSE](https://github.com/midoks/mdserver-web/blob/master/LICENSE) 文件中。 From 56d4ce1e6c9a015512aa4aad17b441945c53f63a Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 00:41:44 +0800 Subject: [PATCH 09/19] Update centos.sh --- scripts/install/centos.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index e307d6dda..0ec376c17 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -31,7 +31,7 @@ if [ -f /etc/init.d/iptables ];then 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 30000:40000 -j ACCEPT + # iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT service iptables save iptables_status=`service iptables status | grep 'not running'` @@ -55,7 +55,7 @@ if [ ! -f /etc/init.d/iptables ];then 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=30000-40000/tcp + # firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf From 2851aff741da204f28e6ac1fcde57c08d7fc3778 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 00:46:07 +0800 Subject: [PATCH 10/19] up --- scripts/install/alma.sh | 4 ++-- scripts/install/debian.sh | 4 ++-- scripts/install/fedora.sh | 4 ++-- scripts/install/rocky.sh | 4 ++-- scripts/install/ubuntu.sh | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/install/alma.sh b/scripts/install/alma.sh index c4d890e00..c396c9792 100755 --- a/scripts/install/alma.sh +++ b/scripts/install/alma.sh @@ -33,7 +33,7 @@ if [ -f /etc/init.d/iptables ];then 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 30000:40000 -j ACCEPT + # iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT service iptables save iptables_status=`service iptables status | grep 'not running'` @@ -57,7 +57,7 @@ if [ ! -f /etc/init.d/iptables ];then 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=30000-40000/tcp + # firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index d1a7d884c..c3f2a19a4 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -25,7 +25,7 @@ if [ -f /usr/sbin/ufw ];then ufw allow 888/tcp ufw allow 7200/tcp ufw allow 3306/tcp - ufw allow 30000:40000/tcp + # ufw allow 30000:40000/tcp fi @@ -47,7 +47,7 @@ if [ ! -f /usr/sbin/ufw ];then 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=30000-40000/tcp + # firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp # fix:debian10 firewalld faq # https://kawsing.gitbook.io/opensystem/andoid-shou-ji/untitled/fang-huo-qiang#debian-10-firewalld-0.6.3-error-commandfailed-usrsbinip6tablesrestorewn-failed-ip6tablesrestore-v1.8 diff --git a/scripts/install/fedora.sh b/scripts/install/fedora.sh index 3b647208b..1d75f4106 100644 --- a/scripts/install/fedora.sh +++ b/scripts/install/fedora.sh @@ -30,7 +30,7 @@ if [ -f /etc/init.d/iptables ];then 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 30000:40000 -j ACCEPT + # iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT service iptables save iptables_status=`service iptables status | grep 'not running'` @@ -56,7 +56,7 @@ if [ "${isVersion}" == '' ];then 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=30000-40000/tcp + # firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp firewall-cmd --reload fi fi diff --git a/scripts/install/rocky.sh b/scripts/install/rocky.sh index 5056eef20..f816a499b 100644 --- a/scripts/install/rocky.sh +++ b/scripts/install/rocky.sh @@ -32,7 +32,7 @@ if [ -f /etc/init.d/iptables ];then 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 30000:40000 -j ACCEPT + # iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT service iptables save iptables_status=`service iptables status | grep 'not running'` @@ -56,7 +56,7 @@ if [ ! -f /etc/init.d/iptables ];then 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=30000-40000/tcp + # firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf diff --git a/scripts/install/ubuntu.sh b/scripts/install/ubuntu.sh index c31c99d45..e31ddb5ea 100644 --- a/scripts/install/ubuntu.sh +++ b/scripts/install/ubuntu.sh @@ -25,7 +25,7 @@ if [ -f /usr/sbin/ufw ];then ufw allow 888/tcp ufw allow 7200/tcp ufw allow 3306/tcp - ufw allow 30000:40000/tcp + # ufw allow 30000:40000/tcp fi @@ -45,7 +45,7 @@ if [ ! -f /usr/sbin/ufw ];then 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=30000-40000/tcp + # firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp # fix:debian10 firewalld faq # https://kawsing.gitbook.io/opensystem/andoid-shou-ji/untitled/fang-huo-qiang#debian-10-firewalld-0.6.3-error-commandfailed-usrsbinip6tablesrestorewn-failed-ip6tablesrestore-v1.8 From 5be4d2d17b46c2f1efc79986a0df99c57b010aa2 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 00:49:04 +0800 Subject: [PATCH 11/19] Update centos.sh --- scripts/install/centos.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index 0ec376c17..5264b16db 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -69,7 +69,8 @@ systemctl stop firewalld yum groupinstall -y "Development Tools" yum install -y libevent libevent-devel libjpeg* libpng* gd* libxslt* unzip libmcrypt libmcrypt-devel -yum install -y wget python-imaging libicu-devel zip bzip2-devel gcc libxml2 libxml2-dev libjpeg-devel libpng-devel libwebp libwebp-devel pcre pcre-devel +yum install -y wget python-imaging libicu-devel zip bzip2-devel gcc libxml2 libxml2-dev pcre pcre-devel +yum install -y libjpeg-devel libpng-devel libwebp libwebp-devel yum install -y lsof net-tools yum install -y ncurses-devel mysql-devel cmake yum install -y MySQL-python From 01324fdc5a2d3b98bcedc608403c2a3b95c2b099 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 00:50:23 +0800 Subject: [PATCH 12/19] Update centos.sh --- scripts/install/centos.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index 5264b16db..727259855 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -69,7 +69,7 @@ systemctl stop firewalld yum groupinstall -y "Development Tools" yum install -y libevent libevent-devel libjpeg* libpng* gd* libxslt* unzip libmcrypt libmcrypt-devel -yum install -y wget python-imaging libicu-devel zip bzip2-devel gcc libxml2 libxml2-dev pcre pcre-devel +yum install -y python-imaging libicu-devel zip bzip2-devel gcc libxml2 libxml2-dev pcre pcre-devel yum install -y libjpeg-devel libpng-devel libwebp libwebp-devel yum install -y lsof net-tools yum install -y ncurses-devel mysql-devel cmake From b763374bf0ad48721097e43feb38669ed25ed781 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 00:55:39 +0800 Subject: [PATCH 13/19] up --- scripts/install/centos.sh | 6 +++--- scripts/update/centos.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index 727259855..1f5873a80 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -88,9 +88,9 @@ cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data -if [ ! -f /www/server/mdserver-web/bin/activate ];then - cd /www/server/mdserver-web && python3 -m venv . -fi +# if [ ! -f /www/server/mdserver-web/bin/activate ];then +# cd /www/server/mdserver-web && python3 -m venv . +# fi if [ -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt diff --git a/scripts/update/centos.sh b/scripts/update/centos.sh index 6f1f75252..88801fff0 100755 --- a/scripts/update/centos.sh +++ b/scripts/update/centos.sh @@ -23,9 +23,9 @@ if [ ! -f /usr/local/bin/pip3 ];then fi #venv -if [ ! -f /www/server/mdserver-web/bin/activate ];then - cd /www/server/mdserver-web && python3 -m venv . -fi +# if [ ! -f /www/server/mdserver-web/bin/activate ];then +# cd /www/server/mdserver-web && python3 -m venv . +# fi if [ -f /www/server/mdserver-web/bin/activate ];then From c2c231e07fddac88cafb8ab054306dfe1b28c623 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 09:31:08 +0800 Subject: [PATCH 14/19] https://github.com/mw-plugin/socket5 --- plugins/socket5/LICENSE | 21 ---- plugins/socket5/ico.png | Bin 1037 -> 0 bytes plugins/socket5/index.html | 20 ---- plugins/socket5/index.py | 207 --------------------------------- plugins/socket5/info.json | 14 --- plugins/socket5/init.d/ss5 | 83 ------------- plugins/socket5/install.sh | 49 -------- plugins/socket5/js/socket5.js | 57 --------- plugins/socket5/tmp/ss5.conf | 8 -- plugins/socket5/tmp/ss5.passwd | 1 - 10 files changed, 460 deletions(-) delete mode 100644 plugins/socket5/LICENSE delete mode 100644 plugins/socket5/ico.png delete mode 100755 plugins/socket5/index.html delete mode 100755 plugins/socket5/index.py delete mode 100755 plugins/socket5/info.json delete mode 100644 plugins/socket5/init.d/ss5 delete mode 100755 plugins/socket5/install.sh delete mode 100755 plugins/socket5/js/socket5.js delete mode 100755 plugins/socket5/tmp/ss5.conf delete mode 100755 plugins/socket5/tmp/ss5.passwd diff --git a/plugins/socket5/LICENSE b/plugins/socket5/LICENSE deleted file mode 100644 index b89fade39..000000000 --- a/plugins/socket5/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Mr Chen - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/socket5/ico.png b/plugins/socket5/ico.png deleted file mode 100644 index 2c21d0545285af6c41f7f0263763886d1099d201..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1037 zcmV+o1oHcdP)o-;Gg{Qu{fdFKC24ga~-{O9aL*l6NdlXJg(ZNGh8zYaS>qP~TZppVs0`e-lE1Gw)H3@#hHZ&m`5wW^}DWF8oW*c^D5f`Ge}_F1*TU7(loVeg-~ zmGkF)76R_cD6O-|cv9gZu@zaI{Cy8JGo5Y${mpM>su93v;9MeVt3z4>IuUg;+NO!3 z)Txwt+-j84)H~N~qRL!Nvw-#WO+!FOxWt)j?pM}6(0+()7ckp;ZfL%6^y)3pveE>! z=6w~C?}Y7OG=5ZwsQ#U00h|l$ND-w>oI(*$Wh6b~T1XyrG}V_^=@bMC1s@{d-lly5nj{b?9DInt6i>>O_|nz* z7l%lDKvyYlNtyeG^?kt5LFT(zlK|7z#!KU@jY+Teeo<2);6o8mTU~S05J}z?Ti|z> z!oVjHP`k8^zWC6T=ygb~0CLOoN%N+W)AF&_0E_b{ZKK -
-
-

服务

-

自启动

-

配置

-

用户

-

端口

-

说明

-
-
-
-
-
- - \ No newline at end of file diff --git a/plugins/socket5/index.py b/plugins/socket5/index.py deleted file mode 100755 index c10f99088..000000000 --- a/plugins/socket5/index.py +++ /dev/null @@ -1,207 +0,0 @@ -# coding:utf-8 - -import sys -import io -import os -import time -import shutil - -sys.path.append(os.getcwd() + "/class/core") -import mw - -app_debug = False -if mw.isAppleSystem(): - app_debug = True - - -def getPluginName(): - return 'socket5' - - -def getPluginDir(): - return mw.getPluginDir() + '/' + getPluginName() - - -def getServerDir(): - return mw.getServerDir() + '/' + getPluginName() - - -def getInitDFile(): - if app_debug: - return '/tmp/' + getPluginName() - return '/etc/init.d/ss5' - - -def initDreplace(): - return getPluginDir() + '/init.d/ss5' - - -def getArgs(): - args = sys.argv[2:] - tmp = {} - args_len = len(args) - - if args_len == 1: - t = args[0].strip('{').strip('}') - t = t.split(':') - tmp[t[0]] = t[1] - elif args_len > 1: - for i in range(len(args)): - t = args[i].split(':') - tmp[t[0]] = t[1] - - return tmp - - -def checkArgs(data, ck=[]): - for i in range(len(ck)): - if not ck[i] in data: - return (False, mw.returnJson(False, '参数:(' + ck[i] + ')没有!')) - return (True, mw.returnJson(True, 'ok')) - - -def status(): - cmd = "ps -ef|grep ss5 |grep -v grep | grep -v python | awk '{print $2}'" - data = mw.execShell(cmd) - if data[0] == '': - return 'stop' - return 'start' - - -def initConf(): - ss5_conf = getServerDir() + '/ss5.conf' - if not os.path.exists(ss5_conf): - tmp = getPluginDir() + '/tmp/ss5.conf' - if not os.path.exists(tmp): - mw.execShell('cp -rf ' + tmp + ' /etc/opt/ss5') - mw.execShell('cp -rf ' + tmp + ' ' + getServerDir()) - - init_file = '/etc/init.d/ss5' - if os.path.exists(init_file): - mw.execShell('chmod +x ' + init_file) - - ss5_pwd = getServerDir() + '/ss5.passwd' - if not os.path.exists(ss5_pwd): - tmp = getPluginDir() + '/tmp/ss5.passwd' - - if not os.path.exists(tmp): - mw.execShell('cp -rf ' + tmp + ' /etc/opt/ss5') - mw.execShell('cp -rf ' + tmp + ' ' + getServerDir()) - - -def start(): - initConf() - - if mw.isAppleSystem(): - return "Apple Computer does not support" - - data = mw.execShell('service ss5 start') - if data[1] == '': - return 'ok' - return data[1] - - -def stop(): - if mw.isAppleSystem(): - return "Apple Computer does not support" - - data = mw.execShell('service ss5 stop') - if data[1] == '': - return 'ok' - return data[1] - - -def restart(): - if mw.isAppleSystem(): - return "Apple Computer does not support" - - data = mw.execShell('service ss5 restart') - if data[1] == '': - return 'ok' - return data[1] - - -def reload(): - data = mw.execShell('service ss5 reload') - if data[1] == '': - return 'ok' - return data[1] - - -def getPathFile(): - if mw.isAppleSystem(): - return getServerDir() + '/ss5.conf' - return '/etc/opt/ss5/ss5.conf' - - -def getPathFilePwd(): - if mw.isAppleSystem(): - return getServerDir() + '/ss5.passwd' - return '/etc/opt/ss5/ss5.passwd' - - -def getPathFilePort(): - return '/etc/sysconfig/ss5' - - -def initdStatus(): - if not app_debug: - if mw.isAppleSystem(): - return "Apple Computer does not support" - initd_bin = getInitDFile() - if os.path.exists(initd_bin): - return 'ok' - return 'fail' - - -def initdInstall(): - import shutil - if not app_debug: - if mw.isAppleSystem(): - return "Apple Computer does not support" - - source_bin = initDreplace() - initd_bin = getInitDFile() - shutil.copyfile(source_bin, initd_bin) - mw.execShell('chmod +x ' + initd_bin) - mw.execShell('chkconfig --add ' + getPluginName()) - return 'ok' - - -def initdUinstall(): - if not app_debug: - if mw.isAppleSystem(): - return "Apple Computer does not support" - - mw.execShell('chkconfig --del ' + getPluginName()) - initd_bin = getInitDFile() - os.remove(initd_bin) - return 'ok' - - -if __name__ == "__main__": - func = sys.argv[1] - if func == 'status': - print(status()) - elif func == 'start': - print(start()) - elif func == 'stop': - print(stop()) - elif func == 'restart': - print(restart()) - elif func == 'reload': - print(reload()) - elif func == 'conf': - print(getPathFile()) - elif func == 'conf_pwd': - print(getPathFilePwd()) - elif func == 'conf_port': - print(getPathFilePort()) - elif func == 'initd_status': - print(initdStatus()) - elif func == 'initd_install': - print(initdInstall()) - elif func == 'initd_uninstall': - print(initdUinstall()) - else: - print('error') diff --git a/plugins/socket5/info.json b/plugins/socket5/info.json deleted file mode 100755 index 8381e50e4..000000000 --- a/plugins/socket5/info.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "title":"socket5", - "tip":"soft", - "name":"socket5", - "type":"运行环境", - "ps":"socket5", - "versions":"1.0", - "shell":"install.sh", - "checks":"server/socket5", - "author":"midoks", - "home":"https://github.com/teddysun/across/blob/master/socket5.sh", - "date":"2021-01-29", - "pid": "5" -} \ No newline at end of file diff --git a/plugins/socket5/init.d/ss5 b/plugins/socket5/init.d/ss5 deleted file mode 100644 index ee7790b75..000000000 --- a/plugins/socket5/init.d/ss5 +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# -# chkconfig: 345 20 80 -# description: This script takes care of starting \ -# and stopping ss5 -# - -OS=`uname -s` -if [ $OS = "Linux" ] || [ $OS = "SunOS" ]; then - -# Source function library. - . /etc/rc.d/init.d/functions - -# Source networking configuration. - . /etc/sysconfig/network - -# Check that networking is up. - [ ${NETWORKING} = "no" ] && exit 0 - - [ -f /usr/sbin/ss5 ] || exit 0 -fi - -# Test custom variables -test -f /etc/sysconfig/ss5 && . /etc/sysconfig/ss5 - -# See how we were called. -case "$1" in - start) - # Start daemon. - echo -n "Starting ss5... " - if [ $OS = "Linux" ]; then - daemon /usr/sbin/ss5 -t $SS5_OPTS - touch /var/lock/subsys/ss5 - else - if [ $OS = "SunOS" ]; then - /usr/sbin/ss5 -t - touch /var/lock/subsys/ss5 - else - /usr/local/sbin/ss5 -t - fi - fi - echo "done" - ;; - stop) - # Stop daemon. - echo "Shutting down ss5... " - if [ $OS = "Linux" ] || [ $OS = "SunOS" ]; then - killproc ss5 - rm -f /var/lock/subsys/ss5 - else - killall ss5 - fi - rm -f /var/run/ss5/ss5.pid - echo "done" - ;; - reload) - # Reload configuration - if [ $OS = "Linux" ] || [ $OS = "SunOS" ]; then - echo -n "Reloading ss5... " - killproc ss5 -1 - else - pkill -HUP ss5 - fi - echo "done reload" - ;; - restart) - # Restart daemon - echo -n "Restarting ss5... " - $0 stop - $0 start - ;; - status) - if [ $OS = "Linux" ] || [ $OS = "SunOS" ]; then - status ss5 - fi - ;; - *) - echo "Usage: ss5 {start|stop|status|restart|reload}" - exit 1 - ;; -esac - -exit 0 diff --git a/plugins/socket5/install.sh b/plugins/socket5/install.sh deleted file mode 100755 index a2d35cf4f..000000000 --- a/plugins/socket5/install.sh +++ /dev/null @@ -1,49 +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") -serverPath=$(dirname "$rootPath") - - -install_tmp=${rootPath}/tmp/mw_install.pl -SYSOS=`uname` - -Install_socket5() -{ - yum -y install gcc automake make pam-devel openldap-devel cyrus-sasl-devel - - isStart="" - echo '正在安装脚本文件...' > $install_tmp - mkdir -p $serverPath/source - mkdir -p $serverPath/socket5 - - if [ ! -f $serverPath/source/ss5-3.8.9-8.tar.gz ];then - wget -O $serverPath/source/ss5-3.8.9-8.tar.gz http://downloads.sourceforge.net/project/ss5/ss5/3.8.9-8/ss5-3.8.9-8.tar.gz - fi - echo '1.0' > $serverPath/socket5/version.pl - - cd $serverPath/source && tar -xzvf ss5-3.8.9-8.tar.gz - cd $serverPath/source/ss5-3.8.9 && ./configure && make && make install - - echo 'install complete' > $install_tmp -} - -Uninstall_socket5() -{ - rm -rf $serverPath/socket5 - rm -rf /usr/sbin/ss5 - service ss5 stop - rm -rf /etc/init.d/ss5 - echo "Uninstall completed" > $install_tmp -} - -action=$1 -if [ "${1}" == 'install' ];then - Install_socket5 -else - Uninstall_socket5 -fi diff --git a/plugins/socket5/js/socket5.js b/plugins/socket5/js/socket5.js deleted file mode 100755 index 800fe95d1..000000000 --- a/plugins/socket5/js/socket5.js +++ /dev/null @@ -1,57 +0,0 @@ -function str2Obj(str){ - var data = {}; - kv = str.split('&'); - for(i in kv){ - v = kv[i].split('='); - data[v[0]] = v[1]; - } - return data; -} - -function lpPost(method,args,callback, title){ - - var _args = null; - if (typeof(args) == 'string'){ - _args = JSON.stringify(str2Obj(args)); - } else { - _args = JSON.stringify(args); - } - - var _title = '正在获取...'; - if (typeof(title) != 'undefined'){ - _title = title; - } - - var loadT = layer.msg(_title, { icon: 16, time: 0, shade: 0.3 }); - $.post('/plugins/run', {name:'l2tp', func:method, args:_args}, function(data) { - layer.close(loadT); - if (!data.status){ - layer.msg(data.msg,{icon:0,time:2000,shade: [0.3, '#000']}); - return; - } - - if(typeof(callback) == 'function'){ - callback(data); - } - },'json'); -} - -function lpAsyncPost(method,args){ - var _args = null; - if (typeof(args) == 'string'){ - _args = JSON.stringify(str2Obj(args)); - } else { - _args = JSON.stringify(args); - } - - var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 }); - return syncPost('/plugins/run', {name:'l2tp', func:method, args:_args}); -} - -function readme(){ - var readme = '
    '; - readme += '
  • 默认需开放端口:UDP:1080
  • '; - readme += '
  • 参考
  • '; - readme += '
'; - $('.soft-man-con').html(readme); -} diff --git a/plugins/socket5/tmp/ss5.conf b/plugins/socket5/tmp/ss5.conf deleted file mode 100755 index 8bda3c201..000000000 --- a/plugins/socket5/tmp/ss5.conf +++ /dev/null @@ -1,8 +0,0 @@ -# 无用户配置 -auth 0.0.0.0/0 - - -permit - 0.0.0.0/0 - 0.0.0.0/0 - - - - - - - -# 用户配置 -#auth 0.0.0.0/0 - u -#permit - 0.0.0.0/0 - 0.0.0.0/0 - - - - - \ No newline at end of file diff --git a/plugins/socket5/tmp/ss5.passwd b/plugins/socket5/tmp/ss5.passwd deleted file mode 100755 index 4be3c4508..000000000 --- a/plugins/socket5/tmp/ss5.passwd +++ /dev/null @@ -1 +0,0 @@ -test test \ No newline at end of file From b4b99655b1ef4db20e69f077dc87fe77fb091aef Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 10:36:05 +0800 Subject: [PATCH 15/19] =?UTF-8?q?php=20systemd=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/php/init.d/php.service.bak.tpl | 17 +++++++++++++++++ plugins/php/init.d/php.service.tpl | 6 +++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 plugins/php/init.d/php.service.bak.tpl diff --git a/plugins/php/init.d/php.service.bak.tpl b/plugins/php/init.d/php.service.bak.tpl new file mode 100644 index 000000000..9a02235e2 --- /dev/null +++ b/plugins/php/init.d/php.service.bak.tpl @@ -0,0 +1,17 @@ +# It's not recommended to modify this file in-place, because it +# will be overwritten during upgrades. If you want to customize, +# the best way is to use the "systemctl edit" command. + +[Unit] +Description=The PHP {$VERSION} FastCGI Process Manager +After=network.target + +[Service] +Type=forking +ExecStart={$SERVER_PATH}/php/{$VERSION}/sbin/php-fpm --daemonize --fpm-config {$SERVER_PATH}/php/{$VERSION}/etc/php-fpm.conf +ExecStop=/bin/kill -INT $MAINPID +ExecReload=/bin/kill -USR2 $MAINPID +PrivateTmp=false + +[Install] +WantedBy=multi-user.target diff --git a/plugins/php/init.d/php.service.tpl b/plugins/php/init.d/php.service.tpl index 9a02235e2..0d5beb87d 100644 --- a/plugins/php/init.d/php.service.tpl +++ b/plugins/php/init.d/php.service.tpl @@ -8,9 +8,9 @@ After=network.target [Service] Type=forking -ExecStart={$SERVER_PATH}/php/{$VERSION}/sbin/php-fpm --daemonize --fpm-config {$SERVER_PATH}/php/{$VERSION}/etc/php-fpm.conf -ExecStop=/bin/kill -INT $MAINPID -ExecReload=/bin/kill -USR2 $MAINPID +ExecStart={$SERVER_PATH}/php/init.d/php{$VERSION} start +ExecStop={$SERVER_PATH}/php/init.d/php{$VERSION} stop +ExecReload={$SERVER_PATH}/php/init.d/php{$VERSION} reload PrivateTmp=false [Install] From 49d8d74f0c88c5c104393ae14ded6a703247098f Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 10:48:13 +0800 Subject: [PATCH 16/19] centos test --- scripts/install/centos.sh | 37 +++++++++++++++++++++---------------- scripts/update/centos.sh | 6 +++--- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index 1f5873a80..49ae894eb 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -82,33 +82,38 @@ if [ ! -f /usr/local/bin/pip3 ];then fi - - cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data -# if [ ! -f /www/server/mdserver-web/bin/activate ];then -# cd /www/server/mdserver-web && python3 -m venv . -# fi +if [ ! -f /www/server/mdserver-web/bin/activate ];then + cd /www/server/mdserver-web && python3 -m venv . +fi if [ -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt + pip install --upgrade pip + pip3 install gunicorn==20.1.0 + 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 python-socketio==4.2.0 + pip3 install psutil==5.9.1 + pip3 install pymongo else + pip install --upgrade pip cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt + pip3 install gunicorn==20.1.0 + 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 python-socketio==4.2.0 + pip3 install psutil==5.9.1 + pip3 install pymongo fi -pip install --upgrade pip -pip3 install gunicorn==20.1.0 -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 python-socketio==4.2.0 -pip3 install psutil==5.9.1 -pip3 install pymongo - - cd /www/server/mdserver-web && ./cli.sh start sleep 5 diff --git a/scripts/update/centos.sh b/scripts/update/centos.sh index 88801fff0..6f1f75252 100755 --- a/scripts/update/centos.sh +++ b/scripts/update/centos.sh @@ -23,9 +23,9 @@ if [ ! -f /usr/local/bin/pip3 ];then fi #venv -# if [ ! -f /www/server/mdserver-web/bin/activate ];then -# cd /www/server/mdserver-web && python3 -m venv . -# fi +if [ ! -f /www/server/mdserver-web/bin/activate ];then + cd /www/server/mdserver-web && python3 -m venv . +fi if [ -f /www/server/mdserver-web/bin/activate ];then From bb78347630b4e11baf78bb699b95f00f2da9c75d Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 12:04:48 +0800 Subject: [PATCH 17/19] =?UTF-8?q?=E6=B7=BB=E5=8A=A0dev=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install_dev.sh | 80 ++++++++++++++++++++++++++++++++++++++++++ scripts/update_dev.sh | 59 +++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100755 scripts/install_dev.sh create mode 100755 scripts/update_dev.sh diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh new file mode 100755 index 000000000..643698616 --- /dev/null +++ b/scripts/install_dev.sh @@ -0,0 +1,80 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH +LANG=en_US.UTF-8 +is64bit=`getconf LONG_BIT` + +if [ -f /etc/motd ];then + echo "welcome to mdserver-web panel" > /etc/motd +fi + +startTime=`date +%s` + +_os=`uname` +echo "use system: ${_os}" + +if [ "$EUID" -ne 0 ] + then echo "Please run as root!" + exit +fi + +if grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then + ln -sf /bin/bash /bin/sh + #sudo dpkg-reconfigure dash +fi + +if grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then + ln -sf /bin/bash /bin/sh +fi + + +if [ ${_os} == "Darwin" ]; then + OSNAME='macos' +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 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 +elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then + OSNAME='raspbian' +else + OSNAME='unknow' +fi + + +if [ $OSNAME != "macos" ];then + mkdir -p /www/server + mkdir -p /www/wwwroot + mkdir -p /www/wwwlogs + mkdir -p /www/backup/database + mkdir -p /www/backup/site + + if [ ! -d /www/server/mdserver-web ];then + wget -O /tmp/dev.zip https://github.com/midoks/mdserver-web/archive/refs/heads/dev.zip + cd /tmp && unzip /tmp/dev.zip + mv /tmp/mdserver-web-dev /www/server/mdserver-web + rm -rf /tmp/dev.zip + rm -rf /tmp/mdserver-web-dev + fi +fi + +echo "use system version: ${OSNAME}" +curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/install/${OSNAME}.sh | bash + + +endTime=`date +%s` +((outTime=(${endTime}-${startTime})/60)) +echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" \ No newline at end of file diff --git a/scripts/update_dev.sh b/scripts/update_dev.sh new file mode 100755 index 000000000..35285da74 --- /dev/null +++ b/scripts/update_dev.sh @@ -0,0 +1,59 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH +LANG=en_US.UTF-8 +is64bit=`getconf LONG_BIT` + +startTime=`date +%s` + +_os=`uname` +echo "use system: ${_os}" + +if grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then + sudo ln -sf /bin/bash /bin/sh + #sudo dpkg-reconfigure dash +fi + +if grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then + sudo ln -sf /bin/bash /bin/sh +fi + +if [ ${_os} == "Darwin" ]; then + OSNAME='macos' +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 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 +elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then + OSNAME='raspbian' +else + OSNAME='unknow' +fi + +wget -O /tmp/dev.zip https://github.com/midoks/mdserver-web/archive/refs/heads/dev.zip +cd /tmp && unzip /tmp/dev.zip +mv /tmp/mdserver-web-dev /www/server/mdserver-web +rm -rf /tmp/dev.zip +rm -rf /tmp/mdserver-web-dev + +#pip uninstall public +echo "use system version: ${OSNAME}" +curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/update/${OSNAME}.sh | bash + +endTime=`date +%s` +((outTime=($endTime-$startTime)/60)) +echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" \ No newline at end of file From becf3143755c8ca25c00677a0bf9ddb5dc6345ee Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 12:05:33 +0800 Subject: [PATCH 18/19] Update README.md --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 19d8cea38..1de155c14 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,22 @@ curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/install_cn. curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/update_cn.sh | bash ``` + +### DEV使用 + +- 自动安装 + +``` +curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install_dev.sh | bash +``` + +- 脚本更新 + +``` +curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update_dev.sh | bash +``` + + ### 无图不真相 [![截图](/route/static/mdw.jpg)](/route/static/mdw.jpg) From dcb9ffd759cb286675a51fb89dd0e530dcee7b8e Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 12:07:05 +0800 Subject: [PATCH 19/19] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1de155c14..8f0476f09 100644 --- a/README.md +++ b/README.md @@ -87,13 +87,13 @@ 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/install_dev.sh | bash +curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install_dev.sh | bash ``` - 脚本更新 ``` -curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update_dev.sh | bash +curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh | bash ```