mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
Compare commits
96
Commits
0.15.0
...
midoks-patch-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59a2765b2f | ||
|
|
612c104cca | ||
|
|
550ca7681a | ||
|
|
6a09706362 | ||
|
|
ca040e8986 | ||
|
|
6fcc980d5d | ||
|
|
b69adc9c7d | ||
|
|
67da343705 | ||
|
|
4b47e27a54 | ||
|
|
fba3ddc9a5 | ||
|
|
4769ce5be8 | ||
|
|
8e16cbf7f9 | ||
|
|
4225d4c040 | ||
|
|
b578f2fddc | ||
|
|
961c3423fd | ||
|
|
8040c8c67a | ||
|
|
5aca7d7c26 | ||
|
|
d9f99e6b7c | ||
|
|
3addb46708 | ||
|
|
e6b493237d | ||
|
|
7f42054a14 | ||
|
|
501af3da15 | ||
|
|
68727cbe91 | ||
|
|
c5207961f3 | ||
|
|
a04e05c7e8 | ||
|
|
5b8cca24aa | ||
|
|
cafe58f3fc | ||
|
|
d1e2781eb9 | ||
|
|
67c899fc84 | ||
|
|
7432548ff9 | ||
|
|
0c2c136097 | ||
|
|
2a7e21951b | ||
|
|
066185e404 | ||
|
|
bd431f1647 | ||
|
|
0a6e88d81d | ||
|
|
02c9988ef7 | ||
|
|
5ee7df4a46 | ||
|
|
5f382c0034 | ||
|
|
63d17c4d77 | ||
|
|
38722c1dc2 | ||
|
|
ea982b7261 | ||
|
|
73d9edced8 | ||
|
|
af03c004a3 | ||
|
|
ddd9e70ac2 | ||
|
|
8976a7a147 | ||
|
|
677ff8ec0c | ||
|
|
47d240e2b8 | ||
|
|
1f7bd76875 | ||
|
|
f04c70f022 | ||
|
|
5044cc5db9 | ||
|
|
4329b90ac4 | ||
|
|
f7873b6dcd | ||
|
|
a80d666786 | ||
|
|
0598704dce | ||
|
|
8f19a05755 | ||
|
|
f320d7cc69 | ||
|
|
1e97929a24 | ||
|
|
c66bbac97e | ||
|
|
1f7a0d2795 | ||
|
|
f05ce79e63 | ||
|
|
9f3d06191a | ||
|
|
2c6614a5ff | ||
|
|
905bad29cf | ||
|
|
9ba572a8ce | ||
|
|
85fc333d2c | ||
|
|
5bc27a4725 | ||
|
|
e5acf206f5 | ||
|
|
ae7afc2eb5 | ||
|
|
5c8527a5de | ||
|
|
274592229e | ||
|
|
60ddb13f8e | ||
|
|
f62af00fb7 | ||
|
|
9c6faefffd | ||
|
|
c9e27c2add | ||
|
|
97b1e8b9b3 | ||
|
|
18cdcd1436 | ||
|
|
7d783c64b6 | ||
|
|
0b65d69750 | ||
|
|
693dbb8cf1 | ||
|
|
117a99e729 | ||
|
|
45d4b8a5de | ||
|
|
a5791051b1 | ||
|
|
dc3f8f8e0b | ||
|
|
bf1d00c012 | ||
|
|
51cf851cea | ||
|
|
1e09408eb9 | ||
|
|
7659865caf | ||
|
|
ad1851d068 | ||
|
|
e174652afc | ||
|
|
a95e7aacd7 | ||
|
|
6aa638ef9a | ||
|
|
6f3d50bae5 | ||
|
|
301a5a95b8 | ||
|
|
d35b9dccc7 | ||
|
|
82680605ac | ||
|
|
5b148b3d1a |
@@ -0,0 +1,16 @@
|
|||||||
|
name: sync2gitee
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
repo-sync:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Mirror the Github organization repos to Gitee.
|
||||||
|
uses: Yikun/hub-mirror-action@master
|
||||||
|
with:
|
||||||
|
src: 'github/midoks'
|
||||||
|
dst: 'gitee/midoks'
|
||||||
|
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
|
||||||
|
dst_token: ${{ secrets.GITEE_TOKEN }}
|
||||||
|
static_list: "mdserver-web"
|
||||||
|
force_update: true
|
||||||
@@ -79,7 +79,7 @@ PHP[72-82]支持phpMyAdmin[5.2.0]
|
|||||||
|
|
||||||
# 特别赞助
|
# 特别赞助
|
||||||
|
|
||||||
- [找资源 - 阿里云盘资源搜索引擎](https://zhaoziyuan.la/)
|
- [找资源 - 阿里云盘资源搜索引擎](https://zhaoziyuan.pw/)
|
||||||
|
|
||||||
# AD - VPS推荐 - 🙏
|
# AD - VPS推荐 - 🙏
|
||||||
|
|
||||||
@@ -99,15 +99,15 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443:
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### 版本更新 0.15.0
|
### 版本更新 0.15.2
|
||||||
|
|
||||||
* debian12适配。
|
* OpenResty升级到1.21.4.2
|
||||||
* 添加nezha插件。
|
* 计划任务自动脚本运行时间
|
||||||
* 优化域名ssl保存功能。
|
* rsyncd添加优化
|
||||||
* 修复PHP扩展intl不加载问题(debian/ubuntu)。
|
* 使用mariadb二进制导入备份文件
|
||||||
* 修复redhat安装openresty缺少openssl-devel。
|
* docker插件-镜像导入导出功能
|
||||||
* docker插件-将就能用。
|
* 网站设置反向代理升级功能
|
||||||
* tgbot接收和push任务分离。
|
* 优化初始化安装SSH端口识别
|
||||||
|
|
||||||
### JSDelivr安装地址
|
### JSDelivr安装地址
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ from flask import redirect
|
|||||||
|
|
||||||
def init():
|
def init():
|
||||||
initDB()
|
initDB()
|
||||||
|
initDBSshPort()
|
||||||
initUserInfo()
|
initUserInfo()
|
||||||
initInitD()
|
initInitD()
|
||||||
initInitTask()
|
initInitTask()
|
||||||
@@ -62,6 +63,17 @@ def initDB():
|
|||||||
print(str(ex))
|
print(str(ex))
|
||||||
|
|
||||||
|
|
||||||
|
def initDBSshPort():
|
||||||
|
# SSH端口必须放开
|
||||||
|
import firewall_api
|
||||||
|
cmd_data = mw.execShell(
|
||||||
|
"cat /etc/ssh/sshd_config | grep '^Port \d*' | tail -1")
|
||||||
|
ssh_port = cmd_data[0].replace("Port ", '').strip()
|
||||||
|
if ssh_port == '':
|
||||||
|
ssh_port = '22'
|
||||||
|
firewall_api.firewall_api().addAcceptPortArgs(ssh_port, 'SSH远程管理服务', 'port')
|
||||||
|
|
||||||
|
|
||||||
def doContentReplace(src, dst):
|
def doContentReplace(src, dst):
|
||||||
content = mw.readFile(src)
|
content = mw.readFile(src)
|
||||||
content = content.replace("{$SERVER_PATH}", mw.getRunDir())
|
content = content.replace("{$SERVER_PATH}", mw.getRunDir())
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ from flask import request
|
|||||||
|
|
||||||
class config_api:
|
class config_api:
|
||||||
|
|
||||||
__version = '0.15.0'
|
__version = '0.15.2'
|
||||||
__api_addr = 'data/api.json'
|
__api_addr = 'data/api.json'
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|||||||
@@ -508,6 +508,22 @@ class crontab_api:
|
|||||||
else:
|
else:
|
||||||
head = "#!/bin/bash\nPATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin\nexport PATH\n"
|
head = "#!/bin/bash\nPATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin\nexport PATH\n"
|
||||||
|
|
||||||
|
start_head = '''
|
||||||
|
SCRIPT_RUN_TIME="0s"
|
||||||
|
MW_ToSeconds()
|
||||||
|
{
|
||||||
|
SEC=$1
|
||||||
|
if [ $SEC -lt 60 ]; then
|
||||||
|
SCRIPT_RUN_TIME="${SEC}s"
|
||||||
|
elif [ $SEC -ge 60 ] && [ $SEC -lt 3600 ];then
|
||||||
|
SCRIPT_RUN_TIME="$(( SEC / 60 ))m$(( SEC % 60 ))s"
|
||||||
|
elif [ $SEC -ge 3600 ]; then
|
||||||
|
SCRIPT_RUN_TIME="$(( SEC / 3600 ))h$(( (SEC % 3600) / 60 ))m$(( (SEC % 3600) % 60 ))s"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
START_MW_SHELL_TIME=`date +%s`
|
||||||
|
'''
|
||||||
|
|
||||||
source_bin_activate = '''
|
source_bin_activate = '''
|
||||||
export LANG=en_US.UTF-8
|
export LANG=en_US.UTF-8
|
||||||
MW_PATH=%s/bin/activate
|
MW_PATH=%s/bin/activate
|
||||||
@@ -515,7 +531,7 @@ if [ -f $MW_PATH ];then
|
|||||||
source $MW_PATH
|
source $MW_PATH
|
||||||
fi''' % (mw.getRunDir(),)
|
fi''' % (mw.getRunDir(),)
|
||||||
|
|
||||||
head = head + source_bin_activate + "\n"
|
head = head + start_head + source_bin_activate + "\n"
|
||||||
log = '.log'
|
log = '.log'
|
||||||
|
|
||||||
script_dir = mw.getRunDir() + "/scripts"
|
script_dir = mw.getRunDir() + "/scripts"
|
||||||
@@ -557,7 +573,10 @@ fi''' % (mw.getRunDir(),)
|
|||||||
shell += '''
|
shell += '''
|
||||||
echo "----------------------------------------------------------------------------"
|
echo "----------------------------------------------------------------------------"
|
||||||
endDate=`date +"%Y-%m-%d %H:%M:%S"`
|
endDate=`date +"%Y-%m-%d %H:%M:%S"`
|
||||||
echo "★[$endDate] Successful"
|
END_MW_SHELL_TIME=`date +"%s"`
|
||||||
|
((SHELL_COS_TIME=($END_MW_SHELL_TIME-$START_MW_SHELL_TIME)))
|
||||||
|
MW_ToSeconds $SHELL_COS_TIME
|
||||||
|
echo "★[$endDate] Successful | Script Run [$SCRIPT_RUN_TIME] "
|
||||||
echo "----------------------------------------------------------------------------"
|
echo "----------------------------------------------------------------------------"
|
||||||
'''
|
'''
|
||||||
cronPath = mw.getServerDir() + '/cron'
|
cronPath = mw.getServerDir() + '/cron'
|
||||||
|
|||||||
@@ -1215,6 +1215,12 @@ def formatDate(format="%Y-%m-%d %H:%M:%S", times=None):
|
|||||||
return time.strftime(format, time_local)
|
return time.strftime(format, time_local)
|
||||||
|
|
||||||
|
|
||||||
|
def strfToTime(sdate):
|
||||||
|
# 转换时间
|
||||||
|
import time
|
||||||
|
return time.strftime('%Y-%m-%d', time.strptime(sdate, '%b %d %H:%M:%S %Y %Z'))
|
||||||
|
|
||||||
|
|
||||||
def checkIp(ip):
|
def checkIp(ip):
|
||||||
# 检查是否为IPv4地址
|
# 检查是否为IPv4地址
|
||||||
import re
|
import re
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ class plugins_api:
|
|||||||
def initApi(self):
|
def initApi(self):
|
||||||
|
|
||||||
plugin_names = {
|
plugin_names = {
|
||||||
'openresty': '1.21.4.1',
|
'openresty': '1.21.4.2',
|
||||||
'php': '56',
|
'php': '56',
|
||||||
'swap': '1.1',
|
'swap': '1.1',
|
||||||
'mysql': '5.7',
|
'mysql': '5.7',
|
||||||
|
|||||||
+105
-51
@@ -1435,6 +1435,8 @@ class site_api:
|
|||||||
data['data'] = mw.readFile(filename)
|
data['data'] = mw.readFile(filename)
|
||||||
data['rlist'] = []
|
data['rlist'] = []
|
||||||
for ds in os.listdir(self.rewritePath):
|
for ds in os.listdir(self.rewritePath):
|
||||||
|
if ds[0:1] == '.':
|
||||||
|
continue
|
||||||
if ds == 'list.txt':
|
if ds == 'list.txt':
|
||||||
continue
|
continue
|
||||||
data['rlist'].append(ds[0:len(ds) - 5])
|
data['rlist'].append(ds[0:len(ds) - 5])
|
||||||
@@ -1868,19 +1870,16 @@ class site_api:
|
|||||||
if _id == '' or _siteName == '':
|
if _id == '' or _siteName == '':
|
||||||
return mw.returnJson(False, "必填项不能为空!")
|
return mw.returnJson(False, "必填项不能为空!")
|
||||||
|
|
||||||
_old_config = mw.readFile(
|
proxy_file = "{}/{}/{}.conf".format(self.proxyPath, _siteName, _id)
|
||||||
"{}/{}/{}.conf".format(self.proxyPath, _siteName, _id))
|
mw.backFile(proxy_file)
|
||||||
if _old_config == False:
|
mw.writeFile(proxy_file, _config)
|
||||||
return mw.returnJson(False, "非法操作")
|
|
||||||
|
|
||||||
mw.writeFile("{}/{}/{}.conf".format(self.proxyPath,
|
|
||||||
_siteName, _id), _config)
|
|
||||||
rule_test = mw.checkWebConfig()
|
rule_test = mw.checkWebConfig()
|
||||||
if rule_test != True:
|
if rule_test != True:
|
||||||
mw.writeFile("{}/{}/{}.conf".format(self.proxyPath,
|
mw.restoreFile(proxy_file)
|
||||||
_siteName, _id), _old_config)
|
mw.removeBackFile(proxy_file)
|
||||||
return mw.returnJson(False, "OpenResty 配置测试不通过, 请重试: {}".format(rule_test))
|
return mw.returnJson(False, "OpenResty 配置测试不通过, 请重试: {}".format(rule_test))
|
||||||
|
|
||||||
|
mw.removeBackFile(proxy_file)
|
||||||
self.operateRedirectConf(_siteName, 'start')
|
self.operateRedirectConf(_siteName, 'start')
|
||||||
mw.restartWeb()
|
mw.restartWeb()
|
||||||
return mw.returnJson(True, "ok")
|
return mw.returnJson(True, "ok")
|
||||||
@@ -1921,21 +1920,20 @@ class site_api:
|
|||||||
_from = request.form.get('from', '')
|
_from = request.form.get('from', '')
|
||||||
_to = request.form.get('to', '')
|
_to = request.form.get('to', '')
|
||||||
_host = request.form.get('host', '')
|
_host = request.form.get('host', '')
|
||||||
|
_name = request.form.get('name', '')
|
||||||
_open_proxy = request.form.get('open_proxy', '')
|
_open_proxy = request.form.get('open_proxy', '')
|
||||||
|
_open_cache = request.form.get('open_cache', '')
|
||||||
|
_cache_time = request.form.get('cache_time', '')
|
||||||
|
_id = request.form.get('id', '')
|
||||||
|
|
||||||
if _siteName == "" or _from == "" or _to == "" or _host == "":
|
# print(_name, _siteName, _from, _to, _host)
|
||||||
|
if _name == "" or _siteName == "" or _from == "" or _to == "" or _host == "":
|
||||||
return mw.returnJson(False, "必填项不能为空")
|
return mw.returnJson(False, "必填项不能为空")
|
||||||
|
|
||||||
data_path = self.getProxyDataPath(_siteName)
|
|
||||||
data_content = mw.readFile(
|
|
||||||
data_path) if os.path.exists(data_path) else ""
|
|
||||||
data = json.loads(data_content) if data_content != "" else []
|
|
||||||
|
|
||||||
rep = "http(s)?\:\/\/([a-zA-Z0-9][-a-zA-Z0-9]{0,62}\.)+([a-zA-Z0-9][a-zA-Z0-9]{0,62})+.?"
|
rep = "http(s)?\:\/\/([a-zA-Z0-9][-a-zA-Z0-9]{0,62}\.)+([a-zA-Z0-9][a-zA-Z0-9]{0,62})+.?"
|
||||||
if not re.match(rep, _to):
|
if not re.match(rep, _to):
|
||||||
return mw.returnJson(False, "错误的目标地址!")
|
return mw.returnJson(False, "错误的目标地址!")
|
||||||
|
|
||||||
# _to = _to.strip("/")
|
|
||||||
# get host from url
|
# get host from url
|
||||||
try:
|
try:
|
||||||
if _host == "$host":
|
if _host == "$host":
|
||||||
@@ -1944,7 +1942,11 @@ class site_api:
|
|||||||
except:
|
except:
|
||||||
return mw.returnJson(False, "错误的目标地址")
|
return mw.returnJson(False, "错误的目标地址")
|
||||||
|
|
||||||
# location ~* ^{from}(.*)$ {
|
proxy_site_path = self.getProxyDataPath(_siteName)
|
||||||
|
data_content = mw.readFile(
|
||||||
|
proxy_site_path) if os.path.exists(proxy_site_path) else ""
|
||||||
|
data = json.loads(data_content) if data_content != "" else []
|
||||||
|
|
||||||
tpl = "#PROXY-START\n\
|
tpl = "#PROXY-START\n\
|
||||||
location ^~ {from} {\n\
|
location ^~ {from} {\n\
|
||||||
proxy_pass {to};\n\
|
proxy_pass {to};\n\
|
||||||
@@ -1952,12 +1954,29 @@ location ^~ {from} {\n\
|
|||||||
proxy_set_header X-Real-IP $remote_addr;\n\
|
proxy_set_header X-Real-IP $remote_addr;\n\
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n\
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n\
|
||||||
proxy_set_header REMOTE-HOST $remote_addr;\n\
|
proxy_set_header REMOTE-HOST $remote_addr;\n\
|
||||||
|
proxy_set_header Upgrade $http_upgrade;\n\
|
||||||
|
proxy_set_header Connection $connection_upgrade;\n\
|
||||||
|
proxy_http_version 1.1;\n\
|
||||||
\n\
|
\n\
|
||||||
add_header X-Cache $upstream_cache_status;\n\
|
add_header X-Cache $upstream_cache_status;\n\
|
||||||
proxy_ignore_headers Set-Cookie Cache-Control expires;\n\
|
|
||||||
add_header Cache-Control no-cache;\n\
|
|
||||||
\n\
|
\n\
|
||||||
set $static_files_app 0;\n\
|
{proxy_cache}\n\
|
||||||
|
}\n\
|
||||||
|
# PROXY-END"
|
||||||
|
|
||||||
|
tpl_proxy_cache = "\n\
|
||||||
|
if ( $uri ~* \"\.(gif|png|jpg|css|js|woff|woff2)$\" )\n\
|
||||||
|
{\n\
|
||||||
|
expires {cache_time}m;\n\
|
||||||
|
}\n\
|
||||||
|
proxy_ignore_headers Set-Cookie Cache-Control expires;\n\
|
||||||
|
proxy_cache mw_cache;\n\
|
||||||
|
proxy_cache_key \"$host$uri$is_args$args\";\n\
|
||||||
|
proxy_cache_valid 200 304 301 302 {cache_time}m;\n\
|
||||||
|
"
|
||||||
|
|
||||||
|
tpl_proxy_nocache = "\n\
|
||||||
|
set $static_files_app 0; \n\
|
||||||
if ( $uri ~* \"\.(gif|png|jpg|css|js|woff|woff2)$\" )\n\
|
if ( $uri ~* \"\.(gif|png|jpg|css|js|woff|woff2)$\" )\n\
|
||||||
{\n\
|
{\n\
|
||||||
set $static_files_app 1;\n\
|
set $static_files_app 1;\n\
|
||||||
@@ -1967,8 +1986,7 @@ location ^~ {from} {\n\
|
|||||||
{\n\
|
{\n\
|
||||||
add_header Cache-Control no-cache;\n\
|
add_header Cache-Control no-cache;\n\
|
||||||
}\n\
|
}\n\
|
||||||
}\n\
|
"
|
||||||
#PROXY-END"
|
|
||||||
|
|
||||||
# replace
|
# replace
|
||||||
if _from[0] != '/':
|
if _from[0] != '/':
|
||||||
@@ -1976,28 +1994,69 @@ location ^~ {from} {\n\
|
|||||||
tpl = tpl.replace("{from}", _from, 999)
|
tpl = tpl.replace("{from}", _from, 999)
|
||||||
tpl = tpl.replace("{to}", _to)
|
tpl = tpl.replace("{to}", _to)
|
||||||
tpl = tpl.replace("{host}", _host, 999)
|
tpl = tpl.replace("{host}", _host, 999)
|
||||||
|
tpl = tpl.replace("{cache_time}", _cache_time, 999)
|
||||||
|
|
||||||
_id = mw.md5("{}+{}+{}".format(_from, _to, _siteName))
|
if _open_cache == 'on':
|
||||||
for item in data:
|
tpl_proxy_cache = tpl_proxy_cache.replace(
|
||||||
if item["id"] == _id:
|
"{cache_time}", _cache_time, 999)
|
||||||
return mw.returnJson(False, "已存在该规则!")
|
tpl = tpl.replace("{proxy_cache}", tpl_proxy_cache, 999)
|
||||||
if item["from"] == _from:
|
else:
|
||||||
return mw.returnJson(False, "代理目录已存在!")
|
tpl = tpl.replace("{proxy_cache}", tpl_proxy_nocache, 999)
|
||||||
data.append({
|
|
||||||
"from": _from,
|
proxy_action = 'add'
|
||||||
"to": _to,
|
if _id == "":
|
||||||
"host": _host,
|
_id = mw.md5("{}".format(_name))
|
||||||
"id": _id
|
else:
|
||||||
})
|
proxy_action = 'edit'
|
||||||
|
|
||||||
|
conf_proxy = "{}/{}.conf".format(self.getProxyPath(_siteName), _id)
|
||||||
|
conf_bk = "{}/{}.conf.txt".format(self.getProxyPath(_siteName), _id)
|
||||||
|
|
||||||
|
mw.writeFile(conf_proxy, tpl)
|
||||||
|
|
||||||
|
rule_test = mw.checkWebConfig()
|
||||||
|
if rule_test != True:
|
||||||
|
os.remove(conf_proxy)
|
||||||
|
return mw.returnJson(False, "OpenResty配置测试不通过, 请重试: {}".format(rule_test))
|
||||||
|
|
||||||
|
if proxy_action == "add":
|
||||||
|
# 添加代理
|
||||||
|
_id = mw.md5("{}".format(_name))
|
||||||
|
for item in data:
|
||||||
|
if item["name"] == _name:
|
||||||
|
return mw.returnJson(False, "名称重复!")
|
||||||
|
if item["from"] == _from:
|
||||||
|
return mw.returnJson(False, "代理目录已存在!")
|
||||||
|
data.append({
|
||||||
|
"name": _name,
|
||||||
|
"from": _from,
|
||||||
|
"to": _to,
|
||||||
|
"host": _host,
|
||||||
|
"open_cache": _open_cache,
|
||||||
|
"open_proxy": _open_proxy,
|
||||||
|
"cache_time": _cache_time,
|
||||||
|
"id": _id,
|
||||||
|
})
|
||||||
|
else:
|
||||||
|
# 修改代理
|
||||||
|
dindex = -1
|
||||||
|
for x in range(len(data)):
|
||||||
|
if data[x]["id"] == _id:
|
||||||
|
dindex = x
|
||||||
|
break
|
||||||
|
if dindex < 0:
|
||||||
|
return mw.returnJson(False, "异常请求")
|
||||||
|
data[dindex]['from'] = _from
|
||||||
|
data[dindex]['to'] = _to
|
||||||
|
data[dindex]['host'] = _host
|
||||||
|
data[dindex]['open_cache'] = _open_cache
|
||||||
|
data[dindex]['open_proxy'] = _open_proxy
|
||||||
|
data[dindex]['cache_time'] = _cache_time
|
||||||
|
|
||||||
conf_file = "{}/{}.conf".format(self.getProxyPath(_siteName), _id)
|
|
||||||
if _open_proxy != 'on':
|
if _open_proxy != 'on':
|
||||||
conf_file = "{}/{}.conf.txt".format(
|
os.rename(conf_proxy, conf_bk)
|
||||||
self.getProxyPath(_siteName), _id)
|
|
||||||
|
|
||||||
mw.writeFile(data_path, json.dumps(data))
|
|
||||||
mw.writeFile(conf_file, tpl)
|
|
||||||
|
|
||||||
|
mw.writeFile(proxy_site_path, json.dumps(data))
|
||||||
self.operateProxyConf(_siteName, 'start')
|
self.operateProxyConf(_siteName, 'start')
|
||||||
mw.restartWeb()
|
mw.restartWeb()
|
||||||
return mw.returnJson(True, "ok", {"hash": _id})
|
return mw.returnJson(True, "ok", {"hash": _id})
|
||||||
@@ -2028,10 +2087,10 @@ location ^~ {from} {\n\
|
|||||||
self.getProxyPath(_siteName), _id)
|
self.getProxyPath(_siteName), _id)
|
||||||
mw.execShell(cmd)
|
mw.execShell(cmd)
|
||||||
except:
|
except:
|
||||||
return mw.returnJson(False, "删除失败!")
|
return mw.returnJson(False, "删除反代失败!")
|
||||||
|
|
||||||
mw.restartWeb()
|
mw.restartWeb()
|
||||||
return mw.returnJson(True, "删除成功!")
|
return mw.returnJson(True, "删除反代成功!")
|
||||||
|
|
||||||
def getSiteTypesApi(self):
|
def getSiteTypesApi(self):
|
||||||
# 取网站分类
|
# 取网站分类
|
||||||
@@ -2098,7 +2157,7 @@ location ^~ {from} {\n\
|
|||||||
|
|
||||||
##### ----- end ----- ###
|
##### ----- end ----- ###
|
||||||
|
|
||||||
# 域名编码转换
|
# 域名编码转换
|
||||||
def toPunycode(self, domain):
|
def toPunycode(self, domain):
|
||||||
import re
|
import re
|
||||||
if sys.version_info[0] == 2:
|
if sys.version_info[0] == 2:
|
||||||
@@ -2106,7 +2165,7 @@ location ^~ {from} {\n\
|
|||||||
tmp = domain.split('.')
|
tmp = domain.split('.')
|
||||||
newdomain = ''
|
newdomain = ''
|
||||||
for dkey in tmp:
|
for dkey in tmp:
|
||||||
# 匹配非ascii字符
|
# 匹配非ascii字符
|
||||||
match = re.search(u"[\x80-\xff]+", dkey)
|
match = re.search(u"[\x80-\xff]+", dkey)
|
||||||
if not match:
|
if not match:
|
||||||
newdomain += dkey + '.'
|
newdomain += dkey + '.'
|
||||||
@@ -2661,7 +2720,7 @@ location ^~ {from} {\n\
|
|||||||
mw.writeLog('TYPE_SITE', '设置成功,站点到期后将自动停止!', (siteName, edate))
|
mw.writeLog('TYPE_SITE', '设置成功,站点到期后将自动停止!', (siteName, edate))
|
||||||
return mw.returnJson(True, '设置成功,站点到期后将自动停止!')
|
return mw.returnJson(True, '设置成功,站点到期后将自动停止!')
|
||||||
|
|
||||||
# ssl相关方法 start
|
# ssl相关方法 start
|
||||||
def setSslConf(self, siteName):
|
def setSslConf(self, siteName):
|
||||||
file = self.getHostConf(siteName)
|
file = self.getHostConf(siteName)
|
||||||
conf = mw.readFile(file)
|
conf = mw.readFile(file)
|
||||||
@@ -2760,9 +2819,4 @@ location ^~ {from} {\n\
|
|||||||
mw.execShell("chattr +i " + filename)
|
mw.execShell("chattr +i " + filename)
|
||||||
|
|
||||||
return mw.returnJson(True, '已打开防跨站设置!')
|
return mw.returnJson(True, '已打开防跨站设置!')
|
||||||
|
# ssl相关方法 end
|
||||||
# 转换时间
|
|
||||||
def strfToTime(self, sdate):
|
|
||||||
import time
|
|
||||||
return time.strftime('%Y-%m-%d', time.strptime(sdate, '%b %d %H:%M:%S %Y %Z'))
|
|
||||||
# ssl相关方法 end
|
|
||||||
|
|||||||
@@ -755,6 +755,8 @@ class system_api:
|
|||||||
#!/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
|
||||||
|
|
||||||
|
P_VER=`python3 -V | awk '{print $2}'`
|
||||||
|
|
||||||
if [ ! -f /www/server/mdserver-web/bin/activate ];then
|
if [ ! -f /www/server/mdserver-web/bin/activate ];then
|
||||||
cd /www/server/mdserver-web && python3 -m venv .
|
cd /www/server/mdserver-web && python3 -m venv .
|
||||||
cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate
|
cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate
|
||||||
@@ -769,6 +771,14 @@ if [ ! -z "$cn" ];then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt -i $PIPSRC
|
cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt -i $PIPSRC
|
||||||
|
|
||||||
|
P_VER_D=`echo "$P_VER"|awk -F '.' '{print $1}'`
|
||||||
|
P_VER_M=`echo "$P_VER"|awk -F '.' '{print $2}'`
|
||||||
|
NEW_P_VER=${P_VER_D}.${P_VER_M}
|
||||||
|
|
||||||
|
if [ -f /www/server/mdserver-web/version/r${NEW_P_VER}.txt ];then
|
||||||
|
cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/version/r${NEW_P_VER}.txt -i $PIPSRC
|
||||||
|
fi
|
||||||
'''
|
'''
|
||||||
os.system(update_env)
|
os.system(update_env)
|
||||||
self.restartMw()
|
self.restartMw()
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ mw_start_task()
|
|||||||
{
|
{
|
||||||
isStart=$(ps aux |grep 'task.py'|grep -v grep|awk '{print $2}')
|
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-tasks... \c"
|
||||||
cd $DIR && python3 task.py >> ${DIR}/logs/task.log 2>&1 &
|
cd $DIR && python3 task.py >> ${DIR}/logs/task.log 2>&1 &
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
isStart=$(ps aux |grep 'task.py'|grep -v grep|awk '{print $2}')
|
isStart=$(ps aux |grep 'task.py'|grep -v grep|awk '{print $2}')
|
||||||
@@ -30,7 +30,7 @@ mw_start_task()
|
|||||||
fi
|
fi
|
||||||
echo -e "\033[32mdone\033[0m"
|
echo -e "\033[32mdone\033[0m"
|
||||||
else
|
else
|
||||||
echo "Starting mw-tasks... mw-tasks (pid $(echo $isStart)) already running"
|
echo "starting mw-tasks... mw-tasks (pid $(echo $isStart)) already running"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,9 +46,8 @@ CREATE TABLE IF NOT EXISTS `firewall` (
|
|||||||
|
|
||||||
INSERT INTO `firewall` (`id`, `port`, `ps`, `addtime`) VALUES
|
INSERT INTO `firewall` (`id`, `port`, `ps`, `addtime`) VALUES
|
||||||
(1, '80', '网站默认端口', '0000-00-00 00:00:00'),
|
(1, '80', '网站默认端口', '0000-00-00 00:00:00'),
|
||||||
(2, '22', 'SSH远程管理服务', '0000-00-00 00:00:00'),
|
(2, '443', 'HTTPS', '0000-00-00 00:00:00'),
|
||||||
(3, '443', 'HTTPS', '0000-00-00 00:00:00'),
|
(3, '888', 'phpMyAdmin默认端口', '0000-00-00 00:00:00');
|
||||||
(4, '888', 'phpMyAdmin默认端口', '0000-00-00 00:00:00');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-9
@@ -39,20 +39,13 @@ server
|
|||||||
allow all;
|
allow all;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ .*\\.(gif|jpg|jpeg|png|bmp|swf)$
|
location ~ .*\\.(gif|jpg|jpeg|png|bmp|swf|js|css)$
|
||||||
{
|
{
|
||||||
expires 30d;
|
expires 30d;
|
||||||
error_log off;
|
error_log /dev/null;
|
||||||
access_log /dev/null;
|
access_log /dev/null;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ .*\\.(js|css)?$
|
|
||||||
{
|
|
||||||
expires 12h;
|
|
||||||
error_log off;
|
|
||||||
access_log /dev/null;
|
|
||||||
}
|
|
||||||
|
|
||||||
access_log {$LOGPATH}/{$SERVER_NAME}.log main;
|
access_log {$LOGPATH}/{$SERVER_NAME}.log main;
|
||||||
error_log {$LOGPATH}/{$SERVER_NAME}.error.log;
|
error_log {$LOGPATH}/{$SERVER_NAME}.error.log;
|
||||||
}
|
}
|
||||||
@@ -35,18 +35,11 @@ server
|
|||||||
allow all;
|
allow all;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ .*\\.(gif|jpg|jpeg|png|bmp|swf)$
|
location ~ .*\\.(gif|jpg|jpeg|png|bmp|swf|js|css)$
|
||||||
{
|
{
|
||||||
expires 30d;
|
error_log /dev/null;
|
||||||
error_log off;
|
|
||||||
access_log /dev/null;
|
access_log /dev/null;
|
||||||
}
|
expires 30d;
|
||||||
|
|
||||||
location ~ .*\\.(js|css)?$
|
|
||||||
{
|
|
||||||
expires 12h;
|
|
||||||
error_log off;
|
|
||||||
access_log /dev/null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
access_log {$LOGPATH}/{$SERVER_MAIN}_{$DIRBIND}.log;
|
access_log {$LOGPATH}/{$SERVER_MAIN}_{$DIRBIND}.log;
|
||||||
|
|||||||
@@ -40,6 +40,8 @@
|
|||||||
<p onclick="pluginInitD('docker');">自启动</p>
|
<p onclick="pluginInitD('docker');">自启动</p>
|
||||||
<p onclick="dockerConList();">容器列表</p>
|
<p onclick="dockerConList();">容器列表</p>
|
||||||
<p onclick="dockerImageList();">镜像列表</p>
|
<p onclick="dockerImageList();">镜像列表</p>
|
||||||
|
<p onclick="dockerImageOutput();">镜像导出</p>
|
||||||
|
<p onclick="dockerIpList();">IP地址池</p>
|
||||||
<p onclick="repoList();">仓库</p>
|
<p onclick="repoList();">仓库</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="bt-w-con pd15">
|
<div class="bt-w-con pd15">
|
||||||
|
|||||||
+193
-2
@@ -429,6 +429,92 @@ def dockerRemoveImage():
|
|||||||
return mw.returnJson(False, '删除失败, 当前镜像正在使用!')
|
return mw.returnJson(False, '删除失败, 当前镜像正在使用!')
|
||||||
|
|
||||||
|
|
||||||
|
def getImageListFunc(dbname=''):
|
||||||
|
bkDir = mw.getRootDir() + '/backup/docker'
|
||||||
|
blist = os.listdir(bkDir)
|
||||||
|
r = []
|
||||||
|
|
||||||
|
bname = 'db_' + dbname
|
||||||
|
blen = len(bname)
|
||||||
|
for x in blist:
|
||||||
|
fbstr = x[0:blen]
|
||||||
|
if fbstr == bname:
|
||||||
|
r.append(x)
|
||||||
|
return r
|
||||||
|
|
||||||
|
|
||||||
|
def dockerImagePickDir():
|
||||||
|
bkDir = mw.getRootDir() + '/backup/docker'
|
||||||
|
return mw.returnJson(True, 'ok', bkDir)
|
||||||
|
|
||||||
|
|
||||||
|
def dockerImagePickList():
|
||||||
|
|
||||||
|
bkDir = mw.getRootDir() + '/backup/docker'
|
||||||
|
if not os.path.exists(bkDir):
|
||||||
|
os.mkdir(bkDir)
|
||||||
|
|
||||||
|
r = os.listdir(bkDir)
|
||||||
|
rr = []
|
||||||
|
for x in range(0, len(r)):
|
||||||
|
p = bkDir + '/' + r[x]
|
||||||
|
data = {}
|
||||||
|
data['name'] = r[x]
|
||||||
|
|
||||||
|
rsize = os.path.getsize(p)
|
||||||
|
data['size'] = mw.toSize(rsize)
|
||||||
|
|
||||||
|
t = os.path.getctime(p)
|
||||||
|
t = time.localtime(t)
|
||||||
|
|
||||||
|
data['time'] = time.strftime('%Y-%m-%d %H:%M:%S', t)
|
||||||
|
rr.append(data)
|
||||||
|
|
||||||
|
data['file'] = p
|
||||||
|
|
||||||
|
return mw.returnJson(True, 'ok', rr)
|
||||||
|
|
||||||
|
|
||||||
|
def dockerImagePickSave():
|
||||||
|
# image 导出
|
||||||
|
args = getArgs()
|
||||||
|
data = checkArgs(args, ['images'])
|
||||||
|
if not data[0]:
|
||||||
|
return data[1]
|
||||||
|
|
||||||
|
bkDir = mw.getRootDir() + '/backup/docker/'
|
||||||
|
images = args['images']
|
||||||
|
try:
|
||||||
|
file_name = bkDir + \
|
||||||
|
str(time.strftime('%Y%m%d_%H%M%S', time.localtime())) + '.tar.gz'
|
||||||
|
mw.execShell('docker image save %s | gzip > %s' %
|
||||||
|
(images, file_name))
|
||||||
|
return mw.returnJson(True, '导出镜像 {} 成功!'.format(file_name))
|
||||||
|
except docker.errors.APIError as ex:
|
||||||
|
return mw.returnJson(False, '操作失败: ' + str(ex))
|
||||||
|
|
||||||
|
|
||||||
|
def dockerImagePickLoad():
|
||||||
|
# 镜像文件导入
|
||||||
|
args = getArgs()
|
||||||
|
data = checkArgs(args, ['file'])
|
||||||
|
if not data[0]:
|
||||||
|
return data[1]
|
||||||
|
try:
|
||||||
|
file_path = args['file']
|
||||||
|
if not os.path.exists(file_path):
|
||||||
|
return mw.returnJson(False, '文件不存在')
|
||||||
|
if file_path.endswith('.tar'):
|
||||||
|
mw.execShell('docker image load < %s' % file_path)
|
||||||
|
elif file_path.endswith('.tar.gz'):
|
||||||
|
mw.execShell('gunzip -c %s | docker image load' % file_path)
|
||||||
|
else:
|
||||||
|
return mw.returnJson(False, '不支持改文件类型!')
|
||||||
|
return mw.returnJson(True, '导入镜像文件成功!')
|
||||||
|
except docker.errors.APIError as ex:
|
||||||
|
return mw.returnJson(False, '操作失败: ' + str(ex))
|
||||||
|
|
||||||
|
|
||||||
def dockerLoginCheck(user_name, user_pass, registry):
|
def dockerLoginCheck(user_name, user_pass, registry):
|
||||||
# 登陆验证
|
# 登陆验证
|
||||||
cmd = 'docker login -u=%s -p %s %s' % (user_name, user_pass, registry)
|
cmd = 'docker login -u=%s -p %s %s' % (user_name, user_pass, registry)
|
||||||
@@ -443,7 +529,7 @@ def dockerLoginCheck(user_name, user_pass, registry):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def getDockerIpList():
|
def getDockerIpListData():
|
||||||
# 取IP列表
|
# 取IP列表
|
||||||
path = getServerDir()
|
path = getServerDir()
|
||||||
ipConf = path + '/iplist.json'
|
ipConf = path + '/iplist.json'
|
||||||
@@ -453,13 +539,63 @@ def getDockerIpList():
|
|||||||
return iplist
|
return iplist
|
||||||
|
|
||||||
|
|
||||||
|
def getDockerIpList():
|
||||||
|
data = getDockerIpListData()
|
||||||
|
return mw.returnJson(True, 'ok!', data)
|
||||||
|
|
||||||
|
|
||||||
|
def dockerAddIP():
|
||||||
|
# 添加IP
|
||||||
|
args = getArgs()
|
||||||
|
data = checkArgs(args, ['address', 'netmask', 'gateway'])
|
||||||
|
if not data[0]:
|
||||||
|
return data[1]
|
||||||
|
|
||||||
|
path = getServerDir()
|
||||||
|
ipConf = path + '/iplist.json'
|
||||||
|
if not os.path.exists(ipConf):
|
||||||
|
iplist = []
|
||||||
|
mw.writeFile(ipConf, json.dumps(iplist))
|
||||||
|
|
||||||
|
iplist = json.loads(mw.readFile(ipConf))
|
||||||
|
ipInfo = {
|
||||||
|
'address': args['address'],
|
||||||
|
'netmask': args['netmask'],
|
||||||
|
'gateway': args['gateway'],
|
||||||
|
}
|
||||||
|
iplist.append(ipInfo)
|
||||||
|
mw.writeFile(ipConf, json.dumps(iplist))
|
||||||
|
return mw.returnJson(True, '添加成功!')
|
||||||
|
|
||||||
|
|
||||||
|
def dockerDelIP():
|
||||||
|
# 删除IP
|
||||||
|
args = getArgs()
|
||||||
|
data = checkArgs(args, ['address'])
|
||||||
|
if not data[0]:
|
||||||
|
return data[1]
|
||||||
|
|
||||||
|
path = getServerDir()
|
||||||
|
ipConf = path + '/iplist.json'
|
||||||
|
if not os.path.exists(ipConf):
|
||||||
|
return mw.returnJson(False, '指定的IP不存在。!')
|
||||||
|
iplist = json.loads(mw.readFile(ipConf))
|
||||||
|
newList = []
|
||||||
|
for ipInfo in iplist:
|
||||||
|
if ipInfo['address'] == args['address']:
|
||||||
|
continue
|
||||||
|
newList.append(ipInfo)
|
||||||
|
mw.writeFile(ipConf, json.dumps(newList))
|
||||||
|
return mw.returnJson(True, '成功删除!')
|
||||||
|
|
||||||
|
|
||||||
def getDockerCreateInfo():
|
def getDockerCreateInfo():
|
||||||
# 取创建依赖
|
# 取创建依赖
|
||||||
import psutil
|
import psutil
|
||||||
data = {}
|
data = {}
|
||||||
data['images'] = imageList()
|
data['images'] = imageList()
|
||||||
data['memSize'] = int(psutil.virtual_memory().total / 1024 / 1024)
|
data['memSize'] = int(psutil.virtual_memory().total / 1024 / 1024)
|
||||||
data['iplist'] = getDockerIpList()
|
data['iplist'] = getDockerIpListData()
|
||||||
return mw.returnJson(True, 'ok!', data)
|
return mw.returnJson(True, 'ok!', data)
|
||||||
|
|
||||||
|
|
||||||
@@ -473,6 +609,45 @@ def __release_port(port):
|
|||||||
return "Release failed {}".format(e)
|
return "Release failed {}".format(e)
|
||||||
|
|
||||||
|
|
||||||
|
def dockerPortCheck():
|
||||||
|
args = getArgs()
|
||||||
|
data = checkArgs(args, ['port'])
|
||||||
|
if not data[0]:
|
||||||
|
return data[1]
|
||||||
|
|
||||||
|
port = args['port']
|
||||||
|
is_ok = IsPortExists(port)
|
||||||
|
if is_ok:
|
||||||
|
return mw.returnJson(True, 'ok')
|
||||||
|
return mw.returnJson(False, 'fail')
|
||||||
|
|
||||||
|
|
||||||
|
def IsPortExists(port):
|
||||||
|
# 判断端口是否被占用
|
||||||
|
ret = __check_dst_port(ip='localhost', port=port)
|
||||||
|
ret2 = __check_dst_port(ip='0.0.0.0', port=port)
|
||||||
|
if ret:
|
||||||
|
return ret
|
||||||
|
if not ret and ret2:
|
||||||
|
return ret2
|
||||||
|
if not ret and not ret2:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def __check_dst_port(ip, port, timeout=3):
|
||||||
|
# 端口检测
|
||||||
|
import socket
|
||||||
|
ok = True
|
||||||
|
try:
|
||||||
|
s = socket.socket()
|
||||||
|
s.settimeout(timeout)
|
||||||
|
s.connect((ip, port))
|
||||||
|
s.close()
|
||||||
|
except:
|
||||||
|
ok = False
|
||||||
|
return ok
|
||||||
|
|
||||||
|
|
||||||
def dockerCreateCon():
|
def dockerCreateCon():
|
||||||
args = getArgs()
|
args = getArgs()
|
||||||
data = checkArgs(args, ['environments', 'command',
|
data = checkArgs(args, ['environments', 'command',
|
||||||
@@ -653,12 +828,28 @@ if __name__ == "__main__":
|
|||||||
print(dockerPullReg())
|
print(dockerPullReg())
|
||||||
elif func == 'image_list':
|
elif func == 'image_list':
|
||||||
print(imageListData())
|
print(imageListData())
|
||||||
|
elif func == 'image_pick_dir':
|
||||||
|
print(dockerImagePickDir())
|
||||||
|
elif func == 'image_pick_save':
|
||||||
|
print(dockerImagePickSave())
|
||||||
|
elif func == 'image_pick_load':
|
||||||
|
print(dockerImagePickLoad())
|
||||||
|
elif func == 'image_pick_list':
|
||||||
|
print(dockerImagePickList())
|
||||||
|
elif func == 'docker_get_iplist':
|
||||||
|
print(getDockerIpList())
|
||||||
|
elif func == 'docker_del_ip':
|
||||||
|
print(dockerDelIP())
|
||||||
|
elif func == 'docker_add_ip':
|
||||||
|
print(dockerAddIP())
|
||||||
elif func == 'get_docker_create_info':
|
elif func == 'get_docker_create_info':
|
||||||
print(getDockerCreateInfo())
|
print(getDockerCreateInfo())
|
||||||
elif func == 'docker_create_con':
|
elif func == 'docker_create_con':
|
||||||
print(dockerCreateCon())
|
print(dockerCreateCon())
|
||||||
elif func == 'docker_remove_image':
|
elif func == 'docker_remove_image':
|
||||||
print(dockerRemoveImage())
|
print(dockerRemoveImage())
|
||||||
|
elif func == 'docker_port_check':
|
||||||
|
print(dockerPortCheck())
|
||||||
elif func == 'docker_login':
|
elif func == 'docker_login':
|
||||||
print(dockerLogin())
|
print(dockerLogin())
|
||||||
elif func == 'docker_logout':
|
elif func == 'docker_logout':
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"sort": 7,
|
"sort": 7,
|
||||||
"ps": "Docker 是一个开源的应用容器引擎(开发测试中)",
|
"ps": "Docker是一个开源的应用容器引擎",
|
||||||
"name": "docker",
|
"name": "docker",
|
||||||
"title": "Docker",
|
"title": "Docker",
|
||||||
"shell": "install.sh",
|
"shell": "install.sh",
|
||||||
|
|||||||
+583
-282
File diff suppressed because it is too large
Load Diff
@@ -739,7 +739,7 @@ def importDbBackup():
|
|||||||
|
|
||||||
pwd = pSqliteDb('config').where('id=?', (1,)).getField('mysql_root')
|
pwd = pSqliteDb('config').where('id=?', (1,)).getField('mysql_root')
|
||||||
sock = getSocketFile()
|
sock = getSocketFile()
|
||||||
mysql_cmd = getServerDir() + '/bin/mysql -S ' + sock + ' -uroot -p' + pwd + \
|
mysql_cmd = getServerDir() + '/bin/mariadb -S ' + sock + ' -uroot -p' + pwd + \
|
||||||
' ' + name + ' < ' + file_path_sql
|
' ' + name + ' < ' + file_path_sql
|
||||||
|
|
||||||
# print(mysql_cmd)
|
# print(mysql_cmd)
|
||||||
@@ -800,7 +800,7 @@ def importDbExternal():
|
|||||||
sock = getSocketFile()
|
sock = getSocketFile()
|
||||||
|
|
||||||
os.environ["MYSQL_PWD"] = pwd
|
os.environ["MYSQL_PWD"] = pwd
|
||||||
mysql_cmd = getServerDir() + '/bin/mysql -S ' + sock + ' -uroot -p' + \
|
mysql_cmd = getServerDir() + '/bin/mariadb -S ' + sock + ' -uroot -p' + \
|
||||||
pwd + ' ' + name + ' < ' + import_sql
|
pwd + ' ' + name + ' < ' + import_sql
|
||||||
|
|
||||||
# print(mysql_cmd)
|
# print(mysql_cmd)
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ default-character-set = UTF8MB4
|
|||||||
[mysqld]
|
[mysqld]
|
||||||
!include {$SERVER_APP_PATH}/etc/mode/classic.cnf
|
!include {$SERVER_APP_PATH}/etc/mode/classic.cnf
|
||||||
|
|
||||||
sha256_password_private_key_path=mysql.pem
|
sha256_password_private_key_path={$SERVER_APP_PATH}/data/mysql.pem
|
||||||
sha256_password_public_key_path=mysql.pub
|
sha256_password_public_key_path={$SERVER_APP_PATH}/data/mysql.pub
|
||||||
authentication_policy=mysql_native_password
|
authentication_policy=mysql_native_password
|
||||||
|
|
||||||
pid-file = {$SERVER_APP_PATH}/data/mysql.pid
|
pid-file = {$SERVER_APP_PATH}/data/mysql.pid
|
||||||
|
|||||||
+21
-10
@@ -167,7 +167,6 @@ def pMysqlDb():
|
|||||||
|
|
||||||
def makeInitRsaKey(version=''):
|
def makeInitRsaKey(version=''):
|
||||||
datadir = getServerDir() + "/data"
|
datadir = getServerDir() + "/data"
|
||||||
|
|
||||||
mysql_pem = datadir + "/mysql.pem"
|
mysql_pem = datadir + "/mysql.pem"
|
||||||
if not os.path.exists(mysql_pem):
|
if not os.path.exists(mysql_pem):
|
||||||
rdata = mw.execShell(
|
rdata = mw.execShell(
|
||||||
@@ -176,12 +175,11 @@ def makeInitRsaKey(version=''):
|
|||||||
rdata = mw.execShell(
|
rdata = mw.execShell(
|
||||||
'cd ' + datadir + ' && openssl rsa -in mysql.pem -pubout -out mysql.pub')
|
'cd ' + datadir + ' && openssl rsa -in mysql.pem -pubout -out mysql.pub')
|
||||||
# print(rdata)
|
# print(rdata)
|
||||||
|
if not mw.isAppleSystem():
|
||||||
if not mw.isAppleSystem():
|
mw.execShell('cd ' + datadir + ' && chmod 400 mysql.pem')
|
||||||
mw.execShell('cd ' + datadir + ' && chmod 400 mysql.pem')
|
mw.execShell('cd ' + datadir + ' && chmod 444 mysql.pub')
|
||||||
mw.execShell('cd ' + datadir + ' && chmod 444 mysql.pub')
|
mw.execShell('cd ' + datadir + ' && chown mysql:mysql mysql.pem')
|
||||||
mw.execShell('cd ' + datadir + ' && chown mysql:mysql mysql.pem')
|
mw.execShell('cd ' + datadir + ' && chown mysql:mysql mysql.pub')
|
||||||
mw.execShell('cd ' + datadir + ' && chown mysql:mysql mysql.pub')
|
|
||||||
|
|
||||||
|
|
||||||
def initDreplace(version=''):
|
def initDreplace(version=''):
|
||||||
@@ -251,6 +249,14 @@ def initDreplace(version=''):
|
|||||||
return file_bin
|
return file_bin
|
||||||
|
|
||||||
|
|
||||||
|
def process_status():
|
||||||
|
cmd = "ps -ef|grep mysql |grep -v grep | grep -v python | awk '{print $2}'"
|
||||||
|
data = mw.execShell(cmd)
|
||||||
|
if data[0] == '':
|
||||||
|
return 'stop'
|
||||||
|
return 'start'
|
||||||
|
|
||||||
|
|
||||||
def status(version=''):
|
def status(version=''):
|
||||||
path = getConf()
|
path = getConf()
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
@@ -450,7 +456,7 @@ def initMysqlPwd():
|
|||||||
|
|
||||||
|
|
||||||
def initMysql8Pwd():
|
def initMysql8Pwd():
|
||||||
time.sleep(2)
|
time.sleep(8)
|
||||||
|
|
||||||
serverdir = getServerDir()
|
serverdir = getServerDir()
|
||||||
myconf = serverdir + "/etc/my.cnf"
|
myconf = serverdir + "/etc/my.cnf"
|
||||||
@@ -540,7 +546,12 @@ def my8cmd(version, method):
|
|||||||
else:
|
else:
|
||||||
mw.execShell('systemctl start mysql')
|
mw.execShell('systemctl start mysql')
|
||||||
|
|
||||||
initMysql8Pwd()
|
for x in range(10):
|
||||||
|
mydb_status = process_status()
|
||||||
|
if mydb_status == 'start':
|
||||||
|
initMysql8Pwd()
|
||||||
|
break
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
if mw.isAppleSystem():
|
if mw.isAppleSystem():
|
||||||
cmd_init_stop = init_file + ' stop'
|
cmd_init_stop = init_file + ' stop'
|
||||||
@@ -562,11 +573,11 @@ def my8cmd(version, method):
|
|||||||
|
|
||||||
|
|
||||||
def appCMD(version, action):
|
def appCMD(version, action):
|
||||||
|
makeInitRsaKey(version)
|
||||||
if version == '8.0' or version == '5.7':
|
if version == '8.0' or version == '5.7':
|
||||||
status = my8cmd(version, action)
|
status = my8cmd(version, action)
|
||||||
else:
|
else:
|
||||||
status = myOp(version, action)
|
status = myOp(version, action)
|
||||||
makeInitRsaKey(version)
|
|
||||||
return status
|
return status
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class App:
|
|||||||
self.__agent_cfg = self.__setupPath + '/agent.cfg'
|
self.__agent_cfg = self.__setupPath + '/agent.cfg'
|
||||||
|
|
||||||
def getArgs(self):
|
def getArgs(self):
|
||||||
args = sys.argv[2:]
|
args = sys.argv[3:]
|
||||||
tmp = {}
|
tmp = {}
|
||||||
args_len = len(args)
|
args_len = len(args)
|
||||||
|
|
||||||
|
|||||||
@@ -533,49 +533,51 @@ end
|
|||||||
function waf()
|
function waf()
|
||||||
min_route()
|
min_route()
|
||||||
-- C:D("min_route")
|
-- C:D("min_route")
|
||||||
-- white ip
|
|
||||||
if waf_ip_white() then return true end
|
|
||||||
-- C:D("waf_ip_white")
|
|
||||||
|
|
||||||
-- url white
|
|
||||||
if waf_url_white() then return true end
|
|
||||||
-- C:D("waf_url_white")
|
|
||||||
|
|
||||||
-- black ip
|
|
||||||
if waf_ip_black() then return true end
|
|
||||||
-- C:D("waf_ip_black")
|
|
||||||
|
|
||||||
-- 封禁ip返回
|
|
||||||
if waf_drop_ip() then return true end
|
|
||||||
-- C:D("waf_drop_ip")
|
|
||||||
|
|
||||||
-- ua check
|
|
||||||
if waf_user_agent() then return true end
|
|
||||||
-- C:D("waf_user_agent")
|
|
||||||
if waf_url() then return true end
|
|
||||||
-- C:D("waf_url")
|
|
||||||
|
|
||||||
-- cc setting
|
|
||||||
if waf_cc_increase() then return true end
|
|
||||||
-- C:D("waf_cc_increase")
|
|
||||||
if waf_cc() then return true end
|
|
||||||
-- C:D("waf_cc")
|
|
||||||
|
|
||||||
-- cookie检查
|
|
||||||
if waf_cookie() then return true end
|
|
||||||
-- C:D("waf_cookie")
|
|
||||||
|
|
||||||
-- args参数拦截
|
|
||||||
if waf_get_args() then return true end
|
|
||||||
-- C:D("waf_get_args")
|
|
||||||
|
|
||||||
-- 扫描软件禁止
|
|
||||||
if waf_scan_black() then return true end
|
|
||||||
-- C:D("waf_scan_black")
|
|
||||||
if waf_post() then return true end
|
|
||||||
-- C:D("waf_post")
|
|
||||||
|
|
||||||
if site_config[server_name] and site_config[server_name]['open'] then
|
if site_config[server_name] and site_config[server_name]['open'] then
|
||||||
|
-- white ip
|
||||||
|
if waf_ip_white() then return true end
|
||||||
|
-- C:D("waf_ip_white")
|
||||||
|
|
||||||
|
-- url white
|
||||||
|
if waf_url_white() then return true end
|
||||||
|
-- C:D("waf_url_white")
|
||||||
|
|
||||||
|
-- black ip
|
||||||
|
if waf_ip_black() then return true end
|
||||||
|
-- C:D("waf_ip_black")
|
||||||
|
|
||||||
|
-- 封禁ip返回
|
||||||
|
if waf_drop_ip() then return true end
|
||||||
|
-- C:D("waf_drop_ip")
|
||||||
|
|
||||||
|
-- ua check
|
||||||
|
if waf_user_agent() then return true end
|
||||||
|
-- C:D("waf_user_agent")
|
||||||
|
if waf_url() then return true end
|
||||||
|
-- C:D("waf_url")
|
||||||
|
|
||||||
|
-- cc setting
|
||||||
|
if waf_cc_increase() then return true end
|
||||||
|
-- C:D("waf_cc_increase")
|
||||||
|
if waf_cc() then return true end
|
||||||
|
-- C:D("waf_cc")
|
||||||
|
|
||||||
|
-- cookie检查
|
||||||
|
if waf_cookie() then return true end
|
||||||
|
-- C:D("waf_cookie")
|
||||||
|
|
||||||
|
-- args参数拦截
|
||||||
|
if waf_get_args() then return true end
|
||||||
|
-- C:D("waf_get_args")
|
||||||
|
|
||||||
|
-- 扫描软件禁止
|
||||||
|
if waf_scan_black() then return true end
|
||||||
|
-- C:D("waf_scan_black")
|
||||||
|
if waf_post() then return true end
|
||||||
|
-- C:D("waf_post")
|
||||||
|
--------------------------------------------------------
|
||||||
|
--------------------------------------------------------
|
||||||
if X_Forwarded() then return true end
|
if X_Forwarded() then return true end
|
||||||
-- C:D("X_Forwarded")
|
-- C:D("X_Forwarded")
|
||||||
if post_X_Forwarded() then return true end
|
if post_X_Forwarded() then return true end
|
||||||
|
|||||||
@@ -60,19 +60,26 @@ http
|
|||||||
limit_conn_zone $binary_remote_addr zone=perip:10m;
|
limit_conn_zone $binary_remote_addr zone=perip:10m;
|
||||||
limit_conn_zone $server_name zone=perserver:10m;
|
limit_conn_zone $server_name zone=perserver:10m;
|
||||||
|
|
||||||
server_tokens off;
|
# CACEH_BEGIN
|
||||||
access_log off;
|
proxy_buffering on;
|
||||||
|
proxy_buffer_size 4k;
|
||||||
|
proxy_buffers 512 4k;
|
||||||
|
proxy_busy_buffers_size 64k;
|
||||||
|
proxy_cache_path {$SERVER_PATH}/openresty/nginx/proxy_cache_temp levels=1:2 keys_zone=mw_cache:512m inactive=5m max_size=2g use_temp_path=off;
|
||||||
|
#proxy timeout
|
||||||
|
proxy_connect_timeout 3s;
|
||||||
|
proxy_read_timeout 5s;
|
||||||
|
proxy_send_timeout 5s;
|
||||||
|
|
||||||
server {
|
fastcgi_cache_key "$scheme$request_method$host$request_uri";
|
||||||
listen 80;
|
fastcgi_cache_path {$SERVER_PATH}/openresty/nginx/fastcgi_cache_temp levels=1:2 keys_zone=mw_cache_fcgi:100m inactive=60m max_size=5g;
|
||||||
listen [::]:80;
|
fastcgi_cache_use_stale error timeout invalid_header http_500;
|
||||||
server_name 127.0.0.1;
|
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
|
||||||
allow 127.0.0.1;
|
# CACEH_END
|
||||||
location /nginx_status {
|
|
||||||
stub_status on;
|
server_tokens off;
|
||||||
access_log off;
|
access_log /dev/null;
|
||||||
}
|
|
||||||
}
|
|
||||||
include {$SERVER_PATH}/web_conf/nginx/vhost/*.conf;
|
include {$SERVER_PATH}/web_conf/nginx/vhost/*.conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name 127.0.0.1;
|
||||||
|
allow 127.0.0.1;
|
||||||
|
location /nginx_status {
|
||||||
|
stub_status on;
|
||||||
|
access_log off;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
map $http_upgrade $connection_upgrade {
|
||||||
|
default upgrade;
|
||||||
|
'' close;
|
||||||
|
}
|
||||||
@@ -180,6 +180,17 @@ def confReplace():
|
|||||||
cmd_s = 'chmod u+s ' + ng_exe_bin
|
cmd_s = 'chmod u+s ' + ng_exe_bin
|
||||||
os.system('echo %s|sudo -S %s' % (sudoPwd, cmd_s))
|
os.system('echo %s|sudo -S %s' % (sudoPwd, cmd_s))
|
||||||
|
|
||||||
|
# vhost
|
||||||
|
vhost_dir = mw.getServerDir() + '/web_conf/nginx/vhost'
|
||||||
|
vhost_tpl_dir = getPluginDir() + '/conf/vhost'
|
||||||
|
# print(vhost_dir, vhost_tpl_dir)
|
||||||
|
vhost_list = ['0.websocket.conf', '0.nginx_status.conf']
|
||||||
|
for f in vhost_list:
|
||||||
|
a_conf = vhost_dir + '/' + f
|
||||||
|
a_conf_tpl = vhost_tpl_dir + '/' + f
|
||||||
|
if not os.path.exists(a_conf):
|
||||||
|
mw.writeFile(a_conf, mw.readFile(a_conf_tpl))
|
||||||
|
|
||||||
|
|
||||||
def initDreplace():
|
def initDreplace():
|
||||||
|
|
||||||
@@ -290,6 +301,7 @@ def restart():
|
|||||||
|
|
||||||
|
|
||||||
def reload():
|
def reload():
|
||||||
|
confReplace()
|
||||||
return restyOp('reload')
|
return restyOp('reload')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,6 @@
|
|||||||
"home":"http://openresty.org",
|
"home":"http://openresty.org",
|
||||||
"date":"2017-11-24",
|
"date":"2017-11-24",
|
||||||
"pid": "1",
|
"pid": "1",
|
||||||
"versions": ["1.17.8.2","1.19.3.1","1.21.4.1"],
|
"versions": ["1.17.8.2","1.19.3.1","1.21.4.2"],
|
||||||
"updates": ["1.17.8.2","1.19.3.1","1.21.4.1"]
|
"updates": ["1.17.8.2","1.19.3.1","1.21.4.2"]
|
||||||
}
|
}
|
||||||
@@ -658,7 +658,7 @@ function phpLibConfig(version){
|
|||||||
|
|
||||||
//安装扩展
|
//安装扩展
|
||||||
function installPHPLib(version, name, title, pathinfo) {
|
function installPHPLib(version, name, title, pathinfo) {
|
||||||
layer.confirm('您真的要安装{1}吗?'.replace('{1}', name), { icon: 3, closeBtn: 2 }, function() {
|
layer.confirm('您真的要卸载{1}吗?'.replace('{1}', name), { icon: 3, closeBtn: 2 }, function() {
|
||||||
name = name.toLowerCase();
|
name = name.toLowerCase();
|
||||||
var data = "name=" + name + "&version=" + version + "&type=1";
|
var data = "name=" + name + "&version=" + version + "&type=1";
|
||||||
|
|
||||||
|
|||||||
@@ -672,7 +672,7 @@ function installPHPLib(version, name, title, pathinfo) {
|
|||||||
|
|
||||||
//卸载扩展
|
//卸载扩展
|
||||||
function uninstallPHPLib(version, name, title, pathinfo) {
|
function uninstallPHPLib(version, name, title, pathinfo) {
|
||||||
layer.confirm('您真的要安装{1}吗?'.replace('{1}', name), { icon: 3, closeBtn: 2 }, function() {
|
layer.confirm('您真的要卸载{1}吗?'.replace('{1}', name), { icon: 3, closeBtn: 2 }, function() {
|
||||||
name = name.toLowerCase();
|
name = name.toLowerCase();
|
||||||
var data = 'name=' + name + '&version=' + version;
|
var data = 'name=' + name + '&version=' + version;
|
||||||
phpPost('uninstall_lib', version, data, function(data){
|
phpPost('uninstall_lib', version, data, function(data){
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ version=$1
|
|||||||
action=$2
|
action=$2
|
||||||
|
|
||||||
if [ -f /lib/systemd/system/php${version}-php-fpm.service ];then
|
if [ -f /lib/systemd/system/php${version}-php-fpm.service ];then
|
||||||
systemctl ${action} php${version}
|
systemctl ${action} php${version}-php-fpm
|
||||||
elif [[ -f /usr/lib/systemd/system/php${version}-php-fpm.service ]]; then
|
elif [[ -f /usr/lib/systemd/system/php${version}-php-fpm.service ]]; then
|
||||||
systemctl ${action} php${version}
|
systemctl ${action} php${version}-php-fpm
|
||||||
else
|
else
|
||||||
$serverPath/php/init.d/php${version} ${action}
|
$serverPath/php/init.d/php${version} ${action}
|
||||||
fi
|
fi
|
||||||
@@ -49,6 +49,7 @@ fi
|
|||||||
|
|
||||||
cd ${curPath} && sh -x $curPath/versions/$2/install.sh $1
|
cd ${curPath} && sh -x $curPath/versions/$2/install.sh $1
|
||||||
|
|
||||||
|
|
||||||
if [ "${action}" == "install" ] && [ -d ${serverPath}/php/${type} ];then
|
if [ "${action}" == "install" ] && [ -d ${serverPath}/php/${type} ];then
|
||||||
|
|
||||||
#初始化
|
#初始化
|
||||||
|
|||||||
@@ -665,7 +665,7 @@ function installPHPLib(version, name, title, pathinfo) {
|
|||||||
|
|
||||||
//卸载扩展
|
//卸载扩展
|
||||||
function uninstallPHPLib(version, name, title, pathinfo) {
|
function uninstallPHPLib(version, name, title, pathinfo) {
|
||||||
layer.confirm('您真的要安装{1}吗?'.replace('{1}', name), { icon: 3, closeBtn: 2 }, function() {
|
layer.confirm('您真的要卸载{1}吗?'.replace('{1}', name), { icon: 3, closeBtn: 2 }, function() {
|
||||||
name = name.toLowerCase();
|
name = name.toLowerCase();
|
||||||
var data = 'name=' + name + '&version=' + version;
|
var data = 'name=' + name + '&version=' + version;
|
||||||
phpPost('uninstall_lib', version, data, function(data){
|
phpPost('uninstall_lib', version, data, function(data){
|
||||||
|
|||||||
@@ -15,11 +15,20 @@ SOURCE_ROOT=$rootPath/source/lib
|
|||||||
|
|
||||||
if [ ! -d ${SERVER_ROOT}/freetype ];then
|
if [ ! -d ${SERVER_ROOT}/freetype ];then
|
||||||
cd $SOURCE_ROOT
|
cd $SOURCE_ROOT
|
||||||
wget -O freetype-2.12.1.tar.gz --no-check-certificate https://download.savannah.gnu.org/releases/freetype/freetype-2.12.1.tar.gz -T 5
|
|
||||||
tar zxvf freetype-2.12.1.tar.gz
|
if [ ! -f $SOURCE_ROOT/freetype-2.12.1.tar.gz ];then
|
||||||
cd freetype-2.12.1
|
wget -O freetype-2.12.1.tar.gz --no-check-certificate https://download.savannah.gnu.org/releases/freetype/freetype-2.12.1.tar.gz -T 5
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d $SOURCE_ROOT/freetype-2.12.1 ];then
|
||||||
|
tar zxvf freetype-2.12.1.tar.gz
|
||||||
|
cd freetype-2.12.1
|
||||||
|
else
|
||||||
|
cd freetype-2.12.1
|
||||||
|
fi
|
||||||
|
|
||||||
./configure --prefix=${SERVER_ROOT}/freetype && make && make install
|
./configure --prefix=${SERVER_ROOT}/freetype && make && make install
|
||||||
cd $SOURCE_ROOT
|
cd $SOURCE_ROOT && rm -rf freetype-2.12.1
|
||||||
#rm -rf freetype-2.12.1.tar.gz
|
#rm -rf freetype-2.12.1.tar.gz
|
||||||
#rm -rf freetype-2.12.1
|
|
||||||
fi
|
fi
|
||||||
@@ -15,11 +15,20 @@ SOURCE_ROOT=$rootPath/source/lib
|
|||||||
|
|
||||||
if [ ! -d ${SERVER_ROOT}/freetype_old ];then
|
if [ ! -d ${SERVER_ROOT}/freetype_old ];then
|
||||||
cd $SOURCE_ROOT
|
cd $SOURCE_ROOT
|
||||||
wget -O freetype-2.7.1.tar.gz --no-check-certificate https://download.savannah.gnu.org/releases/freetype/freetype-2.7.1.tar.gz -T 5
|
|
||||||
tar zxvf freetype-2.7.1.tar.gz
|
if [ ! -f $SOURCE_ROOT/freetype-2.7.1.tar.gz ];then
|
||||||
cd freetype-2.7.1
|
wget -O freetype-2.7.1.tar.gz --no-check-certificate https://download.savannah.gnu.org/releases/freetype/freetype-2.7.1.tar.gz -T 5
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d $SOURCE_ROOT/freetype-2.7.1 ];then
|
||||||
|
tar zxvf freetype-2.7.1.tar.gz
|
||||||
|
cd freetype-2.7.1
|
||||||
|
else
|
||||||
|
cd freetype-2.7.1
|
||||||
|
fi
|
||||||
|
|
||||||
./configure --prefix=${SERVER_ROOT}/freetype_old && make && make install
|
./configure --prefix=${SERVER_ROOT}/freetype_old && make && make install
|
||||||
#cd $SOURCE_ROOT
|
cd $SOURCE_ROOT && rm -rf freetype-2.7.1
|
||||||
|
|
||||||
#rm -rf freetype-2.7.1.tar.gz
|
#rm -rf freetype-2.7.1.tar.gz
|
||||||
#rm -rf freetype-2.7.1
|
|
||||||
fi
|
fi
|
||||||
@@ -13,19 +13,29 @@ rootPath=$(dirname "$rootPath")
|
|||||||
SERVER_ROOT=$rootPath/lib
|
SERVER_ROOT=$rootPath/lib
|
||||||
SOURCE_ROOT=$rootPath/source/lib
|
SOURCE_ROOT=$rootPath/source/lib
|
||||||
|
|
||||||
|
|
||||||
|
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||||
|
HTTP_PREFIX="https://"
|
||||||
|
if [ ! -z "$cn" ];then
|
||||||
|
HTTP_PREFIX="https://ghproxy.com/"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -d ${SERVER_ROOT}/libzip ];then
|
if [ ! -d ${SERVER_ROOT}/libzip ];then
|
||||||
|
|
||||||
cd $SOURCE_ROOT
|
cd $SOURCE_ROOT
|
||||||
if [ ! -f ${SOURCE_ROOT}/libzip-1.3.2.tar.gz ];then
|
if [ ! -f ${SOURCE_ROOT}/libzip-1.3.2.tar.gz ];then
|
||||||
wget --no-check-certificate -O libzip-1.3.2.tar.gz --no-check-certificate https://nih.at/libzip/libzip-1.3.2.tar.gz -T 20
|
wget --no-check-certificate -O libzip-1.3.2.tar.gz ${HTTP_PREFIX}github.com/midoks/mdserver-web/releases/download/init/libzip-1.3.2.tar.gz -T 20
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tar -zxvf libzip-1.3.2.tar.gz
|
tar -zxvf libzip-1.3.2.tar.gz
|
||||||
cd libzip-1.3.2
|
cd ${SOURCE_ROOT}/libzip-1.3.2
|
||||||
|
|
||||||
./configure --prefix=${SERVER_ROOT}/libzip && make && make install
|
./configure --prefix=${SERVER_ROOT}/libzip && make && make install
|
||||||
|
|
||||||
#cd $SOURCE_ROOT
|
#cd $SOURCE_ROOT
|
||||||
#rm -rf libzip-1.3.2
|
|
||||||
#rm -rf libzip-1.3.2.tar.gz
|
if [ "$?" == "0" ];then
|
||||||
|
rm -rf ${SOURCE_ROOT}/libzip-1.3.2
|
||||||
|
rm -rf ${SOURCE_ROOT}/libzip-1.3.2.tar.gz
|
||||||
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
@@ -24,6 +24,22 @@ mkdir -p $serverPath/php
|
|||||||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||||
|
|
||||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
# 中国优化安装
|
||||||
|
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||||
|
LOCAL_ADDR=common
|
||||||
|
if [ ! -z "$cn" ];then
|
||||||
|
LOCAL_ADDR=cn
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||||
|
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||||
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
|
||||||
if [ ! -f $sourcePath/php/php-${version}.tar.gz ];then
|
if [ ! -f $sourcePath/php/php-${version}.tar.gz ];then
|
||||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.gz https://museum.php.net/php5/php-${version}.tar.gz
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.gz https://museum.php.net/php5/php-${version}.tar.gz
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -24,6 +24,22 @@ mkdir -p $serverPath/php
|
|||||||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||||
|
|
||||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
# 中国优化安装
|
||||||
|
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||||
|
LOCAL_ADDR=common
|
||||||
|
if [ ! -z "$cn" ];then
|
||||||
|
LOCAL_ADDR=cn
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||||
|
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||||
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
|
||||||
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 https://museum.php.net/php5/php-${version}.tar.xz
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php5/php-${version}.tar.xz
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -24,6 +24,22 @@ mkdir -p $serverPath/php
|
|||||||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||||
|
|
||||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
# 中国优化安装
|
||||||
|
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||||
|
LOCAL_ADDR=common
|
||||||
|
if [ ! -z "$cn" ];then
|
||||||
|
LOCAL_ADDR=cn
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||||
|
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||||
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
|
||||||
if [ ! -f $sourcePath/php/php-${version}.tar.gz ];then
|
if [ ! -f $sourcePath/php/php-${version}.tar.gz ];then
|
||||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.gz https://museum.php.net/php5/php-${version}.tar.gz
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.gz https://museum.php.net/php5/php-${version}.tar.gz
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -23,6 +23,22 @@ cd ${rootPath}/plugins/php/lib && /bin/bash freetype_old.sh
|
|||||||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||||
|
|
||||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
# 中国优化安装
|
||||||
|
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||||
|
LOCAL_ADDR=common
|
||||||
|
if [ ! -z "$cn" ];then
|
||||||
|
LOCAL_ADDR=cn
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||||
|
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||||
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
|
||||||
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 https://museum.php.net/php5/php-${version}.tar.xz
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php5/php-${version}.tar.xz
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -23,6 +23,22 @@ cd ${rootPath}/plugins/php/lib && /bin/bash freetype_old.sh
|
|||||||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||||
|
|
||||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
# 中国优化安装
|
||||||
|
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||||
|
LOCAL_ADDR=common
|
||||||
|
if [ ! -z "$cn" ];then
|
||||||
|
LOCAL_ADDR=cn
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||||
|
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||||
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
|
||||||
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 https://museum.php.net/php5/php-${version}.tar.xz
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php5/php-${version}.tar.xz
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -23,6 +23,22 @@ cd ${rootPath}/plugins/php/lib && /bin/bash freetype_old.sh
|
|||||||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||||
|
|
||||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
# 中国优化安装
|
||||||
|
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||||
|
LOCAL_ADDR=common
|
||||||
|
if [ ! -z "$cn" ];then
|
||||||
|
LOCAL_ADDR=cn
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||||
|
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||||
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
|
||||||
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 https://museum.php.net/php7/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
|
||||||
|
|||||||
@@ -23,6 +23,22 @@ cd ${rootPath}/plugins/php/lib && /bin/bash freetype_old.sh
|
|||||||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||||
|
|
||||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
# 中国优化安装
|
||||||
|
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||||
|
LOCAL_ADDR=common
|
||||||
|
if [ ! -z "$cn" ];then
|
||||||
|
LOCAL_ADDR=cn
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||||
|
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||||
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
|
||||||
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 https://museum.php.net/php7/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
|
||||||
|
|||||||
@@ -24,6 +24,22 @@ cd ${rootPath}/plugins/php/lib && /bin/bash freetype_old.sh
|
|||||||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||||
|
|
||||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
# 中国优化安装
|
||||||
|
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||||
|
LOCAL_ADDR=common
|
||||||
|
if [ ! -z "$cn" ];then
|
||||||
|
LOCAL_ADDR=cn
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||||
|
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||||
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
|
||||||
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 https://museum.php.net/php7/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
|
||||||
|
|||||||
@@ -28,6 +28,21 @@ cd ${rootPath}/plugins/php/lib && /bin/bash freetype_old.sh
|
|||||||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||||
|
|
||||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
# 中国优化安装
|
||||||
|
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||||
|
LOCAL_ADDR=common
|
||||||
|
if [ ! -z "$cn" ];then
|
||||||
|
LOCAL_ADDR=cn
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||||
|
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||||
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
|
||||||
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 https://museum.php.net/php7/php-${version}.tar.xz
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php7/php-${version}.tar.xz
|
||||||
|
|||||||
@@ -36,6 +36,21 @@ fi
|
|||||||
|
|
||||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
# 中国优化安装
|
||||||
|
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||||
|
LOCAL_ADDR=common
|
||||||
|
if [ ! -z "$cn" ];then
|
||||||
|
LOCAL_ADDR=cn
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||||
|
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||||
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
|
||||||
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 https://museum.php.net/php7/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
|
||||||
@@ -109,7 +124,7 @@ fi
|
|||||||
|
|
||||||
if [ ! -d $serverPath/php/${PHP_VER} ];then
|
if [ ! -d $serverPath/php/${PHP_VER} ];then
|
||||||
cd $sourcePath/php/php${PHP_VER} && make clean
|
cd $sourcePath/php/php${PHP_VER} && make clean
|
||||||
./buildconf --force
|
# ./buildconf --force
|
||||||
./configure \
|
./configure \
|
||||||
--prefix=$serverPath/php/${PHP_VER} \
|
--prefix=$serverPath/php/${PHP_VER} \
|
||||||
--exec-prefix=$serverPath/php/${PHP_VER} \
|
--exec-prefix=$serverPath/php/${PHP_VER} \
|
||||||
|
|||||||
@@ -35,6 +35,22 @@ if [ "$?" == "0" ];then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
# 中国优化安装
|
||||||
|
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||||
|
LOCAL_ADDR=common
|
||||||
|
if [ ! -z "$cn" ];then
|
||||||
|
LOCAL_ADDR=cn
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||||
|
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||||
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
|
||||||
|
|
||||||
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 https://www.php.net/distributions/php-${version}.tar.xz
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://www.php.net/distributions/php-${version}.tar.xz
|
||||||
|
|||||||
@@ -36,6 +36,22 @@ fi
|
|||||||
|
|
||||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
# 中国优化安装
|
||||||
|
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||||
|
LOCAL_ADDR=common
|
||||||
|
if [ ! -z "$cn" ];then
|
||||||
|
LOCAL_ADDR=cn
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||||
|
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||||
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
|
||||||
|
|
||||||
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 https://www.php.net/distributions/php-${version}.tar.xz
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://www.php.net/distributions/php-${version}.tar.xz
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -36,6 +36,22 @@ fi
|
|||||||
|
|
||||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
# 中国优化安装
|
||||||
|
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||||
|
LOCAL_ADDR=common
|
||||||
|
if [ ! -z "$cn" ];then
|
||||||
|
LOCAL_ADDR=cn
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||||
|
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||||
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# ----------------------------------------------------------------------- #
|
||||||
|
|
||||||
|
|
||||||
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 https://www.php.net/distributions/php-${version}.tar.xz
|
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://www.php.net/distributions/php-${version}.tar.xz
|
||||||
fi
|
fi
|
||||||
|
|||||||
+11
-11
@@ -782,20 +782,20 @@ def lsyncdAdd():
|
|||||||
|
|
||||||
info['rsync'] = rsync
|
info['rsync'] = rsync
|
||||||
|
|
||||||
if not 'exclude' in info:
|
|
||||||
info["exclude"] = [
|
|
||||||
"/**.upload.tmp",
|
|
||||||
"**/*.log",
|
|
||||||
"**/*.tmp",
|
|
||||||
"**/*.temp",
|
|
||||||
".git",
|
|
||||||
".gitignore",
|
|
||||||
".user.ini",
|
|
||||||
]
|
|
||||||
|
|
||||||
data = getDefaultConf()
|
data = getDefaultConf()
|
||||||
|
|
||||||
slist = data['send']["list"]
|
slist = data['send']["list"]
|
||||||
res = lsyncdListFindName(slist, info['name'])
|
res = lsyncdListFindName(slist, info['name'])
|
||||||
|
|
||||||
|
if not 'exclude' in info:
|
||||||
|
if res[0]:
|
||||||
|
info["exclude"] = slist[res[1]]['exclude']
|
||||||
|
else:
|
||||||
|
info["exclude"] = [
|
||||||
|
"/**.upload.tmp", "**/*.log", "**/*.tmp",
|
||||||
|
"**/*.temp", ".git", ".gitignore", ".user.ini",
|
||||||
|
]
|
||||||
|
|
||||||
if res[0]:
|
if res[0]:
|
||||||
list_index = res[1]
|
list_index = res[1]
|
||||||
slist[list_index] = info
|
slist[list_index] = info
|
||||||
|
|||||||
@@ -476,7 +476,7 @@ function lsyncdExclude(name){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function lsyncdConfLog(){
|
function lsyncdConfLog(){
|
||||||
pluginStandAloneLogs("rsyncd","","lsyncd_conf_log");;
|
pluginRollingLogs("rsyncd","","lsyncd_conf_log");;
|
||||||
}
|
}
|
||||||
|
|
||||||
function lsyncdSend(){
|
function lsyncdSend(){
|
||||||
@@ -492,7 +492,7 @@ function lsyncdSend(){
|
|||||||
|
|
||||||
con += '<div style="padding-top:1px;">\
|
con += '<div style="padding-top:1px;">\
|
||||||
<button class="btn btn-success btn-sm" onclick="createSendTask();">创建发送任务</button>\
|
<button class="btn btn-success btn-sm" onclick="createSendTask();">创建发送任务</button>\
|
||||||
<button class="btn btn-success btn-sm" onclick="lsyncdConfLog();">日志</button>\
|
<button class="btn btn-success btn-sm" onclick="lsyncdConfLog();">自动同步日志</button>\
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
con += '<div class="divtable" style="margin-top:5px;"><table class="table table-hover" width="100%" cellspacing="0" cellpadding="0" border="0">';
|
con += '<div class="divtable" style="margin-top:5px;"><table class="table table-hover" width="100%" cellspacing="0" cellpadding="0" border="0">';
|
||||||
@@ -532,7 +532,7 @@ function lsyncdSend(){
|
|||||||
'<td>' + period +'</td>' +
|
'<td>' + period +'</td>' +
|
||||||
'<td>\
|
'<td>\
|
||||||
<a class="btlink" onclick="lsyncdRun(\''+list[i]['name']+'\')">同步</a>\
|
<a class="btlink" onclick="lsyncdRun(\''+list[i]['name']+'\')">同步</a>\
|
||||||
| <a class="btlink" onclick="lsyncdLog(\''+list[i]['name']+'\')">日志</a>\
|
| <a class="btlink" onclick="lsyncdLog(\''+list[i]['name']+'\')">手动日志</a>\
|
||||||
| <a class="btlink" onclick="lsyncdExclude(\''+list[i]['name']+'\')">过滤器</a>\
|
| <a class="btlink" onclick="lsyncdExclude(\''+list[i]['name']+'\')">过滤器</a>\
|
||||||
| <a class="btlink" onclick="createSendTask(\''+list[i]['name']+'\')">编辑</a>\
|
| <a class="btlink" onclick="createSendTask(\''+list[i]['name']+'\')">编辑</a>\
|
||||||
| <a class="btlink" onclick="lsyncdDelete(\''+list[i]['name']+'\')">删除</a>\
|
| <a class="btlink" onclick="lsyncdDelete(\''+list[i]['name']+'\')">删除</a>\
|
||||||
@@ -562,7 +562,7 @@ function rsyncdConf(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function rsyncdLog(){
|
function rsyncdLog(){
|
||||||
pluginStandAloneLogs("rsyncd","","run_log");
|
pluginRollingLogs("rsyncd","","run_log");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,6 @@ def init(bot):
|
|||||||
bot.set_my_commands(
|
bot.set_my_commands(
|
||||||
commands=[
|
commands=[
|
||||||
telebot.types.BotCommand("start", "查看帮助信息"),
|
telebot.types.BotCommand("start", "查看帮助信息"),
|
||||||
telebot.types.BotCommand("faq", "查看bbs帖子主题【不要忘记:冒号】"),
|
telebot.types.BotCommand("faq", "查看bbs帖子主题【?:】"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -42,9 +42,10 @@ def send_msg(bot, tag='ad', trigger_time=300):
|
|||||||
# 信号只在一个周期内执行一次|end
|
# 信号只在一个周期内执行一次|end
|
||||||
|
|
||||||
# https://t.me/gjgzs2022 | 22/m
|
# https://t.me/gjgzs2022 | 22/m
|
||||||
# 代付支付宝微信❤️淘宝帮付/💰流量变现💰集团收量/🕵️♀️实名认证/接码✅过人脸👤 | 28/m
|
# 高价收量 👑 集团收量 ❤️ 流量变现/支付宝代付 ❤️ 微信代付/实名认证/过人脸🕵️♀️各种账号处理✅ | 28/m
|
||||||
# https://zhaoziyuan.la/ | 15/m | 2m | next,7/15
|
# https://zhaoziyuan.la/ | web | 15/m | 2m | next,7/15
|
||||||
# 香港高防CDN |9/m
|
# 香港高防CDN |9/m
|
||||||
|
# mvirtua | web | 7/m
|
||||||
keyboard = [
|
keyboard = [
|
||||||
[
|
[
|
||||||
types.InlineKeyboardButton(
|
types.InlineKeyboardButton(
|
||||||
@@ -56,15 +57,15 @@ def send_msg(bot, tag='ad', trigger_time=300):
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
types.InlineKeyboardButton(
|
types.InlineKeyboardButton(
|
||||||
text="🕵️♀️实名认证/接码✅过人脸👤", url='https://t.me/zhanzhangyewu')
|
text="实名认证/过人脸🕵️♀️各种账号处理✅", url='https://t.me/zhanzhangyewu')
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
types.InlineKeyboardButton(
|
types.InlineKeyboardButton(
|
||||||
text="代付支付宝微信❤️淘宝帮付", url='https://t.me/Uxuanzhenpin')
|
text="支付宝代付 ❤️ 微信代付", url='https://t.me/Uxuanzhenpin')
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
types.InlineKeyboardButton(
|
types.InlineKeyboardButton(
|
||||||
text="💰流量变现💰集团收量", url='https://t.me/taohaozhan')
|
text="高价收量 👑 集团收量 ❤️ 流量变现", url='https://t.me/maccms_jccms/93')
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
types.InlineKeyboardButton(
|
types.InlineKeyboardButton(
|
||||||
|
|||||||
@@ -51,8 +51,10 @@ def send_msg(bot, tag='ad', trigger_time=300):
|
|||||||
# 信号只在一个周期内执行一次|end
|
# 信号只在一个周期内执行一次|end
|
||||||
|
|
||||||
# https://t.me/gjgzs2022 | 22/m
|
# https://t.me/gjgzs2022 | 22/m
|
||||||
# 代付支付宝微信❤️淘宝帮付/💰流量变现💰集团收量/🕵️♀️实名认证/接码✅过人脸👤 | 28/m
|
# 高价收量 👑 集团收量 ❤️ 流量变现/支付宝代付 ❤️ 微信代付/实名认证/过人脸🕵️♀️各种账号处理✅ | 28/m
|
||||||
|
# https://zhaoziyuan.la/ | web | 15/m | 2m | next,9/15
|
||||||
# 香港高防CDN |9/m
|
# 香港高防CDN |9/m
|
||||||
|
# mvirtua | web | 7/m
|
||||||
keyboard = [
|
keyboard = [
|
||||||
[
|
[
|
||||||
types.InlineKeyboardButton(
|
types.InlineKeyboardButton(
|
||||||
@@ -64,15 +66,15 @@ def send_msg(bot, tag='ad', trigger_time=300):
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
types.InlineKeyboardButton(
|
types.InlineKeyboardButton(
|
||||||
text="🕵️♀️实名认证/接码✅过人脸👤", url='https://t.me/zhanzhangyewu')
|
text="实名认证/过人脸🕵️♀️各种账号处理✅", url='https://t.me/zhanzhangyewu')
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
types.InlineKeyboardButton(
|
types.InlineKeyboardButton(
|
||||||
text="代付支付宝微信❤️淘宝帮付", url='https://t.me/Uxuanzhenpin')
|
text="支付宝代付 ❤️ 微信代付", url='https://t.me/Uxuanzhenpin')
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
types.InlineKeyboardButton(
|
types.InlineKeyboardButton(
|
||||||
text="💰流量变现💰集团收量", url='https://t.me/taohaozhan')
|
text="高价收量 👑 集团收量 ❤️ 流量变现", url='https://t.me/maccms_jccms/93')
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
types.InlineKeyboardButton(
|
types.InlineKeyboardButton(
|
||||||
|
|||||||
@@ -189,26 +189,22 @@ def run(bot, message):
|
|||||||
return bot
|
return bot
|
||||||
|
|
||||||
# print(text_body)
|
# print(text_body)
|
||||||
if isThisCmd('/faq:', text_body):
|
if isThisCmd('/?:', text_body):
|
||||||
cmd_text = getReadCmd('/faq:', text_body)
|
cmd_text = getReadCmd('/?:', text_body)
|
||||||
return searchFaq(bot, message, cmd_text)
|
return searchFaq(bot, message, cmd_text)
|
||||||
|
|
||||||
# if isThisCmd('/debug', text_body):
|
# if text_body.find('?') > -1 or text_body.find('?') > -1:
|
||||||
# cmd_text = getReadCmd('/debug', text_body)
|
# return_msg = "你似乎在寻找【" + text_body + "】答案:\n"
|
||||||
# return searchDebug(bot, message, cmd_text)
|
# return_msg += "/faq:开始寻找你的问题\n"
|
||||||
|
# keyboard = [
|
||||||
|
# [
|
||||||
|
# types.InlineKeyboardButton(
|
||||||
|
# text="如未找到,可以在论坛补充你的提问!", url='https://bbs.midoks.me'),
|
||||||
|
# ]
|
||||||
|
|
||||||
if text_body.find('?') > -1 or text_body.find('?') > -1:
|
# ]
|
||||||
return_msg = "你似乎在寻找【" + text_body + "】答案:\n"
|
# markup = types.InlineKeyboardMarkup(keyboard)
|
||||||
return_msg += "/faq:开始寻找你的问题\n"
|
# bot.reply_to(message, return_msg, reply_markup=markup)
|
||||||
keyboard = [
|
|
||||||
[
|
|
||||||
types.InlineKeyboardButton(
|
|
||||||
text="如未找到,可以在论坛补充你的提问!", url='https://bbs.midoks.me'),
|
|
||||||
]
|
|
||||||
|
|
||||||
]
|
|
||||||
markup = types.InlineKeyboardMarkup(keyboard)
|
|
||||||
bot.reply_to(message, return_msg, reply_markup=markup)
|
|
||||||
|
|
||||||
return bot
|
return bot
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ setuptools>=33.1.1
|
|||||||
Werkzeug>=1.0.1
|
Werkzeug>=1.0.1
|
||||||
wheel>=0.37.1
|
wheel>=0.37.1
|
||||||
gunicorn==20.1.0
|
gunicorn==20.1.0
|
||||||
requests==2.27.1
|
requests>=2.27.1
|
||||||
urllib3>=1.21.1
|
urllib3>=1.21.1
|
||||||
flask>=2.0.3
|
flask>=2.0.3
|
||||||
flask-session==0.3.2
|
flask-session==0.3.2
|
||||||
|
|||||||
+8
-2
@@ -47,7 +47,7 @@ cache.init_app(app, config={'CACHE_TYPE': 'simple'})
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
from flask_sqlalchemy import SQLAlchemy
|
from flask_sqlalchemy import SQLAlchemy
|
||||||
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/mw_session.db'
|
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/py_mw_session.db'
|
||||||
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
|
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
|
||||||
app.config['SESSION_TYPE'] = 'sqlalchemy'
|
app.config['SESSION_TYPE'] = 'sqlalchemy'
|
||||||
app.config['SESSION_SQLALCHEMY'] = sdb
|
app.config['SESSION_SQLALCHEMY'] = sdb
|
||||||
@@ -60,7 +60,6 @@ except:
|
|||||||
str(sys.version_info[0])
|
str(sys.version_info[0])
|
||||||
app.config['SESSION_FILE_THRESHOLD'] = 1024
|
app.config['SESSION_FILE_THRESHOLD'] = 1024
|
||||||
app.config['SESSION_FILE_MODE'] = 384
|
app.config['SESSION_FILE_MODE'] = 384
|
||||||
mw.execShell("pip install flask_sqlalchemy &")
|
|
||||||
|
|
||||||
app.secret_key = uuid.UUID(int=uuid.getnode()).hex[-12:]
|
app.secret_key = uuid.UUID(int=uuid.getnode()).hex[-12:]
|
||||||
app.config['SESSION_PERMANENT'] = True
|
app.config['SESSION_PERMANENT'] = True
|
||||||
@@ -178,6 +177,13 @@ def requestCheck():
|
|||||||
return domain_check
|
return domain_check
|
||||||
|
|
||||||
|
|
||||||
|
@app.after_request
|
||||||
|
def requestAfter(response):
|
||||||
|
response.headers['soft'] = 'mdserver-web'
|
||||||
|
response.headers['mw-version'] = app.config.version
|
||||||
|
return response
|
||||||
|
|
||||||
|
|
||||||
def isLogined():
|
def isLogined():
|
||||||
if 'login' in session and 'username' in session and session['login'] == True:
|
if 'login' in session and 'username' in session and session['login'] == True:
|
||||||
userInfo = mw.M('users').where(
|
userInfo = mw.M('users').where(
|
||||||
|
|||||||
+128
-221
@@ -1,78 +1,100 @@
|
|||||||
//默认显示7天周期图表
|
//默认显示7天周期图表
|
||||||
|
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
Wday(0,'getload');
|
Wday(0,'getload');
|
||||||
},500);
|
},100);
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
Wday(0,'cpu');
|
Wday(0,'cpu');
|
||||||
},500);
|
},200);
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
Wday(0,'mem');
|
Wday(0,'mem');
|
||||||
},1000);
|
},500);
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
Wday(0,'disk');
|
Wday(0,'disk');
|
||||||
},1500);
|
},100);
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
Wday(0,'network');
|
Wday(0,'network');
|
||||||
},2000);
|
},1500);
|
||||||
|
|
||||||
$(".st").hover(function(){
|
|
||||||
|
$(".searcTime .st").click(function(){
|
||||||
|
var status = $(this).data('status');
|
||||||
|
if (status == 'show'){
|
||||||
|
$(this).next().hide();
|
||||||
|
$(this).data('status','hide');
|
||||||
|
} else{
|
||||||
|
$(this).next().show();
|
||||||
|
$(this).data('status','show');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//自定义时间-切换
|
||||||
|
$(".searcTime .st").hover(function(){
|
||||||
|
$(this).data('status','show');
|
||||||
$(this).next().show();
|
$(this).next().show();
|
||||||
},function(){
|
},function(){
|
||||||
$(this).next().hide();
|
// $(this).next().hide();
|
||||||
$(this).next().hover(function(){
|
// $(this).next().hover(function(){
|
||||||
$(this).show();
|
// $(this).show();
|
||||||
},function(){
|
// },function(){
|
||||||
$(this).hide();
|
// $(this).hide();
|
||||||
})
|
// })
|
||||||
})
|
})
|
||||||
|
|
||||||
$(".searcTime .gt").click(function(){
|
$(".searcTime .gt").click(function(){
|
||||||
$(this).addClass("on").siblings().removeClass("on");
|
$(this).addClass("on").siblings().removeClass("on");
|
||||||
})
|
})
|
||||||
$(".loadbtn").click(function(){
|
|
||||||
$(this).parents(".searcTime").find("span").removeClass("on");
|
|
||||||
$(this).parents(".searcTime").find(".st").addClass("on");
|
//渲染日期时间范围 start
|
||||||
var b = (new Date($(this).parent().find(".btime").val()).getTime())/1000;
|
var render_dlist = [
|
||||||
var e = (new Date($(this).parent().find(".etime").val()).getTime())/1000;
|
'loadbtn_rtime',
|
||||||
|
'cpubtn_rtime',
|
||||||
|
'membtn_rtime',
|
||||||
|
'diskbtn_rtime',
|
||||||
|
'networkbtn_rtime'
|
||||||
|
];
|
||||||
|
|
||||||
|
for (var i = 0; i < render_dlist.length; i++) {
|
||||||
|
|
||||||
|
laydate.render({
|
||||||
|
elem: '#'+render_dlist[i]
|
||||||
|
,type: 'datetime'
|
||||||
|
,range: true
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
var b = getBeforeDate(28).replaceAll('/','-') + " 00:00:00";
|
||||||
|
var e = getBeforeDate(0).replaceAll('/','-') + " 23:59:59";
|
||||||
|
|
||||||
|
$('#'+render_dlist[i]).val(b + ' - ' + e);
|
||||||
|
}
|
||||||
|
//渲染日期时间范围 end
|
||||||
|
|
||||||
|
|
||||||
|
$('.sbtn').click(function(){
|
||||||
|
$(".searcTime .st").next().hide();
|
||||||
|
|
||||||
|
var rtime = $(this).parent().find(".rtime").val();
|
||||||
|
var rarr = rtime.split(' - ');
|
||||||
|
|
||||||
|
var b = (new Date(rarr[0]).getTime())/1000;
|
||||||
|
var e = (new Date(rarr[1]).getTime())/1000;
|
||||||
|
|
||||||
b = Math.round(b);
|
b = Math.round(b);
|
||||||
e = Math.round(e);
|
e = Math.round(e);
|
||||||
getload(b,e)
|
|
||||||
})
|
if ($(this).hasClass('loadbtn')){
|
||||||
$(".cpubtn").click(function(){
|
getload(b,e);
|
||||||
$(this).parents(".searcTime").find("span").removeClass("on");
|
} else if ($(this).hasClass('cpubtn')){
|
||||||
$(this).parents(".searcTime").find(".st").addClass("on");
|
cpu(b,e);
|
||||||
var b = (new Date($(this).parent().find(".btime").val()).getTime())/1000;
|
}else if ($(this).hasClass('membtn')){
|
||||||
var e = (new Date($(this).parent().find(".etime").val()).getTime())/1000;
|
mem(b,e);
|
||||||
b = Math.round(b);
|
} else if ($(this).hasClass('diskbtn')){
|
||||||
e = Math.round(e);
|
disk(b,e);
|
||||||
cpu(b,e)
|
}
|
||||||
})
|
});
|
||||||
$(".membtn").click(function(){
|
|
||||||
$(this).parents(".searcTime").find("span").removeClass("on");
|
|
||||||
$(this).parents(".searcTime").find(".st").addClass("on");
|
|
||||||
var b = (new Date($(this).parent().find(".btime").val()).getTime())/1000;
|
|
||||||
var e = (new Date($(this).parent().find(".etime").val()).getTime())/1000;
|
|
||||||
b = Math.round(b);
|
|
||||||
e = Math.round(e);
|
|
||||||
mem(b,e)
|
|
||||||
})
|
|
||||||
$(".diskbtn").click(function(){
|
|
||||||
$(this).parents(".searcTime").find("span").removeClass("on");
|
|
||||||
$(this).parents(".searcTime").find(".st").addClass("on");
|
|
||||||
var b = (new Date($(this).parent().find(".btime").val()).getTime())/1000;
|
|
||||||
var e = (new Date($(this).parent().find(".etime").val()).getTime())/1000;
|
|
||||||
b = Math.round(b);
|
|
||||||
e = Math.round(e);
|
|
||||||
disk(b,e)
|
|
||||||
})
|
|
||||||
$(".networkbtn").click(function(){
|
|
||||||
$(this).parents(".searcTime").find("span").removeClass("on");
|
|
||||||
$(this).parents(".searcTime").find(".st").addClass("on");
|
|
||||||
var b = (new Date($(this).parent().find(".btime").val()).getTime())/1000;
|
|
||||||
var e = (new Date($(this).parent().find(".etime").val()).getTime())/1000;
|
|
||||||
b = Math.round(b);
|
|
||||||
e = Math.round(e);
|
|
||||||
network(b,e)
|
|
||||||
})
|
|
||||||
//指定天数
|
//指定天数
|
||||||
function Wday(day,name){
|
function Wday(day,name){
|
||||||
var now = (new Date().getTime())/1000;
|
var now = (new Date().getTime())/1000;
|
||||||
@@ -94,19 +116,19 @@ function Wday(day,name){
|
|||||||
}
|
}
|
||||||
switch (name){
|
switch (name){
|
||||||
case "cpu":
|
case "cpu":
|
||||||
cpu(b,e);
|
cpu(b, e);
|
||||||
break;
|
break;
|
||||||
case "mem":
|
case "mem":
|
||||||
mem(b,e);
|
mem(b, e);
|
||||||
break;
|
break;
|
||||||
case "disk":
|
case "disk":
|
||||||
disk(b,e);
|
disk(b, e);
|
||||||
break;
|
break;
|
||||||
case "network":
|
case "network":
|
||||||
network(b,e);
|
network(b, e);
|
||||||
break;
|
break;
|
||||||
case "getload":
|
case "getload":
|
||||||
getload(b,e);
|
getload(b, e);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -119,6 +141,7 @@ function getToday(){
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getStatus();
|
||||||
//取监控状态
|
//取监控状态
|
||||||
function getStatus(){
|
function getStatus(){
|
||||||
loadT = layer.msg('正在读取,请稍候...',{icon:16,time:0})
|
loadT = layer.msg('正在读取,请稍候...',{icon:16,time:0})
|
||||||
@@ -141,7 +164,7 @@ function getStatus(){
|
|||||||
|
|
||||||
},'json');
|
},'json');
|
||||||
}
|
}
|
||||||
getStatus();
|
|
||||||
|
|
||||||
//设置监控状态
|
//设置监控状态
|
||||||
function setControl(act, value=false){
|
function setControl(act, value=false){
|
||||||
@@ -172,8 +195,9 @@ function setControl(act, value=false){
|
|||||||
|
|
||||||
loadT = layer.msg('正在处理,请稍候...',{icon:16,time:0})
|
loadT = layer.msg('正在处理,请稍候...',{icon:16,time:0})
|
||||||
$.post('/system/set_control','type='+type+'&day='+day,function(rdata){
|
$.post('/system/set_control','type='+type+'&day='+day,function(rdata){
|
||||||
layer.close(loadT);
|
showMsg(rdata.msg, function(){
|
||||||
layer.msg(rdata.msg,{icon:rdata.status?1:2});
|
layer.close(loadT);
|
||||||
|
},{icon:rdata.status?1:2})
|
||||||
},'json');
|
},'json');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,8 +207,9 @@ function closeControl(){
|
|||||||
layer.confirm('您真的清空所有监控记录吗?',{title:'清空记录',icon:3,closeBtn:1}, function() {
|
layer.confirm('您真的清空所有监控记录吗?',{title:'清空记录',icon:3,closeBtn:1}, function() {
|
||||||
loadT = layer.msg('正在处理,请稍候...',{icon:16,time:0})
|
loadT = layer.msg('正在处理,请稍候...',{icon:16,time:0})
|
||||||
$.post('/system/set_control','type=del',function(rdata){
|
$.post('/system/set_control','type=del',function(rdata){
|
||||||
layer.close(loadT);
|
showMsg(rdata.msg, function(){
|
||||||
layer.msg(rdata.msg,{icon:rdata.status?1:2});
|
layer.close(loadT);
|
||||||
|
},{icon:rdata.status?1:2})
|
||||||
},'json');
|
},'json');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -199,19 +224,18 @@ function getBeforeDate(n){
|
|||||||
var day=d.getDate();
|
var day=d.getDate();
|
||||||
if(day <= n){
|
if(day <= n){
|
||||||
if(mon>1) {
|
if(mon>1) {
|
||||||
mon=mon-1;
|
mon = mon-1;
|
||||||
}
|
} else {
|
||||||
else {
|
year = year-1;
|
||||||
year = year-1;
|
mon = 12;
|
||||||
mon = 12;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
d.setDate(d.getDate()-n);
|
d.setDate(d.getDate()-n);
|
||||||
year = d.getFullYear();
|
year = d.getFullYear();
|
||||||
mon=d.getMonth()+1;
|
mon=d.getMonth()+1;
|
||||||
day=d.getDate();
|
day=d.getDate();
|
||||||
s = year+"/"+(mon<10?('0'+mon):mon)+"/"+(day<10?('0'+day):day);
|
s = year+"/"+(mon<10?('0'+mon):mon)+"/"+(day<10?('0'+day):day);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
//cpu
|
//cpu
|
||||||
function cpu(b,e){
|
function cpu(b,e){
|
||||||
@@ -229,20 +253,14 @@ function cpu(b,e){
|
|||||||
option = {
|
option = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
axisPointer: {
|
axisPointer: { type: 'cross' },
|
||||||
type: 'cross'
|
|
||||||
},
|
|
||||||
formatter: '{b}<br />{a}: {c}%'
|
formatter: '{b}<br />{a}: {c}%'
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
boundaryGap: false,
|
boundaryGap: false,
|
||||||
data: xData,
|
data: xData,
|
||||||
axisLine:{
|
axisLine:{ lineStyle:{ color:"#666"} }
|
||||||
lineStyle:{
|
|
||||||
color:"#666"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
@@ -250,16 +268,8 @@ function cpu(b,e){
|
|||||||
boundaryGap: [0, '100%'],
|
boundaryGap: [0, '100%'],
|
||||||
min:0,
|
min:0,
|
||||||
max: 100,
|
max: 100,
|
||||||
splitLine:{
|
splitLine:{ lineStyle:{ color:"#ddd" } },
|
||||||
lineStyle:{
|
axisLine:{ lineStyle:{ color:"#666" } }
|
||||||
color:"#ddd"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
axisLine:{
|
|
||||||
lineStyle:{
|
|
||||||
color:"#666"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
dataZoom: [{
|
dataZoom: [{
|
||||||
type: 'inside',
|
type: 'inside',
|
||||||
@@ -286,17 +296,13 @@ function cpu(b,e){
|
|||||||
smooth:true,
|
smooth:true,
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
sampling: 'average',
|
sampling: 'average',
|
||||||
itemStyle: {
|
itemStyle: { normal: { color: 'rgb(0, 153, 238)' } },
|
||||||
normal: {
|
|
||||||
color: 'rgb(0, 153, 238)'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data: yData
|
data: yData
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
myChartCpu.setOption(option);
|
myChartCpu.setOption(option);
|
||||||
window.addEventListener("resize",function(){
|
window.addEventListener("resize",function(){
|
||||||
myChartCpu.resize();
|
myChartCpu.resize();
|
||||||
});
|
});
|
||||||
},'json');
|
},'json');
|
||||||
@@ -318,20 +324,14 @@ function mem(b,e){
|
|||||||
option = {
|
option = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
axisPointer: {
|
axisPointer: { type: 'cross' },
|
||||||
type: 'cross'
|
|
||||||
},
|
|
||||||
formatter: '{b}<br />{a}: {c}%'
|
formatter: '{b}<br />{a}: {c}%'
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
boundaryGap: false,
|
boundaryGap: false,
|
||||||
data: xData,
|
data: xData,
|
||||||
axisLine:{
|
axisLine:{ lineStyle:{ color:"#666" } }
|
||||||
lineStyle:{
|
|
||||||
color:"#666"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
@@ -339,16 +339,8 @@ function mem(b,e){
|
|||||||
boundaryGap: [0, '100%'],
|
boundaryGap: [0, '100%'],
|
||||||
min:0,
|
min:0,
|
||||||
max: 100,
|
max: 100,
|
||||||
splitLine:{
|
splitLine:{ lineStyle:{ color:"#ddd" } },
|
||||||
lineStyle:{
|
axisLine:{ lineStyle:{ color:"#666" } }
|
||||||
color:"#ddd"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
axisLine:{
|
|
||||||
lineStyle:{
|
|
||||||
color:"#666"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
dataZoom: [{
|
dataZoom: [{
|
||||||
type: 'inside',
|
type: 'inside',
|
||||||
@@ -375,11 +367,7 @@ function mem(b,e){
|
|||||||
smooth:true,
|
smooth:true,
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
sampling: 'average',
|
sampling: 'average',
|
||||||
itemStyle: {
|
itemStyle: { normal: { color: 'rgb(0, 153, 238)' } },
|
||||||
normal: {
|
|
||||||
color: 'rgb(0, 153, 238)'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data: zData
|
data: zData
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -423,26 +411,14 @@ function disk(b,e){
|
|||||||
type: 'category',
|
type: 'category',
|
||||||
boundaryGap: false,
|
boundaryGap: false,
|
||||||
data: xData,
|
data: xData,
|
||||||
axisLine:{
|
axisLine:{ lineStyle:{ color:"#666" }}
|
||||||
lineStyle:{
|
|
||||||
color:"#666"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
name: '单位:KB/s',
|
name: '单位:KB/s',
|
||||||
boundaryGap: [0, '100%'],
|
boundaryGap: [0, '100%'],
|
||||||
splitLine:{
|
splitLine:{ lineStyle:{ color:"#ddd"} },
|
||||||
lineStyle:{
|
axisLine:{ lineStyle:{ color:"#666" } }
|
||||||
color:"#ddd"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
axisLine:{
|
|
||||||
lineStyle:{
|
|
||||||
color:"#666"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
dataZoom: [{
|
dataZoom: [{
|
||||||
type: 'inside',
|
type: 'inside',
|
||||||
@@ -469,11 +445,7 @@ function disk(b,e){
|
|||||||
smooth:true,
|
smooth:true,
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
sampling: 'average',
|
sampling: 'average',
|
||||||
itemStyle: {
|
itemStyle: { normal: { color: 'rgb(255, 70, 131)' } },
|
||||||
normal: {
|
|
||||||
color: 'rgb(255, 70, 131)'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data: rData
|
data: rData
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -482,11 +454,7 @@ function disk(b,e){
|
|||||||
smooth:true,
|
smooth:true,
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
sampling: 'average',
|
sampling: 'average',
|
||||||
itemStyle: {
|
itemStyle: { normal: { color: 'rgba(46, 165, 186, .7)'} },
|
||||||
normal: {
|
|
||||||
color: 'rgba(46, 165, 186, .7)'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data: wData
|
data: wData
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -522,9 +490,7 @@ function network(b,e){
|
|||||||
option = {
|
option = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
axisPointer: {
|
axisPointer: { type: 'cross' }
|
||||||
type: 'cross'
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
data:[lan.index.net_up,lan.index.net_down]
|
data:[lan.index.net_up,lan.index.net_down]
|
||||||
@@ -533,26 +499,14 @@ function network(b,e){
|
|||||||
type: 'category',
|
type: 'category',
|
||||||
boundaryGap: false,
|
boundaryGap: false,
|
||||||
data: xData,
|
data: xData,
|
||||||
axisLine:{
|
axisLine:{ lineStyle:{ color:"#666" } }
|
||||||
lineStyle:{
|
|
||||||
color:"#666"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
name: lan.index.unit+':KB/s',
|
name: lan.index.unit+':KB/s',
|
||||||
boundaryGap: [0, '100%'],
|
boundaryGap: [0, '100%'],
|
||||||
splitLine:{
|
splitLine:{ lineStyle:{ color:"#ddd" } },
|
||||||
lineStyle:{
|
axisLine:{ lineStyle:{ color:"#666" } }
|
||||||
color:"#ddd"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
axisLine:{
|
|
||||||
lineStyle:{
|
|
||||||
color:"#666"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
dataZoom: [{
|
dataZoom: [{
|
||||||
type: 'inside',
|
type: 'inside',
|
||||||
@@ -579,11 +533,7 @@ function network(b,e){
|
|||||||
smooth:true,
|
smooth:true,
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
sampling: 'average',
|
sampling: 'average',
|
||||||
itemStyle: {
|
itemStyle: { normal: { color: 'rgb(255, 140, 0)' } },
|
||||||
normal: {
|
|
||||||
color: 'rgb(255, 140, 0)'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data: yData
|
data: yData
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -592,11 +542,7 @@ function network(b,e){
|
|||||||
smooth:true,
|
smooth:true,
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
sampling: 'average',
|
sampling: 'average',
|
||||||
itemStyle: {
|
itemStyle: { normal: { color: 'rgb(30, 144, 255)' } },
|
||||||
normal: {
|
|
||||||
color: 'rgb(30, 144, 255)'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data: zData
|
data: zData
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -879,17 +825,8 @@ function getload(b,e){
|
|||||||
{
|
{
|
||||||
name: '资源使用率%',
|
name: '资源使用率%',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
lineStyle: {
|
lineStyle: { normal: { width: 2, color: 'rgb(255, 140, 0)'}},
|
||||||
normal: {
|
itemStyle: {normal: { color: 'rgb(255, 140, 0)' }},
|
||||||
width: 2,
|
|
||||||
color: 'rgb(255, 140, 0)'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
itemStyle: {
|
|
||||||
normal: {
|
|
||||||
color: 'rgb(255, 140, 0)'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data: yData
|
data: yData
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -897,17 +834,8 @@ function getload(b,e){
|
|||||||
yAxisIndex: 1,
|
yAxisIndex: 1,
|
||||||
name: '1分钟',
|
name: '1分钟',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
lineStyle: {
|
lineStyle: { normal: {width: 2,color: 'rgb(30, 144, 255)' }},
|
||||||
normal: {
|
itemStyle: { normal: { color: 'rgb(30, 144, 255)'} },
|
||||||
width: 2,
|
|
||||||
color: 'rgb(30, 144, 255)'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
itemStyle: {
|
|
||||||
normal: {
|
|
||||||
color: 'rgb(30, 144, 255)'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data: zData
|
data: zData
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -915,17 +843,8 @@ function getload(b,e){
|
|||||||
yAxisIndex: 1,
|
yAxisIndex: 1,
|
||||||
name: '5分钟',
|
name: '5分钟',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
lineStyle: {
|
lineStyle: { normal: { width: 2, color: 'rgb(0, 178, 45)'} },
|
||||||
normal: {
|
itemStyle: { normal: { color: 'rgb(0, 178, 45)' } },
|
||||||
width: 2,
|
|
||||||
color: 'rgb(0, 178, 45)'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
itemStyle: {
|
|
||||||
normal: {
|
|
||||||
color: 'rgb(0, 178, 45)'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data: aData
|
data: aData
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -933,28 +852,16 @@ function getload(b,e){
|
|||||||
yAxisIndex: 1,
|
yAxisIndex: 1,
|
||||||
name: '15分钟',
|
name: '15分钟',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
lineStyle: {
|
lineStyle: { normal: { width: 2, color: 'rgb(147, 38, 255)'}},
|
||||||
normal: {
|
itemStyle: { normal: { color: 'rgb(147, 38, 255)' } },
|
||||||
width: 2,
|
|
||||||
color: 'rgb(147, 38, 255)'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
itemStyle: {
|
|
||||||
normal: {
|
|
||||||
color: 'rgb(147, 38, 255)'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data: bData
|
data: bData
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
textStyle: {
|
textStyle: { color: '#666',fontSize: 12}
|
||||||
color: '#666',
|
|
||||||
fontSize: 12
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
myChartgetload.setOption(option);
|
myChartgetload.setOption(option);
|
||||||
window.addEventListener("resize",function(){
|
window.addEventListener("resize",function(){
|
||||||
myChartgetload.resize();
|
myChartgetload.resize();
|
||||||
})
|
})
|
||||||
},'json')
|
},'json');
|
||||||
}
|
}
|
||||||
+10
-17
@@ -789,18 +789,15 @@ function batchPasteTo(data,path){
|
|||||||
|
|
||||||
function getSuffixName(fileName){
|
function getSuffixName(fileName){
|
||||||
var extArr = fileName.split(".");
|
var extArr = fileName.split(".");
|
||||||
var exts = ['folder','folder-unempty','sql','c','cpp','cs','flv','css','js',
|
var exts = ['folder-unempty','sql','c','cpp','cs','flv','css','js',
|
||||||
'htm','html','java','log','mht','url','xml','ai','bmp','cdr','gif','ico',
|
'htm','html','java','log','mht','url','xml','ai','bmp','cdr','gif','ico',
|
||||||
'jpeg','jpg','JPG','png','psd','webp','ape','avi','flv','mkv','mov','mp3','mp4',
|
'jpeg','jpg','JPG','png','psd','webp','ape','avi','mkv','mov','mp3','mp4',
|
||||||
'mpeg','mpg','rm','rmvb','swf','wav','webm','wma','wmv','rtf','docx','fdf','potm',
|
'mpeg','mpg','rm','rmvb','swf','wav','webm','wma','wmv','rtf','docx','fdf','potm',
|
||||||
'pptx','txt','xlsb','xlsx','7z','cab','iso','rar','zip','gz','bt','file','apk','bookfolder',
|
'pptx','txt','xlsb','xlsx','7z','cab','iso','rar','zip','gz','bt','file','apk','bookfolder',
|
||||||
'folder','folder-empty','folder-unempty','fromchromefolder','documentfolder','fromphonefolder',
|
'folder','folder-empty','fromchromefolder','documentfolder','fromphonefolder',
|
||||||
'mix','musicfolder','picturefolder','videofolder','sefolder','access','mdb','accdb','sql','c',
|
'mix','musicfolder','picturefolder','videofolder','sefolder','access','mdb','accdb',
|
||||||
'cpp','cs','js','fla','flv','htm','html','java','mht','url','xml','ai','bmp','cdr',
|
'fla','doc','docm','dotx','dotm','dot','pdf',
|
||||||
'gif','ico','jpeg','jpg','JPG','png','psd','webp','ape','avi','flv','mkv','mov','mp3','mp4','mpeg',
|
'ppt','pptm','pot','xls','csv','xlsm','scss','svg','pl','py','php','md','json','sh','conf'];
|
||||||
'mpg','rm','rmvb','swf','wav','webm','wma','wmv','doc','docm','dotx','dotm','dot','rtf','docx','pdf',
|
|
||||||
'fdf','ppt','pptm','pot','potm','pptx','txt','xls','csv','xlsm','xlsb','xlsx','7z','gz','cab','iso',
|
|
||||||
'rar','zip','bt','file','apk','css','scss','svg','pl','py','php','md','json','sh'];
|
|
||||||
var extLastName = extArr[extArr.length - 1];
|
var extLastName = extArr[extArr.length - 1];
|
||||||
for(var i=0; i<exts.length; i++){
|
for(var i=0; i<exts.length; i++){
|
||||||
if(exts[i]==extLastName){
|
if(exts[i]==extLastName){
|
||||||
@@ -818,13 +815,9 @@ function getExtName(fileName){
|
|||||||
'jpeg','jpg','JPG','png','psd','webp','ape','avi','flv','mkv','mov','mp3','mp4',
|
'jpeg','jpg','JPG','png','psd','webp','ape','avi','flv','mkv','mov','mp3','mp4',
|
||||||
'mpeg','mpg','rm','rmvb','swf','wav','webm','wma','wmv','rtf','docx','fdf','potm',
|
'mpeg','mpg','rm','rmvb','swf','wav','webm','wma','wmv','rtf','docx','fdf','potm',
|
||||||
'pptx','txt','xlsb','xlsx','7z','cab','iso','rar','zip','gz','bt','file','apk','bookfolder',
|
'pptx','txt','xlsb','xlsx','7z','cab','iso','rar','zip','gz','bt','file','apk','bookfolder',
|
||||||
'folder','folder-empty','folder-unempty','fromchromefolder','documentfolder','fromphonefolder',
|
'folder-empty','fromchromefolder','documentfolder','fromphonefolder',
|
||||||
'mix','musicfolder','picturefolder','videofolder','sefolder','access','mdb','accdb','sql','c',
|
'mix','musicfolder','picturefolder','videofolder','sefolder','access','mdb','accdb',
|
||||||
'cpp','cs','js','fla','flv','htm','html','java','log','mht','url','xml','ai','bmp','cdr',
|
'fla','flv','doc','docm','dotx','dotm','dot','pdf','ppt','pptm','pot','xls','csv','xlsm'];
|
||||||
'gif','ico','jpeg','jpg','JPG','png','psd','webp','ape','avi','flv','mkv','mov','mp3','mp4','mpeg',
|
|
||||||
'mpg','rm','rmvb','swf','wav','webm','wma','wmv','doc','docm','dotx','dotm','dot','rtf','docx','pdf',
|
|
||||||
'fdf','ppt','pptm','pot','potm','pptx','txt','xls','csv','xlsm','xlsb','xlsx','7z','gz','cab','iso',
|
|
||||||
'rar','zip','bt','file','apk','css'];
|
|
||||||
var extLastName = extArr[extArr.length - 1];
|
var extLastName = extArr[extArr.length - 1];
|
||||||
for(var i=0; i<exts.length; i++){
|
for(var i=0; i<exts.length; i++){
|
||||||
if(exts[i]==extLastName){
|
if(exts[i]==extLastName){
|
||||||
@@ -842,7 +835,7 @@ function ShowEditMenu(){
|
|||||||
$(this).removeClass("hover");
|
$(this).removeClass("hover");
|
||||||
}).click(function(){
|
}).click(function(){
|
||||||
$(this).addClass("on").siblings().removeClass("on");
|
$(this).addClass("on").siblings().removeClass("on");
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//取磁盘
|
//取磁盘
|
||||||
|
|||||||
+299
-145
@@ -1301,7 +1301,7 @@ function showRewrite(rdata){
|
|||||||
<select class='bt-input-text mr20' id='myRewrite' name='rewrite' style='width:30%;'>"+rList+"</select>\
|
<select class='bt-input-text mr20' id='myRewrite' name='rewrite' style='width:30%;'>"+rList+"</select>\
|
||||||
<textarea class='bt-input-text mtb15' style='height: 260px; width: 470px; line-height:18px;padding:5px;' id='rewriteBody'>"+rdata.data+"</textarea>\
|
<textarea class='bt-input-text mtb15' style='height: 260px; width: 470px; line-height:18px;padding:5px;' id='rewriteBody'>"+rdata.data+"</textarea>\
|
||||||
</div>\
|
</div>\
|
||||||
<button id='SetRewriteBtn' class='btn btn-success btn-sm' onclick=\"SetRewrite('"+rdata.filename+"')\">保存</button>\
|
<button id='setRewriteBtn' class='btn btn-success btn-sm'>保存</button>\
|
||||||
<ul class='help-info-text c7 ptb10'>\
|
<ul class='help-info-text c7 ptb10'>\
|
||||||
<li>请选择您的应用,若设置伪静态后,网站无法正常访问,请尝试设置回default</li>\
|
<li>请选择您的应用,若设置伪静态后,网站无法正常访问,请尝试设置回default</li>\
|
||||||
<li>您可以对伪静态规则进行修改,修改完后保存即可。</li>\
|
<li>您可以对伪静态规则进行修改,修改完后保存即可。</li>\
|
||||||
@@ -1314,14 +1314,21 @@ function showRewrite(rdata){
|
|||||||
closeBtn: 1,
|
closeBtn: 1,
|
||||||
shift: 5,
|
shift: 5,
|
||||||
shadeClose: true,
|
shadeClose: true,
|
||||||
content:webBakHtml
|
content:webBakHtml,
|
||||||
});
|
success:function(){
|
||||||
|
|
||||||
$("#myRewrite").change(function(){
|
$("#myRewrite").change(function(){
|
||||||
var rewriteName = $(this).val();
|
var rewriteName = $(this).val();
|
||||||
$.post('/files/get_body','path='+rdata['rewrite_dir']+'/'+rewriteName+'.conf',function(fileBody){
|
$.post('/files/get_body','path='+rdata['rewrite_dir']+'/'+rewriteName+'.conf',function(fileBody){
|
||||||
$("#rewriteBody").val(fileBody.data.data);
|
$("#rewriteBody").val(fileBody.data.data);
|
||||||
},'json');
|
},'json');
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#setRewriteBtn').click(function(){
|
||||||
|
var data = $("#rewriteBody").val();
|
||||||
|
setRewrite(rdata.filename, encodeURIComponent(data));
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1334,7 +1341,7 @@ function addDirBinding(id){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var data = 'id='+id+'&domain='+domain+'&dirName='+dirName
|
var data = 'id='+id+'&domain='+domain+'&dirName='+dirName;
|
||||||
$.post('/site/add_dir_bind',data,function(rdata){
|
$.post('/site/add_dir_bind',data,function(rdata){
|
||||||
dirBinding(id);
|
dirBinding(id);
|
||||||
layer.msg(rdata.msg,{icon:rdata.status?1:2});
|
layer.msg(rdata.msg,{icon:rdata.status?1:2});
|
||||||
@@ -1554,82 +1561,164 @@ function to301(siteName, type, obj){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function toProxySwitch(){
|
|
||||||
var status = $("input[name='open_proxy']").prop("checked")==true?1:0;
|
|
||||||
if(status==1){
|
|
||||||
$("input[name='open_proxy']").prop("checked",false);
|
|
||||||
}else{
|
|
||||||
$("input[name='open_proxy']").prop("checked",true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//反向代理
|
//反向代理
|
||||||
function toProxy(siteName, type, obj) {
|
function toProxy(siteName, type, obj) {
|
||||||
// 设置 页面展示
|
// 设置 页面展示
|
||||||
if(type == 1) {
|
if(type == 1) {
|
||||||
var proxy_form = layer.open({
|
var proxy_title = "创建反向代理";
|
||||||
|
if (typeof(obj) != 'undefined'){
|
||||||
|
proxy_title = "编辑反向代理";
|
||||||
|
}
|
||||||
|
|
||||||
|
layer.open({
|
||||||
type: 1,
|
type: 1,
|
||||||
area: '650px',
|
area: '650px',
|
||||||
title: "创建反向代理",
|
title: proxy_title,
|
||||||
closeBtn: 1,
|
closeBtn: 1,
|
||||||
shift: 5,
|
shift: 5,
|
||||||
shadeClose: false,
|
shadeClose: false,
|
||||||
btn: ['提交','关闭'],
|
btn: ['提交','关闭'],
|
||||||
content: "<form id='form_redirect' class='divtable pd15' style='padding-bottom: 10px'>" +
|
content: "<form id='form_proxy' class='divtable pd15' style='padding-bottom: 10px'>\
|
||||||
"<div class='line'>" +
|
<div class='line'>\
|
||||||
'<span class="tname">开启代理</span>'+
|
<span class='tname'>开启代理</span>\
|
||||||
"<div class='info-r ml0'>" +
|
<div class='info-r ml0 mt5'>\
|
||||||
"<input name='open_proxy' class='btswitch btswitch-ios' type='checkbox' checked><label id='open_proxy' class='btswitch-btn' for='openProxy' onclick='toProxySwitch();'></label>" +
|
<input name='open_proxy' class='btswitch btswitch-ios' type='checkbox' checked>\
|
||||||
"</div>" +
|
<label id='open_proxy' class='btswitch-btn' for='openProxy' style='float:left'></label>\
|
||||||
"</div>" +
|
<div style='display: inline-block'>\
|
||||||
"<div class='line'>"+
|
<span class='tname' style='margin-left:15px;position: relative;top: -5px;'>是否缓存</span>\
|
||||||
"<span class='tname'>代理目录</span>" +
|
<input class='btswitch btswitch-ios' type='checkbox' name='open_cache'>\
|
||||||
"<div class='info-r ml0'>" +
|
<label class='btswitch-btn' id='open_cache' for='openCache' style='float:left'></label>\
|
||||||
"<input name='from' value='/' placeholder='/' class='bt-input-text mr5' type='text' style='width:200px''>" +
|
</div>\
|
||||||
"</div>" +
|
</div>\
|
||||||
"</div>" +
|
</div>\
|
||||||
"<div class='line'>" +
|
<div class='line'>\
|
||||||
"<span class='tname'>目标URL</span>" +
|
<span class='tname'>名称</span>\
|
||||||
"<div class='info-r ml0'>" +
|
<div class='info-r ml0'>\
|
||||||
"<input name='to' class='bt-input-text mr5' type='text' style='width:200px;float: left;margin-right:0px''>" +
|
<input name='name' value='index' placeholder='请输入名称' class='bt-input-text mr5' type='text' style='width:200px''>\
|
||||||
"<span class='tname' style='width:90px'>发送域名</span>" +
|
</div>\
|
||||||
"<input name='host' value='$host' class='bt-input-text mr5' type='text' style='width:200px'>" +
|
</div>\
|
||||||
"</div>" +
|
<div class='line' style='display:none' id='cache_time'>\
|
||||||
"</div>" +
|
<span class='tname'>缓存时间</span>\
|
||||||
"<div class='help-info-text c7'>" +
|
<div class='info-r ml0'>\
|
||||||
"<ul class='help-info-text c7'>" +
|
<input name='cache_time' value='1' class='bt-input-text mr5' type='text' style='width:200px''>分钟\
|
||||||
"<li>代理目录:访问这个目录时将会把目标URL的内容返回并显示</li>" +
|
</div>\
|
||||||
"<li>目标URL:可以填写你需要代理的站点,目标URL必须为可正常访问的URL,否则将返回错误</li>" +
|
</div>\
|
||||||
"<li>发送域名:将域名添加到请求头传递到代理服务器,默认为目标URL域名,若设置不当可能导致代理无法正常运行</li>" +
|
<div class='line'>\
|
||||||
"</ul>" +
|
<span class='tname'>代理目录</span>\
|
||||||
"</div>" +
|
<div class='info-r ml0'>\
|
||||||
"</form>",
|
<input name='from' value='/' placeholder='/' class='bt-input-text mr5' type='text' style='width:200px''>\
|
||||||
yes:function(){
|
</div>\
|
||||||
var data = $('#form_redirect').serializeArray();
|
</div>\
|
||||||
|
<div class='line'>\
|
||||||
|
<span class='tname'>目标URL</span>\
|
||||||
|
<div class='info-r ml0'>\
|
||||||
|
<input name='to' class='bt-input-text mr5' type='text' style='width:200px;float: left;margin-right:0px''>\
|
||||||
|
<span class='tname' style='width:90px'>发送域名</span>\
|
||||||
|
<input name='host' value='$host' class='bt-input-text mr5' type='text' style='width:200px'>\
|
||||||
|
</div>\
|
||||||
|
</div>\
|
||||||
|
<input name='id' value='' type='hidden'>\
|
||||||
|
<div class='help-info-text c7'>\
|
||||||
|
<ul class='help-info-text c7'>\
|
||||||
|
<li>代理目录:访问这个目录时将会把目标URL的内容返回并显示</li>\
|
||||||
|
<li>目标URL:可以填写你需要代理的站点,目标URL必须为可正常访问的URL,否则将返回错误</li>\
|
||||||
|
<li>发送域名:将域名添加到请求头传递到代理服务器,默认为目标URL域名,若设置不当可能导致代理无法正常运行</li>\
|
||||||
|
</ul>\
|
||||||
|
</div>\
|
||||||
|
</form>",
|
||||||
|
success:function(){
|
||||||
|
|
||||||
|
if (typeof(obj) != 'undefined'){
|
||||||
|
// console.log(obj);
|
||||||
|
$('input[name="name"]').val(obj['name']).attr('readonly','readonly').addClass('disabled');
|
||||||
|
if (obj['open_cache'] == 'on'){
|
||||||
|
$("input[name='open_cache']").prop("checked",true);
|
||||||
|
$('#cache_time').show();
|
||||||
|
}
|
||||||
|
|
||||||
|
$('input[name="from"]').val(obj['from']);
|
||||||
|
$('input[name="to"]').val(obj['to']);
|
||||||
|
|
||||||
|
var url = obj['to'];
|
||||||
|
var ip_reg = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
|
||||||
|
url = url.replace(/^http[s]?:\/\//, '');
|
||||||
|
url = url.replace(/(:|\?|\/|\\)(.*)$/, '');
|
||||||
|
if (ip_reg.test(url)) {
|
||||||
|
$("[name='host']").val('$host');
|
||||||
|
} else {
|
||||||
|
$("[name='host']").val(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
$('input[name="id"]').val(obj['id']);
|
||||||
|
$('input[name="cache_time"]').val(obj['cache_time']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$('input[name="to"]').on('keyup', function(){
|
||||||
|
var url = $(this).val();
|
||||||
|
var ip_reg = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
|
||||||
|
url = url.replace(/^http[s]?:\/\//, '');
|
||||||
|
url = url.replace(/(:|\?|\/|\\)(.*)$/, '');
|
||||||
|
if (ip_reg.test(url)) {
|
||||||
|
$("[name='host']").val('$host');
|
||||||
|
} else {
|
||||||
|
$("[name='host']").val(url);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#open_proxy").click(function(){
|
||||||
|
var status = $("input[name='open_proxy']").prop("checked")==true?1:0;
|
||||||
|
if(status==1){
|
||||||
|
$("input[name='open_proxy']").prop("checked",false);
|
||||||
|
}else{
|
||||||
|
$("input[name='open_proxy']").prop("checked",true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#open_cache').click(function(){
|
||||||
|
var status = $("input[name='open_cache']").prop("checked")==true?1:0;
|
||||||
|
if(status==1){
|
||||||
|
$('#cache_time').hide();
|
||||||
|
$("input[name='open_cache']").prop("checked",false);
|
||||||
|
}else{
|
||||||
|
$('#cache_time').show();
|
||||||
|
$("input[name='open_cache']").prop("checked",true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
yes:function(index,layer_ro){
|
||||||
|
var data = $('#form_proxy').serializeArray();
|
||||||
var t = {};
|
var t = {};
|
||||||
t['name'] = 'siteName';
|
t['name'] = 'siteName';
|
||||||
t['value'] = siteName;
|
t['value'] = siteName;
|
||||||
data.push(t);
|
data.push(t);
|
||||||
|
|
||||||
var loading = layer.msg('添加中...',{icon:16,time:0,shade: [0.3, '#000']});
|
// console.log(data);
|
||||||
|
var loading = layer.msg('正在'+proxy_title+'...',{icon:16,time:0,shade: [0.3, '#000']});
|
||||||
$.post('/site/set_proxy',data, function(res) {
|
$.post('/site/set_proxy',data, function(res) {
|
||||||
layer.close(loading);
|
layer.close(loading);
|
||||||
if (res.status) {
|
if (!res.status){
|
||||||
layer.close(proxy_form);
|
layer.msg(res.msg, {icon: 2,time:10000});
|
||||||
toProxy(siteName)
|
return;
|
||||||
} else {
|
|
||||||
layer.msg(res.msg, {icon: 2});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showMsg(proxy_title+"成功!",function(){
|
||||||
|
layer.close(index);
|
||||||
|
toProxy(siteName);
|
||||||
|
},{icon: 1, time:2000});
|
||||||
},'json');
|
},'json');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == 2) {
|
if (type == 2) {
|
||||||
|
var loading = layer.msg('正在删除中...',{icon:16,time:0,shade: [0.3, '#000']});
|
||||||
$.post('/site/del_proxy', {siteName: siteName,id: obj,}, function(res) {
|
$.post('/site/del_proxy', {siteName: siteName,id: obj,}, function(res) {
|
||||||
|
layer.close(loading);
|
||||||
if (res.status == true) {
|
if (res.status == true) {
|
||||||
layer.msg('删除成功', {time: 1000,icon: 1});
|
showMsg('删除成功', function(){
|
||||||
toProxy(siteName)
|
toProxy(siteName);
|
||||||
|
},{time: 1000,icon: 1});
|
||||||
} else {
|
} else {
|
||||||
layer.msg(res.msg, {time: 1000,icon: 2});
|
layer.msg(res.msg, {time: 1000,icon: 2});
|
||||||
}
|
}
|
||||||
@@ -1643,90 +1732,118 @@ function toProxy(siteName, type, obj) {
|
|||||||
var data = {siteName: siteName,id: obj};
|
var data = {siteName: siteName,id: obj};
|
||||||
$.post('/site/get_proxy_conf', data, function(res) {
|
$.post('/site/get_proxy_conf', data, function(res) {
|
||||||
layer.close(laoding);
|
layer.close(laoding);
|
||||||
if (res.status == true) {
|
if (!res.status){
|
||||||
var mBody = "<div class='webEdit-box' style='padding: 20px'>\
|
|
||||||
<textarea style='height: 320px; width: 445px; margin-left: 20px; line-height:18px' id='configProxyBody'>"+res.data.result+"</textarea>\
|
|
||||||
<div class='info-r'>\
|
|
||||||
<ul class='help-info-text c7 ptb10'>\
|
|
||||||
<li>此处为反向代理配置文件,若您不了解配置规则,请勿随意修改.</li>\
|
|
||||||
</ul>\
|
|
||||||
</div>\
|
|
||||||
</div>";
|
|
||||||
var editor;
|
|
||||||
var index = layer.open({
|
|
||||||
type: 1,
|
|
||||||
title: '编辑配置文件',
|
|
||||||
closeBtn: 1,
|
|
||||||
shadeClose: true,
|
|
||||||
area: ['500px', '500px'],
|
|
||||||
btn: ['提交','关闭'],
|
|
||||||
content: mBody,
|
|
||||||
success: function () {
|
|
||||||
editor = CodeMirror.fromTextArea(document.getElementById("configProxyBody"), {
|
|
||||||
extraKeys: {"Ctrl-Space": "autocomplete"},
|
|
||||||
lineNumbers: true,
|
|
||||||
matchBrackets:true,
|
|
||||||
});
|
|
||||||
editor.focus();
|
|
||||||
$(".CodeMirror-scroll").css({"height":"300px","margin":0,"padding":0});
|
|
||||||
$("#onlineEditFileBtn").unbind('click');
|
|
||||||
},
|
|
||||||
yes:function(index,layero){
|
|
||||||
$("#configProxyBody").empty().text(editor.getValue());
|
|
||||||
var load = layer.load();
|
|
||||||
var data = {
|
|
||||||
siteName: siteName,
|
|
||||||
id: obj,
|
|
||||||
config: editor.getValue(),
|
|
||||||
};
|
|
||||||
|
|
||||||
$.post('/site/save_proxy_conf', data, function(res) {
|
|
||||||
layer.close(load)
|
|
||||||
if (res.status == true) {
|
|
||||||
layer.msg('保存成功', {icon: 1});
|
|
||||||
layer.close(index);
|
|
||||||
} else {
|
|
||||||
layer.msg(res.msg, {time: 3000,icon: 2});
|
|
||||||
}
|
|
||||||
},'json');
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
layer.msg('请求错误!!', {time: 3000,icon: 2});
|
layer.msg('请求错误!!', {time: 3000,icon: 2});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var mBody = "<div class='webEdit-box' style='padding: 20px'>\
|
||||||
|
<textarea style='height: 320px; width: 445px; margin-left: 20px; line-height:18px' id='configProxyBody'>"+res.data.result+"</textarea>\
|
||||||
|
<div class='info-r'>\
|
||||||
|
<ul class='help-info-text c7 ptb10'>\
|
||||||
|
<li>此处为反向代理配置文件,若您不了解配置规则,请勿随意修改.</li>\
|
||||||
|
</ul>\
|
||||||
|
</div>\
|
||||||
|
</div>";
|
||||||
|
var editor;
|
||||||
|
var index = layer.open({
|
||||||
|
type: 1,
|
||||||
|
title: '编辑配置文件',
|
||||||
|
closeBtn: 1,
|
||||||
|
shadeClose: true,
|
||||||
|
area: ['500px', '500px'],
|
||||||
|
btn: ['提交','关闭'],
|
||||||
|
content: mBody,
|
||||||
|
success: function () {
|
||||||
|
editor = CodeMirror.fromTextArea(document.getElementById("configProxyBody"), {
|
||||||
|
extraKeys: {"Ctrl-Space": "autocomplete"},
|
||||||
|
lineNumbers: true,
|
||||||
|
matchBrackets:true,
|
||||||
|
});
|
||||||
|
editor.focus();
|
||||||
|
$(".CodeMirror-scroll").css({"height":"300px","margin":0,"padding":0});
|
||||||
|
$("#onlineEditFileBtn").unbind('click');
|
||||||
|
},
|
||||||
|
yes:function(index,layero){
|
||||||
|
$("#configProxyBody").empty().text(editor.getValue());
|
||||||
|
var load = layer.load();
|
||||||
|
var data = {
|
||||||
|
siteName: siteName,
|
||||||
|
id: obj,
|
||||||
|
config: editor.getValue(),
|
||||||
|
};
|
||||||
|
|
||||||
|
$.post('/site/save_proxy_conf', data, function(res) {
|
||||||
|
layer.close(load)
|
||||||
|
if (res.status == true) {
|
||||||
|
layer.msg('保存成功', {icon: 1});
|
||||||
|
layer.close(index);
|
||||||
|
} else {
|
||||||
|
layer.msg(res.msg, {time: 3000,icon: 2});
|
||||||
|
}
|
||||||
|
},'json');
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
});
|
||||||
},'json');
|
},'json');
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == 10 || type == 11) {
|
if (type == 10 || type == 11) {
|
||||||
//[11]启动 或 停止[10]
|
//[11]启动 或 停止[10]
|
||||||
status = type==10 ? '0' : '1';
|
status = type==10 ? '0' : '1';
|
||||||
var loading = layer.msg(lan.site.the_msg,{icon:16,time:0,shade: [0.3, '#000']});
|
var loading = layer.msg(lan.site.the_msg,{icon:16,time:0,shade: [0.3, '#000']});
|
||||||
$.post('/site/set_proxy_status', {siteName: siteName,'status':status,'id':obj}, function(res) {
|
$.post('/site/set_proxy_status', {siteName: siteName,'status':status,'id':obj}, function(rdata) {
|
||||||
layer.close(loading);
|
layer.close(loading);
|
||||||
if (res.status == true) {
|
if (!rdata.status){
|
||||||
layer.msg('设置成功', {icon: 1});
|
|
||||||
toProxy(siteName);
|
|
||||||
} else {
|
|
||||||
layer.msg(res.msg, {time: 3000,icon: 2});
|
layer.msg(res.msg, {time: 3000,icon: 2});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showMsg("设置成功",function(){
|
||||||
|
toProxy(siteName);
|
||||||
|
},{icon: 1,time:2000});
|
||||||
|
},'json');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == 20 || type == 21) {
|
||||||
|
//[20] 开始缓存 或 [21] 停止缓存
|
||||||
|
var status = type == 20 ? 'on' : '';
|
||||||
|
obj['open_cache'] = status;
|
||||||
|
obj['siteName'] = siteName;
|
||||||
|
|
||||||
|
var loading = layer.msg('正在提交请求...',{icon:16,time:0,shade: [0.3, '#000']});
|
||||||
|
$.post('/site/set_proxy',obj, function(rdata) {
|
||||||
|
layer.close(loading);
|
||||||
|
if (!rdata.status){
|
||||||
|
layer.msg(rdata.msg, {icon: 2,time:2000});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
showMsg("设置成功!",function(){
|
||||||
|
toProxy(siteName);
|
||||||
|
},{icon: 1, time:2000});
|
||||||
},'json');
|
},'json');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var body = '<div id="proxy_list" class="bt_table">\
|
var body = '<div id="proxy_list" class="bt_table">\
|
||||||
<div style="padding-bottom: 10px">\
|
<div style="padding-bottom: 10px">\
|
||||||
<button type="button" title="添加反向代理" class="btn btn-success btn-sm mr5" onclick="toProxy(\''+siteName+'\',1)" ><span>添加反向代理</span></button>\
|
<button type="button" title="添加反向代理" class="btn btn-success btn-sm mr5" onclick="toProxy(\''+siteName+'\',1)" >\
|
||||||
|
<span>添加反向代理</span>\
|
||||||
|
</button>\
|
||||||
</div>\
|
</div>\
|
||||||
<div class="divtable" style="max-height:200px;">\
|
<div class="divtable" style="max-height:200px;">\
|
||||||
<table class="table table-hover" >\
|
<table class="table table-hover" >\
|
||||||
<thead style="position: relative;z-index: 1;">\
|
<thead style="position: relative;z-index: 1;">\
|
||||||
<tr>\
|
<tr>\
|
||||||
<th><span data-index="1"><span>代理目录</span></span></th>\
|
<th>名称</th>\
|
||||||
<th><span data-index="2"><span>目标地址</span></span></th>\
|
<th>代理目录</th>\
|
||||||
<th><span data-index="2"><span>状态</span></span></th>\
|
<th>目标地址</th>\
|
||||||
<th><span data-index="3"><span>操作</span></span></th>\
|
<th>缓存</th>\
|
||||||
|
<th>状态</th>\
|
||||||
|
<th>操作</th>\
|
||||||
</tr>\
|
</tr>\
|
||||||
</thead>\
|
</thead>\
|
||||||
<tbody id="md-301-body"></tbody>\
|
<tbody id="md-301-body"></tbody>\
|
||||||
@@ -1738,28 +1855,64 @@ function toProxy(siteName, type, obj) {
|
|||||||
var loading = layer.msg(lan.site.the_msg,{icon:16,time:0,shade: [0.3, '#000']});
|
var loading = layer.msg(lan.site.the_msg,{icon:16,time:0,shade: [0.3, '#000']});
|
||||||
$.post("/site/get_proxy_list", {siteName: siteName},function (res) {
|
$.post("/site/get_proxy_list", {siteName: siteName},function (res) {
|
||||||
layer.close(loading);
|
layer.close(loading);
|
||||||
if (res.status === true) {
|
if (!res.status){
|
||||||
let data = res.data.result;
|
|
||||||
data.forEach(function(item){
|
|
||||||
var switchProxy = '<span onclick="toProxy(\''+siteName+'\', 10, \''+ item.id +'\')" style="color:rgb(92, 184, 92);" class="btlink glyphicon glyphicon-play"></span>';
|
|
||||||
if (!item['status']){
|
|
||||||
switchProxy = '<span onclick="toProxy(\''+siteName+'\', 11, \''+ item.id +'\')" style="color:rgb(255, 0, 0);" class="btlink glyphicon glyphicon-pause"></span>';
|
|
||||||
}
|
|
||||||
|
|
||||||
let tmp = '<tr>\
|
|
||||||
<td><span data-index="1"><span>'+item.from+'</span></span></td>\
|
|
||||||
<td><span data-index="2"><span>'+item.to+'</span></span></td>\
|
|
||||||
<td>'+switchProxy+'</td>\
|
|
||||||
<td>\
|
|
||||||
<span data-index="4" onclick="toProxy(\''+siteName+'\', 3, \''+ item.id +'\')" class="btlink">详细</span> |\
|
|
||||||
<span data-index="4" onclick="toProxy(\''+siteName+'\', 2, \''+ item.id +'\')" class="btlink">删除</span>\
|
|
||||||
</td>\
|
|
||||||
</tr>';
|
|
||||||
$("#md-301-body").append(tmp);
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
layer.msg(res.msg, {icon:2});
|
layer.msg(res.msg, {icon:2});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var data = res.data.result;
|
||||||
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
var item = data[i];
|
||||||
|
|
||||||
|
var switchProxy = '<span onclick="toProxy(\''+siteName+'\', 10, \''+ item.id +'\')" style="color:rgb(92, 184, 92);" class="btlink glyphicon glyphicon-play"></span>';
|
||||||
|
if (!item['status']){
|
||||||
|
switchProxy = '<span onclick="toProxy(\''+siteName+'\', 11, \''+ item.id +'\')" style="color:rgb(255, 0, 0);" class="btlink glyphicon glyphicon-pause"></span>';
|
||||||
|
}
|
||||||
|
|
||||||
|
var openCache = '<span data-index="'+i+'" class="btlink cache off">未开启</span>';
|
||||||
|
if (item['open_cache'] == 'on'){
|
||||||
|
openCache = '<span data-index="'+i+'" class="btlink cache on">已开启</span>';
|
||||||
|
}
|
||||||
|
|
||||||
|
let tmp = '<tr>\
|
||||||
|
<td>'+item.name+'</td>\
|
||||||
|
<td>'+item.from+'</td>\
|
||||||
|
<td>'+item.to+'</td>\
|
||||||
|
<td>'+openCache+'</td>\
|
||||||
|
<td>'+switchProxy+'</td>\
|
||||||
|
<td>\
|
||||||
|
<span data-index="'+i+'" class="btlink detail">详细</span> |\
|
||||||
|
<span data-index="'+i+'" class="btlink edit">编辑</span> |\
|
||||||
|
<span data-index="'+i+'" class="btlink delete">删除</span>\
|
||||||
|
</td>\
|
||||||
|
</tr>';
|
||||||
|
$("#md-301-body").append(tmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#md-301-body .detail').click(function(){
|
||||||
|
var index = $(this).data('index');
|
||||||
|
toProxy(siteName, 3 ,data[index]['id']);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#md-301-body .edit').click(function(){
|
||||||
|
var index = $(this).data('index');
|
||||||
|
toProxy(siteName, 1 ,data[index]);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#md-301-body .delete').click(function(){
|
||||||
|
var index = $(this).data('index');
|
||||||
|
toProxy(siteName, 2 ,data[index]['id']);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#md-301-body .cache').click(function(){
|
||||||
|
var index = $(this).data('index');
|
||||||
|
if ($(this).hasClass('on')){
|
||||||
|
toProxy(siteName, 21 ,data[index]);
|
||||||
|
} else{
|
||||||
|
toProxy(siteName, 20 ,data[index]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
},'json');
|
},'json');
|
||||||
/////////
|
/////////
|
||||||
}
|
}
|
||||||
@@ -1772,7 +1925,8 @@ function sslAdmin(siteName){
|
|||||||
var rdata = data['data'];
|
var rdata = data['data'];
|
||||||
var tbody = '';
|
var tbody = '';
|
||||||
for(var i=0;i<rdata.length;i++){
|
for(var i=0;i<rdata.length;i++){
|
||||||
tbody += '<tr><td>'+rdata[i].subject+'</td>\
|
tbody += '<tr>\
|
||||||
|
<td>'+rdata[i].subject+'</td>\
|
||||||
<td>'+rdata[i].dns.join('<br>')+'</td>\
|
<td>'+rdata[i].dns.join('<br>')+'</td>\
|
||||||
<td>'+rdata[i].notAfter+'</td>\
|
<td>'+rdata[i].notAfter+'</td>\
|
||||||
<td>'+rdata[i].issuer.split(' ')[0]+'</td>\
|
<td>'+rdata[i].issuer.split(' ')[0]+'</td>\
|
||||||
@@ -2428,7 +2582,7 @@ function rewrite(siteName){
|
|||||||
$("#SetRewriteBtn").click(function(){
|
$("#SetRewriteBtn").click(function(){
|
||||||
$("#rewriteBody").empty();
|
$("#rewriteBody").empty();
|
||||||
$("#rewriteBody").text(editor.getValue());
|
$("#rewriteBody").text(editor.getValue());
|
||||||
setRewrite(filename);
|
setRewrite(filename, encodeURIComponent(editor.getValue()));
|
||||||
});
|
});
|
||||||
$("#SetRewriteBtnTel").click(function(){
|
$("#SetRewriteBtnTel").click(function(){
|
||||||
$("#rewriteBody").empty();
|
$("#rewriteBody").empty();
|
||||||
@@ -2460,8 +2614,8 @@ function rewrite(siteName){
|
|||||||
|
|
||||||
|
|
||||||
//设置伪静态
|
//设置伪静态
|
||||||
function setRewrite(filename){
|
function setRewrite(filename,data){
|
||||||
var data = 'data='+encodeURIComponent($("#rewriteBody").val())+'&path='+filename+'&encoding=utf-8';
|
var data = 'data='+data+'&path='+filename+'&encoding=utf-8';
|
||||||
var loadT = layer.msg(lan.site.saving_txt,{icon:16,time:0,shade: [0.3, '#000']});
|
var loadT = layer.msg(lan.site.saving_txt,{icon:16,time:0,shade: [0.3, '#000']});
|
||||||
$.post('/site/set_rewrite',data,function(rdata){
|
$.post('/site/set_rewrite',data,function(rdata){
|
||||||
layer.close(loadT);
|
layer.close(loadT);
|
||||||
|
|||||||
@@ -1805,7 +1805,7 @@ html .menu .menu_exit:hover {
|
|||||||
|
|
||||||
.view1,
|
.view1,
|
||||||
.view2 {
|
.view2 {
|
||||||
margin-bottom: 15px
|
margin-bottom: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.searcTime {
|
.searcTime {
|
||||||
@@ -1840,7 +1840,7 @@ html .menu .menu_exit:hover {
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: relative;
|
position: relative;
|
||||||
float: left;
|
float: left;
|
||||||
line-height: 16px
|
line-height: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.searcTime .ss .st {
|
.searcTime .ss .st {
|
||||||
@@ -1848,7 +1848,7 @@ html .menu .menu_exit:hover {
|
|||||||
border: #ddd 1px solid;
|
border: #ddd 1px solid;
|
||||||
margin-right: -1px;
|
margin-right: -1px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
float: left
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.searcTime .ss .time {
|
.searcTime .ss .time {
|
||||||
@@ -1859,26 +1859,27 @@ html .menu .menu_exit:hover {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
right: -1px;
|
right: -1px;
|
||||||
top: 27px;
|
top: 27px;
|
||||||
width: 217px;
|
width: 306px;
|
||||||
z-index: 99
|
z-index: 99;
|
||||||
}
|
}
|
||||||
|
|
||||||
.searcTime .ss .time span {
|
.searcTime .ss .time span {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
display: block
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.searcTime .ss .time input {
|
.searcTime .ss .time input {
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
height: 22px;
|
height: 22px;
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
width: 132px
|
margin-left:5px;
|
||||||
|
width: 227px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.searcTime .ss .time input:focus {
|
.searcTime .ss .time input:focus {
|
||||||
border: #66afe9 1px solid;
|
border: #66afe9 1px solid;
|
||||||
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
|
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
|
||||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6)
|
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
|
||||||
}
|
}
|
||||||
|
|
||||||
.searcTime .ss .sbtn {
|
.searcTime .ss .sbtn {
|
||||||
@@ -4502,7 +4503,7 @@ html .menu .menu_exit:hover {
|
|||||||
margin-right: 3px;
|
margin-right: 3px;
|
||||||
}
|
}
|
||||||
/*微信二维码*/
|
/*微信二维码*/
|
||||||
.boxConter {
|
.boxConter {
|
||||||
height: 458px;
|
height: 458px;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
@@ -4853,3 +4854,21 @@ select[disabled]{
|
|||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#form_proxy .sub-groud .bt-input-text{
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
#form_proxy .sub-groud {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
#form_proxy .btswitch-btn{
|
||||||
|
display:inline-block;
|
||||||
|
}
|
||||||
|
#form_proxy .add-replace-prosy {
|
||||||
|
position: relative;
|
||||||
|
top: -10px;
|
||||||
|
}
|
||||||
|
#form_proxy .disabled{
|
||||||
|
background-color: #eee !important;
|
||||||
|
cursor: default;
|
||||||
|
border: 1px solid #dbdbea;
|
||||||
|
}
|
||||||
|
|||||||
@@ -51,14 +51,15 @@
|
|||||||
<div class="ss">
|
<div class="ss">
|
||||||
<span class="st">自定义时间</span>
|
<span class="st">自定义时间</span>
|
||||||
<div class="time">
|
<div class="time">
|
||||||
<span class="bt">开始时间<input class="btime" type="text" value="2017/1/10 00:00:00"></span>
|
<span class="bt">时间范围
|
||||||
<span class="et">结束时间<input class="etime" type="text" value="2017/1/13 00:00:00"></span>
|
<input id="loadbtn_rtime" class="rtime" type="text" value="2023-07-06 00:00:00 - 2023-08-08 00:00:00">
|
||||||
|
</span>
|
||||||
<div class="sbtn loadbtn">提交</div>
|
<div class="sbtn loadbtn">提交</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="getloadview" style="width:100%; height:330px"></div>
|
<div id="getloadview" style="width:100%; height:330px;"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -67,12 +68,18 @@
|
|||||||
<div class="bgw pb15">
|
<div class="bgw pb15">
|
||||||
<div class="title c6 plr15">
|
<div class="title c6 plr15">
|
||||||
<h3 class="c-tit f16">CPU</h3>
|
<h3 class="c-tit f16">CPU</h3>
|
||||||
<div class="searcTime pull-right"><span class="tit">区间检索:</span><span class="gt" onclick="Wday(1,'cpu')">昨天</span><span class="gt on" onclick="Wday(0,'cpu')">今天</span><span class="gt" onclick="Wday(7,'cpu')">最近7天</span><span class="gt" onclick="Wday(30,'cpu')">最近30天</span>
|
<div class="searcTime pull-right">
|
||||||
|
<span class="tit">区间检索:</span>
|
||||||
|
<span class="gt" onclick="Wday(1,'cpu')">昨天</span>
|
||||||
|
<span class="gt on" onclick="Wday(0,'cpu')">今天</span>
|
||||||
|
<span class="gt" onclick="Wday(7,'cpu')">最近7天</span>
|
||||||
|
<span class="gt" onclick="Wday(30,'cpu')">最近30天</span>
|
||||||
<div class="ss">
|
<div class="ss">
|
||||||
<span class="st">自定义时间</span>
|
<span class="st">自定义时间</span>
|
||||||
<div class="time">
|
<div class="time">
|
||||||
<span class="bt">开始时间<input class="btime" type="text" value="2017/1/10 00:00:00"></span>
|
<span class="bt">时间范围
|
||||||
<span class="et">结束时间<input class="etime" type="text" value="2017/1/13 00:00:00"></span>
|
<input id="cpubtn_rtime" class="rtime" type="text" value="2023-07-06 00:00:00 - 2023-08-08 00:00:00">
|
||||||
|
</span>
|
||||||
<div class="sbtn cpubtn">提交</div>
|
<div class="sbtn cpubtn">提交</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -87,12 +94,18 @@
|
|||||||
<div class="bgw pb15">
|
<div class="bgw pb15">
|
||||||
<div class="title c6 plr15">
|
<div class="title c6 plr15">
|
||||||
<h3 class="c-tit f16">内存</h3>
|
<h3 class="c-tit f16">内存</h3>
|
||||||
<div class="searcTime pull-right"><span class="tit">区间检索:</span><span class="gt" onclick="Wday(1,'mem')">昨天</span><span class="gt on" onclick="Wday(0,'mem')">今天</span><span class="gt" onclick="Wday(7,'mem')">最近7天</span><span class="gt" onclick="Wday(30,'mem')">最近30天</span>
|
<div class="searcTime pull-right">
|
||||||
|
<span class="tit">区间检索:</span>
|
||||||
|
<span class="gt" onclick="Wday(1,'mem')">昨天</span>
|
||||||
|
<span class="gt on" onclick="Wday(0,'mem')">今天</span>、
|
||||||
|
<span class="gt" onclick="Wday(7,'mem')">最近7天</span>
|
||||||
|
<span class="gt" onclick="Wday(30,'mem')">最近30天</span>
|
||||||
<div class="ss">
|
<div class="ss">
|
||||||
<span class="st">自定义时间</span>
|
<span class="st">自定义时间</span>
|
||||||
<div class="time">
|
<div class="time">
|
||||||
<span class="bt">开始时间<input class="btime" type="text" value="2017/1/10 00:00:00"></span>
|
<span class="bt">时间范围
|
||||||
<span class="et">结束时间<input class="etime" type="text" value="2017/1/13 00:00:00"></span>
|
<input id="membtn_rtime" class="rtime" type="text" value="2023-07-06 00:00:00 - 2023-08-08 00:00:00">
|
||||||
|
</span>
|
||||||
<div class="sbtn membtn">提交</div>
|
<div class="sbtn membtn">提交</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -107,12 +120,18 @@
|
|||||||
<div class="bgw pb15">
|
<div class="bgw pb15">
|
||||||
<div class="title c6 plr15 mb15">
|
<div class="title c6 plr15 mb15">
|
||||||
<h3 class="c-tit f16">磁盘IO</h3>
|
<h3 class="c-tit f16">磁盘IO</h3>
|
||||||
<div class="searcTime pull-right"><span class="tit">$data['lan']['S1']</span><span class="gt" onclick="Wday(1,'disk')">昨天</span><span class="gt on" onclick="Wday(0,'disk')">今天</span><span class="gt" onclick="Wday(7,'disk')">最近7天</span><span class="gt" onclick="Wday(30,'disk')">最近30天</span>
|
<div class="searcTime pull-right">
|
||||||
|
<span class="tit">$data['lan']['S1']</span>
|
||||||
|
<span class="gt" onclick="Wday(1,'disk')">昨天</span>
|
||||||
|
<span class="gt on" onclick="Wday(0,'disk')">今天</span>
|
||||||
|
<span class="gt" onclick="Wday(7,'disk')">最近7天</span>
|
||||||
|
<span class="gt" onclick="Wday(30,'disk')">最近30天</span>
|
||||||
<div class="ss">
|
<div class="ss">
|
||||||
<span class="st">自定义时间</span>
|
<span class="st">自定义时间</span>
|
||||||
<div class="time">
|
<div class="time">
|
||||||
<span class="bt">开始时间<input class="btime" type="text" value="2017/1/10 00:00:00"></span>
|
<span class="bt">时间范围
|
||||||
<span class="et">结束时间<input class="etime" type="text" value="2017/1/13 00:00:00"></span>
|
<input id="diskbtn_rtime" class="rtime" type="text" value="2023-07-06 00:00:00 - 2023-08-08 00:00:00">
|
||||||
|
</span>
|
||||||
<div class="sbtn diskbtn">提交</div>
|
<div class="sbtn diskbtn">提交</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -127,12 +146,18 @@
|
|||||||
<div class="bgw pb15">
|
<div class="bgw pb15">
|
||||||
<div class="title c6 plr15 mb15">
|
<div class="title c6 plr15 mb15">
|
||||||
<h3 class="c-tit f16">网络IO</h3>
|
<h3 class="c-tit f16">网络IO</h3>
|
||||||
<div class="searcTime pull-right"><span class="tit">$data['lan']['S1']</span><span class="gt" onclick="Wday(1,'network')">昨天</span><span class="gt on" onclick="Wday(0,'network')">今天</span><span class="gt" onclick="Wday(7,'network')">最近7天</span><span class="gt" onclick="Wday(30,'network')">最近30天</span>
|
<div class="searcTime pull-right">
|
||||||
|
<span class="tit">$data['lan']['S1']</span>
|
||||||
|
<span class="gt" onclick="Wday(1,'network')">昨天</span>
|
||||||
|
<span class="gt on" onclick="Wday(0,'network')">今天</span>
|
||||||
|
<span class="gt" onclick="Wday(7,'network')">最近7天</span>
|
||||||
|
<span class="gt" onclick="Wday(30,'network')">最近30天</span>
|
||||||
<div class="ss">
|
<div class="ss">
|
||||||
<span class="st">自定义时间</span>
|
<span class="st">自定义时间</span>
|
||||||
<div class="time">
|
<div class="time">
|
||||||
<span class="bt">开始时间<input class="btime" type="text" value="2017/1/10 00:00:00"></span>
|
<span class="bt">时间范围
|
||||||
<span class="et">结束时间<input class="etime" type="text" value="2017/1/13 00:00:00"></span>
|
<input id="networkbtn_rtime" class="rtime" type="text" value="2023-07-06 00:00:00 - 2023-08-08 00:00:00">
|
||||||
|
</span>
|
||||||
<div class="sbtn networkbtn">提交</div>
|
<div class="sbtn networkbtn">提交</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -146,6 +171,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<script type="text/javascript" src="/static/laydate/laydate.js?v={{config.version}}"></script>
|
||||||
<script src="/static/app/control.js?v={{config.version}}"></script>
|
<script src="/static/app/control.js?v={{config.version}}"></script>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -15,6 +15,10 @@ dnf install -y crontabs
|
|||||||
dnf install -y mysql-devel
|
dnf install -y mysql-devel
|
||||||
|
|
||||||
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
|
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
|
||||||
|
if [ "$SSH_PORT" == "" ];then
|
||||||
|
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
|
||||||
|
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
|
||||||
|
fi
|
||||||
echo "SSH PORT:${SSH_PORT}"
|
echo "SSH PORT:${SSH_PORT}"
|
||||||
|
|
||||||
# if [ -f /usr/sbin/iptables ];then
|
# if [ -f /usr/sbin/iptables ];then
|
||||||
|
|||||||
@@ -22,6 +22,10 @@ yum install -y mysql-devel
|
|||||||
yum install -y expect
|
yum install -y expect
|
||||||
|
|
||||||
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
|
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
|
||||||
|
if [ "$SSH_PORT" == "" ];then
|
||||||
|
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
|
||||||
|
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
|
||||||
|
fi
|
||||||
echo "SSH PORT:${SSH_PORT}"
|
echo "SSH PORT:${SSH_PORT}"
|
||||||
|
|
||||||
# if [ -f /usr/sbin/iptables ];then
|
# if [ -f /usr/sbin/iptables ];then
|
||||||
|
|||||||
@@ -55,6 +55,10 @@ echo y | pacman -Syu icu
|
|||||||
hwclock --systohc
|
hwclock --systohc
|
||||||
|
|
||||||
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
|
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
|
||||||
|
if [ "$SSH_PORT" == "" ];then
|
||||||
|
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
|
||||||
|
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
|
||||||
|
fi
|
||||||
echo "SSH PORT:${SSH_PORT}"
|
echo "SSH PORT:${SSH_PORT}"
|
||||||
|
|
||||||
# if [ -f /usr/sbin/iptables ];then
|
# if [ -f /usr/sbin/iptables ];then
|
||||||
|
|||||||
@@ -26,8 +26,14 @@ fi
|
|||||||
ntpdate $NTPHOST | logger -t NTP
|
ntpdate $NTPHOST | logger -t NTP
|
||||||
|
|
||||||
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
|
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
|
||||||
|
if [ "$SSH_PORT" == "" ];then
|
||||||
|
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
|
||||||
|
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
|
||||||
|
fi
|
||||||
echo "SSH PORT:${SSH_PORT}"
|
echo "SSH PORT:${SSH_PORT}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# choose lang cmd
|
# choose lang cmd
|
||||||
# dpkg-reconfigure --frontend=noninteractive locales
|
# dpkg-reconfigure --frontend=noninteractive locales
|
||||||
if [ ! -f /usr/sbin/locale-gen ];then
|
if [ ! -f /usr/sbin/locale-gen ];then
|
||||||
@@ -141,6 +147,7 @@ apt install -y devscripts
|
|||||||
apt install -y net-tools
|
apt install -y net-tools
|
||||||
apt install -y autoconf
|
apt install -y autoconf
|
||||||
apt install -y gcc
|
apt install -y gcc
|
||||||
|
apt install -y patchelf
|
||||||
|
|
||||||
apt install -y libffi-dev
|
apt install -y libffi-dev
|
||||||
apt install -y cmake automake make
|
apt install -y cmake automake make
|
||||||
|
|||||||
@@ -18,6 +18,10 @@ yum install -y expect
|
|||||||
dnf install crontabs -y
|
dnf install crontabs -y
|
||||||
|
|
||||||
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
|
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
|
||||||
|
if [ "$SSH_PORT" == "" ];then
|
||||||
|
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
|
||||||
|
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
|
||||||
|
fi
|
||||||
echo "SSH PORT:${SSH_PORT}"
|
echo "SSH PORT:${SSH_PORT}"
|
||||||
|
|
||||||
# if [ -f /usr/sbin/iptables ];then
|
# if [ -f /usr/sbin/iptables ];then
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ pkg install -y harfbuzz
|
|||||||
pkg autoremove -y
|
pkg autoremove -y
|
||||||
|
|
||||||
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
|
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
|
||||||
|
if [ "$SSH_PORT" == "" ];then
|
||||||
|
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
|
||||||
|
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
|
||||||
|
fi
|
||||||
echo "SSH PORT:${SSH_PORT}"
|
echo "SSH PORT:${SSH_PORT}"
|
||||||
|
|
||||||
# if [ -f /usr/sbin/iptables ];then
|
# if [ -f /usr/sbin/iptables ];then
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ zypper install -y freetype2-devel
|
|||||||
# zypper install -y php-config
|
# zypper install -y php-config
|
||||||
|
|
||||||
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
|
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
|
||||||
|
if [ "$SSH_PORT" == "" ];then
|
||||||
|
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
|
||||||
|
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
|
||||||
|
fi
|
||||||
echo "SSH PORT:${SSH_PORT}"
|
echo "SSH PORT:${SSH_PORT}"
|
||||||
|
|
||||||
# if [ -f /usr/sbin/iptables ];then
|
# if [ -f /usr/sbin/iptables ];then
|
||||||
|
|||||||
+30
-7
@@ -31,6 +31,9 @@ fi
|
|||||||
|
|
||||||
echo "install remi source"
|
echo "install remi source"
|
||||||
if [ "$VERSION_ID" == "9" ];then
|
if [ "$VERSION_ID" == "9" ];then
|
||||||
|
# dnf upgrade --refresh -y
|
||||||
|
dnf config-manager --set-enabled crb
|
||||||
|
|
||||||
echo "install remi start"
|
echo "install remi start"
|
||||||
if [ ! -f /etc/yum.repos.d/remi.repo ];then
|
if [ ! -f /etc/yum.repos.d/remi.repo ];then
|
||||||
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-9.rpm
|
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-9.rpm
|
||||||
@@ -45,6 +48,10 @@ if [ ! -d /root/.acme.sh ];then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
|
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
|
||||||
|
if [ "$SSH_PORT" == "" ];then
|
||||||
|
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
|
||||||
|
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
|
||||||
|
fi
|
||||||
echo "SSH PORT:${SSH_PORT}"
|
echo "SSH PORT:${SSH_PORT}"
|
||||||
|
|
||||||
# redhat , iptables no default
|
# redhat , iptables no default
|
||||||
@@ -88,16 +95,28 @@ echo "SSH PORT:${SSH_PORT}"
|
|||||||
# fi
|
# fi
|
||||||
# echo "iptables wrap start"
|
# echo "iptables wrap start"
|
||||||
|
|
||||||
|
|
||||||
|
echo "firewall open common port start"
|
||||||
if [ ! -f /usr/sbin/firewalld ];then
|
if [ ! -f /usr/sbin/firewalld ];then
|
||||||
$PKGMGR install firewalld -y
|
$PKGMGR install firewalld -y
|
||||||
systemctl enable firewalld
|
systemctl enable firewalld
|
||||||
#取消服务锁定
|
#取消服务锁定
|
||||||
systemctl unmask firewalld
|
systemctl unmask firewalld
|
||||||
systemctl start firewalld
|
systemctl start firewalld
|
||||||
|
|
||||||
|
sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf
|
||||||
|
firewall-cmd --reload
|
||||||
|
|
||||||
|
#安装就开启
|
||||||
|
systemctl restart firewalld
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f /usr/sbin/firewalld ];then
|
||||||
# look
|
# look
|
||||||
# firewall-cmd --list-all
|
# firewall-cmd --list-all
|
||||||
|
# systemctl status firewalld
|
||||||
|
# firewall-cmd --zone=public --remove-port=80/tcp --permanent
|
||||||
|
|
||||||
if [ "$SSH_PORT" != "" ];then
|
if [ "$SSH_PORT" != "" ];then
|
||||||
firewall-cmd --permanent --zone=public --add-port=${SSH_PORT}/tcp
|
firewall-cmd --permanent --zone=public --add-port=${SSH_PORT}/tcp
|
||||||
else
|
else
|
||||||
@@ -110,12 +129,10 @@ if [ ! -f /usr/sbin/firewalld ];then
|
|||||||
# 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
|
||||||
|
|
||||||
sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf
|
|
||||||
firewall-cmd --reload
|
firewall-cmd --reload
|
||||||
|
|
||||||
#安装时不开启
|
|
||||||
systemctl stop firewalld
|
|
||||||
fi
|
fi
|
||||||
|
echo "firewall open common port end"
|
||||||
|
|
||||||
$PKGMGR install -y epel-release
|
$PKGMGR install -y epel-release
|
||||||
if [ ! -z "$cn" ];then
|
if [ ! -z "$cn" ];then
|
||||||
@@ -128,7 +145,7 @@ fi
|
|||||||
$PKGMGR makecache
|
$PKGMGR makecache
|
||||||
$PKGMGR groupinstall -y "Development Tools"
|
$PKGMGR groupinstall -y "Development Tools"
|
||||||
|
|
||||||
if [ $VERSION_ID -ge 8 ];then
|
if [ "$VERSION_ID" -ge "8" ];then
|
||||||
# EL8 及以上
|
# EL8 及以上
|
||||||
|
|
||||||
# find repo
|
# find repo
|
||||||
@@ -141,6 +158,12 @@ if [ $VERSION_ID -ge 8 ];then
|
|||||||
REPOS="${REPOS},${REPO_VAR}"
|
REPOS="${REPOS},${REPO_VAR}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ "$REPOS" == "--enablerepo=" ];then
|
||||||
|
# if not find, reset emtpy
|
||||||
|
REPOS=''
|
||||||
|
fi
|
||||||
|
|
||||||
REPOS=${REPOS//=,/=}
|
REPOS=${REPOS//=,/=}
|
||||||
echo "REPOS:${REPOS}"
|
echo "REPOS:${REPOS}"
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,10 @@ locale-gen en_US.UTF-8
|
|||||||
localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
|
localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
|
||||||
|
|
||||||
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
|
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
|
||||||
|
if [ "$SSH_PORT" == "" ];then
|
||||||
|
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
|
||||||
|
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
|
||||||
|
fi
|
||||||
echo "SSH PORT:${SSH_PORT}"
|
echo "SSH PORT:${SSH_PORT}"
|
||||||
|
|
||||||
if [ -f /usr/sbin/ufw ];then
|
if [ -f /usr/sbin/ufw ];then
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)"
|
|||||||
|
|
||||||
P_VER=`python3 -V | awk '{print $2}'`
|
P_VER=`python3 -V | awk '{print $2}'`
|
||||||
echo "python:$P_VER"
|
echo "python:$P_VER"
|
||||||
sleep 3
|
sleep 1
|
||||||
|
|
||||||
curPath=`pwd`
|
curPath=`pwd`
|
||||||
rootPath=$(dirname "$curPath")
|
rootPath=$(dirname "$curPath")
|
||||||
|
|||||||
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
cryptography==36.0.1
|
cryptography==36.0.1
|
||||||
flask==2.0.3
|
flask==2.0.3
|
||||||
pyOpenSSL==22.0.0
|
pyOpenSSL==22.0.0
|
||||||
|
requests==2.27.1
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
urllib3==1.21.1
|
||||||
Reference in New Issue
Block a user