mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-09 22:29:25 +08:00
代码恢复
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
name: BUG提交
|
||||||
|
about: 问题描述
|
||||||
|
---
|
||||||
|
|
||||||
|
## 什么系统 ?
|
||||||
|
|
||||||
|
Debian x, Centos x, Centos x stream, Ubuntu x?
|
||||||
|
|
||||||
|
## 错误信息 ?
|
||||||
|
|
||||||
|
Ex:
|
||||||
|
```bash
|
||||||
|
................start mw success
|
||||||
|
bash: line 149: ./scripts/init.d/mw: No such file or directory
|
||||||
|
```
|
||||||
|
|
||||||
|
## 错误截图 ?
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
## 浏览器版本 ?
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
## 软件版本(插件/面板) ?
|
||||||
|
|
||||||
|
...
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
name: 需求提交
|
||||||
|
about: 需求描述
|
||||||
|
---
|
||||||
|
|
||||||
|
## 需求
|
||||||
|
|
||||||
|
想开发一个什么插件?
|
||||||
|
想有什么功能?
|
||||||
|
|
||||||
|
|
||||||
|
## 提供参考
|
||||||
|
|
||||||
|
给开发者提供参考!
|
||||||
@@ -130,3 +130,5 @@ include
|
|||||||
data/api_login.txt
|
data/api_login.txt
|
||||||
data/sessions
|
data/sessions
|
||||||
data/ssl.pl
|
data/ssl.pl
|
||||||
|
plugins/gdrive/
|
||||||
|
plugins/openlitespeed/
|
||||||
|
|||||||
@@ -186,7 +186,7 @@
|
|||||||
same "printed page" as the copyright notice for easier
|
same "printed page" as the copyright notice for easier
|
||||||
identification within third-party archives.
|
identification within third-party archives.
|
||||||
|
|
||||||
Copyright [yyyy] [name of copyright owner]
|
Copyright [midoks] [midoks of copyright owner]
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -2,14 +2,6 @@
|
|||||||
简单的Linux面板,感谢BT.CN写出如此好的web管理软件。我一看到,就知道这是我一直想要的页面化管理方式。
|
简单的Linux面板,感谢BT.CN写出如此好的web管理软件。我一看到,就知道这是我一直想要的页面化管理方式。
|
||||||
复制了后台管理界面,按照自己想要的方式写了一版。
|
复制了后台管理界面,按照自己想要的方式写了一版。
|
||||||
|
|
||||||
```
|
|
||||||
为了兼容CentOS,Ubuntu,Debian,Fedora, 由chkconfig改systemd管理。原来都要重新安装。还在进行修改..
|
|
||||||
|
|
||||||
chkconfig 支持 Fedora,CentOS
|
|
||||||
update-rc.d 支持 Ubuntu,Debian | 功能不够
|
|
||||||
systemd 支持 CentOS,Ubuntu,Debian,Fedora...
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
@@ -22,7 +14,6 @@ systemd 支持 CentOS,Ubuntu,Debian,Fedora...
|
|||||||
* 面板收藏功能
|
* 面板收藏功能
|
||||||
* 网站子目录绑定
|
* 网站子目录绑定
|
||||||
* 网站备份功能
|
* 网站备份功能
|
||||||
* 自动更新优化
|
|
||||||
* 插件方式管理
|
* 插件方式管理
|
||||||
|
|
||||||
基本上可以使用,后续会继续优化!欢迎提供意见!
|
基本上可以使用,后续会继续优化!欢迎提供意见!
|
||||||
@@ -48,9 +39,8 @@ systemd 支持 CentOS,Ubuntu,Debian,Fedora...
|
|||||||
|
|
||||||
|
|
||||||
### 问题
|
### 问题
|
||||||
- Ubuntu 20 无法安装mysql5.7 && mysql 80.
|
- OP防火墙,暂不要开启。
|
||||||
- Ftp debian无法安装成功。
|
|
||||||
- php52,在debian无法安装成功。
|
|
||||||
|
|
||||||
|
|
||||||
### GW使用
|
### GW使用
|
||||||
@@ -82,6 +72,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使用
|
### DEV使用
|
||||||
|
|
||||||
- 自动安装
|
- 自动安装
|
||||||
@@ -96,6 +94,8 @@ curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/in
|
|||||||
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh | bash
|
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 微信赞助
|
||||||
|
[](/route/static/img/weixin_zz.jpg)
|
||||||
|
|
||||||
### 无图不真相
|
### 无图不真相
|
||||||
|
|
||||||
@@ -109,10 +109,9 @@ curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/up
|
|||||||
如果你自己写了插件,想分享出来,也可以提Issue。
|
如果你自己写了插件,想分享出来,也可以提Issue。
|
||||||
```
|
```
|
||||||
|
|
||||||
- 开发文档 - https://github.com/midoks/mdserver-web/wiki/%E6%8F%92%E4%BB%B6%E5%BC%80%E5%8F%91
|
- 简单例子 - https://github.com/mw-plugin/simple-plugin
|
||||||
- 插件地址 - https://github.com/mw-plugin
|
- 插件地址 - https://github.com/mw-plugin
|
||||||
- 例子 - https://github.com/mw-plugin/simple-plugin
|
- 开发文档 - https://github.com/midoks/mdserver-web/wiki/插件开发
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Stargazers over time
|
### Stargazers over time
|
||||||
@@ -120,11 +119,9 @@ curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/up
|
|||||||
[](https://starchart.cc/midoks/mdserver-web)
|
[](https://starchart.cc/midoks/mdserver-web)
|
||||||
|
|
||||||
|
|
||||||
### 感谢
|
### 感谢开发赞助
|
||||||
|
|
||||||
- 开发赞助
|
[](https://digitalvirt.com/)
|
||||||
|
|
||||||
[digitalvirt](https://digitalvirt.com/)
|
|
||||||
|
|
||||||
### 授权许可
|
### 授权许可
|
||||||
|
|
||||||
|
|||||||
@@ -14,13 +14,19 @@ from geventwebsocket.handler import WebSocketHandler
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
f = open('data/port.pl')
|
|
||||||
PORT = int(f.read())
|
|
||||||
HOST = '0.0.0.0'
|
|
||||||
|
|
||||||
|
PORT = 7200
|
||||||
|
if os.path.exists('data/port.pl'):
|
||||||
|
f = open('data/port.pl')
|
||||||
|
PORT = int(f.read())
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
HOST = '0.0.0.0'
|
||||||
http_server = WSGIServer(
|
http_server = WSGIServer(
|
||||||
(HOST, PORT), app, handler_class=WebSocketHandler)
|
(HOST, PORT), app, handler_class=WebSocketHandler)
|
||||||
|
|
||||||
http_server.serve_forever()
|
http_server.serve_forever()
|
||||||
|
|
||||||
socketio.run(app, host=HOST, port=PORT)
|
socketio.run(app, host=HOST, port=PORT)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
print(ex)
|
print(ex)
|
||||||
|
|||||||
@@ -20,10 +20,9 @@ from flask import redirect
|
|||||||
|
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
|
|
||||||
initDB()
|
initDB()
|
||||||
initInitD()
|
|
||||||
initUserInfo()
|
initUserInfo()
|
||||||
|
initInitD()
|
||||||
|
|
||||||
|
|
||||||
def local():
|
def local():
|
||||||
@@ -57,7 +56,6 @@ def doContentReplace(src, dst):
|
|||||||
|
|
||||||
|
|
||||||
def initInitD():
|
def initInitD():
|
||||||
mw.setHostAddr(mw.getLocalIp())
|
|
||||||
|
|
||||||
# systemctl
|
# systemctl
|
||||||
# 有问题
|
# 有问题
|
||||||
@@ -97,6 +95,9 @@ def initInitD():
|
|||||||
mw.execShell('which chkconfig && chkconfig --add mw')
|
mw.execShell('which chkconfig && chkconfig --add mw')
|
||||||
mw.execShell('which update-rc.d && update-rc.d -f mw defaults')
|
mw.execShell('which update-rc.d && update-rc.d -f mw defaults')
|
||||||
|
|
||||||
|
# 获取系统IPV4
|
||||||
|
mw.setHostAddr(mw.getLocalIp())
|
||||||
|
|
||||||
|
|
||||||
def initUserInfo():
|
def initUserInfo():
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class config_api:
|
|||||||
# 本版解决自启动问题
|
# 本版解决自启动问题
|
||||||
# 文件管理重命名
|
# 文件管理重命名
|
||||||
# 优化计划任务管理
|
# 优化计划任务管理
|
||||||
__version = '0.8.6'
|
__version = '0.8.6.1'
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|||||||
+50
-3
@@ -98,6 +98,23 @@ def isAppleSystem():
|
|||||||
return False
|
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):
|
def deleteFile(file):
|
||||||
if os.path.exists(file):
|
if os.path.exists(file):
|
||||||
os.remove(file)
|
os.remove(file)
|
||||||
@@ -111,9 +128,22 @@ def isInstalledWeb():
|
|||||||
|
|
||||||
|
|
||||||
def restartWeb():
|
def restartWeb():
|
||||||
if isInstalledWeb():
|
if not isInstalledWeb():
|
||||||
initd = getServerDir() + '/openresty/init.d/openresty'
|
return False
|
||||||
|
|
||||||
|
# systemd
|
||||||
|
systemd = '/lib/systemd/system/openresty.service'
|
||||||
|
if os.path.exists(systemd):
|
||||||
|
execShell('systemctl restart openresty')
|
||||||
|
return True
|
||||||
|
|
||||||
|
# initd
|
||||||
|
initd = getServerDir() + '/openresty/init.d/openresty'
|
||||||
|
if os.path.exists(initd):
|
||||||
execShell(initd + ' ' + 'restart')
|
execShell(initd + ' ' + 'restart')
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def restartMw():
|
def restartMw():
|
||||||
@@ -540,7 +570,7 @@ def downloadHook(count, blockSize, totalSize):
|
|||||||
print('%02d%%' % (100.0 * count * blockSize / totalSize))
|
print('%02d%%' % (100.0 * count * blockSize / totalSize))
|
||||||
|
|
||||||
|
|
||||||
def getLocalIp():
|
def getLocalIpBack():
|
||||||
# 取本地外网IP
|
# 取本地外网IP
|
||||||
try:
|
try:
|
||||||
import re
|
import re
|
||||||
@@ -561,6 +591,23 @@ def getLocalIp():
|
|||||||
return '127.0.0.1'
|
return '127.0.0.1'
|
||||||
|
|
||||||
|
|
||||||
|
def getLocalIp():
|
||||||
|
# 取本地外网IP
|
||||||
|
try:
|
||||||
|
import re
|
||||||
|
filename = 'data/iplist.txt'
|
||||||
|
ipaddress = readFile(filename)
|
||||||
|
if not ipaddress or ipaddress == '127.0.0.1':
|
||||||
|
import urllib
|
||||||
|
url = 'https://v6r.ipip.net/?format=text'
|
||||||
|
req = urllib.request.urlopen(url, timeout=10)
|
||||||
|
ipaddress = req.read().decode('utf-8')
|
||||||
|
writeFile(filename, ipaddress)
|
||||||
|
return ipaddress
|
||||||
|
except Exception as ex:
|
||||||
|
return '127.0.0.1'
|
||||||
|
|
||||||
|
|
||||||
def inArray(arrays, searchStr):
|
def inArray(arrays, searchStr):
|
||||||
# 搜索数据中是否存在
|
# 搜索数据中是否存在
|
||||||
for key in arrays:
|
for key in arrays:
|
||||||
|
|||||||
@@ -48,6 +48,13 @@ class plugins_api:
|
|||||||
def listApi(self):
|
def listApi(self):
|
||||||
sType = request.args.get('type', '0')
|
sType = request.args.get('type', '0')
|
||||||
sPage = request.args.get('p', '1')
|
sPage = request.args.get('p', '1')
|
||||||
|
|
||||||
|
if not mw.isNumber(sPage):
|
||||||
|
sPage = 1
|
||||||
|
|
||||||
|
if not mw.isNumber(sType):
|
||||||
|
sType = 0
|
||||||
|
|
||||||
# print sPage
|
# print sPage
|
||||||
data = self.getPluginList(sType, int(sPage))
|
data = self.getPluginList(sType, int(sPage))
|
||||||
return mw.getJson(data)
|
return mw.getJson(data)
|
||||||
|
|||||||
+24
-14
@@ -599,7 +599,11 @@ class site_api:
|
|||||||
if not os.path.exists(acem):
|
if not os.path.exists(acem):
|
||||||
return mw.returnJson(False, '尝试自动安装ACME失败,请通过以下命令尝试手动安装<p>安装命令: curl https://get.acme.sh | sh</p>' + acem)
|
return mw.returnJson(False, '尝试自动安装ACME失败,请通过以下命令尝试手动安装<p>安装命令: curl https://get.acme.sh | sh</p>' + acem)
|
||||||
|
|
||||||
force_bool = False
|
# 避免频繁执行
|
||||||
|
checkAcmeRun = mw.execShell('ps -ef|grep acme.sh |grep -v grep')
|
||||||
|
if checkAcmeRun[0] != '':
|
||||||
|
return mw.returnJson(False, '正在申请或更新SSL中...')
|
||||||
|
|
||||||
if force == 'true':
|
if force == 'true':
|
||||||
force_bool = True
|
force_bool = True
|
||||||
|
|
||||||
@@ -973,7 +977,7 @@ class site_api:
|
|||||||
"-START(.|\n)+BINDING-" + domain + "-END"
|
"-START(.|\n)+BINDING-" + domain + "-END"
|
||||||
tmp = re.search(rep, conf).group()
|
tmp = re.search(rep, conf).group()
|
||||||
dirConf = tmp.replace('rewrite/' + site['name'] + '.conf;', 'rewrite/' + site[
|
dirConf = tmp.replace('rewrite/' + site['name'] + '.conf;', 'rewrite/' + site[
|
||||||
'name'] + '_' + find['path'] + '.conf;')
|
'name'] + '_' + find['path'] + '.conf;')
|
||||||
conf = conf.replace(tmp, dirConf)
|
conf = conf.replace(tmp, dirConf)
|
||||||
mw.writeFile(file, conf)
|
mw.writeFile(file, conf)
|
||||||
data = {}
|
data = {}
|
||||||
@@ -1522,9 +1526,13 @@ class site_api:
|
|||||||
def getSecurity(self, sid, name):
|
def getSecurity(self, sid, name):
|
||||||
filename = self.getHostConf(name)
|
filename = self.getHostConf(name)
|
||||||
conf = mw.readFile(filename)
|
conf = mw.readFile(filename)
|
||||||
|
|
||||||
|
if type(conf) == bool:
|
||||||
|
return mw.returnJson(False, '读取配置文件失败!')
|
||||||
|
|
||||||
data = {}
|
data = {}
|
||||||
if conf.find('SECURITY-START') != -1:
|
if conf.find('SECURITY-START') != -1:
|
||||||
rep = "#SECURITY-START(\n|.){1,500}#SECURITY-END"
|
rep = "#SECURITY-START(.|\n)*#SECURITY-END"
|
||||||
tmp = re.search(rep, conf).group()
|
tmp = re.search(rep, conf).group()
|
||||||
data['fix'] = re.search(
|
data['fix'] = re.search(
|
||||||
"\(.+\)\$", tmp).group().replace('(', '').replace(')$', '').replace('|', ',')
|
"\(.+\)\$", tmp).group().replace('(', '').replace(')$', '').replace('|', ',')
|
||||||
@@ -1549,22 +1557,22 @@ class site_api:
|
|||||||
if os.path.exists(file):
|
if os.path.exists(file):
|
||||||
conf = mw.readFile(file)
|
conf = mw.readFile(file)
|
||||||
if conf.find('SECURITY-START') != -1:
|
if conf.find('SECURITY-START') != -1:
|
||||||
rep = "\s{0,4}#SECURITY-START(\n|.){1,500}#SECURITY-END\n?"
|
rep = "\s{0,4}#SECURITY-START(\n|.)*#SECURITY-END\n?"
|
||||||
conf = re.sub(rep, '', conf)
|
conf = re.sub(rep, '', conf)
|
||||||
mw.writeLog('网站管理', '站点[' + name + ']已关闭防盗链设置!')
|
mw.writeLog('网站管理', '站点[' + name + ']已关闭防盗链设置!')
|
||||||
else:
|
else:
|
||||||
rconf = '''#SECURITY-START 防盗链配置
|
rconf = '''#SECURITY-START 防盗链配置
|
||||||
location ~ .*\.(%s)$
|
location ~ .*\.(%s)$
|
||||||
{
|
{
|
||||||
expires 30d;
|
expires 30d;
|
||||||
access_log /dev/null;
|
access_log /dev/null;
|
||||||
valid_referers none blocked %s;
|
valid_referers none blocked %s;
|
||||||
if ($invalid_referer){
|
if ($invalid_referer){
|
||||||
return 404;
|
return 404;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
#SECURITY-END
|
||||||
# SECURITY-END
|
include enable-php-''' % (fix.strip().replace(',', '|'), domains.strip().replace(',', ' '))
|
||||||
include enable-php-''' % (fix.strip().replace(',', '|'), domains.strip().replace(',', ' '))
|
|
||||||
conf = re.sub("include\s+enable-php-", rconf, conf)
|
conf = re.sub("include\s+enable-php-", rconf, conf)
|
||||||
mw.writeLog('网站管理', '站点[' + name + ']已开启防盗链!')
|
mw.writeLog('网站管理', '站点[' + name + ']已开启防盗链!')
|
||||||
mw.writeFile(file, conf)
|
mw.writeFile(file, conf)
|
||||||
@@ -1615,6 +1623,8 @@ include enable-php-''' % (fix.strip().replace(',', '|'), domains.strip().replace
|
|||||||
os.makedirs(path)
|
os.makedirs(path)
|
||||||
if not mw.isAppleSystem():
|
if not mw.isAppleSystem():
|
||||||
mw.execShell('chown -R www:www ' + path)
|
mw.execShell('chown -R www:www ' + path)
|
||||||
|
|
||||||
|
mw.writeFile(path + '/index.html', '已经开始工作!!!')
|
||||||
mw.execShell('chmod -R 755 ' + path)
|
mw.execShell('chmod -R 755 ' + path)
|
||||||
|
|
||||||
def nginxAddDomain(self, webname, domain, port):
|
def nginxAddDomain(self, webname, domain, port):
|
||||||
|
|||||||
@@ -102,12 +102,9 @@ class system_api:
|
|||||||
return mw.returnJson(True, '正在重启服务器!')
|
return mw.returnJson(True, '正在重启服务器!')
|
||||||
##### ----- end ----- ###
|
##### ----- end ----- ###
|
||||||
|
|
||||||
@mw_async
|
|
||||||
def restartMw(self):
|
def restartMw(self):
|
||||||
sleep(0.3)
|
mw.writeFile('data/restart.pl', 'True')
|
||||||
# cmd = mw.getRunDir() + '/scripts/init.d/mw restart'
|
return True
|
||||||
# print cmd
|
|
||||||
mw.execShell('service mw restart')
|
|
||||||
|
|
||||||
@mw_async
|
@mw_async
|
||||||
def restartServer(self):
|
def restartServer(self):
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ class task_api:
|
|||||||
_page['tojs'] = 'remind'
|
_page['tojs'] = 'remind'
|
||||||
_page['p'] = p
|
_page['p'] = p
|
||||||
|
|
||||||
|
# return data
|
||||||
|
_ret['count'] = count
|
||||||
_ret['page'] = mw.getPage(_page)
|
_ret['page'] = mw.getPage(_page)
|
||||||
return mw.getJson(_ret)
|
return mw.getJson(_ret)
|
||||||
|
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ mw_start_debug(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
mw_start_debug2(){
|
mw_start_debug2(){
|
||||||
gunicorn -c setting.py app:app
|
|
||||||
python3 task.py &
|
python3 task.py &
|
||||||
|
gunicorn -b :7200 -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 app:app
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ INSERT INTO `firewall` (`id`, `port`, `ps`, `addtime`) VALUES
|
|||||||
(2, '7200', 'WEB面板', '0000-00-00 00:00:00'),
|
(2, '7200', 'WEB面板', '0000-00-00 00:00:00'),
|
||||||
(3, '22', 'SSH远程管理服务', '0000-00-00 00:00:00'),
|
(3, '22', 'SSH远程管理服务', '0000-00-00 00:00:00'),
|
||||||
(4, '888', 'phpMyAdmin默认端口', '0000-00-00 00:00:00'),
|
(4, '888', 'phpMyAdmin默认端口', '0000-00-00 00:00:00'),
|
||||||
(5, '3306', 'MySQL端口', '0000-00-00 00:00:00');
|
(5, '443', 'HTTPS', '0000-00-00 00:00:00');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,81 @@
|
|||||||
|
#!/www/server/mdserver-web/bin/python
|
||||||
|
# description: mdserver-web cli tools
|
||||||
|
# ln -s /www/server/mdserver-web/mw-cli /usr/bin/mw-cli
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def mw_start():
|
||||||
|
"""
|
||||||
|
Start mdserver-web
|
||||||
|
"""
|
||||||
|
os.system('systemctl start mw')
|
||||||
|
print("服务已启动")
|
||||||
|
|
||||||
|
|
||||||
|
def mw_stop():
|
||||||
|
"""
|
||||||
|
stop mdserver-web
|
||||||
|
"""
|
||||||
|
os.system('systemctl stop mw')
|
||||||
|
print("服务已停止")
|
||||||
|
|
||||||
|
|
||||||
|
def mw_restart():
|
||||||
|
"""
|
||||||
|
restart mdserver-web
|
||||||
|
"""
|
||||||
|
os.system('systemctl restart mw')
|
||||||
|
print("服务已重启")
|
||||||
|
|
||||||
|
|
||||||
|
def mw_reset_username():
|
||||||
|
"""
|
||||||
|
reset mdserver-web username
|
||||||
|
"""
|
||||||
|
from tools import set_panel_username
|
||||||
|
user_name = input("请输入新的用户名: ")
|
||||||
|
set_panel_username(user_name)
|
||||||
|
|
||||||
|
|
||||||
|
def mw_reset_pwd():
|
||||||
|
"""
|
||||||
|
reset mdserver-web password
|
||||||
|
"""
|
||||||
|
from tools import set_panel_pwd
|
||||||
|
pwd = input("请输入新的密码: ")
|
||||||
|
set_panel_pwd(pwd, True)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
os.chdir("/www/server/mdserver-web")
|
||||||
|
sys.path.append(os.getcwd() + "/class/core")
|
||||||
|
|
||||||
|
try:
|
||||||
|
str = '''
|
||||||
|
==== mdserver-web cli tools ====
|
||||||
|
1. 启动服务 2. 停止服务
|
||||||
|
3. 重启服务 4. 修改用户名
|
||||||
|
5. 修改密码
|
||||||
|
=================================
|
||||||
|
'''
|
||||||
|
if len(sys.argv) == 2:
|
||||||
|
sw = sys.argv[1]
|
||||||
|
else:
|
||||||
|
print(str)
|
||||||
|
sw = input("请输入您要进行的操作: ")
|
||||||
|
|
||||||
|
if sw == '1':
|
||||||
|
mw_start()
|
||||||
|
elif sw == '2':
|
||||||
|
mw_stop()
|
||||||
|
elif sw == '3':
|
||||||
|
mw_restart()
|
||||||
|
elif sw == '4':
|
||||||
|
mw_reset_username()
|
||||||
|
elif sw == '5':
|
||||||
|
mw_reset_pwd()
|
||||||
|
else:
|
||||||
|
print("操作不存在")
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print("\n操作已终止")
|
||||||
@@ -21,7 +21,7 @@ class mysqlDb:
|
|||||||
def __Conn(self):
|
def __Conn(self):
|
||||||
'''连接MYSQL数据库'''
|
'''连接MYSQL数据库'''
|
||||||
try:
|
try:
|
||||||
socket = '/tmp/mysql.sock'
|
socket = '/www/server/mysql/mysql.sock'
|
||||||
try:
|
try:
|
||||||
import MySQLdb
|
import MySQLdb
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
echo `date`
|
echo `date`
|
||||||
|
|
||||||
GITADDR="{$GITROOTURL}/{$USERNAME}/{$PROJECT}"
|
GITADDR="{$GITROOTURL}/{$USERNAME}/{$PROJECT}.git"
|
||||||
GIT_SDIR="{$CODE_DIR}"
|
GIT_SDIR="{$CODE_DIR}"
|
||||||
|
|
||||||
GIT_USER_DIR="${GIT_SDIR}/{$USERNAME}"
|
GIT_USER_DIR="${GIT_SDIR}/{$USERNAME}"
|
||||||
@@ -24,7 +24,7 @@ cd $GIT_PROJECT_DIR && git pull
|
|||||||
# cd $GIT_PROJECT_DIR && env -i git pull origin master
|
# cd $GIT_PROJECT_DIR && env -i git pull origin master
|
||||||
|
|
||||||
|
|
||||||
|
#更新的目的地址
|
||||||
WEB_PATH={$WEB_ROOT}/{$USERNAME}/{$PROJECT}
|
WEB_PATH={$WEB_ROOT}/{$USERNAME}/{$PROJECT}
|
||||||
mkdir -p $WEB_PATH
|
mkdir -p $WEB_PATH
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<div class="bt-w-menu">
|
<div class="bt-w-menu">
|
||||||
<p class="bgw" onclick="pluginService('gogs');">服务</p>
|
<p class="bgw" onclick="pluginService('gogs');">服务</p>
|
||||||
<p onclick="pluginInitD('gogs');">自启动</p>
|
<p onclick="pluginInitD('gogs');">自启动</p>
|
||||||
<p onclick="pluginConfig('gogs',null, 'init_conf');">启动配置</p>
|
<!-- <p onclick="pluginConfig('gogs',null, 'init_conf');">启动配置</p> -->
|
||||||
<p onclick="gogsEdit();">手动编辑</p>
|
<p onclick="gogsEdit();">手动编辑</p>
|
||||||
<p onclick="pluginConfig('gogs',null, 'conf');">配置文件</p>
|
<p onclick="pluginConfig('gogs',null, 'conf');">配置文件</p>
|
||||||
<p onclick="gogsSetConfig();">配置修改</p>
|
<p onclick="gogsSetConfig();">配置修改</p>
|
||||||
|
|||||||
+97
-47
@@ -11,10 +11,11 @@ sys.path.append(os.getcwd() + "/class/core")
|
|||||||
import mw
|
import mw
|
||||||
|
|
||||||
|
|
||||||
cmd = 'ls /usr/local/lib/ | grep python | cut -d \\ -f 1 | awk \'END {print}\''
|
# cmd = 'ls /usr/local/lib/ | grep python | cut -d \\ -f 1 | awk \'END {print}\''
|
||||||
info = mw.execShell(cmd)
|
# info = mw.execShell(cmd)
|
||||||
p = "/usr/local/lib/" + info[0].strip() + "/site-packages"
|
# p = "/usr/local/lib/" + info[0].strip() + "/site-packages"
|
||||||
sys.path.append(p)
|
# sys.path.append(p)
|
||||||
|
|
||||||
import psutil
|
import psutil
|
||||||
|
|
||||||
|
|
||||||
@@ -61,6 +62,13 @@ def getArgs():
|
|||||||
return tmp
|
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 getInitdConfTpl():
|
def getInitdConfTpl():
|
||||||
path = getPluginDir() + "/init.d/gogs.tpl"
|
path = getPluginDir() + "/init.d/gogs.tpl"
|
||||||
return path
|
return path
|
||||||
@@ -170,9 +178,14 @@ def getRootUrl():
|
|||||||
content = mw.readFile(getConf())
|
content = mw.readFile(getConf())
|
||||||
rep = 'ROOT_URL\s*=\s*(.*)'
|
rep = 'ROOT_URL\s*=\s*(.*)'
|
||||||
tmp = re.search(rep, content)
|
tmp = re.search(rep, content)
|
||||||
if not tmp:
|
if tmp:
|
||||||
return ''
|
return tmp.groups()[0]
|
||||||
return tmp.groups()[0]
|
|
||||||
|
rep = 'EXTERNAL_URL\s*=\s*(.*)'
|
||||||
|
tmp = re.search(rep, content)
|
||||||
|
if tmp:
|
||||||
|
return tmp.groups()[0]
|
||||||
|
return ''
|
||||||
|
|
||||||
|
|
||||||
def getSshPort():
|
def getSshPort():
|
||||||
@@ -218,8 +231,7 @@ def getDbConfValue():
|
|||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
||||||
def pMysqlDb():
|
def pMysqlDb(conf):
|
||||||
conf = getDbConfValue()
|
|
||||||
|
|
||||||
host = conf['HOST'].split(':')
|
host = conf['HOST'].split(':')
|
||||||
conn = mysqlDb.mysqlDb()
|
conn = mysqlDb.mysqlDb()
|
||||||
@@ -232,6 +244,53 @@ def pMysqlDb():
|
|||||||
return conn
|
return conn
|
||||||
|
|
||||||
|
|
||||||
|
def pSqliteDb(conf):
|
||||||
|
# print(conf)
|
||||||
|
import db
|
||||||
|
psDb = db.Sql()
|
||||||
|
|
||||||
|
# 默认
|
||||||
|
gsdir = getServerDir() + '/data'
|
||||||
|
dbname = 'gogs'
|
||||||
|
if conf['PATH'][0] == '/':
|
||||||
|
# 绝对路径
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
path = conf['PATH'].split('/')
|
||||||
|
gsdir = getServerDir() + '/' + path[0]
|
||||||
|
dbname = path[1].split('.')[0]
|
||||||
|
|
||||||
|
# print(gsdir, dbname)
|
||||||
|
psDb.dbPos(gsdir, dbname)
|
||||||
|
return psDb
|
||||||
|
|
||||||
|
|
||||||
|
def getGogsDbType(conf):
|
||||||
|
|
||||||
|
if 'DB_TYPE' in conf:
|
||||||
|
return conf['DB_TYPE']
|
||||||
|
|
||||||
|
if 'TYPE' in conf:
|
||||||
|
return conf['TYPE']
|
||||||
|
|
||||||
|
return 'NONE'
|
||||||
|
|
||||||
|
|
||||||
|
def pQuery(sql):
|
||||||
|
conf = getDbConfValue()
|
||||||
|
gtype = getGogsDbType(conf)
|
||||||
|
if gtype == 'sqlite3':
|
||||||
|
db = pSqliteDb(conf)
|
||||||
|
data = db.query(sql, []).fetchall()
|
||||||
|
return data
|
||||||
|
elif gtype == 'mysql':
|
||||||
|
db = pMysqlDb(conf)
|
||||||
|
return db.query(sql)
|
||||||
|
|
||||||
|
print("仅支持mysql|sqlite3配置")
|
||||||
|
exit(0)
|
||||||
|
|
||||||
|
|
||||||
def isSqlError(mysqlMsg):
|
def isSqlError(mysqlMsg):
|
||||||
# 检测数据库执行错误
|
# 检测数据库执行错误
|
||||||
_mysqlMsg = str(mysqlMsg)
|
_mysqlMsg = str(mysqlMsg)
|
||||||
@@ -255,37 +314,35 @@ def isSqlError(mysqlMsg):
|
|||||||
return mw.returnData(True, 'OK')
|
return mw.returnData(True, 'OK')
|
||||||
|
|
||||||
|
|
||||||
def start():
|
def gogsOp(method):
|
||||||
|
|
||||||
file = initDreplace()
|
file = initDreplace()
|
||||||
data = mw.execShell(__SR + file + ' start')
|
|
||||||
|
if not mw.isAppleSystem():
|
||||||
|
data = mw.execShell('systemctl ' + method + ' gogs')
|
||||||
|
if data[1] == '':
|
||||||
|
return 'ok'
|
||||||
|
return 'fail'
|
||||||
|
|
||||||
|
data = mw.execShell(__SR + file + ' ' + method)
|
||||||
if data[1] == '':
|
if data[1] == '':
|
||||||
return 'ok'
|
return 'ok'
|
||||||
return data[0]
|
return data[0]
|
||||||
|
|
||||||
|
|
||||||
|
def start():
|
||||||
|
return gogsOp('start')
|
||||||
|
|
||||||
|
|
||||||
def stop():
|
def stop():
|
||||||
file = initDreplace()
|
return gogsOp('stop')
|
||||||
data = mw.execShell(__SR + file + ' stop')
|
|
||||||
if data[1] == '':
|
|
||||||
return 'ok'
|
|
||||||
return data[1]
|
|
||||||
|
|
||||||
|
|
||||||
def restart():
|
def restart():
|
||||||
file = initDreplace()
|
return gogsOp('restart')
|
||||||
data = mw.execShell(__SR + file + ' restart')
|
|
||||||
if data[1] == '':
|
|
||||||
return 'ok'
|
|
||||||
return data[1]
|
|
||||||
|
|
||||||
|
|
||||||
def reload():
|
def reload():
|
||||||
file = initDreplace()
|
return gogsOp('reload')
|
||||||
data = mw.execShell(__SR + file + ' reload')
|
|
||||||
if data[1] == '':
|
|
||||||
return 'ok'
|
|
||||||
return data[1]
|
|
||||||
|
|
||||||
|
|
||||||
def initdStatus():
|
def initdStatus():
|
||||||
@@ -391,15 +448,13 @@ def userList():
|
|||||||
import math
|
import math
|
||||||
args = getArgs()
|
args = getArgs()
|
||||||
|
|
||||||
page = 1
|
data = checkArgs(args, ['page', 'page_size'])
|
||||||
page_size = 10
|
if not data[0]:
|
||||||
|
return data[1]
|
||||||
|
|
||||||
|
page = int(args['page'])
|
||||||
|
page_size = int(args['page_size'])
|
||||||
search = ''
|
search = ''
|
||||||
if 'page' in args:
|
|
||||||
page = int(args['page'])
|
|
||||||
|
|
||||||
if 'page_size' in args:
|
|
||||||
page_size = int(args['page_size'])
|
|
||||||
|
|
||||||
if 'search' in args:
|
if 'search' in args:
|
||||||
search = args['search']
|
search = args['search']
|
||||||
|
|
||||||
@@ -407,17 +462,13 @@ def userList():
|
|||||||
|
|
||||||
data['root_url'] = getRootUrl()
|
data['root_url'] = getRootUrl()
|
||||||
|
|
||||||
pm = pMysqlDb()
|
|
||||||
start = (page - 1) * page_size
|
start = (page - 1) * page_size
|
||||||
list_count = pm.query('select count(id) as num from user')
|
list_count = pQuery('select count(id) as num from user')
|
||||||
count = list_count[0][0]
|
count = list_count[0][0]
|
||||||
|
list_data = pQuery(
|
||||||
list_data = pm.query(
|
|
||||||
'select id,name,email from user order by id desc limit ' + str(start) + ',' + str(page_size))
|
'select id,name,email from user order by id desc limit ' + str(start) + ',' + str(page_size))
|
||||||
|
data['list'] = mw.getPage({'count': count, 'p': page,
|
||||||
page_info = {'count': count, 'p': page,
|
'row': page_size, 'tojs': 'gogsUserList'})
|
||||||
'row': page_size, 'tojs': 'gogsUserList'}
|
|
||||||
data['list'] = mw.getPage(page_info)
|
|
||||||
data['page'] = page
|
data['page'] = page
|
||||||
data['page_size'] = page_size
|
data['page_size'] = page_size
|
||||||
data['page_count'] = int(math.ceil(count / page_size))
|
data['page_count'] = int(math.ceil(count / page_size))
|
||||||
@@ -542,8 +593,8 @@ def projectScriptLoad():
|
|||||||
|
|
||||||
cc_content = mw.readFile(commit_tpl)
|
cc_content = mw.readFile(commit_tpl)
|
||||||
|
|
||||||
sshUrl = 'http://127.0.0.1:' + getHttpPort()
|
gitPath = getRootPath()
|
||||||
cc_content = cc_content.replace('{$GITROOTURL}', sshUrl)
|
cc_content = cc_content.replace('{$GITROOTURL}', gitPath)
|
||||||
cc_content = cc_content.replace('{$CODE_DIR}', codeDir)
|
cc_content = cc_content.replace('{$CODE_DIR}', codeDir)
|
||||||
cc_content = cc_content.replace('{$USERNAME}', user)
|
cc_content = cc_content.replace('{$USERNAME}', user)
|
||||||
cc_content = cc_content.replace('{$PROJECT}', args['name'])
|
cc_content = cc_content.replace('{$PROJECT}', args['name'])
|
||||||
@@ -620,8 +671,7 @@ def getTotalStatistics():
|
|||||||
st = status()
|
st = status()
|
||||||
data = {}
|
data = {}
|
||||||
if st.strip() == 'start':
|
if st.strip() == 'start':
|
||||||
pm = pMysqlDb()
|
list_count = pQuery('select count(id) as num from repository')
|
||||||
list_count = pm.query('select count(id) as num from repository')
|
|
||||||
|
|
||||||
if list_count.find("error") > -1:
|
if list_count.find("error") > -1:
|
||||||
data['status'] = False
|
data['status'] = False
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Gogs
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
# Modify these two values and uncomment them if you have
|
||||||
|
# repos with lots of files and get an HTTP error 500 because
|
||||||
|
# of that
|
||||||
|
###
|
||||||
|
#LimitMEMLOCK=infinity
|
||||||
|
#LimitNOFILE=65535
|
||||||
|
Type=simple
|
||||||
|
User=git
|
||||||
|
Group=git
|
||||||
|
WorkingDirectory={$SERVER_PATH}/gogs
|
||||||
|
ExecStart={$SERVER_PATH}/gogs/gogs web
|
||||||
|
ExecReload=/bin/kill -USR2 $MAINPID
|
||||||
|
Restart=always
|
||||||
|
Environment=USER=git HOME=/home/git
|
||||||
|
|
||||||
|
# Some distributions may not support these hardening directives. If you cannot start the service due
|
||||||
|
# to an unknown option, comment out the ones not supported by your version of systemd.
|
||||||
|
ProtectSystem=full
|
||||||
|
PrivateDevices=yes
|
||||||
|
PrivateTmp=yes
|
||||||
|
NoNewPrivileges=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -1,30 +1,12 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Gogs
|
Description=Gogs
|
||||||
After=syslog.target
|
|
||||||
After=network.target
|
After=network.target
|
||||||
After=mariadb.service mysqld.service postgresql.service memcached.service redis.service
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
# Modify these two values and uncomment them if you have
|
Type=forking
|
||||||
# repos with lots of files and get an HTTP error 500 because
|
ExecStart={$SERVER_PATH}/gogs/init.d/gogs start
|
||||||
# of that
|
ExecStop={$SERVER_PATH}/gogs/init.d/gogs stop
|
||||||
###
|
RemainAfterExit=yes
|
||||||
#LimitMEMLOCK=infinity
|
|
||||||
#LimitNOFILE=65535
|
|
||||||
Type=simple
|
|
||||||
User=root
|
|
||||||
Group=root
|
|
||||||
WorkingDirectory={$SERVER_PATH}/gogs
|
|
||||||
ExecStart={$SERVER_PATH}/gogs/gogs web
|
|
||||||
Restart=always
|
|
||||||
Environment=USER=git HOME=/home/git
|
|
||||||
|
|
||||||
# Some distributions may not support these hardening directives. If you cannot start the service due
|
|
||||||
# to an unknown option, comment out the ones not supported by your version of systemd.
|
|
||||||
ProtectSystem=full
|
|
||||||
PrivateDevices=yes
|
|
||||||
PrivateTmp=yes
|
|
||||||
NoNewPrivileges=true
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|||||||
+18
-1
@@ -35,6 +35,16 @@ Install_gogs()
|
|||||||
version=$1
|
version=$1
|
||||||
os=`getOs`
|
os=`getOs`
|
||||||
|
|
||||||
|
# if id git &> /dev/null ;then
|
||||||
|
# echo "git uid is `id -u git`"
|
||||||
|
# echo "git shell is `grep "^git:" /etc/passwd |cut -d':' -f7 `"
|
||||||
|
# else
|
||||||
|
# groupadd git
|
||||||
|
# useradd -g git git
|
||||||
|
# fi
|
||||||
|
|
||||||
|
git config --global push.default simple
|
||||||
|
|
||||||
if [ "darwin" == "$os" ];then
|
if [ "darwin" == "$os" ];then
|
||||||
file=gogs_${version}_darwin_amd64.zip
|
file=gogs_${version}_darwin_amd64.zip
|
||||||
else
|
else
|
||||||
@@ -47,8 +57,11 @@ Install_gogs()
|
|||||||
|
|
||||||
cd $serverPath/source/gogs && unzip -o $file -d gogs_${version}
|
cd $serverPath/source/gogs && unzip -o $file -d gogs_${version}
|
||||||
mv $serverPath/source/gogs/gogs_${version}/gogs/ $serverPath/gogs
|
mv $serverPath/source/gogs/gogs_${version}/gogs/ $serverPath/gogs
|
||||||
echo $version > $serverPath/gogs/version.pl
|
|
||||||
|
|
||||||
|
|
||||||
|
if [ -d $serverPath/gogs ];then
|
||||||
|
echo $version > $serverPath/gogs/version.pl
|
||||||
|
fi
|
||||||
# if id -u gogs > /dev/null 2>&1; then
|
# if id -u gogs > /dev/null 2>&1; then
|
||||||
# echo "gogs user exists"
|
# echo "gogs user exists"
|
||||||
# else
|
# else
|
||||||
@@ -63,6 +76,10 @@ Install_gogs()
|
|||||||
Uninstall_gogs()
|
Uninstall_gogs()
|
||||||
{
|
{
|
||||||
rm -rf $serverPath/gogs
|
rm -rf $serverPath/gogs
|
||||||
|
if [ -f /usr/lib/systemd/system/gogs.service ];then
|
||||||
|
systemctl stop gogs
|
||||||
|
rm -rf /usr/lib/systemd/system/gogs.service
|
||||||
|
fi
|
||||||
echo 'uninstall success' > $install_tmp
|
echo 'uninstall success' > $install_tmp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ function getRsaPublic(){
|
|||||||
var rdata = $.parseJSON(data.data);
|
var rdata = $.parseJSON(data.data);
|
||||||
var con = '<div class="tab-con">\
|
var con = '<div class="tab-con">\
|
||||||
<div class="myKeyCon ptb15">\
|
<div class="myKeyCon ptb15">\
|
||||||
<textarea style="margin:0px;width:580px;height:110px;outline:none;" spellcheck="false">'+rdata.public+'</textarea>\
|
<textarea style="margin:0px;width:580px;height:110px;outline:none;" spellcheck="false">'+rdata.mw+'</textarea>\
|
||||||
</div>\
|
</div>\
|
||||||
<ul class="help-info-text c7 pull-left"></ul>\
|
<ul class="help-info-text c7 pull-left"></ul>\
|
||||||
</div>'
|
</div>'
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
"name": "mongodb",
|
"name": "mongodb",
|
||||||
"title": "Mongodb",
|
"title": "Mongodb",
|
||||||
"shell": "install.sh",
|
"shell": "install.sh",
|
||||||
"versions":["4.4.14","5.0.9"],
|
"versions":["4.4.14","5.0.4"],
|
||||||
"updates":["4.4.14","5.0.9"],
|
"updates":["4.4.14","5.0.4"],
|
||||||
"tip": "soft",
|
"tip": "soft",
|
||||||
"checks": "server/mongodb",
|
"checks": "server/mongodb",
|
||||||
"path": "server/mongodb",
|
"path": "server/mongodb",
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class mysqlDb:
|
|||||||
'''连接MYSQL数据库'''
|
'''连接MYSQL数据库'''
|
||||||
try:
|
try:
|
||||||
import mw
|
import mw
|
||||||
socket = '/tmp/mysql.sock'
|
socket = '/www/server/mysql/mysql.sock'
|
||||||
try:
|
try:
|
||||||
import MySQLdb
|
import MySQLdb
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ innodb_write_io_threads = 1
|
|||||||
innodb_file_per_table=1
|
innodb_file_per_table=1
|
||||||
|
|
||||||
|
|
||||||
secure-file-priv=/tmp
|
secure-file-priv={$SERVER_APP_PATH}/tmp
|
||||||
|
|
||||||
[mysqldump]
|
[mysqldump]
|
||||||
quick
|
quick
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ innodb_read_io_threads = 1
|
|||||||
innodb_write_io_threads = 1
|
innodb_write_io_threads = 1
|
||||||
innodb_file_per_table=1
|
innodb_file_per_table=1
|
||||||
|
|
||||||
secure-file-priv=/tmp
|
secure-file-priv={$SERVER_APP_PATH}/tmp
|
||||||
|
|
||||||
[mysqldump]
|
[mysqldump]
|
||||||
quick
|
quick
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ innodb_write_io_threads = 1
|
|||||||
innodb_file_per_table=1
|
innodb_file_per_table=1
|
||||||
binlog_expire_logs_seconds=2592000
|
binlog_expire_logs_seconds=2592000
|
||||||
|
|
||||||
secure-file-priv=/tmp
|
secure-file-priv={$SERVER_APP_PATH}/tmp
|
||||||
|
|
||||||
[mysqldump]
|
[mysqldump]
|
||||||
quick
|
quick
|
||||||
|
|||||||
+63
-77
@@ -103,6 +103,8 @@ def getConf():
|
|||||||
|
|
||||||
def getInitdTpl(version=''):
|
def getInitdTpl(version=''):
|
||||||
path = getPluginDir() + '/init.d/mysql' + version + '.tpl'
|
path = getPluginDir() + '/init.d/mysql' + version + '.tpl'
|
||||||
|
if not os.path.exists(path):
|
||||||
|
path = getPluginDir() + '/init.d/mysql.tpl'
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
|
||||||
@@ -161,6 +163,11 @@ def initDreplace(version=''):
|
|||||||
if not os.path.exists(mysql_conf_dir):
|
if not os.path.exists(mysql_conf_dir):
|
||||||
os.mkdir(mysql_conf_dir)
|
os.mkdir(mysql_conf_dir)
|
||||||
|
|
||||||
|
mysql_tmp = getServerDir() + '/tmp'
|
||||||
|
if not os.path.exists(mysql_tmp):
|
||||||
|
os.mkdir(mysql_tmp)
|
||||||
|
mw.execShell("chown -R mysql:mysql " + mysql_tmp)
|
||||||
|
|
||||||
mysql_conf = mysql_conf_dir + '/my.cnf'
|
mysql_conf = mysql_conf_dir + '/my.cnf'
|
||||||
if not os.path.exists(mysql_conf):
|
if not os.path.exists(mysql_conf):
|
||||||
mysql_conf_tpl = getPluginDir() + '/conf/my' + version + '.cnf'
|
mysql_conf_tpl = getPluginDir() + '/conf/my' + version + '.cnf'
|
||||||
@@ -291,8 +298,8 @@ def initMysqlData():
|
|||||||
cmd = 'cd ' + serverdir + ' && ./scripts/mysql_install_db --user=' + \
|
cmd = 'cd ' + serverdir + ' && ./scripts/mysql_install_db --user=' + \
|
||||||
user + ' --basedir=' + serverdir + ' --ldata=' + datadir
|
user + ' --basedir=' + serverdir + ' --ldata=' + datadir
|
||||||
mw.execShell(cmd)
|
mw.execShell(cmd)
|
||||||
return 0
|
return False
|
||||||
return 1
|
return True
|
||||||
|
|
||||||
|
|
||||||
def initMysql57Data():
|
def initMysql57Data():
|
||||||
@@ -302,10 +309,10 @@ def initMysql57Data():
|
|||||||
myconf = serverdir + "/etc/my.cnf"
|
myconf = serverdir + "/etc/my.cnf"
|
||||||
user = pGetDbUser()
|
user = pGetDbUser()
|
||||||
cmd = 'cd ' + serverdir + ' && ./bin/mysqld --defaults-file=' + myconf + \
|
cmd = 'cd ' + serverdir + ' && ./bin/mysqld --defaults-file=' + myconf + \
|
||||||
' --initialize --explicit_defaults_for_timestamp'
|
' --initialize-insecure --explicit_defaults_for_timestamp'
|
||||||
mw.execShell(cmd)
|
mw.execShell(cmd)
|
||||||
return 0
|
return False
|
||||||
return 1
|
return True
|
||||||
|
|
||||||
|
|
||||||
def initMysql8Data():
|
def initMysql8Data():
|
||||||
@@ -313,12 +320,16 @@ def initMysql8Data():
|
|||||||
if not os.path.exists(datadir + '/mysql'):
|
if not os.path.exists(datadir + '/mysql'):
|
||||||
serverdir = getServerDir()
|
serverdir = getServerDir()
|
||||||
user = pGetDbUser()
|
user = pGetDbUser()
|
||||||
|
# cmd = 'cd ' + serverdir + ' && ./bin/mysqld --basedir=' + serverdir + ' --datadir=' + \
|
||||||
|
# datadir + ' --initialize'
|
||||||
|
|
||||||
cmd = 'cd ' + serverdir + ' && ./bin/mysqld --basedir=' + serverdir + ' --datadir=' + \
|
cmd = 'cd ' + serverdir + ' && ./bin/mysqld --basedir=' + serverdir + ' --datadir=' + \
|
||||||
datadir + ' --initialize'
|
datadir + ' --initialize-insecure'
|
||||||
|
|
||||||
# print(cmd)
|
# print(cmd)
|
||||||
mw.execShell(cmd)
|
mw.execShell(cmd)
|
||||||
return 0
|
return False
|
||||||
return 1
|
return True
|
||||||
|
|
||||||
|
|
||||||
def initMysqlPwd():
|
def initMysqlPwd():
|
||||||
@@ -328,8 +339,8 @@ def initMysqlPwd():
|
|||||||
|
|
||||||
pwd = mw.getRandomString(16)
|
pwd = mw.getRandomString(16)
|
||||||
cmd_pass = serverdir + '/bin/mysqladmin -uroot password ' + pwd
|
cmd_pass = serverdir + '/bin/mysqladmin -uroot password ' + pwd
|
||||||
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
|
|
||||||
mw.execShell(cmd_pass)
|
mw.execShell(cmd_pass)
|
||||||
|
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@@ -347,62 +358,29 @@ def mysql8IsInitedPasswd():
|
|||||||
|
|
||||||
|
|
||||||
def initMysql8Pwd():
|
def initMysql8Pwd():
|
||||||
is_start = False
|
time.sleep(2)
|
||||||
for x in range(60):
|
|
||||||
data = mw.execShell(
|
|
||||||
"ps -ef|grep mysql|grep -v grep|grep -v py|grep -v init.d|awk '{print $2}'")
|
|
||||||
if data[0] != "":
|
|
||||||
# print("mysql start ok!")
|
|
||||||
is_start = True
|
|
||||||
break
|
|
||||||
time.sleep(0.5)
|
|
||||||
|
|
||||||
if not is_start:
|
|
||||||
# print("mysql start fail!")
|
|
||||||
return False
|
|
||||||
|
|
||||||
serverdir = getServerDir()
|
serverdir = getServerDir()
|
||||||
pwd = mw.getRandomString(16)
|
pwd = mw.getRandomString(16)
|
||||||
|
|
||||||
pass_cmd = "cat " + serverdir + \
|
|
||||||
"/data/error.log | grep root@localhost | awk -F 'root@localhost:' '{print $2}'"
|
|
||||||
passdata = mw.execShell(pass_cmd)
|
|
||||||
password = passdata[0].strip()
|
|
||||||
|
|
||||||
if len(password) == 0:
|
|
||||||
return True
|
|
||||||
|
|
||||||
# print('localhost', 3306, 'root', password,
|
|
||||||
# "/www/server/mysql/mysql.sock")
|
|
||||||
|
|
||||||
# import MySQLdb as mdb
|
|
||||||
# dbconn = mdb.connect(host='localhost', port=3306, user='root',
|
|
||||||
# passwd=password, unix_socket="/www/server/mysql/mysql.sock")
|
|
||||||
# dbconn.autocommit(True)
|
|
||||||
# dbcurr = dbconn.cursor()
|
|
||||||
# dbcurr.execute('SET NAMES UTF8MB4')
|
|
||||||
|
|
||||||
# # with mysql_native_password
|
|
||||||
alter_root_pwd = 'flush privileges;'
|
alter_root_pwd = 'flush privileges;'
|
||||||
alter_root_pwd = alter_root_pwd + \
|
alter_root_pwd = alter_root_pwd + \
|
||||||
"alter user 'root'@'localhost' IDENTIFIED by '" + pwd + "';"
|
"alter user 'root'@'localhost' IDENTIFIED by '" + pwd + "';"
|
||||||
alter_root_pwd = alter_root_pwd + \
|
alter_root_pwd = alter_root_pwd + \
|
||||||
"alter user 'root'@'localhost' IDENTIFIED WITH mysql_native_password by '" + pwd + "';"
|
"alter user 'root'@'localhost' IDENTIFIED WITH mysql_native_password by '" + pwd + "';"
|
||||||
alter_root_pwd = alter_root_pwd + "flush privileges;"
|
alter_root_pwd = alter_root_pwd + "flush privileges;"
|
||||||
# dbcurr.execute(alter_root_pwd)
|
|
||||||
|
cmd_pass = serverdir + '/bin/mysqladmin -uroot password root'
|
||||||
|
data = mw.execShell(cmd_pass)
|
||||||
|
# print(data)
|
||||||
|
|
||||||
tmp_file = "/tmp/mysql_init_tmp.log"
|
tmp_file = "/tmp/mysql_init_tmp.log"
|
||||||
mw.writeFile(tmp_file, alter_root_pwd)
|
mw.writeFile(tmp_file, alter_root_pwd)
|
||||||
cmd_pass = serverdir + '/bin/mysql --connect-expired-password -uroot -p"' + \
|
cmd_pass = serverdir + '/bin/mysql -uroot -proot < ' + tmp_file
|
||||||
password + '" < ' + tmp_file
|
|
||||||
# print(cmd_pass)
|
|
||||||
data = mw.execShell(cmd_pass)
|
data = mw.execShell(cmd_pass)
|
||||||
if data[1].find("ERROR") != -1:
|
# print(data)
|
||||||
# print(data[1])
|
os.remove(tmp_file)
|
||||||
pass
|
|
||||||
else:
|
|
||||||
mw.writeFile(serverdir + "/data/error.log", "")
|
|
||||||
os.remove(tmp_file)
|
|
||||||
|
|
||||||
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
|
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
|
||||||
|
|
||||||
@@ -413,9 +391,11 @@ def myOp(version, method):
|
|||||||
# import commands
|
# import commands
|
||||||
init_file = initDreplace()
|
init_file = initDreplace()
|
||||||
try:
|
try:
|
||||||
initData = initMysqlData()
|
isInited = initMysqlData()
|
||||||
if initData == 0:
|
if not isInited:
|
||||||
|
mw.execShell('systemctl start mysql')
|
||||||
initMysqlPwd()
|
initMysqlPwd()
|
||||||
|
mw.execShell('systemctl stop mysql')
|
||||||
|
|
||||||
mw.execShell('systemctl ' + method + ' mysql')
|
mw.execShell('systemctl ' + method + ' mysql')
|
||||||
return 'ok'
|
return 'ok'
|
||||||
@@ -424,39 +404,46 @@ def myOp(version, method):
|
|||||||
|
|
||||||
|
|
||||||
def my8cmd(version, method):
|
def my8cmd(version, method):
|
||||||
# mysql 8.0 and 5.7 ok
|
# mysql 8.0 and 5.7
|
||||||
init_file = initDreplace(version)
|
init_file = initDreplace(version)
|
||||||
if version == '5.7':
|
cmd = init_file + ' ' + method
|
||||||
initMysql57Data()
|
|
||||||
elif version == '8.0':
|
|
||||||
initMysql8Data()
|
|
||||||
try:
|
try:
|
||||||
|
if version == '5.7':
|
||||||
|
isInited = initMysql57Data()
|
||||||
|
elif version == '8.0':
|
||||||
|
isInited = initMysql8Data()
|
||||||
|
|
||||||
if not mysql8IsInitedPasswd():
|
if not isInited:
|
||||||
setSkipGrantTables(True)
|
|
||||||
cmd_init_start = init_file + ' start'
|
if mw.isAppleSystem():
|
||||||
subprocess.Popen(cmd_init_start, stdout=subprocess.PIPE, shell=True,
|
cmd_init_start = init_file + ' start'
|
||||||
bufsize=4096, stderr=subprocess.PIPE)
|
subprocess.Popen(cmd_init_start, stdout=subprocess.PIPE, shell=True,
|
||||||
|
bufsize=4096, stderr=subprocess.PIPE)
|
||||||
|
|
||||||
|
time.sleep(6)
|
||||||
|
else:
|
||||||
|
mw.execShell('systemctl start mysql')
|
||||||
|
|
||||||
time.sleep(6)
|
|
||||||
initMysql8Pwd()
|
initMysql8Pwd()
|
||||||
|
|
||||||
cmd_init_stop = init_file + ' stop'
|
if mw.isAppleSystem():
|
||||||
subprocess.Popen(cmd_init_stop, stdout=subprocess.PIPE, shell=True,
|
cmd_init_stop = init_file + ' stop'
|
||||||
bufsize=4096, stderr=subprocess.PIPE)
|
subprocess.Popen(cmd_init_stop, stdout=subprocess.PIPE, shell=True,
|
||||||
setSkipGrantTables(False)
|
bufsize=4096, stderr=subprocess.PIPE)
|
||||||
|
time.sleep(3)
|
||||||
|
else:
|
||||||
|
mw.execShell('systemctl stop mysql')
|
||||||
|
|
||||||
time.sleep(3)
|
if mw.isAppleSystem():
|
||||||
my8cmd(version, method)
|
sub = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True,
|
||||||
|
bufsize=4096, stderr=subprocess.PIPE)
|
||||||
|
sub.wait(5)
|
||||||
else:
|
else:
|
||||||
mw.execShell('systemctl ' + method + ' mysql')
|
mw.execShell('systemctl ' + method + ' mysql')
|
||||||
|
|
||||||
return 'ok'
|
return 'ok'
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return str(e)
|
return str(e)
|
||||||
|
|
||||||
return 'fail'
|
|
||||||
|
|
||||||
|
|
||||||
def appCMD(version, action):
|
def appCMD(version, action):
|
||||||
if version == '8.0' or version == '5.7':
|
if version == '8.0' or version == '5.7':
|
||||||
@@ -481,9 +468,8 @@ def reload(version=''):
|
|||||||
|
|
||||||
|
|
||||||
def initdStatus():
|
def initdStatus():
|
||||||
if not app_debug:
|
if mw.isAppleSystem():
|
||||||
if mw.isAppleSystem():
|
return "Apple Computer does not support"
|
||||||
return "Apple Computer does not support"
|
|
||||||
|
|
||||||
shell_cmd = 'systemctl status mysql | grep loaded | grep "enabled;"'
|
shell_cmd = 'systemctl status mysql | grep loaded | grep "enabled;"'
|
||||||
data = mw.execShell(shell_cmd)
|
data = mw.execShell(shell_cmd)
|
||||||
@@ -673,7 +659,7 @@ def isSqlError(mysqlMsg):
|
|||||||
# 检测数据库执行错误
|
# 检测数据库执行错误
|
||||||
mysqlMsg = str(mysqlMsg)
|
mysqlMsg = str(mysqlMsg)
|
||||||
if "MySQLdb" in mysqlMsg:
|
if "MySQLdb" in mysqlMsg:
|
||||||
return mw.returnJson(False, 'MySQLdb组件缺失! <br>进入SSH命令行输入: pip install mysql-python')
|
return mw.returnJson(False, 'MySQLdb组件缺失! <br>进入SSH命令行输入: pip install mysql-python | pip install mysqlclient==2.0.3')
|
||||||
if "2002," in mysqlMsg:
|
if "2002," in mysqlMsg:
|
||||||
return mw.returnJson(False, '数据库连接失败,请检查数据库服务是否启动!')
|
return mw.returnJson(False, '数据库连接失败,请检查数据库服务是否启动!')
|
||||||
if "2003," in mysqlMsg:
|
if "2003," in mysqlMsg:
|
||||||
|
|||||||
@@ -805,6 +805,8 @@ function setDbPs(id, name, obj) {
|
|||||||
function openPhpmyadmin(name,username,password){
|
function openPhpmyadmin(name,username,password){
|
||||||
|
|
||||||
data = syncPost('/plugins/check',{'name':'phpmyadmin'});
|
data = syncPost('/plugins/check',{'name':'phpmyadmin'});
|
||||||
|
|
||||||
|
|
||||||
if (!data.status){
|
if (!data.status){
|
||||||
layer.msg(data.msg,{icon:2,shade: [0.3, '#000']});
|
layer.msg(data.msg,{icon:2,shade: [0.3, '#000']});
|
||||||
return;
|
return;
|
||||||
@@ -815,7 +817,7 @@ function openPhpmyadmin(name,username,password){
|
|||||||
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// console.log(data);
|
||||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_home_page'});
|
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_home_page'});
|
||||||
var rdata = $.parseJSON(data.data);
|
var rdata = $.parseJSON(data.data);
|
||||||
if (!rdata.status){
|
if (!rdata.status){
|
||||||
@@ -830,16 +832,28 @@ function openPhpmyadmin(name,username,password){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var murl = $("#toPHPMyAdmin").attr('action');
|
//检查版本
|
||||||
$("#pma_username").val(username);
|
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'version'});
|
||||||
$("#pma_password").val(password);
|
bigVer = data.data.split('.')[0]
|
||||||
$("#db").val(name);
|
if (bigVer>=5){
|
||||||
|
|
||||||
layer.msg('正在打开phpMyAdmin',{icon:16,shade: [0.3, '#000'],time:1000});
|
setTimeout(function(){
|
||||||
|
$("#toPHPMyAdmin").submit();
|
||||||
|
},3000);
|
||||||
|
layer.msg('phpMyAdmin['+data.data+']需要手动登录😭',{icon:16,shade: [0.3, '#000'],time:4000});
|
||||||
|
|
||||||
|
} else{
|
||||||
|
var murl = $("#toPHPMyAdmin").attr('action');
|
||||||
|
$("#pma_username").val(username);
|
||||||
|
$("#pma_password").val(password);
|
||||||
|
$("#db").val(name);
|
||||||
|
|
||||||
setTimeout(function(){
|
layer.msg('正在打开phpMyAdmin',{icon:16,shade: [0.3, '#000'],time:2000});
|
||||||
$("#toPHPMyAdmin").submit();
|
|
||||||
},2000);
|
setTimeout(function(){
|
||||||
|
$("#toPHPMyAdmin").submit();
|
||||||
|
},3000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function delBackup(filename,name){
|
function delBackup(filename,name){
|
||||||
|
|||||||
@@ -14,16 +14,23 @@ sysName=`uname`
|
|||||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||||
mysqlDir=${serverPath}/source/mysql
|
mysqlDir=${serverPath}/source/mysql
|
||||||
|
|
||||||
|
|
||||||
Install_mysql()
|
Install_mysql()
|
||||||
{
|
{
|
||||||
mkdir -p ${mysqlDir}
|
mkdir -p ${mysqlDir}
|
||||||
echo '正在安装脚本文件...' > $install_tmp
|
echo '正在安装脚本文件...' > $install_tmp
|
||||||
|
|
||||||
|
if id mysql &> /dev/null ;then
|
||||||
|
echo "mysql UID is `id -u www`"
|
||||||
|
echo "mysql Shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
|
||||||
|
else
|
||||||
|
groupadd mysql
|
||||||
|
useradd -g mysql mysql
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$sysName" != "Darwin" ];then
|
if [ "$sysName" != "Darwin" ];then
|
||||||
mkdir -p /var/log/mariadb
|
mkdir -p /var/log/mariadb
|
||||||
touch /var/log/mariadb/mariadb.log
|
touch /var/log/mariadb/mariadb.log
|
||||||
groupadd mysql
|
|
||||||
useradd -g mysql mysql
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f ${mysqlDir}/mysql-5.5.62.tar.gz ];then
|
if [ ! -f ${mysqlDir}/mysql-5.5.62.tar.gz ];then
|
||||||
@@ -47,11 +54,18 @@ Install_mysql()
|
|||||||
-DENABLED_LOCAL_INFILE=1 \
|
-DENABLED_LOCAL_INFILE=1 \
|
||||||
-DWITH_PARTITION_STORAGE_ENGINE=1 \
|
-DWITH_PARTITION_STORAGE_ENGINE=1 \
|
||||||
-DEXTRA_CHARSETS=all \
|
-DEXTRA_CHARSETS=all \
|
||||||
-DDEFAULT_CHARSET=utf8 \
|
-DDEFAULT_CHARSET=utf8mb4 \
|
||||||
-DDEFAULT_COLLATION=utf8_general_ci \
|
-DDEFAULT_COLLATION=utf8mb4_general_ci \
|
||||||
&& make && make install && make clean \
|
-DCMAKE_C_COMPILER=/usr/bin/gcc \
|
||||||
&& echo '5.5' > $serverPath/mysql/version.pl
|
-DCMAKE_CXX_COMPILER=/usr/bin/g++ \
|
||||||
echo '安装完成' > $install_tmp
|
&& make ${MAKEJN:--j2} && make install && make clean
|
||||||
|
|
||||||
|
if [ -d $serverPath/mysql ];then
|
||||||
|
echo '5.5' > $serverPath/mysql/version.pl
|
||||||
|
echo '安装完成' > $install_tmp
|
||||||
|
else
|
||||||
|
echo '安装失败' > $install_tmp
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,16 +17,23 @@ sysName=`uname`
|
|||||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||||
mysqlDir=${serverPath}/source/mysql
|
mysqlDir=${serverPath}/source/mysql
|
||||||
|
|
||||||
|
|
||||||
Install_mysql()
|
Install_mysql()
|
||||||
{
|
{
|
||||||
mkdir -p ${mysqlDir}
|
mkdir -p ${mysqlDir}
|
||||||
echo '正在安装脚本文件...' > $install_tmp
|
echo '正在安装脚本文件...' > $install_tmp
|
||||||
|
|
||||||
|
if id mysql &> /dev/null ;then
|
||||||
|
echo "mysql UID is `id -u www`"
|
||||||
|
echo "mysql Shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
|
||||||
|
else
|
||||||
|
groupadd mysql
|
||||||
|
useradd -g mysql mysql
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$sysName" != "Darwin" ];then
|
if [ "$sysName" != "Darwin" ];then
|
||||||
mkdir -p /var/log/mariadb
|
mkdir -p /var/log/mariadb
|
||||||
touch /var/log/mariadb/mariadb.log
|
touch /var/log/mariadb/mariadb.log
|
||||||
groupadd mysql
|
|
||||||
useradd -g mysql mysql
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@@ -51,11 +58,19 @@ Install_mysql()
|
|||||||
-DENABLED_LOCAL_INFILE=1 \
|
-DENABLED_LOCAL_INFILE=1 \
|
||||||
-DWITH_PARTITION_STORAGE_ENGINE=1 \
|
-DWITH_PARTITION_STORAGE_ENGINE=1 \
|
||||||
-DEXTRA_CHARSETS=all \
|
-DEXTRA_CHARSETS=all \
|
||||||
-DDEFAULT_CHARSET=utf8 \
|
-DDEFAULT_CHARSET=utf8mb4 \
|
||||||
-DDEFAULT_COLLATION=utf8_general_ci \
|
-DCMAKE_C_COMPILER=/usr/bin/gcc \
|
||||||
&& make && make install && make clean
|
-DCMAKE_CXX_COMPILER=/usr/bin/g++ \
|
||||||
echo '5.6' > $serverPath/mysql/version.pl
|
-DDEFAULT_COLLATION=utf8mb4_general_ci \
|
||||||
echo '安装完成' > $install_tmp
|
&& make ${MAKEJN:--j2} && make install && make clean
|
||||||
|
|
||||||
|
|
||||||
|
if [ -d $serverPath/mysql ];then
|
||||||
|
echo '5.6' > $serverPath/mysql/version.pl
|
||||||
|
echo '安装完成' > $install_tmp
|
||||||
|
else
|
||||||
|
echo '安装失败' > $install_tmp
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,22 +19,43 @@ mysqlDir=${serverPath}/source/mysql
|
|||||||
|
|
||||||
VERSION="5.7.37"
|
VERSION="5.7.37"
|
||||||
|
|
||||||
|
|
||||||
Install_mysql()
|
Install_mysql()
|
||||||
{
|
{
|
||||||
mkdir -p ${mysqlDir}
|
mkdir -p ${mysqlDir}
|
||||||
echo '正在安装脚本文件...' > $install_tmp
|
echo '正在安装脚本文件...' > $install_tmp
|
||||||
|
|
||||||
|
if id mysql &> /dev/null ;then
|
||||||
|
echo "mysql UID is `id -u www`"
|
||||||
|
echo "mysql Shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
|
||||||
|
else
|
||||||
|
groupadd mysql
|
||||||
|
useradd -g mysql mysql
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$sysName" != "Darwin" ];then
|
if [ "$sysName" != "Darwin" ];then
|
||||||
mkdir -p /var/log/mariadb
|
mkdir -p /var/log/mariadb
|
||||||
touch /var/log/mariadb/mariadb.log
|
touch /var/log/mariadb/mariadb.log
|
||||||
groupadd mysql
|
fi
|
||||||
useradd -g mysql mysql
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f ${mysqlDir}/mysql-boost-${VERSION}.tar.gz ];then
|
if [ ! -f ${mysqlDir}/mysql-boost-${VERSION}.tar.gz ];then
|
||||||
wget -O ${mysqlDir}/mysql-boost-${VERSION}.tar.gz https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-${VERSION}.tar.gz
|
wget -O ${mysqlDir}/mysql-boost-${VERSION}.tar.gz https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-${VERSION}.tar.gz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#检测文件是否损坏.
|
||||||
|
md5_mysql_ok=d0489fc3880248a58759c50bfb286dbb
|
||||||
|
if [ -f ${mysqlDir}/mysql-boost-${VERSION}.tar.gz ];then
|
||||||
|
md5_mysql=`md5sum ${mysqlDir}/mysql-boost-${VERSION}.tar.gz | awk '{print $1}'`
|
||||||
|
if [ "${md5_mysql_ok}" == "${md5_mysql}" ]; then
|
||||||
|
echo "mysql5.7 file check ok"
|
||||||
|
else
|
||||||
|
# 重新下载
|
||||||
|
rm -rf ${mysqlDir}/mysql-${VERSION}
|
||||||
|
wget -O ${mysqlDir}/mysql-boost-${VERSION}.tar.gz https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-${VERSION}.tar.gz
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -d ${mysqlDir}/mysql-${VERSION} ];then
|
if [ ! -d ${mysqlDir}/mysql-${VERSION} ];then
|
||||||
cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-boost-${VERSION}.tar.gz
|
cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-boost-${VERSION}.tar.gz
|
||||||
fi
|
fi
|
||||||
@@ -51,11 +72,13 @@ Install_mysql()
|
|||||||
-DENABLED_LOCAL_INFILE=1 \
|
-DENABLED_LOCAL_INFILE=1 \
|
||||||
-DWITH_PARTITION_STORAGE_ENGINE=1 \
|
-DWITH_PARTITION_STORAGE_ENGINE=1 \
|
||||||
-DEXTRA_CHARSETS=all \
|
-DEXTRA_CHARSETS=all \
|
||||||
-DDEFAULT_CHARSET=utf8 \
|
-DDEFAULT_CHARSET=utf8mb4 \
|
||||||
-DDEFAULT_COLLATION=utf8_general_ci \
|
-DDEFAULT_COLLATION=utf8mb4_general_ci \
|
||||||
-DDOWNLOAD_BOOST=1 \
|
-DDOWNLOAD_BOOST=1 \
|
||||||
|
-DCMAKE_C_COMPILER=/usr/bin/gcc \
|
||||||
|
-DCMAKE_CXX_COMPILER=/usr/bin/g++ \
|
||||||
-DWITH_BOOST=${mysqlDir}/mysql-${VERSION}/boost/
|
-DWITH_BOOST=${mysqlDir}/mysql-${VERSION}/boost/
|
||||||
make && make install && make clean
|
make ${MAKEJN:--j2} && make install && make clean
|
||||||
echo '5.7' > $serverPath/mysql/version.pl
|
echo '5.7' > $serverPath/mysql/version.pl
|
||||||
echo '安装完成' > $install_tmp
|
echo '安装完成' > $install_tmp
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
export MAKEJN=-j12
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
@@ -22,13 +24,19 @@ Install_mysql()
|
|||||||
mkdir -p ${mysqlDir}
|
mkdir -p ${mysqlDir}
|
||||||
echo '正在安装脚本文件...' > $install_tmp
|
echo '正在安装脚本文件...' > $install_tmp
|
||||||
|
|
||||||
|
|
||||||
|
if id mysql &> /dev/null ;then
|
||||||
|
echo "mysql UID is `id -u www`"
|
||||||
|
echo "mysql Shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
|
||||||
|
else
|
||||||
|
groupadd mysql
|
||||||
|
useradd -g mysql mysql
|
||||||
|
fi
|
||||||
|
|
||||||
INSTALL_CMD=cmake
|
INSTALL_CMD=cmake
|
||||||
if [ "$sysName" != "Darwin" ];then
|
if [ "$sysName" != "Darwin" ];then
|
||||||
mkdir -p /var/log/mariadb
|
mkdir -p /var/log/mariadb
|
||||||
touch /var/log/mariadb/mariadb.log
|
touch /var/log/mariadb/mariadb.log
|
||||||
groupadd mysql
|
|
||||||
useradd -g mysql mysql
|
|
||||||
|
|
||||||
INSTALL_CMD=cmake
|
INSTALL_CMD=cmake
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -36,10 +44,24 @@ Install_mysql()
|
|||||||
wget -O ${mysqlDir}/mysql-boost-8.0.25.tar.gz https://cdn.mysql.com/archives/mysql-8.0/mysql-boost-8.0.25.tar.gz
|
wget -O ${mysqlDir}/mysql-boost-8.0.25.tar.gz https://cdn.mysql.com/archives/mysql-8.0/mysql-boost-8.0.25.tar.gz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#检测文件是否损坏.
|
||||||
|
md5_mysql_ok=e142c2058313b4646c36fa9bb1b38493
|
||||||
|
if [ -f ${mysqlDir}/mysql-boost-8.0.25.tar.gz ];then
|
||||||
|
md5_mysql=`md5sum ${mysqlDir}/mysql-boost-8.0.25.tar.gz | awk '{print $1}'`
|
||||||
|
if [ "${md5_mysql_ok}" == "${md5_mysql}" ]; then
|
||||||
|
echo "mysql8.0 file check ok"
|
||||||
|
else
|
||||||
|
# 重新下载
|
||||||
|
rm -rf ${mysqlDir}/mysql-8.0.25
|
||||||
|
wget -O ${mysqlDir}/mysql-boost-8.0.25.tar.gz https://cdn.mysql.com/archives/mysql-8.0/mysql-boost-8.0.25.tar.gz
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -d ${mysqlDir}/mysql-8.0.25 ];then
|
if [ ! -d ${mysqlDir}/mysql-8.0.25 ];then
|
||||||
cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-boost-8.0.25.tar.gz
|
cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-boost-8.0.25.tar.gz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ ! -d $serverPath/mysql ];then
|
if [ ! -d $serverPath/mysql ];then
|
||||||
cd ${mysqlDir}/mysql-8.0.25 && ${INSTALL_CMD} \
|
cd ${mysqlDir}/mysql-8.0.25 && ${INSTALL_CMD} \
|
||||||
-DCMAKE_INSTALL_PREFIX=$serverPath/mysql \
|
-DCMAKE_INSTALL_PREFIX=$serverPath/mysql \
|
||||||
@@ -52,13 +74,18 @@ Install_mysql()
|
|||||||
-DENABLED_LOCAL_INFILE=1 \
|
-DENABLED_LOCAL_INFILE=1 \
|
||||||
-DWITH_PARTITION_STORAGE_ENGINE=1 \
|
-DWITH_PARTITION_STORAGE_ENGINE=1 \
|
||||||
-DEXTRA_CHARSETS=all \
|
-DEXTRA_CHARSETS=all \
|
||||||
-DDEFAULT_CHARSET=utf8 \
|
-DDEFAULT_CHARSET=utf8mb4 \
|
||||||
-DDEFAULT_COLLATION=utf8_general_ci \
|
-DDEFAULT_COLLATION=utf8mb4_general_ci \
|
||||||
-DDOWNLOAD_BOOST=1 \
|
-DDOWNLOAD_BOOST=1 \
|
||||||
-DFORCE_INSOURCE_BUILD=1 \
|
-DFORCE_INSOURCE_BUILD=1 \
|
||||||
|
-DCMAKE_C_COMPILER=/usr/bin/gcc \
|
||||||
|
-DCMAKE_CXX_COMPILER=/usr/bin/g++ \
|
||||||
-DWITH_BOOST=${mysqlDir}/mysql-8.0.25/boost/
|
-DWITH_BOOST=${mysqlDir}/mysql-8.0.25/boost/
|
||||||
make && make install && make clean
|
make ${MAKEJN:--j2} && make install && make clean
|
||||||
echo '8.0' > $serverPath/mysql/version.pl
|
|
||||||
|
if [ -d $serverPath/mysql ];then
|
||||||
|
echo '8.0' > $serverPath/mysql/version.pl
|
||||||
|
fi
|
||||||
echo '安装完成' > $install_tmp
|
echo '安装完成' > $install_tmp
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,8 +15,10 @@ Install_of(){
|
|||||||
|
|
||||||
echo '正在安装脚本文件...' > $install_tmp
|
echo '正在安装脚本文件...' > $install_tmp
|
||||||
mkdir -p $serverPath/op_waf
|
mkdir -p $serverPath/op_waf
|
||||||
mkdir -p $rootPath/wwwlogs/waf
|
|
||||||
|
|
||||||
|
if [ -f $serverPath/openresty ];then
|
||||||
|
mkdir -p $serverPath/openresty/nginx/conf/waf
|
||||||
|
fi
|
||||||
echo '0.1' > $serverPath/op_waf/version.pl
|
echo '0.1' > $serverPath/op_waf/version.pl
|
||||||
echo 'install ok' > $install_tmp
|
echo 'install ok' > $install_tmp
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>网站防火墙</title>
|
<title>OP网站防火墙</title>
|
||||||
<style>
|
<style>
|
||||||
*{margin:0;padding:0;color:#444}
|
*{margin:0;padding:0;color:#444}
|
||||||
body{font-size:14px;font-family:"宋体"}
|
body{font-size:14px;font-family:"宋体"}
|
||||||
@@ -18,7 +18,7 @@ ol li{line-height:30px}
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="title">网站防火墙</div>
|
<div class="title">OP网站防火墙</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<p class="t1">您的请求带有不合法参数,已被网站管理员设置拦截!</p>
|
<p class="t1">您的请求带有不合法参数,已被网站管理员设置拦截!</p>
|
||||||
<p class="t2">可能原因:</p>
|
<p class="t2">可能原因:</p>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>网站防火墙</title>
|
<title>OP网站防火墙</title>
|
||||||
<style>
|
<style>
|
||||||
*{margin:0;padding:0;color:#444}
|
*{margin:0;padding:0;color:#444}
|
||||||
body{font-size:14px;font-family:"宋体"}
|
body{font-size:14px;font-family:"宋体"}
|
||||||
@@ -18,7 +18,7 @@ ol li{line-height:30px}
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="title">网站防火墙</div>
|
<div class="title">OP网站防火墙</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<p class="t1">您的请求带有不合法参数,已被网站管理员设置拦截!</p>
|
<p class="t1">您的请求带有不合法参数,已被网站管理员设置拦截!</p>
|
||||||
<p class="t2">可能原因:</p>
|
<p class="t2">可能原因:</p>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>网站防火墙</title>
|
<title>OP网站防火墙</title>
|
||||||
<style>
|
<style>
|
||||||
*{margin:0;padding:0;color:#444}
|
*{margin:0;padding:0;color:#444}
|
||||||
body{font-size:14px;font-family:"宋体"}
|
body{font-size:14px;font-family:"宋体"}
|
||||||
@@ -18,7 +18,7 @@ ol li{line-height:30px}
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="title">网站防火墙</div>
|
<div class="title">OP网站防火墙</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<p class="t1">您的请求带有不合法参数,已被网站管理员设置拦截!</p>
|
<p class="t1">您的请求带有不合法参数,已被网站管理员设置拦截!</p>
|
||||||
<p class="t2">可能原因:</p>
|
<p class="t2">可能原因:</p>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>网站防火墙</title>
|
<title>OP网站防火墙</title>
|
||||||
<style>
|
<style>
|
||||||
*{margin:0;padding:0;color:#444}
|
*{margin:0;padding:0;color:#444}
|
||||||
body{font-size:14px;font-family:"宋体"}
|
body{font-size:14px;font-family:"宋体"}
|
||||||
@@ -18,7 +18,7 @@ ol li{line-height:30px}
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="title">网站防火墙</div>
|
<div class="title">OP网站防火墙</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<p class="t1">您的请求带有不合法参数,已被网站管理员设置拦截!</p>
|
<p class="t1">您的请求带有不合法参数,已被网站管理员设置拦截!</p>
|
||||||
<p class="t2">可能原因:</p>
|
<p class="t2">可能原因:</p>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>网站防火墙</title>
|
<title>OP网站防火墙</title>
|
||||||
<style>
|
<style>
|
||||||
*{margin:0;padding:0;color:#444}
|
*{margin:0;padding:0;color:#444}
|
||||||
body{font-size:14px;font-family:"宋体"}
|
body{font-size:14px;font-family:"宋体"}
|
||||||
@@ -18,7 +18,7 @@ ol li{line-height:30px}
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="title">网站防火墙</div>
|
<div class="title">OP网站防火墙</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<p class="t1">您的请求带有不合法参数,已被网站管理员设置拦截!</p>
|
<p class="t1">您的请求带有不合法参数,已被网站管理员设置拦截!</p>
|
||||||
<p class="t2">可能原因:</p>
|
<p class="t2">可能原因:</p>
|
||||||
|
|||||||
@@ -317,26 +317,35 @@ function post_data_chekc()
|
|||||||
if C:return_post_data() then return false end
|
if C:return_post_data() then return false end
|
||||||
request_args = ngx.req.get_post_args()
|
request_args = ngx.req.get_post_args()
|
||||||
if not request_args then return false end
|
if not request_args then return false end
|
||||||
if not request_header['Content-Type'] then return false end
|
|
||||||
av=string.match(request_header['Content-Type'],"=.+")
|
if request_header then
|
||||||
|
if not request_header['Content-Type'] then return false end
|
||||||
|
av = string.match(request_header['Content-Type'],"=.+")
|
||||||
|
end
|
||||||
|
|
||||||
if not av then return false end
|
if not av then return false end
|
||||||
ac=split(av,'=')
|
ac = split(av,'=')
|
||||||
|
|
||||||
if not ac then return false end
|
if not ac then return false end
|
||||||
|
|
||||||
list_list=nil
|
list_list=nil
|
||||||
for i,v in ipairs(ac)
|
for i,v in ipairs(ac)
|
||||||
do
|
do
|
||||||
list_list='--'..v
|
list_list='--'..v
|
||||||
end
|
end
|
||||||
|
|
||||||
if not list_list then return false end
|
if not list_list then return false end
|
||||||
aaa=nil
|
aaa=nil
|
||||||
for k,v in pairs(request_args)
|
for k,v in pairs(request_args)
|
||||||
do
|
do
|
||||||
aaa=v
|
aaa=v
|
||||||
end
|
end
|
||||||
|
|
||||||
if not aaa then return false end
|
if not aaa then return false end
|
||||||
if tostring(aaa) == 'true' then return false end
|
if tostring(aaa) == 'true' then return false end
|
||||||
if type(aaa) ~= "string" then return false end
|
if type(aaa) ~= "string" then return false end
|
||||||
data_len=split(aaa,list_list)
|
data_len=split(aaa,list_list)
|
||||||
|
|
||||||
--return return_message(200,data_len)
|
--return return_message(200,data_len)
|
||||||
if not data_len then return false end
|
if not data_len then return false end
|
||||||
if arrlen(data_len) ==0 then return false end
|
if arrlen(data_len) ==0 then return false end
|
||||||
|
|||||||
@@ -131,11 +131,14 @@ def confReplace():
|
|||||||
content = content.replace('{$OS_USER}', user)
|
content = content.replace('{$OS_USER}', user)
|
||||||
content = content.replace('{$OS_USER_GROUP}', user_group)
|
content = content.replace('{$OS_USER_GROUP}', user_group)
|
||||||
|
|
||||||
|
# 主配置文件
|
||||||
nconf = getServerDir() + '/nginx/conf/nginx.conf'
|
nconf = getServerDir() + '/nginx/conf/nginx.conf'
|
||||||
|
mw.writeFile(nconf, content)
|
||||||
|
|
||||||
__content = mw.readFile(nconf)
|
# 静态配置
|
||||||
if __content.find('#user'):
|
static_conf = getServerDir() + '/nginx/conf/enable-php-00.conf'
|
||||||
mw.writeFile(getServerDir() + '/nginx/conf/nginx.conf', content)
|
if not os.path.exists(static_conf):
|
||||||
|
mw.writeFile(static_conf, '')
|
||||||
|
|
||||||
# give nginx root permission
|
# give nginx root permission
|
||||||
ng_exe_bin = getServerDir() + "/nginx/sbin/nginx"
|
ng_exe_bin = getServerDir() + "/nginx/sbin/nginx"
|
||||||
@@ -262,7 +265,21 @@ def initdUinstall():
|
|||||||
def runInfo():
|
def runInfo():
|
||||||
# 取Openresty负载状态
|
# 取Openresty负载状态
|
||||||
try:
|
try:
|
||||||
result = mw.httpGet('http://127.0.0.1/nginx_status')
|
url = 'http://' + mw.getHostAddr() + '/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)
|
||||||
|
except Exception as e:
|
||||||
|
url = 'http://127.0.0.1/nginx_status'
|
||||||
|
result = mw.httpGet(url)
|
||||||
tmp = result.split()
|
tmp = result.split()
|
||||||
data = {}
|
data = {}
|
||||||
data['active'] = tmp[2]
|
data['active'] = tmp[2]
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ else
|
|||||||
useradd -g www -s /bin/bash www
|
useradd -g www -s /bin/bash www
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# cd /www/server/mdserver-web/plugins/openresty && /bin/bash install.sh install 1.21.4.1
|
||||||
Install_openresty()
|
Install_openresty()
|
||||||
{
|
{
|
||||||
mkdir -p ${openrestyDir}
|
mkdir -p ${openrestyDir}
|
||||||
@@ -37,14 +38,19 @@ Install_openresty()
|
|||||||
cd ${openrestyDir} && tar -zxvf openresty-${VERSION}.tar.gz
|
cd ${openrestyDir} && tar -zxvf openresty-${VERSION}.tar.gz
|
||||||
|
|
||||||
# --with-openssl=$serverPath/source/lib/openssl-1.0.2q
|
# --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_v2_module \
|
||||||
--with-http_ssl_module \
|
--with-http_ssl_module \
|
||||||
--with-http_slice_module \
|
--with-http_slice_module \
|
||||||
--with-http_stub_status_module && make && make install && \
|
--with-http_stub_status_module
|
||||||
echo "${VERSION}" > $serverPath/openresty/version.pl
|
|
||||||
|
|
||||||
|
|
||||||
|
make && make install && make clean
|
||||||
|
|
||||||
|
if [ -d $serverPath/openresty ];then
|
||||||
|
echo "${VERSION}" > $serverPath/openresty/version.pl
|
||||||
|
echo "" > $serverPath/openresty/nginx/conf/enable-php-00.conf
|
||||||
|
fi
|
||||||
echo '安装完成' > $install_tmp
|
echo '安装完成' > $install_tmp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+28
-15
@@ -521,25 +521,38 @@ def setFpmConfig(version):
|
|||||||
|
|
||||||
|
|
||||||
def checkFpmStatusFile(version):
|
def checkFpmStatusFile(version):
|
||||||
if mw.isInstalledWeb():
|
if not mw.isInstalledWeb():
|
||||||
sdir = mw.getServerDir()
|
return False
|
||||||
dfile = sdir + '/openresty/nginx/conf/php_status/phpfpm_status_' + version + '.conf'
|
|
||||||
if not os.path.exists(dfile):
|
dfile = getServerDir() + '/nginx/conf/php_status/phpfpm_status_' + version + '.conf'
|
||||||
tpl = getPluginDir() + '/conf/phpfpm_status.conf'
|
if not os.path.exists(dfile):
|
||||||
content = mw.readFile(tpl)
|
tpl = getPluginDir() + '/conf/phpfpm_status.conf'
|
||||||
content = contentReplace(content, version)
|
content = mw.readFile(tpl)
|
||||||
mw.writeFile(dfile, content)
|
content = contentReplace(content, version)
|
||||||
mw.restartWeb()
|
mw.writeFile(dfile, content)
|
||||||
|
mw.restartWeb()
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def getFpmStatus(version):
|
def getFpmStatus(version):
|
||||||
checkFpmStatusFile(version)
|
checkFpmStatusFile(version)
|
||||||
result = mw.httpGet(
|
|
||||||
'http://127.0.0.1/phpfpm_status_' + version + '?json')
|
try:
|
||||||
tmp = json.loads(result)
|
url = 'http://' + mw.getHostAddr() + '/phpfpm_status_' + version + '?json'
|
||||||
fTime = time.localtime(int(tmp['start time']))
|
result = mw.httpGet(url)
|
||||||
tmp['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime)
|
data = json.loads(result)
|
||||||
return mw.getJson(tmp)
|
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)
|
||||||
|
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:
|
||||||
|
data = {}
|
||||||
|
|
||||||
|
return mw.getJson(data)
|
||||||
|
|
||||||
|
|
||||||
def getDisableFunc(version):
|
def getDisableFunc(version):
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ function phpPost(method, version, args,callback){
|
|||||||
$.post('/plugins/run', req_data, function(data) {
|
$.post('/plugins/run', req_data, function(data) {
|
||||||
layer.close(loadT);
|
layer.close(loadT);
|
||||||
if (!data.status){
|
if (!data.status){
|
||||||
layer.msg(data.msg,{icon:0,time:2000,shade: [0.3, '#000']});
|
//错误展示10S
|
||||||
|
layer.msg(data.msg,{icon:0,time:2000,shade: [10, '#000']});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ rootPath=$(dirname "$rootPath")
|
|||||||
SERVER_ROOT=$rootPath/lib
|
SERVER_ROOT=$rootPath/lib
|
||||||
SOURCE_ROOT=$rootPath/source/lib
|
SOURCE_ROOT=$rootPath/source/lib
|
||||||
|
|
||||||
if [ ! -d ${SERVER_ROOT}/libiconv ];then
|
if [ ! -d ${SERVER_ROOT}/zlib ];then
|
||||||
|
|
||||||
cd $SOURCE_ROOT
|
cd $SOURCE_ROOT
|
||||||
if [ ! -f ${SOURCE_ROOT}/zlib-1.2.11.tar.gz ];then
|
if [ ! -f ${SOURCE_ROOT}/zlib-1.2.11.tar.gz ];then
|
||||||
|
|||||||
@@ -11,6 +11,46 @@ sysName=`uname`
|
|||||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
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
|
version=5.2.17
|
||||||
PHP_VER=52
|
PHP_VER=52
|
||||||
Install_php()
|
Install_php()
|
||||||
@@ -30,16 +70,16 @@ if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f $sourcePath/php/php-5.2.17-fpm-0.5.14.diff.gz ]; then
|
if [ ! -f $sourcePath/php/php-5.2.17-fpm-0.5.14.diff.gz ]; then
|
||||||
wget -O $sourcePath/php/php-5.2.17-fpm-0.5.14.diff.gz http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz
|
wget --no-check-certificate -O $sourcePath/php/php-5.2.17-fpm-0.5.14.diff.gz http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ ! -f $sourcePath/php/php-5.2.17-max-input-vars.patch ]; then
|
if [ ! -f $sourcePath/php/php-5.2.17-max-input-vars.patch ]; then
|
||||||
wget -O $sourcePath/php/php-5.2.17-max-input-vars.patch https://raw.github.com/laruence/laruence.github.com/master/php-5.2-max-input-vars/php-5.2.17-max-input-vars.patch
|
wget --no-check-certificate -O $sourcePath/php/php-5.2.17-max-input-vars.patch https://raw.github.com/laruence/laruence.github.com/master/php-5.2-max-input-vars/php-5.2.17-max-input-vars.patch
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f $sourcePath/php/php-5.x.x.patch ]; then
|
if [ ! -f $sourcePath/php/php-5.x.x.patch ]; then
|
||||||
wget -O $sourcePath/php/php-5.x.x.patch https://mail.gnome.org/archives/xml/2012-August/txtbgxGXAvz4N.txt
|
wget --no-check-certificate -O $sourcePath/php/php-5.x.x.patch https://mail.gnome.org/archives/xml/2012-August/txtbgxGXAvz4N.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ sysName=`uname`
|
|||||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
version=5.3.29
|
version=5.3.29
|
||||||
PHP_VER=53
|
PHP_VER=53
|
||||||
Install_php()
|
Install_php()
|
||||||
@@ -34,15 +35,6 @@ if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
|||||||
fi
|
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
|
if [ -f $serverPath/php/53/bin/php ];then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
@@ -92,8 +84,8 @@ if [ ! -d $serverPath/php/53 ];then
|
|||||||
--enable-sysvshm \
|
--enable-sysvshm \
|
||||||
--disable-fileinfo \
|
--disable-fileinfo \
|
||||||
$OPTIONS \
|
$OPTIONS \
|
||||||
--enable-fpm \
|
--enable-fpm
|
||||||
&& make && make install && make clean
|
make clean && make ${MAKEJN:--j2} && make install && make clean
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ else
|
|||||||
OPTIONS="${OPTIONS} --with-curl"
|
OPTIONS="${OPTIONS} --with-curl"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ ! -d $serverPath/php/${PHP_VER} ];then
|
if [ ! -d $serverPath/php/${PHP_VER} ];then
|
||||||
cd $sourcePath/php/php${PHP_VER} && ./configure \
|
cd $sourcePath/php/php${PHP_VER} && ./configure \
|
||||||
--prefix=$serverPath/php/${PHP_VER} \
|
--prefix=$serverPath/php/${PHP_VER} \
|
||||||
@@ -67,8 +68,37 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then
|
|||||||
--enable-sysvshm \
|
--enable-sysvshm \
|
||||||
--disable-fileinfo \
|
--disable-fileinfo \
|
||||||
$OPTIONS \
|
$OPTIONS \
|
||||||
--enable-fpm \
|
--enable-fpm
|
||||||
&& make && make install && make clean
|
|
||||||
|
make clean && make ${MAKEJN:--j2}
|
||||||
|
|
||||||
|
#debian11,没有生成php54 man
|
||||||
|
if [ ! -f sapi/cli/php.1 ];then
|
||||||
|
cp -rf sapi/cli/php.1.in sapi/cli/php.1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f sapi/cgi/php-cgi.1 ];then
|
||||||
|
cp -rf sapi/cgi/php-cgi.1.in sapi/cgi/php-cgi.1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f scripts/man1/phpize.1 ];then
|
||||||
|
cp -rf scripts/man1/phpize.1.in scripts/man1/phpize.1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f scripts/man1/php-config.1 ];then
|
||||||
|
cp -rf scripts/man1/php-config.1.in scripts/man1/php-config.1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f ext/phar/phar.1 ];then
|
||||||
|
cp -rf ext/phar/phar.1.in ext/phar/phar.1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f ext/phar/phar.phar.1 ];then
|
||||||
|
cp -rf ext/phar/phar.phar.1.in ext/phar/phar.phar.1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
make install && make clean
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------ install end ------------------------------------#
|
#------------------------ install end ------------------------------------#
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ if [ ! -d $serverPath/php/55 ];then
|
|||||||
--disable-intl \
|
--disable-intl \
|
||||||
--disable-fileinfo \
|
--disable-fileinfo \
|
||||||
$OPTIONS \
|
$OPTIONS \
|
||||||
--enable-fpm \
|
--enable-fpm
|
||||||
&& make && make install && make clean
|
make clean && make ${MAKEJN:--j2} && make install && make clean
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------ install end ------------------------------------#
|
#------------------------ install end ------------------------------------#
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ else
|
|||||||
OPTIONS="${OPTIONS} --with-curl"
|
OPTIONS="${OPTIONS} --with-curl"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ ! -d $serverPath/php/56 ];then
|
if [ ! -d $serverPath/php/56 ];then
|
||||||
cd $sourcePath/php/php${PHP_VER} && ./configure \
|
cd $sourcePath/php/php${PHP_VER} && ./configure \
|
||||||
--prefix=$serverPath/php/56 \
|
--prefix=$serverPath/php/56 \
|
||||||
@@ -69,8 +70,8 @@ if [ ! -d $serverPath/php/56 ];then
|
|||||||
--disable-intl \
|
--disable-intl \
|
||||||
--disable-fileinfo \
|
--disable-fileinfo \
|
||||||
$OPTIONS \
|
$OPTIONS \
|
||||||
--enable-fpm \
|
--enable-fpm
|
||||||
&& make clean && make && make install && make clean
|
make clean && make ${MAKEJN:--j2} && make install && make clean
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------ install end ------------------------------------#
|
#------------------------ install end ------------------------------------#
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ sourcePath=${serverPath}/source
|
|||||||
sysName=`uname`
|
sysName=`uname`
|
||||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||||
|
|
||||||
version=7.0.30
|
version=7.0.33
|
||||||
PHP_VER=70
|
PHP_VER=70
|
||||||
Install_php()
|
Install_php()
|
||||||
{
|
{
|
||||||
@@ -25,7 +25,7 @@ cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash zlib.sh
|
|||||||
|
|
||||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz http://au1.php.net/distributions/php-${version}.tar.xz
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php7/php-${version}.tar.xz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $sourcePath/php && tar -Jxf $sourcePath/php/php-${version}.tar.xz
|
cd $sourcePath/php && tar -Jxf $sourcePath/php/php-${version}.tar.xz
|
||||||
@@ -66,8 +66,8 @@ if [ ! -d $serverPath/php/70 ];then
|
|||||||
--disable-intl \
|
--disable-intl \
|
||||||
--disable-fileinfo \
|
--disable-fileinfo \
|
||||||
$OPTIONS \
|
$OPTIONS \
|
||||||
--enable-fpm \
|
--enable-fpm
|
||||||
&& make && make install && make clean
|
make clean && make ${MAKEJN:--j2} && make install && make clean
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------ install end ------------------------------------#
|
#------------------------ install end ------------------------------------#
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ else
|
|||||||
OPTIONS="${OPTIONS} --with-curl"
|
OPTIONS="${OPTIONS} --with-curl"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ ! -d $serverPath/php/71 ];then
|
if [ ! -d $serverPath/php/71 ];then
|
||||||
cd $sourcePath/php/php${PHP_VER} && ./configure \
|
cd $sourcePath/php/php${PHP_VER} && ./configure \
|
||||||
--prefix=$serverPath/php/71 \
|
--prefix=$serverPath/php/71 \
|
||||||
@@ -65,8 +66,8 @@ if [ ! -d $serverPath/php/71 ];then
|
|||||||
--disable-intl \
|
--disable-intl \
|
||||||
--disable-fileinfo \
|
--disable-fileinfo \
|
||||||
$OPTIONS \
|
$OPTIONS \
|
||||||
--enable-fpm \
|
--enable-fpm
|
||||||
&& make && make install && make clean
|
make clean && make ${MAKEJN:--j2} && make install && make clean
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------ install end ------------------------------------#
|
#------------------------ install end ------------------------------------#
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ else
|
|||||||
OPTIONS="${OPTIONS} --with-curl"
|
OPTIONS="${OPTIONS} --with-curl"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ ! -d $serverPath/php/72 ];then
|
if [ ! -d $serverPath/php/72 ];then
|
||||||
cd $sourcePath/php/php${PHP_VER} && ./configure \
|
cd $sourcePath/php/php${PHP_VER} && ./configure \
|
||||||
--prefix=$serverPath/php/72 \
|
--prefix=$serverPath/php/72 \
|
||||||
@@ -66,8 +67,8 @@ if [ ! -d $serverPath/php/72 ];then
|
|||||||
--disable-intl \
|
--disable-intl \
|
||||||
--disable-fileinfo \
|
--disable-fileinfo \
|
||||||
$OPTIONS \
|
$OPTIONS \
|
||||||
--enable-fpm \
|
--enable-fpm
|
||||||
&& make && make install && make clean
|
make clean && make ${MAKEJN:--j2} && make install && make clean
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------ install end ------------------------------------#
|
#------------------------ install end ------------------------------------#
|
||||||
|
|||||||
@@ -71,8 +71,8 @@ if [ ! -d $serverPath/php/73 ];then
|
|||||||
--disable-intl \
|
--disable-intl \
|
||||||
--disable-fileinfo \
|
--disable-fileinfo \
|
||||||
$OPTIONS \
|
$OPTIONS \
|
||||||
--enable-fpm \
|
--enable-fpm
|
||||||
&& make && make install && make clean
|
make clean && make ${MAKEJN:--j2} && make install && make clean
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------ install end ------------------------------------#
|
#------------------------ install end ------------------------------------#
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ sysName=`uname`
|
|||||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||||
|
|
||||||
|
|
||||||
version=7.4.30
|
version=7.4.26
|
||||||
PHP_VER=74
|
PHP_VER=74
|
||||||
Install_php()
|
Install_php()
|
||||||
{
|
{
|
||||||
@@ -28,7 +28,7 @@ cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash libzip.sh
|
|||||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||||
|
|
||||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz http://au1.php.net/distributions/php-${version}.tar.xz
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php7/php-${version}.tar.xz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $sourcePath/php && tar -Jxf $sourcePath/php/php-${version}.tar.xz
|
cd $sourcePath/php && tar -Jxf $sourcePath/php/php-${version}.tar.xz
|
||||||
@@ -49,13 +49,11 @@ if [ $sysName == 'Darwin' ]; then
|
|||||||
export LDFLAGS="-L/usr/local/opt/libxml2/lib"
|
export LDFLAGS="-L/usr/local/opt/libxml2/lib"
|
||||||
else
|
else
|
||||||
OPTIONS="--with-iconv=${serverPath}/lib/libiconv"
|
OPTIONS="--with-iconv=${serverPath}/lib/libiconv"
|
||||||
OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype"
|
|
||||||
OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf"
|
|
||||||
OPTIONS="${OPTIONS} --with-curl"
|
OPTIONS="${OPTIONS} --with-curl"
|
||||||
OPTIONS="${OPTIONS} --with-libzip=${serverPath}/lib/libzip"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo "$sourcePath/php/php${PHP_VER}"
|
echo "$sourcePath/php/php${PHP_VER}"
|
||||||
|
|
||||||
if [ ! -d $serverPath/php/${PHP_VER} ];then
|
if [ ! -d $serverPath/php/${PHP_VER} ];then
|
||||||
@@ -81,8 +79,8 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then
|
|||||||
--disable-intl \
|
--disable-intl \
|
||||||
--disable-fileinfo \
|
--disable-fileinfo \
|
||||||
$OPTIONS \
|
$OPTIONS \
|
||||||
--enable-fpm \
|
--enable-fpm
|
||||||
&& make && make install && make clean
|
make ${MAKEJN:--j2} && make install && make clean
|
||||||
fi
|
fi
|
||||||
#------------------------ install end ------------------------------------#
|
#------------------------ install end ------------------------------------#
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,13 +49,9 @@ if [ $sysName == 'Darwin' ]; then
|
|||||||
export LDFLAGS="-L/usr/local/opt/libxml2/lib"
|
export LDFLAGS="-L/usr/local/opt/libxml2/lib"
|
||||||
else
|
else
|
||||||
OPTIONS="--with-iconv=${serverPath}/lib/libiconv"
|
OPTIONS="--with-iconv=${serverPath}/lib/libiconv"
|
||||||
OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype"
|
|
||||||
OPTIONS="${OPTIONS} --with-gd"
|
|
||||||
OPTIONS="${OPTIONS} --with-curl"
|
OPTIONS="${OPTIONS} --with-curl"
|
||||||
OPTIONS="${OPTIONS} --with-libzip=${serverPath}/lib/libzip"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo "$sourcePath/php/php${PHP_VER}"
|
echo "$sourcePath/php/php${PHP_VER}"
|
||||||
|
|
||||||
if [ ! -d $serverPath/php/${PHP_VER} ];then
|
if [ ! -d $serverPath/php/${PHP_VER} ];then
|
||||||
@@ -81,8 +77,8 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then
|
|||||||
--disable-intl \
|
--disable-intl \
|
||||||
--disable-fileinfo \
|
--disable-fileinfo \
|
||||||
$OPTIONS \
|
$OPTIONS \
|
||||||
--enable-fpm \
|
--enable-fpm
|
||||||
&& make && make install && make clean
|
make clean && make ${MAKEJN:--j2} && make install && make clean
|
||||||
fi
|
fi
|
||||||
#------------------------ install end ------------------------------------#
|
#------------------------ install end ------------------------------------#
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then
|
|||||||
--disable-intl \
|
--disable-intl \
|
||||||
--disable-fileinfo \
|
--disable-fileinfo \
|
||||||
$OPTIONS \
|
$OPTIONS \
|
||||||
--enable-fpm \
|
--enable-fpm
|
||||||
&& make && make install && make clean
|
make clean && make ${MAKEJN:--j2} && make install && make clean
|
||||||
fi
|
fi
|
||||||
#------------------------ install end ------------------------------------#
|
#------------------------ install end ------------------------------------#
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ $cfg['Servers'][$i]['host'] = '127.0.0.1';
|
|||||||
$cfg['Servers'][$i]['connect_type'] = 'tcp';
|
$cfg['Servers'][$i]['connect_type'] = 'tcp';
|
||||||
$cfg['Servers'][$i]['compress'] = false;
|
$cfg['Servers'][$i]['compress'] = false;
|
||||||
$cfg['Servers'][$i]['AllowNoPassword'] = false;
|
$cfg['Servers'][$i]['AllowNoPassword'] = false;
|
||||||
|
$cfg['TempDir'] = '/www/server/phpmyadmin/tmp';
|
||||||
$cfg['UploadDir'] = '';
|
$cfg['UploadDir'] = '';
|
||||||
$cfg['SaveDir'] = '';
|
$cfg['SaveDir'] = '';
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
<p onclick="safeConf();">安全设置</p>
|
<p onclick="safeConf();">安全设置</p>
|
||||||
<p onclick="pluginLogs('phpmyadmin','','access_log');">访问日志</p>
|
<p onclick="pluginLogs('phpmyadmin','','access_log');">访问日志</p>
|
||||||
<p onclick="pluginLogs('phpmyadmin','','error_log');">错误日志</p>
|
<p onclick="pluginLogs('phpmyadmin','','error_log');">错误日志</p>
|
||||||
|
<p onclick="pluginConfig('phpmyadmin','','config_inc');" title="config.inc.php">配置</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="bt-w-con pd15">
|
<div class="bt-w-con pd15">
|
||||||
<div class="soft-man-con"></div>
|
<div class="soft-man-con"></div>
|
||||||
|
|||||||
@@ -48,6 +48,10 @@ def getConf():
|
|||||||
return mw.getServerDir() + '/web_conf/nginx/vhost/phpmyadmin.conf'
|
return mw.getServerDir() + '/web_conf/nginx/vhost/phpmyadmin.conf'
|
||||||
|
|
||||||
|
|
||||||
|
def getConfInc():
|
||||||
|
return getServerDir() + '/phpmyadmin/config.inc.php'
|
||||||
|
|
||||||
|
|
||||||
def getPort():
|
def getPort():
|
||||||
file = getConf()
|
file = getConf()
|
||||||
content = mw.readFile(file)
|
content = mw.readFile(file)
|
||||||
@@ -116,6 +120,10 @@ def start():
|
|||||||
centent = contentReplace(centent)
|
centent = contentReplace(centent)
|
||||||
mw.writeFile(file_run, centent)
|
mw.writeFile(file_run, centent)
|
||||||
|
|
||||||
|
tmp = getServerDir() + '/phpmyadmin/tmp'
|
||||||
|
if not os.path.exists(tmp):
|
||||||
|
os.mkdir(tmp)
|
||||||
|
|
||||||
conf_run = getServerDir() + '/phpmyadmin/config.inc.php'
|
conf_run = getServerDir() + '/phpmyadmin/config.inc.php'
|
||||||
if not os.path.exists(conf_run):
|
if not os.path.exists(conf_run):
|
||||||
conf_tpl = getPluginDir() + '/conf/config.inc.php'
|
conf_tpl = getPluginDir() + '/conf/config.inc.php'
|
||||||
@@ -208,6 +216,10 @@ def errorLog():
|
|||||||
return '/www/server/phpmyadmin/error.log'
|
return '/www/server/phpmyadmin/error.log'
|
||||||
|
|
||||||
|
|
||||||
|
def Version():
|
||||||
|
return mw.readFile(getServerDir() + '/version.pl')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
func = sys.argv[1]
|
func = sys.argv[1]
|
||||||
if func == 'status':
|
if func == 'status':
|
||||||
@@ -222,6 +234,10 @@ if __name__ == "__main__":
|
|||||||
print(reload())
|
print(reload())
|
||||||
elif func == 'conf':
|
elif func == 'conf':
|
||||||
print(getConf())
|
print(getConf())
|
||||||
|
elif func == 'version':
|
||||||
|
print(Version())
|
||||||
|
elif func == 'config_inc':
|
||||||
|
print(getConfInc())
|
||||||
elif func == 'get_home_page':
|
elif func == 'get_home_page':
|
||||||
print(getHomePage())
|
print(getHomePage())
|
||||||
elif func == 'set_php_ver':
|
elif func == 'set_php_ver':
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ Install_phpmyadmin()
|
|||||||
cp -r $serverPath/source/phpmyadmin/$FDIR $serverPath/phpmyadmin/
|
cp -r $serverPath/source/phpmyadmin/$FDIR $serverPath/phpmyadmin/
|
||||||
cd $serverPath/phpmyadmin/ && mv $FDIR phpmyadmin
|
cd $serverPath/phpmyadmin/ && mv $FDIR phpmyadmin
|
||||||
|
|
||||||
|
mkdir -p $serverPath/phpmyadmin/tmp
|
||||||
|
chown -R www:www $serverPath/phpmyadmin/tmp
|
||||||
|
|
||||||
echo "${1}" > ${serverPath}/phpmyadmin/version.pl
|
echo "${1}" > ${serverPath}/phpmyadmin/version.pl
|
||||||
echo '安装完成' > $install_tmp
|
echo '安装完成' > $install_tmp
|
||||||
|
|
||||||
|
|||||||
@@ -109,6 +109,16 @@ def initDreplace():
|
|||||||
content = contentReplace(content)
|
content = contentReplace(content)
|
||||||
mw.writeFile(pureFtpdConfig, content)
|
mw.writeFile(pureFtpdConfig, content)
|
||||||
|
|
||||||
|
# systemd
|
||||||
|
systemDir = '/lib/systemd/system'
|
||||||
|
systemService = systemDir + '/pureftp.service'
|
||||||
|
systemServiceTpl = getPluginDir() + '/init.d/pureftp.service.tpl'
|
||||||
|
if os.path.exists(systemDir) and not os.path.exists(systemService):
|
||||||
|
se_content = mw.readFile(systemServiceTpl)
|
||||||
|
se_content = se_content.replace('{$SERVER_PATH}', service_path)
|
||||||
|
mw.writeFile(systemService, se_content)
|
||||||
|
mw.execShell('systemctl daemon-reload')
|
||||||
|
|
||||||
return file_bin
|
return file_bin
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"tip":"soft",
|
"tip":"soft",
|
||||||
"name":"pureftp",
|
"name":"pureftp",
|
||||||
"ps":"一款免费FTP服务器软件",
|
"ps":"一款免费FTP服务器软件",
|
||||||
"versions": "1.0.51",
|
"versions": "1.0.49",
|
||||||
"shell":"install.sh",
|
"shell":"install.sh",
|
||||||
"checks":"server/pureftp",
|
"checks":"server/pureftp",
|
||||||
"path":"server/pureftp",
|
"path":"server/pureftp",
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Pure-FTPd is a fast, production-quality, standard-conformant FTP server
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=forking
|
||||||
|
ExecStart={$SERVER_PATH}/pureftp/sbin/pure-ftpd {$SERVER_PATH}/pureftp/etc/pure-ftpd.conf --daemonize
|
||||||
|
ExecStop=/bin/kill -HUP $MAINPID
|
||||||
|
ExecReload=/bin/kill -USR2 $MAINPID
|
||||||
|
Restart=on-failure
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
+32
-11
@@ -30,28 +30,49 @@ fi
|
|||||||
|
|
||||||
Install_pureftp()
|
Install_pureftp()
|
||||||
{
|
{
|
||||||
mkdir -p ${serverPath}/pureftp
|
# mkdir -p ${serverPath}/pureftp
|
||||||
mkdir -p ${serverPath}/source/pureftp
|
mkdir -p ${serverPath}/source/pureftp
|
||||||
|
|
||||||
|
# https://github.com/jedisct1/pure-ftpd/releases/download/1.0.49/pure-ftpd-1.0.49.tar.gz
|
||||||
|
# https://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.49.tar.gz
|
||||||
|
# DOWNLOAD=https://github.com/jedisct1/pure-ftpd/releases/download/${VER}/pure-ftpd-${VER}.tar.gz
|
||||||
|
|
||||||
VER=$1
|
VER=$1
|
||||||
FILE=pure-ftpd-${VER}.tar.gz
|
DOWNLOAD=https://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-${VER}.tar.gz
|
||||||
FDIR=pure-ftpd-${VER}
|
|
||||||
DOWNLOAD=https://download.pureftpd.org/pub/pure-ftpd/releases/$FILE
|
|
||||||
|
if [ ! -f $serverPath/source/pureftp/pure-ftpd-${VER}.tar.gz ];then
|
||||||
|
wget --no-check-certificate -O $serverPath/source/pureftp/pure-ftpd-${VER}.tar.gz $DOWNLOAD
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [ ! -f $serverPath/source/pureftp/$FILE ];then
|
#检测文件是否损坏.
|
||||||
wget -O $serverPath/source/pureftp/$FILE $DOWNLOAD
|
md5_ok=451879495ba61c1d7dcfca8dd231119f
|
||||||
|
if [ -f $serverPath/source/pureftp/pure-ftpd-${VER}.tar.gz ];then
|
||||||
|
md5_check=`md5sum $serverPath/source/pureftp/pure-ftpd-${VER}.tar.gz | awk '{print $1}'`
|
||||||
|
if [ "${md5_ok}" == "${md5_check}" ]; then
|
||||||
|
echo "pure-ftpd file check ok"
|
||||||
|
else
|
||||||
|
# 重新下载
|
||||||
|
rm -rf $serverPath/source/pureftp/pure-ftpd-${VER}
|
||||||
|
wget --no-check-certificate -O $serverPath/source/pureftp/pure-ftpd-${VER}.tar.gz $DOWNLOAD
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d $serverPath/source/pureftp/$FDIR ];then
|
if [ ! -d $serverPath/source/pureftp/pure-ftpd-${VER} ];then
|
||||||
cd $serverPath/source/pureftp && tar zxvf $FILE
|
cd $serverPath/source/pureftp && tar zxvf pure-ftpd-${VER}.tar.gz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $serverPath/source/pureftp/$FDIR && ./configure --prefix=${serverPath}/pureftp \
|
cd $serverPath/source/pureftp/pure-ftpd-${VER} && ./configure --prefix=${serverPath}/pureftp \
|
||||||
--with-everything && make && make install && make clean
|
--with-everything && make && make install && make clean
|
||||||
|
|
||||||
echo "${1}" > ${serverPath}/pureftp/version.pl
|
if [ -d ${serverPath}/pureftp ];then
|
||||||
echo '安装完成' > $install_tmp
|
echo "${1}" > ${serverPath}/pureftp/version.pl
|
||||||
|
echo '安装完成' > $install_tmp
|
||||||
|
else
|
||||||
|
echo '安装失败' > $install_tmp
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
Uninstall_pureftp()
|
Uninstall_pureftp()
|
||||||
|
|||||||
@@ -96,9 +96,12 @@ def initDreplace():
|
|||||||
|
|
||||||
# config replace
|
# config replace
|
||||||
dst_conf = getServerDir() + '/redis.conf'
|
dst_conf = getServerDir() + '/redis.conf'
|
||||||
conf_content = mw.readFile(getConfTpl())
|
dst_conf_init = getServerDir() + '/init.pl'
|
||||||
conf_content = conf_content.replace('{$SERVER_PATH}', service_path)
|
if not os.path.exists(dst_conf_init):
|
||||||
mw.writeFile(dst_conf, conf_content)
|
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
|
# systemd
|
||||||
systemDir = '/lib/systemd/system'
|
systemDir = '/lib/systemd/system'
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
#禁止弱口令登录改良版
|
|
||||||
|
|
||||||
cat /var/log/secure|awk '/Failed/{print $(NF-3)}'|sort|uniq -c|awk '{print $2"="$1;}' > black.txt #尝试登录的次数和ip
|
|
||||||
|
|
||||||
DEFINE="5" #单个ip尝试登录最大值
|
|
||||||
|
|
||||||
for i in `cat /root/black.txt`
|
|
||||||
do
|
|
||||||
|
|
||||||
IP=`echo $i |awk -F= '{print $1}'`
|
|
||||||
NUM=`echo $i|awk -F= '{print $2}'`
|
|
||||||
|
|
||||||
if [ $NUM -gt $DEFINE ]; then
|
|
||||||
grep $IP /etc/hosts.deny > /dev/null
|
|
||||||
|
|
||||||
if [ $? -gt 0 ]; then
|
|
||||||
echo "sshd:$IP" >> /etc/hosts.deny #扔到hosts文件中
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
<p class="bgw" onclick="pluginService('varnish');">服务</p>
|
<p class="bgw" onclick="pluginService('varnish');">服务</p>
|
||||||
<p onclick="pluginInitD('varnish');">自启动</p>
|
<p onclick="pluginInitD('varnish');">自启动</p>
|
||||||
<p onclick="pluginConfigTpl('varnish');">VCL</p>
|
<p onclick="pluginConfigTpl('varnish');">VCL</p>
|
||||||
|
<p onclick="varnishPluginConfig('varnish','','conf_service');">服务配置</p>
|
||||||
<p onclick="pluginLogs('varnish','','run_log');">日志</p>
|
<p onclick="pluginLogs('varnish','','run_log');">日志</p>
|
||||||
<p onclick="varnishStatus();">状态</p>
|
<p onclick="varnishStatus();">状态</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+22
-24
@@ -81,33 +81,29 @@ def status():
|
|||||||
return 'start'
|
return 'start'
|
||||||
|
|
||||||
|
|
||||||
def start():
|
def vaOp(method):
|
||||||
data = mw.execShell('systemctl start ' + getPluginName())
|
mw.execShell("systemctl daemon-reload")
|
||||||
|
data = mw.execShell('systemctl ' + method + ' ' + getPluginName())
|
||||||
if data[1] == '':
|
if data[1] == '':
|
||||||
return 'ok'
|
return 'ok'
|
||||||
return 'fail'
|
return 'fail'
|
||||||
|
|
||||||
|
|
||||||
|
def start():
|
||||||
|
return vaOp('start')
|
||||||
|
|
||||||
|
|
||||||
def stop():
|
def stop():
|
||||||
data = mw.execShell('systemctl stop ' + getPluginName())
|
return vaOp('stop')
|
||||||
if data[1] == '':
|
|
||||||
return 'ok'
|
|
||||||
return 'fail'
|
|
||||||
|
|
||||||
|
|
||||||
def restart():
|
def restart():
|
||||||
data = mw.execShell('systemctl restart ' + getPluginName())
|
return vaOp('restart')
|
||||||
if data[1] == '':
|
|
||||||
return 'ok'
|
|
||||||
return 'fail'
|
|
||||||
|
|
||||||
|
|
||||||
def reload():
|
def reload():
|
||||||
# file = initDreplace()
|
# file = initDreplace()
|
||||||
data = mw.execShell('systemctl reload ' + getPluginName())
|
return vaOp('reload')
|
||||||
if data[1] == '':
|
|
||||||
return 'ok'
|
|
||||||
return 'fail'
|
|
||||||
|
|
||||||
|
|
||||||
def runInfo():
|
def runInfo():
|
||||||
@@ -138,9 +134,8 @@ def readConfigTpl():
|
|||||||
|
|
||||||
|
|
||||||
def initdStatus():
|
def initdStatus():
|
||||||
if not app_debug:
|
if mw.isAppleSystem():
|
||||||
if mw.isAppleSystem():
|
return "Apple Computer does not support"
|
||||||
return "Apple Computer does not support"
|
|
||||||
|
|
||||||
shell_cmd = 'systemctl status ' + \
|
shell_cmd = 'systemctl status ' + \
|
||||||
getPluginName() + ' | grep loaded | grep "enabled;"'
|
getPluginName() + ' | grep loaded | grep "enabled;"'
|
||||||
@@ -151,19 +146,16 @@ def initdStatus():
|
|||||||
|
|
||||||
|
|
||||||
def initdInstall():
|
def initdInstall():
|
||||||
import shutil
|
if mw.isAppleSystem():
|
||||||
if not app_debug:
|
return "Apple Computer does not support"
|
||||||
if mw.isAppleSystem():
|
|
||||||
return "Apple Computer does not support"
|
|
||||||
|
|
||||||
mw.execShell('systemctl enable ' + getPluginName())
|
mw.execShell('systemctl enable ' + getPluginName())
|
||||||
return 'ok'
|
return 'ok'
|
||||||
|
|
||||||
|
|
||||||
def initdUinstall():
|
def initdUinstall():
|
||||||
if not app_debug:
|
if mw.isAppleSystem():
|
||||||
if mw.isAppleSystem():
|
return "Apple Computer does not support"
|
||||||
return "Apple Computer does not support"
|
|
||||||
|
|
||||||
mw.execShell('systemctl disable ' + getPluginName())
|
mw.execShell('systemctl disable ' + getPluginName())
|
||||||
return 'ok'
|
return 'ok'
|
||||||
@@ -172,6 +164,10 @@ def initdUinstall():
|
|||||||
def runLog():
|
def runLog():
|
||||||
return "/var/log/varnish/varnishncsa.log"
|
return "/var/log/varnish/varnishncsa.log"
|
||||||
|
|
||||||
|
|
||||||
|
def confService():
|
||||||
|
return '/lib/systemd/system/varnish.service'
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
func = sys.argv[1]
|
func = sys.argv[1]
|
||||||
if func == 'status':
|
if func == 'status':
|
||||||
@@ -194,6 +190,8 @@ if __name__ == "__main__":
|
|||||||
print(runInfo())
|
print(runInfo())
|
||||||
elif func == 'conf':
|
elif func == 'conf':
|
||||||
print(getConf())
|
print(getConf())
|
||||||
|
elif func == 'conf_service':
|
||||||
|
print(confService())
|
||||||
elif func == 'run_log':
|
elif func == 'run_log':
|
||||||
print(runLog())
|
print(runLog())
|
||||||
elif func == 'config_tpl':
|
elif func == 'config_tpl':
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ function pRead(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//redis负载状态 start
|
//varnish负载状态 start
|
||||||
function varnishStatus() {
|
function varnishStatus() {
|
||||||
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
|
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
|
||||||
$.post('/plugins/run', {name:'varnish', func:'run_info'}, function(data) {
|
$.post('/plugins/run', {name:'varnish', func:'run_info'}, function(data) {
|
||||||
@@ -20,7 +20,7 @@ function varnishStatus() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var rdata = $.parseJSON(data.data);
|
var rdata = $.parseJSON(data.data);
|
||||||
// console.log(rdata);
|
console.log(rdata);
|
||||||
|
|
||||||
var tmp = "";
|
var tmp = "";
|
||||||
for (let i in rdata) {
|
for (let i in rdata) {
|
||||||
@@ -41,4 +41,61 @@ function varnishStatus() {
|
|||||||
$(".soft-man-con").html(Con);
|
$(".soft-man-con").html(Con);
|
||||||
},'json');
|
},'json');
|
||||||
}
|
}
|
||||||
//redis负载状态 end
|
//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 = '<p style="color: #666; margin-bottom: 7px">提示:Ctrl+F 搜索关键字,Ctrl+G 查找下一个,Ctrl+S 保存,Ctrl+Shift+R 查找替换!</p>\
|
||||||
|
<textarea class="bt-input-text" style="height: 320px; line-height:18px;" id="textBody"></textarea>\
|
||||||
|
<button id="onlineEditFileBtn" class="btn btn-success btn-sm" style="margin-top:10px;">保存</button>\
|
||||||
|
<ul class="help-info-text c7 ptb15">\
|
||||||
|
<li>此处为'+ _name + version +'主配置文件,若您不了解配置规则,请勿随意修改。</li>\
|
||||||
|
</ul>';
|
||||||
|
$(".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');
|
||||||
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ Uninstall_xh()
|
|||||||
{
|
{
|
||||||
rm -rf ${serverPath}/xhprof
|
rm -rf ${serverPath}/xhprof
|
||||||
cd /tmp/xhprof && rm -rf *.xhprof
|
cd /tmp/xhprof && rm -rf *.xhprof
|
||||||
|
rm -f /www/server/web_conf/nginx/vhost/xhprof.conf
|
||||||
echo '卸载完成' > $install_tmp
|
echo '卸载完成' > $install_tmp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -15,13 +15,13 @@ flask-sqlalchemy==2.3.2
|
|||||||
cryptography==3.3.2
|
cryptography==3.3.2
|
||||||
requests==2.20.0
|
requests==2.20.0
|
||||||
ConfigParser==5.2.0
|
ConfigParser==5.2.0
|
||||||
python-engineio==3.13.2
|
python-engineio==4.3.2
|
||||||
python-socketio==4.2.0
|
python-socketio>=4.2.0
|
||||||
Flask-SocketIO==3.0.2
|
flask-socketio==5.2.0
|
||||||
zmq==0.0.0
|
zmq==0.0.0
|
||||||
|
paramiko>=2.8.0
|
||||||
pymongo
|
pymongo
|
||||||
pillow
|
pillow
|
||||||
Jinja2>=2.11.2
|
Jinja2>=2.11.2
|
||||||
mysqlclient>=2.0.3
|
|
||||||
flask-caching>=1.10.1
|
flask-caching>=1.10.1
|
||||||
mysql-connector-python
|
mysql-connector-python
|
||||||
|
|||||||
+45
-14
@@ -315,7 +315,7 @@ def index(reqClass=None, reqAction=None, reqData=None):
|
|||||||
'plugins_api', 'system_api', 'site_api', 'task_api')
|
'plugins_api', 'system_api', 'site_api', 'task_api')
|
||||||
className = reqClass + '_api'
|
className = reqClass + '_api'
|
||||||
if not className in classFile:
|
if not className in classFile:
|
||||||
return "error"
|
return "api request error"
|
||||||
|
|
||||||
eval_str = "__import__('" + className + "')." + className + '()'
|
eval_str = "__import__('" + className + "')." + className + '()'
|
||||||
newInstance = eval(eval_str)
|
newInstance = eval(eval_str)
|
||||||
@@ -323,13 +323,9 @@ def index(reqClass=None, reqAction=None, reqData=None):
|
|||||||
return publicObject(newInstance, reqAction)
|
return publicObject(newInstance, reqAction)
|
||||||
|
|
||||||
|
|
||||||
|
##################### ssh start ###########################
|
||||||
ssh = None
|
ssh = None
|
||||||
shell = None
|
shell = None
|
||||||
try:
|
|
||||||
import paramiko
|
|
||||||
ssh = paramiko.SSHClient()
|
|
||||||
except:
|
|
||||||
mw.execShell('pip3 install paramiko &')
|
|
||||||
|
|
||||||
|
|
||||||
def create_rsa():
|
def create_rsa():
|
||||||
@@ -340,12 +336,21 @@ def create_rsa():
|
|||||||
|
|
||||||
|
|
||||||
def clear_ssh():
|
def clear_ssh():
|
||||||
|
# 服务器IP
|
||||||
|
ip = mw.getHostAddr()
|
||||||
sh = '''
|
sh = '''
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
PLIST=`who | grep localhost | awk '{print $2}'`
|
PLIST=`who | grep localhost | awk '{print $2}'`
|
||||||
for i in $PLIST
|
for i in $PLIST
|
||||||
do
|
do
|
||||||
ps -t /dev/$i |grep -v TTY |awk '{print $1}' | xargs kill -9
|
ps -t /dev/$i |grep -v TTY | awk '{print $1}' | xargs kill -9
|
||||||
|
done
|
||||||
|
|
||||||
|
#getHostAddr
|
||||||
|
PLIST=`who | grep "${ip}" | awk '{print $2}'`
|
||||||
|
for i in $PLIST
|
||||||
|
do
|
||||||
|
ps -t /dev/$i |grep -v TTY | awk '{print $1}' | xargs kill -9
|
||||||
done
|
done
|
||||||
'''
|
'''
|
||||||
if not mw.isAppleSystem():
|
if not mw.isAppleSystem():
|
||||||
@@ -355,21 +360,32 @@ done
|
|||||||
|
|
||||||
def connect_ssh():
|
def connect_ssh():
|
||||||
# print 'connect_ssh ....'
|
# print 'connect_ssh ....'
|
||||||
clear_ssh()
|
# clear_ssh()
|
||||||
global shell, ssh
|
global shell, ssh
|
||||||
if not os.path.exists('/root/.ssh/authorized_keys') or not os.path.exists('/root/.ssh/id_rsa') or not os.path.exists('/root/.ssh/id_rsa.pub'):
|
if not os.path.exists('/root/.ssh/authorized_keys') or not os.path.exists('/root/.ssh/id_rsa') or not os.path.exists('/root/.ssh/id_rsa.pub'):
|
||||||
create_rsa()
|
create_rsa()
|
||||||
|
|
||||||
|
# 检查是否写入authorized_keys
|
||||||
|
data = mw.execShell("cat /root/.ssh/id_rsa.pub | awk '{print $3}'")
|
||||||
|
if data[0] != "":
|
||||||
|
ak_data = mw.execShell(
|
||||||
|
"cat /root/.ssh/authorized_keys | grep " + data[0])
|
||||||
|
if ak_data[0] == "":
|
||||||
|
mw.execShell(
|
||||||
|
'cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys')
|
||||||
|
mw.execShell('chmod 600 /root/.ssh/authorized_keys')
|
||||||
|
|
||||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
ssh.connect(mw.getHostAddr(), mw.getSSHPort(), timeout=5)
|
||||||
|
except Exception as e:
|
||||||
|
ssh.connect('127.0.0.1', mw.getSSHPort())
|
||||||
|
except Exception as e:
|
||||||
ssh.connect('localhost', mw.getSSHPort())
|
ssh.connect('localhost', mw.getSSHPort())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if mw.getSSHStatus():
|
return False
|
||||||
try:
|
|
||||||
ssh.connect('127.0.0.1', mw.getSSHPort())
|
|
||||||
except:
|
|
||||||
return False
|
|
||||||
ssh.connect('127.0.0.1', mw.getSSHPort())
|
|
||||||
shell = ssh.invoke_shell(term='xterm', width=83, height=21)
|
shell = ssh.invoke_shell(term='xterm', width=83, height=21)
|
||||||
shell.setblocking(0)
|
shell.setblocking(0)
|
||||||
return True
|
return True
|
||||||
@@ -420,6 +436,7 @@ def connected_msg(msg):
|
|||||||
ssh_success = True
|
ssh_success = True
|
||||||
if not shell:
|
if not shell:
|
||||||
ssh_success = connect_ssh()
|
ssh_success = connect_ssh()
|
||||||
|
# print(ssh_success)
|
||||||
if not ssh_success:
|
if not ssh_success:
|
||||||
emit('server_response', {'data': '连接SSH服务失败!\r\n'})
|
emit('server_response', {'data': '连接SSH服务失败!\r\n'})
|
||||||
return
|
return
|
||||||
@@ -430,3 +447,17 @@ def connected_msg(msg):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
# print 'connected_msg:' + str(e)
|
# print 'connected_msg:' + str(e)
|
||||||
|
|
||||||
|
|
||||||
|
if not mw.isAppleSystem():
|
||||||
|
try:
|
||||||
|
import paramiko
|
||||||
|
ssh = paramiko.SSHClient()
|
||||||
|
|
||||||
|
# 启动尝试时连接
|
||||||
|
# connect_ssh()
|
||||||
|
except Exception as e:
|
||||||
|
print("本地终端无法使用")
|
||||||
|
|
||||||
|
|
||||||
|
##################### ssh end ###########################
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ function setIPv6() {
|
|||||||
$.post('/config/set_ipv6_status', {}, function (rdata) {
|
$.post('/config/set_ipv6_status', {}, function (rdata) {
|
||||||
layer.close(loadT);
|
layer.close(loadT);
|
||||||
layer.msg(rdata.msg, {icon:rdata.status?1:2});
|
layer.msg(rdata.msg, {icon:rdata.status?1:2});
|
||||||
setTimeout(function(){window.location.reload();},1500);
|
setTimeout(function(){window.location.reload();},5000);
|
||||||
},'json');
|
},'json');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1310,7 +1310,7 @@ function setChmod(action,fileName){
|
|||||||
var chown = $("#chown").val();
|
var chown = $("#chown").val();
|
||||||
var data = 'filename='+ encodeURIComponent(fileName)+'&user='+chown+'&access='+chmod;
|
var data = 'filename='+ encodeURIComponent(fileName)+'&user='+chown+'&access='+chmod;
|
||||||
var loadT = layer.msg('正在设置...',{icon:16,time:0,shade: [0.3, '#000']});
|
var loadT = layer.msg('正在设置...',{icon:16,time:0,shade: [0.3, '#000']});
|
||||||
$.post('files/set_file_access',data,function(rdata){
|
$.post('/files/set_file_access',data,function(rdata){
|
||||||
layer.close(loadT);
|
layer.close(loadT);
|
||||||
if(rdata.status) layer.closeAll();
|
if(rdata.status) layer.closeAll();
|
||||||
layer.msg(rdata.msg,{icon:rdata.status?1:2});
|
layer.msg(rdata.msg,{icon:rdata.status?1:2});
|
||||||
|
|||||||
@@ -1088,15 +1088,17 @@ function execLog(){
|
|||||||
function remind(a){
|
function remind(a){
|
||||||
a = a == undefined ? 1 : a;
|
a = a == undefined ? 1 : a;
|
||||||
$.post("/task/list", "table=tasks&result=2,4,6,8&limit=10&p=" + a, function(g) {
|
$.post("/task/list", "table=tasks&result=2,4,6,8&limit=10&p=" + a, function(g) {
|
||||||
|
// console.log(g);
|
||||||
var e = "";
|
var e = "";
|
||||||
var f = false;
|
var f = false;
|
||||||
var task_count = 0;
|
var task_count = 0;
|
||||||
for(var d = 0; d < g.data.length; d++) {
|
for(var d = 0; d < g.data.length; d++) {
|
||||||
if(g.data[d].status != '1'){
|
if(g.data[d].status != '1'){
|
||||||
task_count++;
|
task_count++;
|
||||||
continue;
|
e += '<tr><td><input type="checkbox"></td><td><div class="titlename c3">'+g.data[d].name+'</span><span class="rs-status">【'+lan.bt.task_the+'】<span><span class="rs-time">'+ lan.bt.time + (g.data[d].end - g.data[d].start) + lan.bt.s+'</span></div></td><td class="text-right c3">'+g.data[d].addtime+'</td></tr>'
|
||||||
|
} else{
|
||||||
|
e += '<tr><td><input type="checkbox"></td><td><div class="titlename c3">'+g.data[d].name+'</span><span class="rs-status">【'+lan.bt.task_ok+'】<span><span class="rs-time">'+ lan.bt.time + (g.data[d].end - g.data[d].start) + lan.bt.s+'</span></div></td><td class="text-right c3">'+g.data[d].addtime+'</td></tr>';
|
||||||
}
|
}
|
||||||
e += '<tr><td><input type="checkbox"></td><td><div class="titlename c3">'+g.data[d].name+'</span><span class="rs-status">【'+lan.bt.task_ok+'】<span><span class="rs-time">'+ lan.bt.time + (g.data[d].end - g.data[d].start) + lan.bt.s+'</span></div></td><td class="text-right c3">'+g.data[d].addtime+'</td></tr>'
|
|
||||||
}
|
}
|
||||||
var con = '<div class="divtable"><table class="table table-hover">\
|
var con = '<div class="divtable"><table class="table table-hover">\
|
||||||
<thead><tr><th width="20"><input id="Rs-checkAll" type="checkbox" onclick="RscheckSelect()"></th><th>'+lan.bt.task_name+'</th><th class="text-right">'+lan.bt.task_time+'</th></tr></thead>\
|
<thead><tr><th width="20"><input id="Rs-checkAll" type="checkbox" onclick="RscheckSelect()"></th><th>'+lan.bt.task_name+'</th><th class="text-right">'+lan.bt.task_time+'</th></tr></thead>\
|
||||||
@@ -1112,7 +1114,7 @@ function remind(a){
|
|||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
$(".task_count").text(task_count);
|
$(".task_count").text(task_count);
|
||||||
$(".msg_count").text(g.data.length);
|
$(".msg_count").text(g.count);
|
||||||
$(".taskcon").html(con);
|
$(".taskcon").html(con);
|
||||||
$("#taskPage").html(g.page);
|
$("#taskPage").html(g.page);
|
||||||
|
|
||||||
@@ -1592,7 +1594,8 @@ function pluginOpService(a, b, v) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
location.reload();
|
// location.reload();
|
||||||
|
getSList();
|
||||||
},2000);
|
},2000);
|
||||||
},'json').error(function() {
|
},'json').error(function() {
|
||||||
layer.close(e);
|
layer.close(e);
|
||||||
|
|||||||
@@ -1085,7 +1085,7 @@ function setSecurity(name,id){
|
|||||||
$.post('/site/set_security',data,function(rdata){
|
$.post('/site/set_security',data,function(rdata){
|
||||||
layer.close(loadT);
|
layer.close(loadT);
|
||||||
layer.msg(rdata.msg,{icon:rdata.status?1:2});
|
layer.msg(rdata.msg,{icon:rdata.status?1:2});
|
||||||
if(rdata.status) setTimeout(function(){Security(id,name);},1000);
|
if(rdata.status) setTimeout(function(){security(id,name);},1000);
|
||||||
},'json');
|
},'json');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ function getSList(isdisplay) {
|
|||||||
var loadT = layer.msg('正在获取列表...', { icon: 16, time: 0, shade: [0.3, '#000'] })
|
var loadT = layer.msg('正在获取列表...', { icon: 16, time: 0, shade: [0.3, '#000'] })
|
||||||
}
|
}
|
||||||
if (!isdisplay || isdisplay === true)
|
if (!isdisplay || isdisplay === true)
|
||||||
isdisplay = getCookie('p' + getCookie('softType'));
|
isdisplay = getCookie('p' + getCookie('soft_type'));
|
||||||
if (isdisplay == true || isdisplay == 'true') isdisplay = 1;
|
if (isdisplay == true || isdisplay == 'true') isdisplay = 1;
|
||||||
|
|
||||||
var search = $("#SearchValue").val();
|
var search = $("#SearchValue").val();
|
||||||
@@ -41,7 +41,7 @@ function getSList(isdisplay) {
|
|||||||
search = '&search=' + search;
|
search = '&search=' + search;
|
||||||
}
|
}
|
||||||
var type = '';
|
var type = '';
|
||||||
var istype = getCookie('softType');
|
var istype = getCookie('soft_type');
|
||||||
if (istype == 'undefined' || istype == 'null' || !istype) {
|
if (istype == 'undefined' || istype == 'null' || !istype) {
|
||||||
istype = '0';
|
istype = '0';
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ function getSList(isdisplay) {
|
|||||||
var page = '';
|
var page = '';
|
||||||
if (isdisplay) {
|
if (isdisplay) {
|
||||||
page = '&p=' + isdisplay;
|
page = '&p=' + isdisplay;
|
||||||
setCookie('p' + getCookie('softType'), isdisplay);
|
setCookie('p' + getCookie('soft_type'), isdisplay);
|
||||||
}
|
}
|
||||||
|
|
||||||
var condition = (search + type + page).slice(1);
|
var condition = (search + type + page).slice(1);
|
||||||
@@ -106,7 +106,7 @@ function getSList(isdisplay) {
|
|||||||
var mupdate = '';//(plugin.versions[n] == plugin.updates[n]) '' : '<a class="btlink" onclick="SoftUpdate(\'' + plugin.name + '\',\'' + plugin.versions[n].version + '\',\'' + plugin.updates[n] + '\')">更新</a> | ';
|
var mupdate = '';//(plugin.versions[n] == plugin.updates[n]) '' : '<a class="btlink" onclick="SoftUpdate(\'' + plugin.name + '\',\'' + plugin.versions[n].version + '\',\'' + plugin.updates[n] + '\')">更新</a> | ';
|
||||||
// if (plugin.versions[n] == '') mupdate = '';
|
// if (plugin.versions[n] == '') mupdate = '';
|
||||||
handle = mupdate + '<a class="btlink" onclick="softMain(\'' + plugin.name + '\',\'' + plugin.setup_version + '\')">设置</a> | <a class="btlink" onclick="uninstallVersion(\'' + plugin.name + '\',\'' + plugin.setup_version + '\')">卸载</a>';
|
handle = mupdate + '<a class="btlink" onclick="softMain(\'' + plugin.name + '\',\'' + plugin.setup_version + '\')">设置</a> | <a class="btlink" onclick="uninstallVersion(\'' + plugin.name + '\',\'' + plugin.setup_version + '\')">卸载</a>';
|
||||||
titleClick = 'onclick="softMain(\'' + plugin.name + '\',\'' + version_info + '\')" style="cursor:pointer"';
|
titleClick = 'onclick="softMain(\'' + plugin.name + '\',\'' + plugin.setup_version + '\')" style="cursor:pointer"';
|
||||||
|
|
||||||
softPath = '<span class="glyphicon glyphicon-folder-open" title="' + plugin.path + '" onclick="openPath(\'' + plugin.path + '\')"></span>';
|
softPath = '<span class="glyphicon glyphicon-folder-open" title="' + plugin.path + '" onclick="openPath(\'' + plugin.path + '\')"></span>';
|
||||||
if (plugin.coexist){
|
if (plugin.coexist){
|
||||||
@@ -162,7 +162,7 @@ function getSList(isdisplay) {
|
|||||||
sBody += pBody;
|
sBody += pBody;
|
||||||
$("#softList").html(sBody);
|
$("#softList").html(sBody);
|
||||||
$(".menu-sub span").click(function() {
|
$(".menu-sub span").click(function() {
|
||||||
setCookie('softType', $(this).attr('typeid'));
|
setCookie('soft_type', $(this).attr('typeid'));
|
||||||
$(this).addClass("on").siblings().removeClass("on");
|
$(this).addClass("on").siblings().removeClass("on");
|
||||||
getSList();
|
getSList();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ html {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border:transparent 1px solid;
|
border:transparent 1px solid;
|
||||||
min-height: 20px;
|
min-height: 20px;
|
||||||
min-width: 150px;
|
/*min-width: 150px;*/
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
.input-edit:hover{
|
.input-edit:hover{
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 59 KiB |
+7
-3
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+93
-56
@@ -26,62 +26,71 @@ else
|
|||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
mw_start_panel()
|
||||||
mw_start(){
|
{
|
||||||
isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'`
|
isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'`
|
||||||
if [ "$isStart" == '' ];then
|
|
||||||
echo -e "Starting mw... \c"
|
|
||||||
cd $mw_path && gunicorn -c setting.py app:app
|
|
||||||
port=$(cat ${mw_path}/data/port.pl)
|
|
||||||
isStart=""
|
|
||||||
while [[ "$isStart" == "" ]];
|
|
||||||
do
|
|
||||||
echo -e ".\c"
|
|
||||||
sleep 0.5
|
|
||||||
isStart=$(lsof -n -P -i:$port|grep LISTEN|grep -v grep|awk '{print $2}'|xargs)
|
|
||||||
let n+=1
|
|
||||||
if [ $n -gt 15 ];then
|
|
||||||
break;
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if [ "$isStart" == '' ];then
|
|
||||||
echo -e "\033[31mfailed\033[0m"
|
|
||||||
echo '------------------------------------------------------'
|
|
||||||
tail -n 20 ${mw_path}/logs/error.log
|
|
||||||
echo '------------------------------------------------------'
|
|
||||||
echo -e "\033[31mError: mw service startup failed.\033[0m"
|
|
||||||
return;
|
|
||||||
fi
|
|
||||||
echo -e "\033[32mdone\033[0m"
|
|
||||||
else
|
|
||||||
echo "Starting mw... mw(pid $(echo $isStart)) already running"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
isStart=$(ps aux |grep 'task.py'|grep -v grep|awk '{print $2}')
|
|
||||||
if [ "$isStart" == '' ];then
|
if [ "$isStart" == '' ];then
|
||||||
echo -e "Starting mw-tasks... \c"
|
echo -e "Starting mw-panel... \c"
|
||||||
cd $mw_path && python3 task.py >> ${mw_path}/logs/task.log 2>&1 &
|
cd $mw_path && gunicorn -c setting.py app:app
|
||||||
sleep 0.3
|
port=$(cat ${mw_path}/data/port.pl)
|
||||||
isStart=$(ps aux |grep 'task.py'|grep -v grep|awk '{print $2}')
|
isStart=""
|
||||||
if [ "$isStart" == '' ];then
|
while [[ "$isStart" == "" ]];
|
||||||
echo -e "\033[31mfailed\033[0m"
|
do
|
||||||
echo '------------------------------------------------------'
|
echo -e ".\c"
|
||||||
tail -n 20 $mw_path/logs/task.log
|
sleep 0.5
|
||||||
echo '------------------------------------------------------'
|
isStart=$(lsof -n -P -i:$port|grep LISTEN|grep -v grep|awk '{print $2}'|xargs)
|
||||||
echo -e "\033[31mError: mw-tasks service startup failed.\033[0m"
|
let n+=1
|
||||||
return;
|
if [ $n -gt 15 ];then
|
||||||
|
break;
|
||||||
fi
|
fi
|
||||||
echo -e "\033[32mdone\033[0m"
|
done
|
||||||
|
if [ "$isStart" == '' ];then
|
||||||
|
echo -e "\033[31mfailed\033[0m"
|
||||||
|
echo '------------------------------------------------------'
|
||||||
|
tail -n 20 ${mw_path}/logs/error.log
|
||||||
|
echo '------------------------------------------------------'
|
||||||
|
echo -e "\033[31mError: mw-panel service startup failed.\033[0m"
|
||||||
|
return;
|
||||||
|
fi
|
||||||
|
echo -e "\033[32mdone\033[0m"
|
||||||
else
|
else
|
||||||
echo "Starting mw-tasks... mw-tasks (pid $isStart) already running"
|
echo "Starting mw-panel... mw(pid $(echo $isStart)) already running"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
mw_stop()
|
mw_start_task()
|
||||||
{
|
{
|
||||||
echo -e "Stopping mw-tasks... \c";
|
isStart=$(ps aux |grep 'task.py'|grep -v grep|awk '{print $2}')
|
||||||
|
if [ "$isStart" == '' ];then
|
||||||
|
echo -e "Starting mw-tasks... \c"
|
||||||
|
cd $mw_path && python3 task.py >> ${mw_path}/logs/task.log 2>&1 &
|
||||||
|
sleep 0.3
|
||||||
|
isStart=$(ps aux |grep 'task.py'|grep -v grep|awk '{print $2}')
|
||||||
|
if [ "$isStart" == '' ];then
|
||||||
|
echo -e "\033[31mfailed\033[0m"
|
||||||
|
echo '------------------------------------------------------'
|
||||||
|
tail -n 20 $mw_path/logs/task.log
|
||||||
|
echo '------------------------------------------------------'
|
||||||
|
echo -e "\033[31mError: mw-tasks service startup failed.\033[0m"
|
||||||
|
return;
|
||||||
|
fi
|
||||||
|
echo -e "\033[32mdone\033[0m"
|
||||||
|
else
|
||||||
|
echo "Starting mw-tasks... mw-tasks (pid $isStart) already running"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
mw_start()
|
||||||
|
{
|
||||||
|
mw_start_panel
|
||||||
|
mw_start_task
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
mw_stop_task()
|
||||||
|
{
|
||||||
|
echo -e "Stopping mw-tasks... \c";
|
||||||
pids=$(ps aux | grep 'task.py'|grep -v grep|awk '{print $2}')
|
pids=$(ps aux | grep 'task.py'|grep -v grep|awk '{print $2}')
|
||||||
arr=($pids)
|
arr=($pids)
|
||||||
|
|
||||||
@@ -90,20 +99,29 @@ mw_stop()
|
|||||||
kill -9 $p
|
kill -9 $p
|
||||||
done
|
done
|
||||||
echo -e "\033[32mdone\033[0m"
|
echo -e "\033[32mdone\033[0m"
|
||||||
|
}
|
||||||
|
|
||||||
echo -e "Stopping mw... \c";
|
mw_stop_panel()
|
||||||
|
{
|
||||||
|
echo -e "Stopping mw-panel... \c";
|
||||||
arr=`ps aux|grep 'gunicorn -c setting.py app:app'|grep -v grep|awk '{print $2}'`
|
arr=`ps aux|grep 'gunicorn -c setting.py app:app'|grep -v grep|awk '{print $2}'`
|
||||||
for p in ${arr[@]}
|
for p in ${arr[@]}
|
||||||
do
|
do
|
||||||
kill -9 $p &>/dev/null
|
kill -9 $p &>/dev/null
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -f $pidfile ];then
|
if [ -f $pidfile ];then
|
||||||
rm -f $pidfile
|
rm -f $pidfile
|
||||||
fi
|
fi
|
||||||
echo -e "\033[32mdone\033[0m"
|
echo -e "\033[32mdone\033[0m"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mw_stop()
|
||||||
|
{
|
||||||
|
mw_stop_panel
|
||||||
|
mw_stop_task
|
||||||
|
}
|
||||||
|
|
||||||
mw_status()
|
mw_status()
|
||||||
{
|
{
|
||||||
isStart=$(ps aux|grep 'gunicorn -c setting.py app:app'|grep -v grep|awk '{print $2}')
|
isStart=$(ps aux|grep 'gunicorn -c setting.py app:app'|grep -v grep|awk '{print $2}')
|
||||||
@@ -163,6 +181,9 @@ case "$1" in
|
|||||||
'restart')
|
'restart')
|
||||||
mw_stop
|
mw_stop
|
||||||
mw_start;;
|
mw_start;;
|
||||||
|
'restart_panel')
|
||||||
|
mw_stop_panel
|
||||||
|
mw_start_panel;;
|
||||||
'status') mw_status;;
|
'status') mw_status;;
|
||||||
'logs') error_logs;;
|
'logs') error_logs;;
|
||||||
'default')
|
'default')
|
||||||
@@ -175,7 +196,7 @@ case "$1" in
|
|||||||
|
|
||||||
if [ ! -f $mw_path/data/default.pl ];then
|
if [ ! -f $mw_path/data/default.pl ];then
|
||||||
echo -e "\033[33mInstall Failed\033[0m"
|
echo -e "\033[33mInstall Failed\033[0m"
|
||||||
exit 0
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
password=$(cat $mw_path/data/default.pl)
|
password=$(cat $mw_path/data/default.pl)
|
||||||
@@ -185,18 +206,34 @@ case "$1" in
|
|||||||
if [ -f $mw_path/data/admin_path.pl ];then
|
if [ -f $mw_path/data/admin_path.pl ];then
|
||||||
auth_path=$(cat $mw_path/data/admin_path.pl)
|
auth_path=$(cat $mw_path/data/admin_path.pl)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$address" = "" ];then
|
if [ "$address" = "" ];then
|
||||||
address=$(curl -sS --connect-timeout 10 -m 60 https://www.bt.cn/Api/getIpAddress)
|
v4=$(python3 $mw_path/tools.py getServerIp 4)
|
||||||
|
v6=$(python3 $mw_path/tools.py getServerIp 6)
|
||||||
|
|
||||||
|
if [ "$v4" != "" ] && [ "$v6" != "" ]; then
|
||||||
|
address="MW-Panel-Url-Ipv4: http://$v4:$port$auth_path \nMW-Panel-Url-Ipv6: http://[$v6]:$port$auth_path"
|
||||||
|
elif [ "$v4" != "" ]; then
|
||||||
|
address="MW-Panel-Url: http://$v4:$port$auth_path"
|
||||||
|
elif [ "$v6" != "" ]; then
|
||||||
|
echo 'True' > $mw_path/data/ipv6.pl
|
||||||
|
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
|
fi
|
||||||
|
|
||||||
echo -e "=================================================================="
|
echo -e "=================================================================="
|
||||||
echo -e "\033[32mMW-Panel default info!\033[0m"
|
echo -e "\033[32mMW-Panel default info!\033[0m"
|
||||||
echo -e "=================================================================="
|
echo -e "=================================================================="
|
||||||
echo "MW-Panel-URL: http://$address:$port$auth_path"
|
echo -e "$address"
|
||||||
echo -e `python3 $mw_path/tools.py username`
|
echo -e `python3 $mw_path/tools.py username`
|
||||||
echo -e "password: $password"
|
echo -e "password: $password"
|
||||||
echo -e "\033[33mWarning:\033[0m"
|
echo -e "\033[33mWarning:\033[0m"
|
||||||
echo -e "\033[33mIf you cannot access the panel, \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 "=================================================================="
|
echo -e "=================================================================="
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
+10
-4
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||||
export PATH
|
export PATH
|
||||||
LANG=en_US.UTF-8
|
# LANG=en_US.UTF-8
|
||||||
is64bit=`getconf LONG_BIT`
|
is64bit=`getconf LONG_BIT`
|
||||||
|
|
||||||
if [ -f /etc/motd ];then
|
if [ -f /etc/motd ];then
|
||||||
@@ -44,6 +44,9 @@ elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; th
|
|||||||
yum install -y wget zip unzip
|
yum install -y wget zip unzip
|
||||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||||
OSNAME='debian'
|
OSNAME='debian'
|
||||||
|
apt update -y
|
||||||
|
apt install -y devscripts
|
||||||
|
apt install -y wget zip unzip
|
||||||
apt install -y wget zip unzip
|
apt install -y wget zip unzip
|
||||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||||
OSNAME='ubuntu'
|
OSNAME='ubuntu'
|
||||||
@@ -72,9 +75,12 @@ if [ $OSNAME != "macos" ];then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "use system version: ${OSNAME}"
|
echo "use system version: ${OSNAME}"
|
||||||
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install/${OSNAME}.sh | bash
|
cd /www/server/mdserver-web && bash scripts/install/${OSNAME}.sh
|
||||||
|
|
||||||
|
|
||||||
|
chmod +x /www/server/mdserver-web/mw-cli
|
||||||
|
if [ ! -e /usr/bin/mw-cli ]; then
|
||||||
|
ln -s /www/server/mdserver-web/mw-cli /usr/bin/mw-cli
|
||||||
|
fi
|
||||||
endTime=`date +%s`
|
endTime=`date +%s`
|
||||||
((outTime=(${endTime}-${startTime})/60))
|
((outTime=(${endTime}-${startTime})/60))
|
||||||
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
|
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
|
||||||
|
|||||||
+17
-59
@@ -5,19 +5,13 @@ LANG=C.UTF-8
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [ ! -f /usr/bin/applydeltarpm ];then
|
|
||||||
yum -y provides '*/applydeltarpm'
|
|
||||||
yum -y install deltarpm
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
setenforce 0
|
setenforce 0
|
||||||
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
|
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
|
||||||
|
|
||||||
yum install -y wget lsof crontabs
|
dnf install -y wget lsof
|
||||||
yum install -y python3-devel
|
dnf install -y python3-devel
|
||||||
yum install -y python-devel
|
dnf install -y python-devel
|
||||||
yum install -y vixie-cron
|
dnf install -y crontabs
|
||||||
|
|
||||||
#https need
|
#https need
|
||||||
|
|
||||||
@@ -32,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 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 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 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
|
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT
|
||||||
service iptables save
|
service iptables save
|
||||||
|
|
||||||
@@ -56,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=443/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=888/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=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 --permanent --zone=public --add-port=30000-40000/tcp
|
||||||
|
|
||||||
|
|
||||||
@@ -68,62 +62,26 @@ fi
|
|||||||
#安装时不开启
|
#安装时不开启
|
||||||
systemctl stop firewalld
|
systemctl stop firewalld
|
||||||
|
|
||||||
yum groupinstall -y "Development Tools"
|
dnf upgrade -y
|
||||||
|
dnf autoremove -y
|
||||||
|
|
||||||
yum install -y libevent libevent-devel libjpeg* libpng* gd* libxslt* unzip libmcrypt libmcrypt-devel
|
dnf groupinstall -y "Development Tools"
|
||||||
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
|
dnf install -y epel-release
|
||||||
yum install -y lsof net-tools
|
|
||||||
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
|
dnf install -y oniguruma
|
||||||
wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master
|
dnf --enablerepo=crb install oniguruma-devel
|
||||||
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
|
dnf install -y libevent libevent-devel libjpeg* libpng* gd* libxslt* unzip libmcrypt libmcrypt-devel
|
||||||
# wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
|
dnf install -y wget libicu-devel zip bzip2-devel gcc libxml2 libxml2-devel libjpeg-devel libpng-devel libwebp libwebp-devel pcre pcre-devel
|
||||||
# python get-pip.py
|
dnf install -y lsof net-tools
|
||||||
# pip install --upgrade pip
|
dnf install -y ncurses-devel cmake
|
||||||
# pip install pillow==6.2.2
|
dnf --enablerepo=crb install mysql-devel
|
||||||
#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
|
cd /www/server/mdserver-web/scripts && bash lib.sh
|
||||||
chmod 755 /www/server/mdserver-web/data
|
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 && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt
|
|
||||||
else
|
|
||||||
cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt
|
|
||||||
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 flask-socketio==5.2.0
|
|
||||||
pip3 install psutil==5.9.1
|
|
||||||
pip3 install pymongo
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cd /www/server/mdserver-web && ./cli.sh start
|
cd /www/server/mdserver-web && ./cli.sh start
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
|
|||||||
+17
-41
@@ -17,6 +17,7 @@ yum install -y python3-devel
|
|||||||
yum install -y python-devel
|
yum install -y python-devel
|
||||||
yum install -y vixie-cron
|
yum install -y vixie-cron
|
||||||
yum install -y curl-devel libmcrypt libmcrypt-devel
|
yum install -y curl-devel libmcrypt libmcrypt-devel
|
||||||
|
yum install -y mysql-devel
|
||||||
|
|
||||||
#https need
|
#https need
|
||||||
if [ ! -d /root/.acme.sh ];then
|
if [ ! -d /root/.acme.sh ];then
|
||||||
@@ -30,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 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 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 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
|
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT
|
||||||
service iptables save
|
service iptables save
|
||||||
|
|
||||||
@@ -54,7 +55,8 @@ if [ ! -f /etc/init.d/iptables ];then
|
|||||||
firewall-cmd --permanent --zone=public --add-port=443/tcp
|
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=888/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=7200/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=1723/tcp
|
||||||
# firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
# firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
||||||
|
|
||||||
|
|
||||||
@@ -67,54 +69,28 @@ fi
|
|||||||
systemctl stop firewalld
|
systemctl stop firewalld
|
||||||
|
|
||||||
yum groupinstall -y "Development Tools"
|
yum groupinstall -y "Development Tools"
|
||||||
|
|
||||||
yum install -y libevent libevent-devel libjpeg* libpng* gd* libxslt* unzip libmcrypt libmcrypt-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
|
|
||||||
yum install -y MySQL-python
|
|
||||||
yum install -y epel-release
|
yum install -y epel-release
|
||||||
|
|
||||||
|
yum install -y oniguruma oniguruma-devel
|
||||||
if [ ! -f /usr/local/bin/pip3 ];then
|
#centos8 stream | use dnf
|
||||||
python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple
|
if [ "$?" != "0" ];then
|
||||||
|
yum install -y dnf dnf-plugins-core
|
||||||
|
dnf config-manager --set-enabled powertools
|
||||||
|
yum install -y oniguruma oniguruma-devel
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
yum install -y libevent libevent-devel libjpeg* libpng* gd* libxslt* unzip
|
||||||
|
yum install -y python-imaging libicu-devel zip bzip2-devel gcc libxml2 libxml2-devel pcre pcre-devel
|
||||||
|
yum install -y libjpeg-devel libpng-devel libwebp libwebp-devel
|
||||||
|
yum install -y lsof net-tools
|
||||||
|
yum install -y ncurses-devel cmake
|
||||||
|
yum install -y MySQL-python
|
||||||
|
|
||||||
|
|
||||||
cd /www/server/mdserver-web/scripts && bash lib.sh
|
cd /www/server/mdserver-web/scripts && bash lib.sh
|
||||||
chmod 755 /www/server/mdserver-web/data
|
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 && 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
|
|
||||||
|
|
||||||
|
|
||||||
cd /www/server/mdserver-web && ./cli.sh start
|
cd /www/server/mdserver-web && ./cli.sh start
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
|
|||||||
+41
-28
@@ -3,14 +3,22 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
|||||||
export PATH
|
export PATH
|
||||||
LANG=en_US.UTF-8
|
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
|
apt update -y
|
||||||
|
|
||||||
|
|
||||||
apt install -y wget curl lsof unzip
|
apt install -y wget curl lsof unzip
|
||||||
apt install -y python3-pip
|
apt install -y python3-pip
|
||||||
|
apt install -y python3-dev
|
||||||
apt install -y python3-venv
|
apt install -y python3-venv
|
||||||
|
|
||||||
apt install -y cron
|
apt install -y cron
|
||||||
|
|
||||||
if [ ! -d /root/.acme.sh ];then
|
if [ ! -d /root/.acme.sh ];then
|
||||||
@@ -24,7 +32,7 @@ if [ -f /usr/sbin/ufw ];then
|
|||||||
ufw allow 443/tcp
|
ufw allow 443/tcp
|
||||||
ufw allow 888/tcp
|
ufw allow 888/tcp
|
||||||
ufw allow 7200/tcp
|
ufw allow 7200/tcp
|
||||||
ufw allow 3306/tcp
|
# ufw allow 3306/tcp
|
||||||
# ufw allow 30000:40000/tcp
|
# ufw allow 30000:40000/tcp
|
||||||
|
|
||||||
fi
|
fi
|
||||||
@@ -46,7 +54,7 @@ if [ ! -f /usr/sbin/ufw ];then
|
|||||||
firewall-cmd --permanent --zone=public --add-port=443/tcp
|
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=888/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=7200/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 --permanent --zone=public --add-port=30000-40000/tcp
|
||||||
|
|
||||||
# fix:debian10 firewalld faq
|
# fix:debian10 firewalld faq
|
||||||
@@ -60,34 +68,39 @@ fi
|
|||||||
systemctl stop firewalld
|
systemctl stop firewalld
|
||||||
|
|
||||||
|
|
||||||
|
#fix zlib1g-dev fail
|
||||||
|
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
|
||||||
|
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 zlib1g=${ZLIB1G_BASE_VER} zlib1g-dev\e[0m"
|
||||||
|
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"
|
||||||
|
|
||||||
|
|
||||||
|
#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 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"`
|
||||||
|
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
|
cd /www/server/mdserver-web/scripts && bash lib.sh
|
||||||
chmod 755 /www/server/mdserver-web/data
|
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
|
|
||||||
pip install --upgrade pip
|
|
||||||
pip install --upgrade setuptools
|
|
||||||
cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt
|
|
||||||
else
|
|
||||||
cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f /usr/local/bin/pip3 ];then
|
|
||||||
python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
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 flask-socketio==5.2.0
|
|
||||||
pip3 install pymongo
|
|
||||||
pip3 install psutil
|
|
||||||
|
|
||||||
|
|
||||||
cd /www/server/mdserver-web && ./cli.sh start
|
cd /www/server/mdserver-web && ./cli.sh start
|
||||||
|
|||||||
@@ -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 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 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 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
|
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT
|
||||||
service iptables save
|
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=443/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=888/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=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 --permanent --zone=public --add-port=30000-40000/tcp
|
||||||
firewall-cmd --reload
|
firewall-cmd --reload
|
||||||
fi
|
fi
|
||||||
@@ -66,6 +66,7 @@ systemctl stop firewalld
|
|||||||
|
|
||||||
|
|
||||||
yum groupinstall -y "Development Tools"
|
yum groupinstall -y "Development Tools"
|
||||||
|
yum -y install epel-release
|
||||||
|
|
||||||
yum install -y libevent libevent-devel libxslt* libjpeg* libpng* gd* zip libmcrypt libmcrypt-devel
|
yum install -y libevent libevent-devel libxslt* libjpeg* libpng* gd* zip libmcrypt libmcrypt-devel
|
||||||
yum install -y gcc libffi-devel python-devel openssl-devel
|
yum install -y gcc libffi-devel python-devel openssl-devel
|
||||||
@@ -74,38 +75,16 @@ yum -y install wget python-devel python-imaging libicu-devel unzip bzip2-devel g
|
|||||||
yum -y install net-tools
|
yum -y install net-tools
|
||||||
yum -y install ncurses-devel mysql-devel cmake
|
yum -y install ncurses-devel mysql-devel cmake
|
||||||
yum -y install python-devel
|
yum -y install python-devel
|
||||||
yum -y install MySQL-python
|
yum -y install MySQL-python
|
||||||
yum -y install epel-release
|
|
||||||
yum -y install python3-devel
|
yum -y install python3-devel
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#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
|
cd /www/server/mdserver-web/scripts && bash lib.sh
|
||||||
chmod 755 /www/server/mdserver-web/data
|
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 && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt
|
|
||||||
else
|
|
||||||
cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt
|
|
||||||
fi
|
|
||||||
cd /www/server/mdserver-web && ./cli.sh start
|
cd /www/server/mdserver-web && ./cli.sh start
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ if [ ! -d $DEV/server/lib ]; then
|
|||||||
cd $DEV/server/mdserver-web/scripts && ./lib.sh
|
cd $DEV/server/mdserver-web/scripts && ./lib.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
pip3 install mysqlclient
|
||||||
|
|
||||||
chmod 755 $DEV/server/mdserver-web/data
|
chmod 755 $DEV/server/mdserver-web/data
|
||||||
if [ -f $DEV/server/mdserver-web/bin/activate ];then
|
if [ -f $DEV/server/mdserver-web/bin/activate ];then
|
||||||
@@ -44,6 +45,8 @@ else
|
|||||||
cd $DEV/server/mdserver-web && pip3 install -r $DEV/server/mdserver-web/requirements.txt
|
cd $DEV/server/mdserver-web && pip3 install -r $DEV/server/mdserver-web/requirements.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
pip3 install mysqlclient
|
||||||
|
|
||||||
|
|
||||||
cd $DEV/server/mdserver-web && ./cli.sh start
|
cd $DEV/server/mdserver-web && ./cli.sh start
|
||||||
cd $DEV/server/mdserver-web && ./cli.sh stop
|
cd $DEV/server/mdserver-web && ./cli.sh stop
|
||||||
|
|||||||
@@ -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 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 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 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
|
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT
|
||||||
service iptables save
|
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=443/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=888/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=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 --permanent --zone=public --add-port=30000-40000/tcp
|
||||||
|
|
||||||
|
|
||||||
@@ -68,53 +68,19 @@ fi
|
|||||||
systemctl stop firewalld
|
systemctl stop firewalld
|
||||||
|
|
||||||
yum groupinstall -y "Development Tools"
|
yum groupinstall -y "Development Tools"
|
||||||
|
yum install -y epel-release
|
||||||
|
|
||||||
yum install -y libevent libevent-devel libjpeg* libpng* gd* libxslt* unzip libmcrypt libmcrypt-devel
|
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 libjpeg-devel libpng-devel libwebp libwebp-devel pcre pcre-devel
|
||||||
yum install -y lsof net-tools
|
yum install -y lsof net-tools
|
||||||
yum install -y ncurses-devel mysql-devel cmake
|
yum install -y ncurses-devel mysql-devel cmake
|
||||||
yum install -y MySQL-python
|
yum install -y MySQL-python
|
||||||
yum install -y epel-release
|
|
||||||
|
|
||||||
#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
|
cd /www/server/mdserver-web/scripts && bash lib.sh
|
||||||
chmod 755 /www/server/mdserver-web/data
|
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 && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt
|
|
||||||
else
|
|
||||||
cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt
|
|
||||||
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
|
cd /www/server/mdserver-web && ./cli.sh start
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ apt update -y
|
|||||||
apt install -y wget curl lsof unzip
|
apt install -y wget curl lsof unzip
|
||||||
apt install -y python3-pip
|
apt install -y python3-pip
|
||||||
apt install -y python3-venv
|
apt install -y python3-venv
|
||||||
|
apt install -y python3-dev
|
||||||
|
|
||||||
|
|
||||||
apt install -y cron
|
apt install -y cron
|
||||||
|
|
||||||
@@ -24,7 +26,7 @@ if [ -f /usr/sbin/ufw ];then
|
|||||||
ufw allow 443/tcp
|
ufw allow 443/tcp
|
||||||
ufw allow 888/tcp
|
ufw allow 888/tcp
|
||||||
ufw allow 7200/tcp
|
ufw allow 7200/tcp
|
||||||
ufw allow 3306/tcp
|
# ufw allow 3306/tcp
|
||||||
# ufw allow 30000:40000/tcp
|
# ufw allow 30000:40000/tcp
|
||||||
|
|
||||||
fi
|
fi
|
||||||
@@ -44,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=443/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=888/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=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 --permanent --zone=public --add-port=30000-40000/tcp
|
||||||
|
|
||||||
# fix:debian10 firewalld faq
|
# fix:debian10 firewalld faq
|
||||||
@@ -62,46 +64,6 @@ cd /www/server/mdserver-web/scripts && bash lib.sh
|
|||||||
chmod 755 /www/server/mdserver-web/data
|
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
|
|
||||||
fi
|
|
||||||
|
|
||||||
# cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt
|
|
||||||
# pip install --upgrade pip
|
|
||||||
# pip install --upgrade setuptools
|
|
||||||
# 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 flask-socketio==5.2.0
|
|
||||||
# pip3 install flask-session==0.3.2
|
|
||||||
# pip3 install pymongo
|
|
||||||
# pip3 install psutil
|
|
||||||
|
|
||||||
|
|
||||||
# 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
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt
|
|
||||||
else
|
|
||||||
cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt
|
|
||||||
fi
|
|
||||||
|
|
||||||
pip3 install gunicorn==20.1.0
|
|
||||||
pip3 install gevent==20.9.0
|
|
||||||
pip3 install gevent-websocket==0.10.1
|
|
||||||
pip3 install requests==2.20.0
|
|
||||||
pip3 install flask-caching==1.10.1
|
|
||||||
#ubuntu 20 need
|
|
||||||
pip3 install flask-socketio==5.2.0
|
|
||||||
pip3 install flask-session==0.3.2
|
|
||||||
pip3 install pymongo
|
|
||||||
pip3 install psutil
|
|
||||||
|
|
||||||
|
|
||||||
cd /www/server/mdserver-web && ./cli.sh start
|
cd /www/server/mdserver-web && ./cli.sh start
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|||||||
+10
-3
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||||
export PATH
|
export PATH
|
||||||
LANG=en_US.UTF-8
|
# LANG=en_US.UTF-8
|
||||||
is64bit=`getconf LONG_BIT`
|
is64bit=`getconf LONG_BIT`
|
||||||
|
|
||||||
if [ -f /etc/motd ];then
|
if [ -f /etc/motd ];then
|
||||||
@@ -44,6 +44,9 @@ elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; th
|
|||||||
yum install -y wget zip unzip
|
yum install -y wget zip unzip
|
||||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||||
OSNAME='debian'
|
OSNAME='debian'
|
||||||
|
apt update -y
|
||||||
|
apt install -y devscripts
|
||||||
|
apt install -y wget zip unzip
|
||||||
apt install -y wget zip unzip
|
apt install -y wget zip unzip
|
||||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||||
OSNAME='ubuntu'
|
OSNAME='ubuntu'
|
||||||
@@ -72,9 +75,13 @@ if [ $OSNAME != "macos" ];then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "use system version: ${OSNAME}"
|
echo "use system version: ${OSNAME}"
|
||||||
curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/install/${OSNAME}.sh | bash
|
cd /www/server/mdserver-web && bash scripts/install/${OSNAME}.sh
|
||||||
|
|
||||||
|
chmod +x /www/server/mdserver-web/mw-cli
|
||||||
|
if [ ! -e /usr/bin/mw-cli ]; then
|
||||||
|
ln -s /www/server/mdserver-web/mw-cli /usr/bin/mw-cli
|
||||||
|
fi
|
||||||
|
|
||||||
endTime=`date +%s`
|
endTime=`date +%s`
|
||||||
((outTime=(${endTime}-${startTime})/60))
|
((outTime=(${endTime}-${startTime})/60))
|
||||||
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
|
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
|
||||||
|
|||||||
+13
-3
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||||
export PATH
|
export PATH
|
||||||
LANG=en_US.UTF-8
|
# LANG=en_US.UTF-8
|
||||||
is64bit=`getconf LONG_BIT`
|
is64bit=`getconf LONG_BIT`
|
||||||
|
|
||||||
if [ -f /etc/motd ];then
|
if [ -f /etc/motd ];then
|
||||||
@@ -44,6 +44,8 @@ elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; th
|
|||||||
yum install -y wget zip unzip
|
yum install -y wget zip unzip
|
||||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||||
OSNAME='debian'
|
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
|
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||||
OSNAME='ubuntu'
|
OSNAME='ubuntu'
|
||||||
@@ -72,9 +74,17 @@ if [ $OSNAME != "macos" ];then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "use system version: ${OSNAME}"
|
echo "use system version: ${OSNAME}"
|
||||||
curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/install/${OSNAME}.sh | bash
|
|
||||||
|
|
||||||
|
|
||||||
|
# cd /www/server/mdserver-web && bash ./scripts/install/debian.sh
|
||||||
|
cd /www/server/mdserver-web && bash scripts/install/${OSNAME}.sh
|
||||||
|
# curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install/${OSNAME}.sh | bash
|
||||||
|
|
||||||
|
chmod +x /www/server/mdserver-web/mw-cli
|
||||||
|
if [ ! -e /usr/bin/mw-cli ]; then
|
||||||
|
ln -s /www/server/mdserver-web/mw-cli /usr/bin/mw-cli
|
||||||
|
fi
|
||||||
|
|
||||||
endTime=`date +%s`
|
endTime=`date +%s`
|
||||||
((outTime=(${endTime}-${startTime})/60))
|
((outTime=(${endTime}-${startTime})/60))
|
||||||
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
|
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
|
||||||
|
|||||||
+59
-8
@@ -244,17 +244,19 @@ echo -e "Install_Curl" >> ${libPath}/lib.pl
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_os=`uname`
|
|
||||||
|
|
||||||
if grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
if grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||||
sudo ln -sf /bin/bash /bin/sh
|
sudo ln -sf /bin/bash /bin/sh
|
||||||
#sudo dpkg-reconfigure dash
|
#sudo dpkg-reconfigure dash
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
_os=`uname`
|
||||||
if [ ${_os} == "Darwin" ]; then
|
if [ ${_os} == "Darwin" ]; then
|
||||||
OSNAME='macos'
|
OSNAME='macos'
|
||||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||||
OSNAME='centos'
|
OSNAME='centos'
|
||||||
|
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||||
|
OSNAME='rocky'
|
||||||
elif grep -Eqi "Red Hat Enterprise Linux Server" /etc/issue || grep -Eq "Red Hat Enterprise Linux Server" /etc/*-release; then
|
elif grep -Eqi "Red Hat Enterprise Linux Server" /etc/issue || grep -Eq "Red Hat Enterprise Linux Server" /etc/*-release; then
|
||||||
OSNAME='rhel'
|
OSNAME='rhel'
|
||||||
elif grep -Eqi "Aliyun" /etc/issue || grep -Eq "Aliyun" /etc/*-release; then
|
elif grep -Eqi "Aliyun" /etc/issue || grep -Eq "Aliyun" /etc/*-release; then
|
||||||
@@ -288,21 +290,25 @@ if [ "$OSNAME" == "macos" ]; then
|
|||||||
elif [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "debian" ]; then
|
elif [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "debian" ]; then
|
||||||
|
|
||||||
apt install -y devscripts
|
apt install -y devscripts
|
||||||
|
apt install -y net-tools
|
||||||
|
|
||||||
apt install -y libffi-dev
|
apt install -y libffi-dev
|
||||||
apt install -y cmake automake make
|
apt install -y cmake automake make
|
||||||
|
|
||||||
apt install -y php-common webp scons
|
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 libpcre3 libpcre3-dev
|
||||||
apt install -y openssl
|
apt install -y openssl
|
||||||
|
|
||||||
apt install -y libxml2 libxml2-dev libbz2-dev libmcrypt-dev libpspell-dev librecode-dev
|
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 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 libjpeg62-turbo-dev libjpeg-dev libpng-dev
|
apt install -y zlib1g-dev
|
||||||
|
apt install -y libjpeg-dev libpng-dev
|
||||||
apt install -y libfreetype6
|
apt install -y libfreetype6
|
||||||
|
apt install -y libjpeg62-turbo-dev
|
||||||
apt install -y libfreetype6-dev
|
apt install -y libfreetype6-dev
|
||||||
apt install -y libevent-dev libncurses5-dev libldap2-dev
|
apt install -y libevent-dev libncurses5-dev libldap2-dev
|
||||||
|
|
||||||
@@ -328,20 +334,19 @@ elif [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "debian" ]; then
|
|||||||
else
|
else
|
||||||
|
|
||||||
yum install -y openldap openldap-devel libtirpc libtirpc-devel rpcgen
|
yum install -y openldap openldap-devel libtirpc libtirpc-devel rpcgen
|
||||||
|
|
||||||
yum install -y bison re2c cmake
|
yum install -y bison re2c cmake
|
||||||
|
|
||||||
yum install -y libmemcached libmemcached-devel
|
yum install -y libmemcached libmemcached-devel
|
||||||
yum install -y curl-devel
|
yum install -y curl-devel
|
||||||
yum install -y zlib zlib-devel
|
yum install -y zlib zlib-devel
|
||||||
|
yum install -y libzip libzip-devel
|
||||||
yum install -y pcre pcre-devel
|
yum install -y pcre pcre-devel
|
||||||
yum install -y icu libicu-devel autoconf
|
yum install -y icu libicu-devel autoconf
|
||||||
yum install -y freetype freetype-devel
|
yum install -y freetype freetype-devel
|
||||||
yum install -y openssl openssl-devel
|
yum install -y openssl openssl-devel
|
||||||
yum install -y libzip libzip-devel
|
|
||||||
yum install -y graphviz libxml2 libxml2-devel
|
yum install -y graphviz libxml2 libxml2-devel
|
||||||
|
|
||||||
yum install -y sqlite-devel
|
yum install -y sqlite-devel
|
||||||
|
yum install -y mysql-devel
|
||||||
yum install -y oniguruma oniguruma-devel
|
yum install -y oniguruma oniguruma-devel
|
||||||
yum install -y ImageMagick ImageMagick-devel
|
yum install -y ImageMagick ImageMagick-devel
|
||||||
|
|
||||||
@@ -351,6 +356,52 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
#面板需要的库
|
||||||
|
|
||||||
|
if [ ! -f /usr/local/bin/pip3 ];then
|
||||||
|
python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple
|
||||||
|
fi
|
||||||
|
|
||||||
|
pip install --upgrade pip
|
||||||
|
pip3 install --upgrade setuptools
|
||||||
|
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 flask-session==0.3.2
|
||||||
|
pip3 install pymongo
|
||||||
|
pip3 install psutil
|
||||||
|
pip3 install flask-socketio==5.2.0
|
||||||
|
pip3 install mysqlclient
|
||||||
|
|
||||||
|
if [ ! -f /www/server/mdserver-web/bin/activate ];then
|
||||||
|
cd /www/server/mdserver-web && python3 -m venv .
|
||||||
|
cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate
|
||||||
|
else
|
||||||
|
cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate
|
||||||
|
fi
|
||||||
|
|
||||||
|
pip install --upgrade pip
|
||||||
|
pip3 install --upgrade setuptools
|
||||||
|
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 flask-session==0.3.2
|
||||||
|
pip3 install pymongo
|
||||||
|
pip3 install psutil
|
||||||
|
pip3 install flask-socketio==5.2.0
|
||||||
|
pip3 install mysqlclient
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
##### common start #####
|
##### common start #####
|
||||||
|
|
||||||
# Install_Libiconv
|
# Install_Libiconv
|
||||||
|
|||||||
Executable
+42
@@ -0,0 +1,42 @@
|
|||||||
|
#!/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 [ ! -d /www/server/mdserver-web ];then
|
||||||
|
echo "mdserver-web not exist!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# openresty
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
# php
|
||||||
|
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`
|
||||||
|
((outTime=(${endTime}-${startTime})/60))
|
||||||
|
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
|
||||||
|
|
||||||
Executable
+89
@@ -0,0 +1,89 @@
|
|||||||
|
#!/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 [ ! -d /www/server/mdserver-web ];then
|
||||||
|
echo "mdserver-web not exist!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# openresty
|
||||||
|
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
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# PHP_VER_LIST=(53 54 55 56 71 72 73 74 80 81)
|
||||||
|
# # PHP_VER_LIST=(81)
|
||||||
|
# for PHP_VER in ${PHP_VER_LIST[@]}; do
|
||||||
|
# echo "php${PHP_VER} -- start"
|
||||||
|
# cd $DIR/php$PHP_VER && sh install.sh
|
||||||
|
# dir=$(ls -l $DIR/php$PHP_VER |awk '/^d/ {print $NF}')
|
||||||
|
# for i in $dir
|
||||||
|
# do
|
||||||
|
# cd $DIR/php$PHP_VER/$i && sh install.sh $PHP_VER
|
||||||
|
# done
|
||||||
|
# echo "php${PHP_VER} -- end"
|
||||||
|
# done
|
||||||
|
|
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 53
|
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 53
|
||||||
|
|
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 54
|
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 54
|
||||||
|
|
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 55
|
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 55
|
||||||
|
|
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 56
|
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 56
|
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 70
|
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 70
|
||||||
|
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
|
||||||
|
|
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 72
|
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 72
|
||||||
|
|
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 73
|
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 73
|
||||||
|
|
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 74
|
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 74
|
||||||
|
|
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 80
|
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 80
|
||||||
|
|
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 81
|
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 81
|
||||||
|
|
||||||
|
|
||||||
|
# mysql
|
||||||
|
if [ ! -d /www/server/mysql ];then
|
||||||
|
# cd /www/server/mdserver-web/plugins/mysql && bash install.sh install 5.7
|
||||||
|
# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 5.7
|
||||||
|
|
||||||
|
|
||||||
|
# cd /www/server/mdserver-web/plugins/mysql && bash install.sh install 5.6
|
||||||
|
# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 5.6
|
||||||
|
cd /www/server/mdserver-web/plugins/mysql && bash install.sh install 8.0
|
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 8.0
|
||||||
|
fi
|
||||||
|
|
||||||
|
endTime=`date +%s`
|
||||||
|
((outTime=(${endTime}-${startTime})/60))
|
||||||
|
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
|
||||||
|
|
||||||
@@ -61,6 +61,14 @@ if [ -f $rootPath"/php/init.d/php74" ];then
|
|||||||
$rootPath"/php/init.d/php74" reload
|
$rootPath"/php/init.d/php74" reload
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f $rootPath"/php/init.d/php80" ];then
|
||||||
|
$rootPath"/php/init.d/php74" reload
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f $rootPath"/php/init.d/php81" ];then
|
||||||
|
$rootPath"/php/init.d/php74" reload
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -f $rootPath"/openresty/nginx/sbin/nginx" ];then
|
if [ -f $rootPath"/openresty/nginx/sbin/nginx" ];then
|
||||||
$rootPath"/openresty/nginx/sbin/nginx" -s reload
|
$rootPath"/openresty/nginx/sbin/nginx" -s reload
|
||||||
fi
|
fi
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user