mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 21:59:26 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b31d30bb31 | ||
|
|
0670b7f338 | ||
|
|
c25ecc9db2 | ||
|
|
d0d75f4526 | ||
|
|
539857919a | ||
|
|
5139cacce8 | ||
|
|
222c4c6d58 | ||
|
|
c2d6f5408d | ||
|
|
d3a5b9874b | ||
|
|
87da2b9fc5 | ||
|
|
a3a40c830b | ||
|
|
d30ff5b882 | ||
|
|
8a0e4122f3 | ||
|
|
0766ad0063 | ||
|
|
04823f656a | ||
|
|
5d50b3664d | ||
|
|
889c5d96e5 | ||
|
|
c6ac7e90df | ||
|
|
28fe1950c4 | ||
|
|
4a9baeb924 | ||
|
|
3e6a2e148c | ||
|
|
79ec3b2ec0 | ||
|
|
4b7b8aa801 | ||
|
|
66ea1b7f5b | ||
|
|
a9b703c6ee | ||
|
|
00b57bc1c0 | ||
|
|
47cfe6ee04 | ||
|
|
2b9c47b79c | ||
|
|
540fb5a11f | ||
|
|
5dca6bfb80 | ||
|
|
8439fcbe98 | ||
|
|
6cee6f4785 | ||
|
|
6a067ad457 | ||
|
|
691aba1f2a | ||
|
|
6446a7053e | ||
|
|
040c66cdc3 | ||
|
|
c8d02eaa85 | ||
|
|
59bbd99ba4 | ||
|
|
c8d86fa835 | ||
|
|
e629a82ed9 | ||
|
|
fb0a771c81 | ||
|
|
891cd56163 | ||
|
|
0714780938 | ||
|
|
0a11f17d90 | ||
|
|
e22722f40e | ||
|
|
519544715f | ||
|
|
6d34061402 | ||
|
|
119928d9df | ||
|
|
022dfe31d4 | ||
|
|
c2011eedf9 | ||
|
|
b77d549b34 | ||
|
|
0b3bcafec7 | ||
|
|
4e12548978 | ||
|
|
bf7de761c8 | ||
|
|
bfc96e925f | ||
|
|
de1da98e92 | ||
|
|
d4edc449a2 | ||
|
|
a03d4e7dda | ||
|
|
4351367e32 | ||
|
|
0ec628f5e2 | ||
|
|
a94ef37b49 | ||
|
|
cf8729a6ac | ||
|
|
3688456ea0 | ||
|
|
47c64e7212 | ||
|
|
e653f76608 | ||
|
|
d40d0001bf | ||
|
|
793a236641 | ||
|
|
07996a3fe5 | ||
|
|
a826f784fc | ||
|
|
1561768524 | ||
|
|
1d899fe330 | ||
|
|
a1b3e70816 | ||
|
|
6f4479558f | ||
|
|
f817792aeb | ||
|
|
c8c0e44143 | ||
|
|
6668c2e14b | ||
|
|
721f041c65 | ||
|
|
87239f5361 | ||
|
|
b48e3cbfcc | ||
|
|
4b41c6df57 | ||
|
|
b491a6e913 | ||
|
|
42271c5562 | ||
|
|
ef63465aea | ||
|
|
98745e8134 | ||
|
|
2fb293c89c | ||
|
|
4e0db8d0a1 | ||
|
|
4b1e40b42d | ||
|
|
935bee90f7 | ||
|
|
0489a9df2c | ||
|
|
20a4154240 | ||
|
|
a8ced31d32 | ||
|
|
ac97b8f7ec | ||
|
|
a797cd3741 | ||
|
|
a616736bf1 | ||
|
|
8a90f5cb90 | ||
|
|
419d4abe8e | ||
|
|
ba555fba63 | ||
|
|
7ead8708bc | ||
|
|
bd5b066afe | ||
|
|
6d08c160e0 | ||
|
|
f24f8a3a16 | ||
|
|
707b0d4b53 | ||
|
|
d19e9cd8f4 | ||
|
|
a2d0cc6cfe | ||
|
|
356fd831fb | ||
|
|
ec4988e732 | ||
|
|
3a694b8d7d | ||
|
|
d5945fd449 | ||
|
|
10186786d9 | ||
|
|
0eb8791e84 | ||
|
|
5234b55798 |
+1
-2
@@ -154,6 +154,7 @@ data/notify.json
|
||||
data/api.json
|
||||
data/bind_domain.pl
|
||||
data/unauthorized_status.pl
|
||||
data/auth_secret.pl
|
||||
|
||||
plugins/vip_*
|
||||
plugins/own_*
|
||||
@@ -175,7 +176,5 @@ plugins/proxysql
|
||||
debug.out
|
||||
|
||||
|
||||
|
||||
|
||||
mdioks.session-journal
|
||||
*.session
|
||||
|
||||
@@ -30,14 +30,14 @@
|
||||
|
||||
- 吹水组 - https://t.me/mdserver_web
|
||||
- 交流论坛 - https://bbs.midoks.icu
|
||||
|
||||
- discord - https://discord.gg/3zXk4mES
|
||||
```
|
||||
如果出现问题,最好私给我面板信息。不要让我猜。如果不提供,不要提出问题,自行解决。 — 座右铭
|
||||
Talk is cheap, show me the code. -- linus
|
||||
```
|
||||
|
||||
- [兼容性测试报告](/compatibility.md)
|
||||
- [常用命令说明](/cmd.md) [ mw default ]
|
||||
- [常用命令说明](/cmd.md) [ mw default ] [ mw update_dev ]
|
||||
|
||||
### 主要插件介绍
|
||||
|
||||
@@ -90,7 +90,7 @@ PHP[72-83]支持phpMyAdmin[5.2.0]
|
||||
|
||||
# 特别赞助
|
||||
|
||||
- [找资源 - 阿里云盘资源搜索引擎](https://zhaoziyuan.pw/)
|
||||
- [找资源 - 阿里云盘资源搜索引擎](https://zhaoziyuan1.cc)
|
||||
|
||||
# AD - VPS推荐 - 🙏
|
||||
|
||||
@@ -110,15 +110,10 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443:
|
||||
```
|
||||
|
||||
|
||||
### 版本更新 0.16.3
|
||||
### 版本更新 0.16.6
|
||||
|
||||
* 面板配置-可以配置时区。
|
||||
* PHP(GD)扩展安装优化。
|
||||
* PHP界面功能调整。
|
||||
* PHP-FPM设置多个应用池(提高高并发稳定性)。
|
||||
* MySQL(apt/yum)调整优化。
|
||||
* 网站类型优化。
|
||||
* 增加数据管理插件。
|
||||
- openresty【1.25.3.1】配置更新,支持h3;
|
||||
- 修复php83的扩展bcmath在centos7安装出错。
|
||||
|
||||
### JSDelivr安装地址
|
||||
|
||||
@@ -194,9 +189,9 @@ TVbNgrpeGBGZVm5gTLa21ADP7RpnPFhjya
|
||||
日行一善,以后必定大富大贵
|
||||
|
||||
|
||||
### 微信赞助
|
||||
### 支付宝赞助
|
||||
|
||||
[](https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/route/static/img/weixin_zz.jpg)
|
||||
[](https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/route/static/img/alipay_zz.png)
|
||||
|
||||
|
||||
### 无图不真相
|
||||
|
||||
+2
-97
@@ -441,19 +441,7 @@ fi
|
||||
return None
|
||||
if not os.path.exists(site_path):
|
||||
return None
|
||||
args = mw.dict_obj()
|
||||
args.id = site_id
|
||||
import panelSite
|
||||
run_path = panelSite.panelSite().GetRunPath(args)
|
||||
if run_path in ['/']:
|
||||
run_path = ''
|
||||
if run_path:
|
||||
if run_path[0] == '/':
|
||||
run_path = run_path[1:]
|
||||
site_run_path = os.path.join(site_path, run_path)
|
||||
if not os.path.exists(site_run_path):
|
||||
return site_path
|
||||
return site_run_path
|
||||
return site_path
|
||||
else:
|
||||
return False
|
||||
|
||||
@@ -1283,85 +1271,6 @@ fullchain.pem 粘贴到证书输入框
|
||||
root = old_domain_name
|
||||
return root, zone
|
||||
|
||||
# 获取当前正在使用此证书的网站目录
|
||||
def getSslUsedSite(self, save_path):
|
||||
pkey_file = '{}/privkey.pem'.format(save_path)
|
||||
pkey = mw.readFile(pkey_file)
|
||||
if not pkey:
|
||||
return False
|
||||
cert_paths = 'vhost/cert'
|
||||
import panelSite
|
||||
args = mw.dict_obj()
|
||||
args.siteName = ''
|
||||
for c_name in os.listdir(cert_paths):
|
||||
skey_file = '{}/{}/privkey.pem'.format(cert_paths, c_name)
|
||||
skey = mw.readFile(skey_file)
|
||||
if not skey:
|
||||
continue
|
||||
if skey == pkey:
|
||||
args.siteName = c_name
|
||||
run_path = panelSite.panelSite().GetRunPath(args)
|
||||
if not run_path:
|
||||
continue
|
||||
sitePath = mw.M('sites').where(
|
||||
'name=?', c_name).getField('path')
|
||||
if not sitePath:
|
||||
continue
|
||||
to_path = "{}/{}".format(sitePath, run_path)
|
||||
return to_path
|
||||
return False
|
||||
|
||||
def renewCertOther(self):
|
||||
cert_path = "{}/vhost/cert".format(mw.getRunDir())
|
||||
if not os.path.exists(cert_path):
|
||||
return
|
||||
new_time = time.time() + (86400 * 30)
|
||||
n = 0
|
||||
if not 'orders' in self.__config:
|
||||
self.__config['orders'] = {}
|
||||
import panelSite
|
||||
siteObj = panelSite.panelSite()
|
||||
args = mw.dict_obj()
|
||||
for siteName in os.listdir(cert_path):
|
||||
try:
|
||||
cert_file = '{}/{}/fullchain.pem'.format(cert_path, siteName)
|
||||
if not os.path.exists(cert_file):
|
||||
continue # 无证书文件
|
||||
siteInfo = mw.M('sites').where('name=?', siteName).find()
|
||||
if not siteInfo:
|
||||
continue # 无网站信息
|
||||
cert_init = self.getCertInit(cert_file)
|
||||
if not cert_init:
|
||||
continue # 无法获取证书
|
||||
end_time = time.mktime(time.strptime(
|
||||
cert_init['notAfter'], '%Y-%m-%d'))
|
||||
if end_time > new_time:
|
||||
continue # 未到期
|
||||
try:
|
||||
if not cert_init['issuer'] in ['R3', "Let's Encrypt"] and cert_init['issuer'].find("Let's Encrypt") == -1:
|
||||
continue # 非同品牌证书
|
||||
except:
|
||||
continue
|
||||
|
||||
if isinstance(cert_init['dns'], str):
|
||||
cert_init['dns'] = [cert_init['dns']]
|
||||
index = self.getIndex(cert_init['dns'])
|
||||
if index in self.__config['orders'].keys():
|
||||
continue # 已在订单列表
|
||||
|
||||
n += 1
|
||||
writeLog(
|
||||
"|-正在续签第 {} 张其它证书,域名: {}..".format(n, cert_init['subject']))
|
||||
writeLog("|-正在创建订单..")
|
||||
args.id = siteInfo['id']
|
||||
runPath = siteObj.GetRunPath(args)
|
||||
if runPath and not runPath in ['/']:
|
||||
path = siteInfo['path'] + '/' + runPath
|
||||
else:
|
||||
path = siteInfo['path']
|
||||
except:
|
||||
writeLog("|-[{}]续签失败".format(siteName))
|
||||
|
||||
# 外部API - START ----------------------------------------------------------
|
||||
def getHostConf(self, siteName):
|
||||
return mw.getServerDir() + '/web_conf/nginx/vhost/' + siteName + '.conf'
|
||||
@@ -1509,8 +1418,7 @@ fullchain.pem 粘贴到证书输入框
|
||||
# 已删除的网站直接跳过续签
|
||||
if self.__config['orders'][i]['auth_to'].find('|') == -1 and self.__config['orders'][i]['auth_to'].find('/') != -1:
|
||||
if not os.path.exists(self.__config['orders'][i]['auth_to']):
|
||||
auth_to = self.getSslUsedSite(
|
||||
self.__config['orders'][i]['save_path'])
|
||||
auth_to = self.__config['orders'][i]['auth_to']
|
||||
if not auth_to:
|
||||
continue
|
||||
|
||||
@@ -1549,9 +1457,6 @@ fullchain.pem 粘贴到证书输入框
|
||||
# 加入到续签订单
|
||||
order_index.append(i)
|
||||
if not order_index:
|
||||
writeLog("|-没有找到30天内到期的SSL证书,正在尝试去寻找其它可续签证书!")
|
||||
# self.getApis()
|
||||
# self.renewCertOther()
|
||||
writeLog("|-所有任务已处理完成!")
|
||||
return
|
||||
writeLog("|-共需要续签 {} 张证书".format(len(order_index)))
|
||||
|
||||
@@ -242,7 +242,7 @@ class cert_request:
|
||||
# 注册acme帐户
|
||||
def register(self, existing=False):
|
||||
if not 'email' in self.__config:
|
||||
self.__config['email'] = 'mdioks@163.com'
|
||||
self.__config['email'] = 'xxxx.xxxx@gmail.com'
|
||||
if existing:
|
||||
payload = {"onlyReturnExisting": True}
|
||||
elif self.__config['email']:
|
||||
|
||||
+105
-47
@@ -28,9 +28,26 @@ from flask import request
|
||||
|
||||
class config_api:
|
||||
|
||||
__version = '0.16.3'
|
||||
__version = '0.16.6'
|
||||
__api_addr = 'data/api.json'
|
||||
|
||||
# 统一默认配置文件
|
||||
__file = {
|
||||
'api' : 'data/api.json', # API文件
|
||||
'debug' : 'data/debug.pl', # DEBUG文件
|
||||
'close' : 'data/close.pl', # 识别关闭面板文件
|
||||
'basic_auth' : 'data/basic_auth.json', # 面板Basic验证
|
||||
'admin_path' : 'data/admin_path.pl', # 面板后缀路径设置
|
||||
'ipv6' : 'data/ipv6.pl', # ipv6识别文件
|
||||
'bind_domain' : 'data/bind_domain.pl', # 面板域名绑定
|
||||
'unauth_status' : 'data/unauthorized_status.pl', # URL路径未成功显示状态
|
||||
'auth_secret': 'data/auth_secret.pl', # 二次验证密钥
|
||||
'ssl':'data/ssl.pl', # ssl设置
|
||||
'hook_database' : 'data/hook_database.json', # 数据库钩子
|
||||
'hook_menu' : 'data/hook_menu.json', # 菜单钩子
|
||||
'hook_global_static' : 'data/hook_global_static.json', # 静态文件钩子
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@@ -179,7 +196,7 @@ class config_api:
|
||||
basic_open = request.form.get('is_open', '').strip()
|
||||
|
||||
salt = '_md_salt'
|
||||
path = 'data/basic_auth.json'
|
||||
path = self.__file['basic_auth']
|
||||
is_open = True
|
||||
|
||||
if basic_open == 'false':
|
||||
@@ -224,7 +241,7 @@ class config_api:
|
||||
backup_path = request.form.get('backup_path', '')
|
||||
|
||||
if domain != '':
|
||||
reg = "^([\w\-\*]{1,100}\.){1,4}(\w{1,10}|\w{1,10}\.\w{1,10})$"
|
||||
reg = "^([\\w\\-\\*]{1,100}\\.){1,4}(\\w{1,10}|\\w{1,10}\\.\\w{1,10})$"
|
||||
if not re.match(reg, domain):
|
||||
return mw.returnJson(False, '主域名格式不正确')
|
||||
|
||||
@@ -286,7 +303,7 @@ class config_api:
|
||||
return mw.returnJson(False, '安全入口地址长度不能小于6位!')
|
||||
if admin_path in admin_path_checks:
|
||||
return mw.returnJson(False, '该入口已被面板占用,请使用其它入口!')
|
||||
if not re.match("^/[\w\./-_]+$", admin_path):
|
||||
if not re.match("^/[\\w\\./-_]+$", admin_path):
|
||||
return mw.returnJson(False, '入口地址格式不正确,示例: /mw_rand')
|
||||
# else:
|
||||
# domain = mw.readFile('data/bind_domain.pl')
|
||||
@@ -300,7 +317,7 @@ class config_api:
|
||||
# '警告,关闭安全入口等于直接暴露你的后台地址在外网,十分危险,至少开启以下一种安全方式才能关闭:<a
|
||||
# style="color:red;"><br>1、绑定访问域名<br>2、绑定授权IP</a>')
|
||||
|
||||
admin_path_file = 'data/admin_path.pl'
|
||||
admin_path_file = self.__file['admin_path']
|
||||
admin_path_old = '/'
|
||||
if os.path.exists(admin_path_file):
|
||||
admin_path_old = mw.readFile(admin_path_file).strip()
|
||||
@@ -311,7 +328,7 @@ class config_api:
|
||||
return mw.returnJson(True, '修改成功!')
|
||||
|
||||
def closePanelApi(self):
|
||||
filename = 'data/close.pl'
|
||||
filename = self.__file['close']
|
||||
if os.path.exists(filename):
|
||||
os.remove(filename)
|
||||
return mw.returnJson(True, '开启成功')
|
||||
@@ -329,8 +346,8 @@ class config_api:
|
||||
return mw.returnJson(True, '开发模式开启!')
|
||||
|
||||
def setIpv6StatusApi(self):
|
||||
ipv6_file = 'data/ipv6.pl'
|
||||
if os.path.exists('data/ipv6.pl'):
|
||||
ipv6_file = self.__file['ipv6']
|
||||
if os.path.exists(ipv6_file):
|
||||
os.remove(ipv6_file)
|
||||
mw.writeLog('面板设置', '关闭面板IPv6兼容!')
|
||||
else:
|
||||
@@ -400,7 +417,7 @@ class config_api:
|
||||
# 设置面板SSL证书设置
|
||||
def setPanelHttpToHttpsApi(self):
|
||||
|
||||
bind_domain = 'data/bind_domain.pl'
|
||||
bind_domain = self.__file['bind_domain']
|
||||
if not os.path.exists(bind_domain):
|
||||
return mw.returnJson(False, '先要绑定域名!')
|
||||
|
||||
@@ -430,9 +447,9 @@ class config_api:
|
||||
else:
|
||||
conf = mw.readFile(panel_ssl)
|
||||
if conf:
|
||||
rep = "\n\s*#HTTP_TO_HTTPS_START(.|\n){1,300}#HTTP_TO_HTTPS_END"
|
||||
rep = "\n\\s*#HTTP_TO_HTTPS_START(.|\n){1,300}#HTTP_TO_HTTPS_END"
|
||||
conf = re.sub(rep, '', conf)
|
||||
rep = "\s+if.+server_port.+\n.+\n\s+\s*}"
|
||||
rep = "\\s+if.+server_port.+\n.+\n\\s+\\s*}"
|
||||
conf = re.sub(rep, '', conf)
|
||||
mw.writeFile(panel_ssl, conf)
|
||||
|
||||
@@ -445,7 +462,7 @@ class config_api:
|
||||
|
||||
# 删除面板证书
|
||||
def delPanelSslApi(self):
|
||||
bind_domain = 'data/bind_domain.pl'
|
||||
bind_domain = self.__file['bind_domain']
|
||||
if not os.path.exists(bind_domain):
|
||||
return mw.returnJson(False, '未绑定域名!')
|
||||
|
||||
@@ -474,7 +491,7 @@ class config_api:
|
||||
def applyPanelLetSslApi(self):
|
||||
|
||||
# check domain is bind?
|
||||
bind_domain = 'data/bind_domain.pl'
|
||||
bind_domain = self.__file['bind_domain']
|
||||
if not os.path.exists(bind_domain):
|
||||
return mw.returnJson(False, '先要绑定域名!')
|
||||
|
||||
@@ -531,7 +548,7 @@ class config_api:
|
||||
panel_tpl = mw.getRunDir() + "/data/tpl/nginx_panel.conf"
|
||||
dst_panel_path = mw.getServerDir() + "/web_conf/nginx/vhost/panel.conf"
|
||||
|
||||
cfg_domain = 'data/bind_domain.pl'
|
||||
cfg_domain = self.__file['bind_domain']
|
||||
if domain == '':
|
||||
os.remove(cfg_domain)
|
||||
os.remove(dst_panel_path)
|
||||
@@ -560,7 +577,7 @@ class config_api:
|
||||
|
||||
# 设置面板SSL
|
||||
def setPanelSslApi(self):
|
||||
sslConf = mw.getRunDir() + '/data/ssl.pl'
|
||||
sslConf = mw.getRunDir() + '/' + self.__file['ssl']
|
||||
|
||||
panel_tpl = mw.getRunDir() + "/data/tpl/nginx_panel.conf"
|
||||
dst_panel_path = mw.getServerDir() + "/web_conf/nginx/vhost/panel.conf"
|
||||
@@ -569,35 +586,35 @@ class config_api:
|
||||
|
||||
conf = mw.readFile(dst_panel_path)
|
||||
if conf:
|
||||
rep = "\s+ssl_certificate\s+.+;\s+ssl_certificate_key\s+.+;"
|
||||
rep = "\\s+ssl_certificate\\s+.+;\\s+ssl_certificate_key\\s+.+;"
|
||||
conf = re.sub(rep, '', conf)
|
||||
rep = "\s+ssl_protocols\s+.+;\n"
|
||||
rep = "\\s+ssl_protocols\\s+.+;\n"
|
||||
conf = re.sub(rep, '', conf)
|
||||
rep = "\s+ssl_ciphers\s+.+;\n"
|
||||
rep = "\\s+ssl_ciphers\\s+.+;\n"
|
||||
conf = re.sub(rep, '', conf)
|
||||
rep = "\s+ssl_prefer_server_ciphers\s+.+;\n"
|
||||
rep = "\\s+ssl_prefer_server_ciphers\\s+.+;\n"
|
||||
conf = re.sub(rep, '', conf)
|
||||
rep = "\s+ssl_session_cache\s+.+;\n"
|
||||
rep = "\\s+ssl_session_cache\\s+.+;\n"
|
||||
conf = re.sub(rep, '', conf)
|
||||
rep = "\s+ssl_session_timeout\s+.+;\n"
|
||||
rep = "\\s+ssl_session_timeout\\s+.+;\n"
|
||||
conf = re.sub(rep, '', conf)
|
||||
rep = "\s+ssl_ecdh_curve\s+.+;\n"
|
||||
rep = "\\s+ssl_ecdh_curve\\s+.+;\n"
|
||||
conf = re.sub(rep, '', conf)
|
||||
rep = "\s+ssl_session_tickets\s+.+;\n"
|
||||
rep = "\\s+ssl_session_tickets\\s+.+;\n"
|
||||
conf = re.sub(rep, '', conf)
|
||||
rep = "\s+ssl_stapling\s+.+;\n"
|
||||
rep = "\\s+ssl_stapling\\s+.+;\n"
|
||||
conf = re.sub(rep, '', conf)
|
||||
rep = "\s+ssl_stapling_verify\s+.+;\n"
|
||||
rep = "\\s+ssl_stapling_verify\\s+.+;\n"
|
||||
conf = re.sub(rep, '', conf)
|
||||
rep = "\s+ssl\s+on;"
|
||||
rep = "\\s+ssl\\s+on;"
|
||||
conf = re.sub(rep, '', conf)
|
||||
rep = "\s+error_page\s497.+;"
|
||||
rep = "\\s+error_page\\s497.+;"
|
||||
conf = re.sub(rep, '', conf)
|
||||
rep = "\s+if.+server_port.+\n.+\n\s+\s*}"
|
||||
rep = "\\s+if.+server_port.+\n.+\n\\s+\\s*}"
|
||||
conf = re.sub(rep, '', conf)
|
||||
rep = "\s+listen\s+443.*;"
|
||||
rep = "\\s+listen\\s+443.*;"
|
||||
conf = re.sub(rep, '', conf)
|
||||
rep = "\s+listen\s+\[\:\:\]\:443.*;"
|
||||
rep = "\\s+listen\\s+\\[\\:\\:\\]\\:443.*;"
|
||||
conf = re.sub(rep, '', conf)
|
||||
mw.writeFile(dst_panel_path, conf)
|
||||
|
||||
@@ -628,7 +645,7 @@ class config_api:
|
||||
|
||||
conf = conf.replace('#error_page 404/404.html;', sslStr)
|
||||
|
||||
rep = "listen\s+([0-9]+)\s*[default_server]*;"
|
||||
rep = "listen\\s+([0-9]+)\\s*[default_server]*;"
|
||||
tmp = re.findall(rep, conf)
|
||||
if not mw.inArray(tmp, '443'):
|
||||
listen = re.search(rep, conf).group()
|
||||
@@ -744,15 +761,15 @@ class config_api:
|
||||
|
||||
def setStatusCodeApi(self):
|
||||
status_code = request.form.get('status_code', '').strip()
|
||||
if re.match("^\d+$", status_code):
|
||||
if re.match("^\\d+$", status_code):
|
||||
status_code = int(status_code)
|
||||
if status_code != 0:
|
||||
if status_code < 100 or status_code > 999:
|
||||
return mw.returnJson(False, '状态码范围错误!')
|
||||
else:
|
||||
return mw.returnJson(False, '状态码范围错误!')
|
||||
|
||||
mw.writeFile('data/unauthorized_status.pl', str(status_code))
|
||||
unauthorized_status = self.__file['unauth_status']
|
||||
mw.writeFile(unauthorized_status, str(status_code))
|
||||
mw.writeLog('面板设置', '将未授权响应状态码设置为:{}'.format(status_code))
|
||||
return mw.returnJson(True, '设置成功!')
|
||||
|
||||
@@ -871,8 +888,7 @@ class config_api:
|
||||
if not 'token_crypt' in data:
|
||||
token = mw.getRandomString(32)
|
||||
data['token'] = mw.md5(token)
|
||||
data['token_crypt'] = mw.enCrypt(
|
||||
data['token'], token).decode('utf-8')
|
||||
data['token_crypt'] = mw.enCrypt(data['token'], token).decode('utf-8')
|
||||
|
||||
token = stats[data['open']] + '成功!'
|
||||
mw.writeLog('API配置', '%sAPI接口' % stats[data['open']])
|
||||
@@ -888,7 +904,7 @@ class config_api:
|
||||
return mw.returnJson(True, '保存成功!')
|
||||
|
||||
def renderUnauthorizedStatus(self, data):
|
||||
cfg_unauth_status = 'data/unauthorized_status.pl'
|
||||
cfg_unauth_status = self.__file['unauth_status']
|
||||
if os.path.exists(cfg_unauth_status):
|
||||
status_code = mw.readFile(cfg_unauth_status)
|
||||
data['status_code'] = status_code
|
||||
@@ -927,6 +943,37 @@ class config_api:
|
||||
return mw.returnJson(True, '设置成功!')
|
||||
|
||||
|
||||
def getAuthSecretApi(self):
|
||||
reset = request.form.get('reset', '')
|
||||
|
||||
import pyotp
|
||||
auth = self.__file['auth_secret']
|
||||
tag = 'mdserver-web'
|
||||
if os.path.exists(auth) and reset != '1':
|
||||
content = mw.readFile(auth)
|
||||
sec = mw.deDoubleCrypt(tag,content)
|
||||
else:
|
||||
sec = pyotp.random_base32()
|
||||
crypt_data = mw.enDoubleCrypt(tag, sec)
|
||||
mw.writeFile(auth, crypt_data)
|
||||
|
||||
ip = mw.getHostAddr()
|
||||
url = pyotp.totp.TOTP(sec).provisioning_uri(name=ip, issuer_name='mdserver-web')
|
||||
|
||||
rdata = {}
|
||||
rdata['secret'] = sec
|
||||
rdata['url'] = url
|
||||
return mw.returnJson(True, '设置成功!', rdata)
|
||||
|
||||
def setAuthSecretApi(self):
|
||||
auth = self.__file['auth_secret']
|
||||
if os.path.exists(auth):
|
||||
os.remove(auth)
|
||||
return mw.returnJson(True, '关闭成功!', 0)
|
||||
else:
|
||||
return mw.returnJson(True, '开启成功!', 1)
|
||||
|
||||
|
||||
def get(self):
|
||||
|
||||
data = {}
|
||||
@@ -939,31 +986,38 @@ class config_api:
|
||||
data['port'] = mw.getHostPort()
|
||||
data['ip'] = mw.getHostAddr()
|
||||
|
||||
admin_path_file = 'data/admin_path.pl'
|
||||
admin_path_file = self.__file['admin_path']
|
||||
if not os.path.exists(admin_path_file):
|
||||
data['admin_path'] = '/'
|
||||
else:
|
||||
data['admin_path'] = mw.readFile(admin_path_file)
|
||||
|
||||
ipv6_file = 'data/ipv6.pl'
|
||||
ipv6_file = self.__file['ipv6']
|
||||
if os.path.exists(ipv6_file):
|
||||
data['ipv6'] = 'checked'
|
||||
else:
|
||||
data['ipv6'] = ''
|
||||
|
||||
debug_file = 'data/debug.pl'
|
||||
debug_file = self.__file['debug']
|
||||
if os.path.exists(debug_file):
|
||||
data['debug'] = 'checked'
|
||||
else:
|
||||
data['debug'] = ''
|
||||
|
||||
ssl_file = 'data/ssl.pl'
|
||||
if os.path.exists('data/ssl.pl'):
|
||||
ssl_file = self.__file['ssl']
|
||||
if os.path.exists(ssl_file):
|
||||
data['ssl'] = 'checked'
|
||||
else:
|
||||
data['ssl'] = ''
|
||||
|
||||
basic_auth = 'data/basic_auth.json'
|
||||
|
||||
auth_secret = self.__file['auth_secret']
|
||||
if os.path.exists(auth_secret):
|
||||
data['auth_secret'] = 'checked'
|
||||
else:
|
||||
data['auth_secret'] = ''
|
||||
|
||||
basic_auth = self.__file['basic_auth']
|
||||
if os.path.exists(basic_auth):
|
||||
bac = mw.readFile(basic_auth)
|
||||
bac = json.loads(bac)
|
||||
@@ -972,7 +1026,7 @@ class config_api:
|
||||
else:
|
||||
data['basic_auth'] = ''
|
||||
|
||||
cfg_domain = 'data/bind_domain.pl'
|
||||
cfg_domain = self.__file['bind_domain']
|
||||
if os.path.exists(cfg_domain):
|
||||
domain = mw.readFile(cfg_domain)
|
||||
data['bind_domain'] = domain.strip()
|
||||
@@ -981,6 +1035,7 @@ class config_api:
|
||||
|
||||
data = self.renderUnauthorizedStatus(data)
|
||||
|
||||
#api
|
||||
api_token = self.__api_addr
|
||||
if os.path.exists(api_token):
|
||||
bac = mw.readFile(api_token)
|
||||
@@ -990,6 +1045,9 @@ class config_api:
|
||||
else:
|
||||
data['api_token'] = ''
|
||||
|
||||
#auth
|
||||
|
||||
|
||||
data['site_count'] = mw.M('sites').count()
|
||||
|
||||
data['username'] = mw.M('users').where(
|
||||
@@ -998,7 +1056,7 @@ class config_api:
|
||||
data['hook_tag'] = request.args.get('tag', '')
|
||||
|
||||
# databases hook
|
||||
database_hook_file = 'data/hook_database.json'
|
||||
database_hook_file = self.__file['hook_database']
|
||||
if os.path.exists(database_hook_file):
|
||||
df = mw.readFile(database_hook_file)
|
||||
df = json.loads(df)
|
||||
@@ -1007,7 +1065,7 @@ class config_api:
|
||||
data['hook_database'] = []
|
||||
|
||||
# menu hook
|
||||
menu_hook_file = 'data/hook_menu.json'
|
||||
menu_hook_file = self.__file['hook_menu']
|
||||
if os.path.exists(menu_hook_file):
|
||||
df = mw.readFile(menu_hook_file)
|
||||
df = json.loads(df)
|
||||
@@ -1016,7 +1074,7 @@ class config_api:
|
||||
data['hook_menu'] = []
|
||||
|
||||
# global_static hook
|
||||
global_static_hook_file = 'data/hook_global_static.json'
|
||||
global_static_hook_file = self.__file['hook_global_static']
|
||||
if os.path.exists(global_static_hook_file):
|
||||
df = mw.readFile(global_static_hook_file)
|
||||
df = json.loads(df)
|
||||
|
||||
+66
-13
@@ -161,15 +161,12 @@ class files_api:
|
||||
search = request.args.get('search', '').strip().lower()
|
||||
search_all = request.args.get('all', '').strip().lower()
|
||||
page = request.args.get('p', '1').strip().lower()
|
||||
row = request.args.get('showRow', '10')
|
||||
disk = request.form.get('disk', '')
|
||||
if disk == 'True':
|
||||
row = 1000
|
||||
row = request.args.get('row', '10')
|
||||
order = request.form.get('order', '')
|
||||
|
||||
# return self.getAllDir(path, int(page), int(row), "wp-inlcude")
|
||||
if search_all == 'yes' and search != '':
|
||||
return self.getAllDir(path, int(page), int(row), search)
|
||||
return self.getDir(path, int(page), int(row), search)
|
||||
return self.getAllDir(path, int(page), int(row), order, search)
|
||||
return self.getDir(path, int(page), int(row), order, search)
|
||||
|
||||
def createFileApi(self):
|
||||
file = request.form.get('path', '')
|
||||
@@ -948,16 +945,64 @@ class files_api:
|
||||
i += 1
|
||||
return i
|
||||
|
||||
def getAllDir(self, path, page=1, page_size=10, search=None):
|
||||
def getAllDir(self, path, page=1, page_size=10, order='', search=None):
|
||||
# print("search:", search)
|
||||
data = {}
|
||||
dirnames = []
|
||||
filenames = []
|
||||
|
||||
info = {}
|
||||
|
||||
i = 0
|
||||
n = 0
|
||||
count = 0
|
||||
max_limit = 3000
|
||||
order_arr = order.split(' ')
|
||||
if len(order_arr) < 2:
|
||||
plist = mw.sortAllFileList(path, order_arr[0],'',search, max_limit)
|
||||
else:
|
||||
plist = mw.sortAllFileList(path, order_arr[0], order_arr[1], search,max_limit)
|
||||
|
||||
info['count'] = len(plist)
|
||||
info['row'] = page_size
|
||||
info['p'] = page
|
||||
info['tojs'] = 'getFiles'
|
||||
pageObj = mw.getPageObject(info, '1,2,3,4,5,6,7,8')
|
||||
data['PAGE'] = pageObj[0]
|
||||
|
||||
for dst_file in plist:
|
||||
|
||||
if not os.path.exists(dst_file):
|
||||
continue
|
||||
|
||||
i += 1
|
||||
if n >= pageObj[1].ROW:
|
||||
break
|
||||
if i < pageObj[1].SHIFT:
|
||||
continue
|
||||
|
||||
if os.path.isdir(dst_file):
|
||||
dirnames.append(self.__get_stats(dst_file, path))
|
||||
else:
|
||||
filenames.append(self.__get_stats(dst_file, path))
|
||||
n += 1
|
||||
|
||||
data['DIR'] = dirnames
|
||||
data['FILES'] = filenames
|
||||
data['PATH'] = path.replace('//', '/')
|
||||
|
||||
return mw.getJson(data)
|
||||
|
||||
#备份
|
||||
def getAllDirBk(self, path, page=1, page_size=10, order='', search=None):
|
||||
data = {}
|
||||
dirnames = []
|
||||
filenames = []
|
||||
|
||||
count = 0
|
||||
max_limit = 3000
|
||||
|
||||
for d_list in os.walk(path):
|
||||
|
||||
if count >= max_limit:
|
||||
break
|
||||
|
||||
@@ -996,7 +1041,7 @@ class files_api:
|
||||
|
||||
return mw.getJson(data)
|
||||
|
||||
def getDir(self, path, page=1, page_size=10, search=None):
|
||||
def getDir(self, path, page=1, page_size=10, order = '', search=None):
|
||||
data = {}
|
||||
dirnames = []
|
||||
filenames = []
|
||||
@@ -1011,7 +1056,14 @@ class files_api:
|
||||
|
||||
i = 0
|
||||
n = 0
|
||||
for filename in os.listdir(path):
|
||||
|
||||
order_arr = order.split(' ')
|
||||
if len(order_arr) < 2:
|
||||
plist = mw.sortFileList(path, order_arr[0],'')
|
||||
else:
|
||||
plist = mw.sortFileList(path, order_arr[0],order_arr[1])
|
||||
|
||||
for filename in plist:
|
||||
if search:
|
||||
if filename.lower().find(search) == -1:
|
||||
continue
|
||||
@@ -1033,8 +1085,8 @@ class files_api:
|
||||
n += 1
|
||||
except Exception as e:
|
||||
continue
|
||||
data['DIR'] = sorted(dirnames)
|
||||
data['FILES'] = sorted(filenames)
|
||||
data['DIR'] = dirnames
|
||||
data['FILES'] = filenames
|
||||
data['PATH'] = path.replace('//', '/')
|
||||
|
||||
return mw.getJson(data)
|
||||
@@ -1067,6 +1119,7 @@ cd %s
|
||||
return mw.returnJson(status, mw.getNumLines(fileName, 200))
|
||||
|
||||
def __get_stats(self, filename, path=None):
|
||||
# print(filename,path)
|
||||
filename = filename.replace('//', '/')
|
||||
try:
|
||||
stat = os.stat(filename)
|
||||
|
||||
+64
-7
@@ -246,7 +246,7 @@ def isInstalledWeb():
|
||||
|
||||
def isIpAddr(ip):
|
||||
check_ip = re.compile(
|
||||
'^(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)$')
|
||||
'^(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$')
|
||||
if check_ip.match(ip):
|
||||
return True
|
||||
else:
|
||||
@@ -1176,10 +1176,10 @@ def getLocalIpBack():
|
||||
url = 'http://pv.sohu.com/cityjson?ie=utf-8'
|
||||
req = urllib.request.urlopen(url, timeout=10)
|
||||
content = req.read().decode('utf-8')
|
||||
ipaddress = re.search('\d+.\d+.\d+.\d+', content).group(0)
|
||||
ipaddress = re.search('\\d+.\\d+.\\d+.\\d+', content).group(0)
|
||||
writeFile(filename, ipaddress)
|
||||
|
||||
ipaddress = re.search('\d+.\d+.\d+.\d+', ipaddress).group(0)
|
||||
ipaddress = re.search('\\d+.\\d+.\\d+.\\d+', ipaddress).group(0)
|
||||
return ipaddress
|
||||
except Exception as ex:
|
||||
# print(ex)
|
||||
@@ -1244,7 +1244,7 @@ def checkIp(ip):
|
||||
# 检查是否为IPv4地址
|
||||
import re
|
||||
p = re.compile(
|
||||
'^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)$')
|
||||
'^((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$')
|
||||
if p.match(ip):
|
||||
return True
|
||||
else:
|
||||
@@ -1382,13 +1382,13 @@ def getCpuType():
|
||||
|
||||
# 取CPU类型
|
||||
cpuinfo = open('/proc/cpuinfo', 'r').read()
|
||||
rep = "model\s+name\s+:\s+(.+)"
|
||||
rep = "model\\s+name\\s+:\\s+(.+)"
|
||||
tmp = re.search(rep, cpuinfo, re.I)
|
||||
if tmp:
|
||||
cpuType = tmp.groups()[0]
|
||||
else:
|
||||
cpuinfo = execShell('LANG="en_US.UTF-8" && lscpu')[0]
|
||||
rep = "Model\s+name:\s+(.+)"
|
||||
rep = "Model\\s+name:\\s+(.+)"
|
||||
tmp = re.search(rep, cpuinfo, re.I)
|
||||
if tmp:
|
||||
cpuType = tmp.groups()[0]
|
||||
@@ -1598,6 +1598,63 @@ def checkCert(certPath='ssl/certificate.pem'):
|
||||
return True
|
||||
|
||||
|
||||
def sortFileList(path, ftype = 'mtime', sort = 'desc'):
|
||||
flist = os.listdir(path)
|
||||
if ftype == 'mtime':
|
||||
if sort == 'desc':
|
||||
flist = sorted(flist, key=lambda f: os.path.getmtime(os.path.join(path,f)), reverse=True)
|
||||
if sort == 'asc':
|
||||
flist = sorted(flist, key=lambda f: os.path.getmtime(os.path.join(path,f)), reverse=False)
|
||||
|
||||
if ftype == 'size':
|
||||
if sort == 'desc':
|
||||
flist = sorted(flist, key=lambda f: os.path.getsize(os.path.join(path,f)), reverse=True)
|
||||
if sort == 'asc':
|
||||
flist = sorted(flist, key=lambda f: os.path.getsize(os.path.join(path,f)), reverse=False)
|
||||
return flist
|
||||
|
||||
|
||||
def sortAllFileList(path, ftype = 'mtime', sort = 'desc', search = '',limit = 3000):
|
||||
count = 0
|
||||
flist = []
|
||||
for d_list in os.walk(path):
|
||||
if count >= limit:
|
||||
break
|
||||
|
||||
for d in d_list[1]:
|
||||
if count >= limit:
|
||||
break
|
||||
if d.lower().find(search) != -1:
|
||||
filename = d_list[0] + '/' + d
|
||||
if not os.path.exists(filename):
|
||||
continue
|
||||
count += 1
|
||||
flist.append(filename)
|
||||
|
||||
for f in d_list[2]:
|
||||
if count >= limit:
|
||||
break
|
||||
|
||||
if f.lower().find(search) != -1:
|
||||
filename = d_list[0] + '/' + f
|
||||
if not os.path.exists(filename):
|
||||
continue
|
||||
count += 1
|
||||
flist.append(filename)
|
||||
|
||||
if ftype == 'mtime':
|
||||
if sort == 'desc':
|
||||
flist = sorted(flist, key=lambda f: os.path.getmtime(f), reverse=True)
|
||||
if sort == 'asc':
|
||||
flist = sorted(flist, key=lambda f: os.path.getmtime(f), reverse=False)
|
||||
|
||||
if ftype == 'size':
|
||||
if sort == 'desc':
|
||||
flist = sorted(flist, key=lambda f: os.path.getsize(f), reverse=True)
|
||||
if sort == 'asc':
|
||||
flist = sorted(flist, key=lambda f: os.path.getsize(f), reverse=False)
|
||||
return flist
|
||||
|
||||
def getPathSize(path):
|
||||
# 取文件或目录大小
|
||||
if not os.path.exists(path):
|
||||
@@ -1772,7 +1829,7 @@ def getSSHPort():
|
||||
try:
|
||||
file = '/etc/ssh/sshd_config'
|
||||
conf = readFile(file)
|
||||
rep = "(#*)?Port\s+([0-9]+)\s*\n"
|
||||
rep = "(#*)?Port\\s+([0-9]+)\\s*\n"
|
||||
port = re.search(rep, conf).groups(0)[1]
|
||||
return int(port)
|
||||
except:
|
||||
|
||||
+25
-4
@@ -2767,24 +2767,41 @@ location ^~ {from} {\n\
|
||||
mw.writeLog('TYPE_SITE', '设置成功,站点到期后将自动停止!', (siteName, edate))
|
||||
return mw.returnJson(True, '设置成功,站点到期后将自动停止!')
|
||||
|
||||
# ssl相关方法 start
|
||||
# ssl相关方法 start
|
||||
def setSslConf(self, siteName):
|
||||
file = self.getHostConf(siteName)
|
||||
conf = mw.readFile(file)
|
||||
|
||||
version = ''
|
||||
version_file_pl = mw.getServerDir() + '/openresty/version.pl'
|
||||
if os.path.exists(version_file_pl):
|
||||
version = mw.readFile(version_file_pl)
|
||||
version = version.strip()
|
||||
|
||||
|
||||
keyPath = self.sslDir + '/' + siteName + '/privkey.pem'
|
||||
certPath = self.sslDir + '/' + siteName + '/fullchain.pem'
|
||||
if conf:
|
||||
if conf.find('ssl_certificate') == -1:
|
||||
#ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
|
||||
|
||||
http3Header = """
|
||||
add_header Strict-Transport-Security "max-age=63072000";
|
||||
add_header Alt-Svc 'h3=":443";ma=86400,h3-29=":443";ma=86400';
|
||||
"""
|
||||
if version != '1.25.3.1':
|
||||
http3Header = '';
|
||||
|
||||
sslStr = """#error_page 404/404.html;
|
||||
ssl_certificate %s;
|
||||
ssl_certificate_key %s;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_timeout 10m;
|
||||
error_page 497 https://$host$request_uri;""" % (certPath, keyPath)
|
||||
%s
|
||||
error_page 497 https://$host$request_uri;""" % (certPath, keyPath, http3Header)
|
||||
if(conf.find('ssl_certificate') != -1):
|
||||
return mw.returnData(True, 'SSL开启成功!')
|
||||
|
||||
@@ -2796,6 +2813,10 @@ location ^~ {from} {\n\
|
||||
listen = re.search(rep, conf).group()
|
||||
http_ssl = "\n\tlisten 443 ssl http2;"
|
||||
http_ssl = http_ssl + "\n\tlisten [::]:443 ssl http2;"
|
||||
|
||||
if version == '1.25.3.1':
|
||||
http_ssl = http_ssl + "\n\tlisten 443 quic;"
|
||||
|
||||
conf = conf.replace(listen, listen + http_ssl)
|
||||
|
||||
mw.backFile(file)
|
||||
|
||||
@@ -49,7 +49,7 @@ ALTER TABLE `firewall` ADD COLUMN `protocol` TEXT DEFAULT 'tcp';
|
||||
|
||||
INSERT INTO `firewall` (`id`, `port`, `protocol`, `ps`, `addtime`) VALUES
|
||||
(1, '80', 'tcp','网站默认端口', '0000-00-00 00:00:00'),
|
||||
(2, '443', 'tcp', 'HTTPS', '0000-00-00 00:00:00');
|
||||
(2, '443', 'tcp/udp', 'HTTPS', '0000-00-00 00:00:00');
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -202,6 +202,11 @@ class nosqlMySQLCtr():
|
||||
sql = 'select * from ' + table + where_sql + ' limit '+str(start_index)+',10';
|
||||
# print(sql)
|
||||
result = my_instance.query(sql)
|
||||
|
||||
for i in range(len(result)):
|
||||
for f in result[i]:
|
||||
result[i][f] = str(result[i][f])
|
||||
|
||||
# print(result)
|
||||
|
||||
page_args = {}
|
||||
|
||||
@@ -38,7 +38,7 @@ Install_App()
|
||||
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
HTTP_PREFIX="https://"
|
||||
if [ ! -z "$cn" ];then
|
||||
HTTP_PREFIX="https://ghproxy.com/"
|
||||
HTTP_PREFIX="https://mirror.ghproxy.com/"
|
||||
fi
|
||||
|
||||
# FlameGraph start
|
||||
|
||||
@@ -15,7 +15,9 @@ if [ ! -d $GIT_PROJECT_DIR ];then
|
||||
fi
|
||||
|
||||
unset GIT_DIR
|
||||
git config pull.rebase false
|
||||
|
||||
git config pull.rebase true
|
||||
git config credential.helper store
|
||||
|
||||
cd $GIT_PROJECT_DIR && git pull
|
||||
|
||||
|
||||
@@ -860,68 +860,53 @@ function setDbPs(id, name, obj) {
|
||||
}
|
||||
|
||||
function openPhpmyadmin(name,username,password){
|
||||
$.post('/plugins/run', {'name':'phpmyadmin','func':'plugins_db_support'}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
|
||||
data = syncPost('/plugins/check',{'name':'phpmyadmin'});
|
||||
if (rdata.data['installed'] != 'ok'){
|
||||
layer.msg('phpMyAdmin未安装!',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if (rdata.data['status'] != 'start'){
|
||||
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data.status){
|
||||
layer.msg(data.msg,{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
if (rdata.data['cfg']['choose'] != 'mariadb'){
|
||||
layer.msg('当前为['+rdata.choose+']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
var home_page = rdata.data['home_page'];
|
||||
$("#toPHPMyAdmin").attr('action',home_page);
|
||||
if($("#toPHPMyAdmin").attr('action').indexOf('phpmyadmin') == -1){
|
||||
layer.msg('请先安装phpMyAdmin',{icon:2,shade: [0.3, '#000']});
|
||||
setTimeout(function(){ window.location.href = '/soft'; },3000);
|
||||
return;
|
||||
}
|
||||
//检查版本
|
||||
bigVer = rdata.data['version'];
|
||||
if (bigVer>=4.5){
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'status'});
|
||||
if (data.data != 'start'){
|
||||
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_cfg'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (rdata.choose != 'mariadb'){
|
||||
layer.msg('当前为['+rdata.choose+']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
var phpmyadmin_cfg = rdata;
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
layer.msg('phpMyAdmin['+data.data+']需要手动登录😭',{icon:16,shade: [0.3, '#000'],time:4000});
|
||||
|
||||
} else{
|
||||
var murl = $("#toPHPMyAdmin").attr('action');
|
||||
$("#pma_username").val(username);
|
||||
$("#pma_password").val(password);
|
||||
$("#db").val(name);
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_home_page'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (!rdata.status){
|
||||
layer.msg(rdata.msg,{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
layer.msg('正在打开phpMyAdmin',{icon:16,shade: [0.3, '#000'],time:2000});
|
||||
|
||||
var home_page = rdata.data;
|
||||
home_page = home_page.replace("http://","http://"+phpmyadmin_cfg['username']+":"+phpmyadmin_cfg['password']+"@");
|
||||
$("#toPHPMyAdmin").attr('action',home_page);
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
}
|
||||
|
||||
if($("#toPHPMyAdmin").attr('action').indexOf('phpmyadmin') == -1){
|
||||
layer.msg('请先安装phpMyAdmin',{icon:2,shade: [0.3, '#000']});
|
||||
setTimeout(function(){ window.location.href = '/soft'; },3000);
|
||||
return;
|
||||
}
|
||||
|
||||
//检查版本
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'version'});
|
||||
bigVer = data.data.split('.')[0]
|
||||
if (bigVer>=4.5){
|
||||
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},3000);
|
||||
layer.msg('phpMyAdmin['+data.data+']需要手动登录😭',{icon:16,shade: [0.3, '#000'],time:4000});
|
||||
|
||||
} else{
|
||||
var murl = $("#toPHPMyAdmin").attr('action');
|
||||
$("#pma_username").val(username);
|
||||
$("#pma_password").val(password);
|
||||
$("#db").val(name);
|
||||
|
||||
layer.msg('正在打开phpMyAdmin',{icon:16,shade: [0.3, '#000'],time:2000});
|
||||
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},3000);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
function delBackup(filename, name, path){
|
||||
|
||||
@@ -14,7 +14,7 @@ sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
mariadbDir=${serverPath}/source/mariadb
|
||||
|
||||
MY_VER=10.11.6
|
||||
MY_VER=10.11.7
|
||||
|
||||
Install_app()
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
mariadbDir=${serverPath}/source/mariadb
|
||||
|
||||
MY_VER=10.6.16
|
||||
MY_VER=10.6.17
|
||||
|
||||
Install_app()
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
mariadbDir=${serverPath}/source/mariadb
|
||||
|
||||
MY_VER=11.0.4
|
||||
MY_VER=11.0.5
|
||||
|
||||
Install_app()
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
mariadbDir=${serverPath}/source/mariadb
|
||||
|
||||
MY_VER=11.1.3
|
||||
MY_VER=11.1.4
|
||||
|
||||
Install_app()
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
mariadbDir=${serverPath}/source/mariadb
|
||||
|
||||
MY_VER=11.2.2
|
||||
MY_VER=11.2.3
|
||||
|
||||
Install_app()
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
mariadbDir=${serverPath}/source/mariadb
|
||||
|
||||
MY_VER=11.3.1
|
||||
MY_VER=11.3.2
|
||||
|
||||
Install_app()
|
||||
{
|
||||
|
||||
@@ -856,68 +856,53 @@ function setDbPs(id, name, obj) {
|
||||
}
|
||||
|
||||
function openPhpmyadmin(name,username,password){
|
||||
$.post('/plugins/run', {'name':'phpmyadmin','func':'plugins_db_support'}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
|
||||
data = syncPost('/plugins/check',{'name':'phpmyadmin'});
|
||||
if (rdata.data['installed'] != 'ok'){
|
||||
layer.msg('phpMyAdmin未安装!',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if (rdata.data['status'] != 'start'){
|
||||
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data.status){
|
||||
layer.msg(data.msg,{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
if (rdata.data['cfg']['choose'] != 'mysql-apt'){
|
||||
layer.msg('当前为['+rdata.choose+']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
var home_page = rdata.data['home_page'];
|
||||
$("#toPHPMyAdmin").attr('action',home_page);
|
||||
if($("#toPHPMyAdmin").attr('action').indexOf('phpmyadmin') == -1){
|
||||
layer.msg('请先安装phpMyAdmin',{icon:2,shade: [0.3, '#000']});
|
||||
setTimeout(function(){ window.location.href = '/soft'; },3000);
|
||||
return;
|
||||
}
|
||||
//检查版本
|
||||
bigVer = rdata.data['version'];
|
||||
if (bigVer>=4.5){
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'status'});
|
||||
if (data.data != 'start'){
|
||||
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
layer.msg('phpMyAdmin['+data.data+']需要手动登录😭',{icon:16,shade: [0.3, '#000'],time:4000});
|
||||
|
||||
} else{
|
||||
var murl = $("#toPHPMyAdmin").attr('action');
|
||||
$("#pma_username").val(username);
|
||||
$("#pma_password").val(password);
|
||||
$("#db").val(name);
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_cfg'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (rdata.choose != 'mysql-apt'){
|
||||
layer.msg('当前为['+rdata.choose+']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
layer.msg('正在打开phpMyAdmin',{icon:16,shade: [0.3, '#000'],time:2000});
|
||||
|
||||
var phpmyadmin_cfg = rdata;
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_home_page'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (!rdata.status){
|
||||
layer.msg(rdata.msg,{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
var home_page = rdata.data;
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
}
|
||||
|
||||
home_page = home_page.replace("http://","http://"+phpmyadmin_cfg['username']+":"+phpmyadmin_cfg['password']+"@")
|
||||
|
||||
$("#toPHPMyAdmin").attr('action',home_page);
|
||||
if($("#toPHPMyAdmin").attr('action').indexOf('phpmyadmin') == -1){
|
||||
layer.msg('请先安装phpMyAdmin',{icon:2,shade: [0.3, '#000']});
|
||||
setTimeout(function(){ window.location.href = '/soft'; },3000);
|
||||
return;
|
||||
}
|
||||
|
||||
//检查版本
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'version'});
|
||||
bigVer = data.data.split('.')[0];
|
||||
if (bigVer>=4.5){
|
||||
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},3000);
|
||||
layer.msg('phpMyAdmin['+data.data+']需要手动登录😭',{icon:16,shade: [0.3, '#000'],time:4000});
|
||||
|
||||
} else{
|
||||
var murl = $("#toPHPMyAdmin").attr('action');
|
||||
$("#pma_username").val(username);
|
||||
$("#pma_password").val(password);
|
||||
$("#db").val(name);
|
||||
|
||||
layer.msg('正在打开phpMyAdmin',{icon:16,shade: [0.3, '#000'],time:2000});
|
||||
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},3000);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
function delBackup(filename, name, path){
|
||||
|
||||
@@ -857,68 +857,53 @@ function setDbPs(id, name, obj) {
|
||||
}
|
||||
|
||||
function openPhpmyadmin(name,username,password){
|
||||
$.post('/plugins/run', {'name':'phpmyadmin','func':'plugins_db_support'}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
|
||||
data = syncPost('/plugins/check',{'name':'phpmyadmin'});
|
||||
if (rdata.data['installed'] != 'ok'){
|
||||
layer.msg('phpMyAdmin未安装!',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if (rdata.data['status'] != 'start'){
|
||||
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data.status){
|
||||
layer.msg(data.msg,{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
if (rdata.data['cfg']['choose'] != 'mysql-yum'){
|
||||
layer.msg('当前为['+rdata.choose+']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
var home_page = rdata.data['home_page'];
|
||||
$("#toPHPMyAdmin").attr('action',home_page);
|
||||
if($("#toPHPMyAdmin").attr('action').indexOf('phpmyadmin') == -1){
|
||||
layer.msg('请先安装phpMyAdmin',{icon:2,shade: [0.3, '#000']});
|
||||
setTimeout(function(){ window.location.href = '/soft'; },3000);
|
||||
return;
|
||||
}
|
||||
//检查版本
|
||||
bigVer = rdata.data['version'];
|
||||
if (bigVer>=4.5){
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'status'});
|
||||
if (data.data != 'start'){
|
||||
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
layer.msg('phpMyAdmin['+data.data+']需要手动登录😭',{icon:16,shade: [0.3, '#000'],time:4000});
|
||||
|
||||
} else{
|
||||
var murl = $("#toPHPMyAdmin").attr('action');
|
||||
$("#pma_username").val(username);
|
||||
$("#pma_password").val(password);
|
||||
$("#db").val(name);
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_cfg'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (rdata.choose != 'mysql-yum'){
|
||||
layer.msg('当前为['+rdata.choose+']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
layer.msg('正在打开phpMyAdmin',{icon:16,shade: [0.3, '#000'],time:2000});
|
||||
|
||||
var phpmyadmin_cfg = rdata;
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_home_page'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (!rdata.status){
|
||||
layer.msg(rdata.msg,{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
var home_page = rdata.data;
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
}
|
||||
|
||||
home_page = home_page.replace("http://","http://"+phpmyadmin_cfg['username']+":"+phpmyadmin_cfg['password']+"@")
|
||||
|
||||
$("#toPHPMyAdmin").attr('action',home_page);
|
||||
if($("#toPHPMyAdmin").attr('action').indexOf('phpmyadmin') == -1){
|
||||
layer.msg('请先安装phpMyAdmin',{icon:2,shade: [0.3, '#000']});
|
||||
setTimeout(function(){ window.location.href = '/soft'; },3000);
|
||||
return;
|
||||
}
|
||||
|
||||
//检查版本
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'version'});
|
||||
bigVer = data.data.split('.')[0];
|
||||
if (bigVer>=4.5){
|
||||
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},3000);
|
||||
layer.msg('phpMyAdmin['+data.data+']需要手动登录😭',{icon:16,shade: [0.3, '#000'],time:4000});
|
||||
|
||||
} else{
|
||||
var murl = $("#toPHPMyAdmin").attr('action');
|
||||
$("#pma_username").val(username);
|
||||
$("#pma_password").val(password);
|
||||
$("#db").val(name);
|
||||
|
||||
layer.msg('正在打开phpMyAdmin',{icon:16,shade: [0.3, '#000'],time:2000});
|
||||
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},3000);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
function delBackup(filename, name, path){
|
||||
|
||||
@@ -2598,6 +2598,10 @@ def trySlaveSyncBugfix(version=''):
|
||||
|
||||
gtid_purged = ''
|
||||
|
||||
var_slave_gtid = sdb.query('show VARIABLES like "%gtid_purged%"')
|
||||
if len(var_slave_gtid) > 0:
|
||||
gtid_purged += var_slave_gtid[0]['Value'] + ','
|
||||
|
||||
for i in range(len(slave_sync_data)):
|
||||
port = slave_sync_data[i]['port']
|
||||
password = slave_sync_data[i]['pass']
|
||||
@@ -2617,6 +2621,8 @@ def trySlaveSyncBugfix(version=''):
|
||||
if len(var_gtid) > 0:
|
||||
gtid_purged += var_gtid[0]['Value'] + ','
|
||||
|
||||
|
||||
|
||||
gtid_purged = gtid_purged.strip(',')
|
||||
sql = "set @@global.gtid_purged='" + gtid_purged + "'"
|
||||
|
||||
|
||||
+40
-55
@@ -857,68 +857,53 @@ function setDbPs(id, name, obj) {
|
||||
}
|
||||
|
||||
function openPhpmyadmin(name,username,password){
|
||||
$.post('/plugins/run', {'name':'phpmyadmin','func':'plugins_db_support'}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
|
||||
data = syncPost('/plugins/check',{'name':'phpmyadmin'});
|
||||
if (rdata.data['installed'] != 'ok'){
|
||||
layer.msg('phpMyAdmin未安装!',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if (rdata.data['status'] != 'start'){
|
||||
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data.status){
|
||||
layer.msg(data.msg,{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
if (rdata.data['cfg']['choose'] != 'mysql'){
|
||||
layer.msg('当前为['+rdata.choose+']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
var home_page = rdata.data['home_page'];
|
||||
$("#toPHPMyAdmin").attr('action',home_page);
|
||||
if($("#toPHPMyAdmin").attr('action').indexOf('phpmyadmin') == -1){
|
||||
layer.msg('请先安装phpMyAdmin',{icon:2,shade: [0.3, '#000']});
|
||||
setTimeout(function(){ window.location.href = '/soft'; },3000);
|
||||
return;
|
||||
}
|
||||
//检查版本
|
||||
bigVer = rdata.data['version'];
|
||||
if (bigVer>=4.5){
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'status'});
|
||||
if (data.data != 'start'){
|
||||
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
layer.msg('phpMyAdmin['+data.data+']需要手动登录😭',{icon:16,shade: [0.3, '#000'],time:4000});
|
||||
|
||||
} else{
|
||||
var murl = $("#toPHPMyAdmin").attr('action');
|
||||
$("#pma_username").val(username);
|
||||
$("#pma_password").val(password);
|
||||
$("#db").val(name);
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_cfg'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (rdata.choose != 'mysql'){
|
||||
layer.msg('当前为['+rdata.choose+']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
layer.msg('正在打开phpMyAdmin',{icon:16,shade: [0.3, '#000'],time:2000});
|
||||
|
||||
var phpmyadmin_cfg = rdata;
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_home_page'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (!rdata.status){
|
||||
layer.msg(rdata.msg,{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
var home_page = rdata.data;
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
}
|
||||
|
||||
home_page = home_page.replace("http://","http://"+phpmyadmin_cfg['username']+":"+phpmyadmin_cfg['password']+"@")
|
||||
|
||||
$("#toPHPMyAdmin").attr('action',home_page);
|
||||
if($("#toPHPMyAdmin").attr('action').indexOf('phpmyadmin') == -1){
|
||||
layer.msg('请先安装phpMyAdmin',{icon:2,shade: [0.3, '#000']});
|
||||
setTimeout(function(){ window.location.href = '/soft'; },3000);
|
||||
return;
|
||||
}
|
||||
|
||||
//检查版本
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'version'});
|
||||
bigVer = data.data.split('.')[0];
|
||||
if (bigVer>=4.5){
|
||||
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
layer.msg('phpMyAdmin['+data.data+']需要手动登录😭',{icon:16,shade: [0.3, '#000'],time:4000});
|
||||
|
||||
} else{
|
||||
var murl = $("#toPHPMyAdmin").attr('action');
|
||||
$("#pma_username").val(username);
|
||||
$("#pma_password").val(password);
|
||||
$("#db").val(name);
|
||||
|
||||
layer.msg('正在打开phpMyAdmin',{icon:16,shade: [0.3, '#000'],time:2000});
|
||||
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
function delBackup(filename, name, path){
|
||||
|
||||
@@ -579,6 +579,12 @@ def reload():
|
||||
mw.opWeb('start')
|
||||
return 'ok'
|
||||
|
||||
def reload_hook():
|
||||
s = status()
|
||||
if s == 'start':
|
||||
return reload()
|
||||
return 'ok'
|
||||
|
||||
|
||||
def getJsonPath(name):
|
||||
path = getServerDir() + "/waf/" + name + ".json"
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
"site_cb": {
|
||||
"title":"网站统计",
|
||||
"name":"op_waf",
|
||||
"add":{"func":"reload"},
|
||||
"update":{"func":"reload"},
|
||||
"delete":{"func":"reload"}
|
||||
"add":{"func":"reload_hook"},
|
||||
"update":{"func":"reload_hook"},
|
||||
"delete":{"func":"reload_hook"}
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@@ -87,7 +87,7 @@ Install_App(){
|
||||
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
HTTP_PREFIX="https://"
|
||||
if [ ! -z "$cn" ];then
|
||||
HTTP_PREFIX="https://ghproxy.com/"
|
||||
HTTP_PREFIX="https://mirror.ghproxy.com/"
|
||||
fi
|
||||
|
||||
# download GeoLite Data
|
||||
|
||||
@@ -1614,8 +1614,9 @@ function wafSite(){
|
||||
<label class="btswitch-btn" for="closeget_'+ i + '" onclick="setSiteObjState(\'' + k + '\',\'open\')"></label>\
|
||||
</div>\
|
||||
</td>\
|
||||
<td class="text-right"><a onclick="wafLogs(\''+ k + '\')" class="btlink ' + (v.log_size > 0 ? 'dot' : '') + '">日志</a> | <a onclick="siteWafConfig(\'' + k + '\')" class="btlink">设置</a></td>\
|
||||
<td class="text-right"><a onclick="wafLogs(\''+ k + '\')" class="btlink ' + (v.log_size > 0 ? 'dot' : '') + '">日志</a> </td>\
|
||||
</tr>';
|
||||
//| <a onclick="siteWafConfig(\'' + k + '\')" class="btlink">设置</a>
|
||||
});
|
||||
|
||||
var con = '<div class="lib-box">\
|
||||
|
||||
@@ -1 +1,28 @@
|
||||
[[1, "\\.\\./\\.\\./", "\u76ee\u5f55\u4fdd\u62a41", 0], [1, "/\\*", "\u76ee\u5f55\u4fdd\u62a42", 0], [1, "(?:etc\\/\\W*passwd)", "\u76ee\u5f55\u4fdd\u62a43", 0], [1, "(gopher|doc|php|glob|file|phar|zlib|ftp|ldap|dict|ogg|data)\\:\\/", "PHP\u6d41\u534f\u8bae\u8fc7\u6ee41", 0], [1, "\\:\\$", "\u4e00\u53e5\u8bdd\u6728\u9a6c\u8fc7\u6ee41", 0], [1, "\\$\\{", "\u4e00\u53e5\u8bdd\u6728\u9a6c\u8fc7\u6ee42", 0], [1, "base64_decode\\(", "\u4e00\u53e5\u8bdd\u6728\u9a6c\u8fc7\u6ee43", 0], [1, "(?:define|eval|file_get_contents|include|require|require_once|shell_exec|phpinfo|system|passthru|char|chr|preg_\\w+|execute|echo|print|print_r|var_dump|(fp)open|alert|showmodaldialog)\\(", "\u4e00\u53e5\u8bdd\u6728\u9a6c\u8fc7\u6ee44", 0], [1, "\\$_(GET|post|cookie|files|session|env|phplib|GLOBALS|SERVER)\\[", "\u4e00\u53e5\u8bdd\u6728\u9a6c\u8fc7\u6ee45", 0], [1, "\\s+(or|xor|and)\\s+.*(=|<|>|'|\")", "SQL\u6ce8\u5165\u8fc7\u6ee41", 0], [1, "select.+(from|limit)", "SQL\u6ce8\u5165\u8fc7\u6ee42", 0], [1, "(?:(union(.*?)select))", "SQL\u6ce8\u5165\u8fc7\u6ee43", 0], [1, "sleep\\((\\s*)(\\d*)(\\s*)\\)", "SQL\u6ce8\u5165\u8fc7\u6ee45", 0], [1, "benchmark\\((.*)\\,(.*)\\)", "SQL\u6ce8\u5165\u8fc7\u6ee46", 0], [1, "(?:from\\W+information_schema\\W)", "SQL\u6ce8\u5165\u8fc7\u6ee47", 0], [1, "(?:(?:current_)user|database|schema|connection_id)\\s*\\(", "SQL\u6ce8\u5165\u8fc7\u6ee48", 0], [1, "into(\\s+)+(?:dump|out)file\\s*", "SQL\u6ce8\u5165\u8fc7\u6ee49", 0], [1, "group\\s+by.+\\(", "SQL\u6ce8\u5165\u8fc7\u6ee410", 0], [1, "\\<(iframe|script|body|img|layer|div|meta|style|base|object|input)", "XSS\u8fc7\u6ee41", 0], [0, "(onmouseover|onerror|onload)\\=", "XSS\u8fc7\u6ee42", 0], [1, "(invokefunction|call_user_func_array|\\\\think\\\\)", "ThinkPHP payload\u5c01\u5835", 0], [1, "^url_array\\[.*\\]$", "Metinfo6.x XSS\u6f0f\u6d1e", 0], [1, "(extractvalue\\(|concat\\(0x|user\\(\\)|substring\\(|count\\(\\*\\)|substring\\(hex\\(|updatexml\\()", "SQL\u62a5\u9519\u6ce8\u5165\u8fc7\u6ee401", 0], [1, "(@@version|load_file\\(|NAME_CONST\\(|exp\\(\\~|floor\\(rand\\(|geometrycollection\\(|multipoint\\(|polygon\\(|multipolygon\\(|linestring\\(|multilinestring\\()", "SQL\u62a5\u9519\u6ce8\u5165\u8fc7\u6ee402", 0], [1, "(substr\\()", "SQL\u6ce8\u5165\u8fc7\u6ee410", 0], [1, "\\|+\\s+[\\w\\W]+=[\\w\\W]+", "SQL\u6ce8\u5165\u8fc7\u6ee41", 0]]
|
||||
[
|
||||
[1, "\\.\\./\\.\\./", "\u76ee\u5f55\u4fdd\u62a41", 0],
|
||||
[1, "/\\*", "\u76ee\u5f55\u4fdd\u62a42", 0],
|
||||
[1, "(?:etc\\/\\W*passwd)", "\u76ee\u5f55\u4fdd\u62a43", 0],
|
||||
[1, "(gopher|doc|php|glob|file|phar|zlib|ftp|ldap|dict|ogg|data)\\:\\/", "PHP\u6d41\u534f\u8bae\u8fc7\u6ee41", 0],
|
||||
[1, "\\:\\$", "\u4e00\u53e5\u8bdd\u6728\u9a6c\u8fc7\u6ee41", 0],
|
||||
[1, "\\$\\{", "\u4e00\u53e5\u8bdd\u6728\u9a6c\u8fc7\u6ee42", 0],
|
||||
[1, "base64_decode\\(", "\u4e00\u53e5\u8bdd\u6728\u9a6c\u8fc7\u6ee43", 0],
|
||||
[1, "(?:define|eval|file_get_contents|include|require|require_once|shell_exec|phpinfo|system|passthru|char|chr|preg_\\w+|execute|echo|print|print_r|var_dump|(fp)open|alert|showmodaldialog)\\(", "\u4e00\u53e5\u8bdd\u6728\u9a6c\u8fc7\u6ee44", 0],
|
||||
[1, "\\$_(GET|post|cookie|files|session|env|phplib|GLOBALS|SERVER)\\[", "\u4e00\u53e5\u8bdd\u6728\u9a6c\u8fc7\u6ee45", 0],
|
||||
[1, "\\s+(or|xor|and)\\s+.*(=|<|>|'|\")", "SQL\u6ce8\u5165\u8fc7\u6ee41", 0],
|
||||
[1, "select.+(from|limit)", "SQL\u6ce8\u5165\u8fc7\u6ee42", 0],
|
||||
[1, "(?:(union(.*?)select))", "SQL\u6ce8\u5165\u8fc7\u6ee43", 0],
|
||||
[1, "sleep\\((\\s*)(\\d*)(\\s*)\\)", "SQL\u6ce8\u5165\u8fc7\u6ee45", 0],
|
||||
[1, "benchmark\\((.*)\\,(.*)\\)", "SQL\u6ce8\u5165\u8fc7\u6ee46", 0],
|
||||
[1, "(?:from\\W+information_schema\\W)", "SQL\u6ce8\u5165\u8fc7\u6ee47", 0],
|
||||
[1, "(?:(?:current_)user|database|schema|connection_id)\\s*\\(", "SQL\u6ce8\u5165\u8fc7\u6ee48", 0],
|
||||
[1, "into(\\s+)+(?:dump|out)file\\s*", "SQL\u6ce8\u5165\u8fc7\u6ee49", 0],
|
||||
[1, "group\\s+by.+\\(", "SQL\u6ce8\u5165\u8fc7\u6ee410", 0],
|
||||
[1, "\\<(iframe|script|body|img|layer|div|meta|style|base|object|input)", "XSS\u8fc7\u6ee41", 0],
|
||||
[0, "(onmouseover|onerror|onload)\\=", "XSS\u8fc7\u6ee42", 0],
|
||||
[1, "(invokefunction|call_user_func_array|\\\\think\\\\)", "ThinkPHP payload\u5c01\u5835", 0],
|
||||
[1, "^url_array\\[.*\\]$", "Metinfo6.x XSS\u6f0f\u6d1e", 0],
|
||||
[1, "(extractvalue\\(|concat\\(0x|user\\(\\)|substring\\(|count\\(\\*\\)|substring\\(hex\\(|updatexml\\()", "SQL\u62a5\u9519\u6ce8\u5165\u8fc7\u6ee401", 0],
|
||||
[1, "(@@version|load_file\\(|NAME_CONST\\(|exp\\(\\~|floor\\(rand\\(|geometrycollection\\(|multipoint\\(|polygon\\(|multipolygon\\(|linestring\\(|multilinestring\\()", "SQL\u62a5\u9519\u6ce8\u5165\u8fc7\u6ee402", 0],
|
||||
[1, "(substr\\()", "SQL\u6ce8\u5165\u8fc7\u6ee410", 0],
|
||||
[1, "\\|+\\s+[\\w\\W]+=[\\w\\W]+", "SQL\u6ce8\u5165\u8fc7\u6ee41", 0]
|
||||
]
|
||||
@@ -1 +1,21 @@
|
||||
[[1, "\\.\\./\\.\\./", "\u76ee\u5f55\u4fdd\u62a41", 0], [1, "(?:etc\\/\\W*passwd)", "\u76ee\u5f55\u4fdd\u62a43", 0], [1, "(gopher|doc|php|glob|file|phar|zlib|ftp|ldap|dict|ogg|data)\\:\\/", "PHP\u6d41\u534f\u8bae\u8fc7\u6ee41", 0], [1, "\\:\\$", "\u4e00\u53e5\u8bdd\u6728\u9a6c\u8fc7\u6ee41", 0], [1, "\\$\\{", "\u4e00\u53e5\u8bdd\u6728\u9a6c\u8fc7\u6ee42", 0], [1, "base64_decode\\(", "\u4e00\u53e5\u8bdd\u6728\u9a6c\u8fc7\u6ee43", 0], [1, "\\$_(GET|post|cookie|files|session|env|phplib|GLOBALS|SERVER)\\[", "\u4e00\u53e5\u8bdd\u6728\u9a6c\u8fc7\u6ee45", 0], [1, "\\b(or|xor|and)\\b.*(=|<|>|'|\")", "SQL\u6ce8\u5165\u8fc7\u6ee41", 0], [1, "select.+(from|limit)", "SQL\u6ce8\u5165\u8fc7\u6ee42", 0], [1, "(?:(union(.*?)select))", "SQL\u6ce8\u5165\u8fc7\u6ee43", 0], [0, "having|load_file", "SQL\u6ce8\u5165\u8fc7\u6ee44", 0], [1, "sleep\\((\\s*)(\\d*)(\\s*)\\)", "SQL\u6ce8\u5165\u8fc7\u6ee45", 0], [1, "benchmark\\((.*)\\,(.*)\\)", "SQL\u6ce8\u5165\u8fc7\u6ee46", 0], [1, "(?:from\\W+information_schema\\W)", "SQL\u6ce8\u5165\u8fc7\u6ee47", 0], [1, "(?:(?:current_)user|database|schema|connection_id)\\s*\\(", "SQL\u6ce8\u5165\u8fc7\u6ee48", 0], [1, "into(\\s+)+(?:dump|out)file\\s*", "SQL\u6ce8\u5165\u8fc7\u6ee49", 0], [1, "group\\s+by.+\\(", "SQL\u6ce8\u5165\u8fc7\u6ee410", 0], [0, "\\<(iframe|script|body|img|layer|div|meta|style|base|object|input)", "XSS\u8fc7\u6ee41", 0], [1, "(onmouseover|onerror|onload)\\=", "XSS\u8fc7\u6ee42", 0]]
|
||||
[
|
||||
[1, "\\.\\./\\.\\./", "\u76ee\u5f55\u4fdd\u62a41", 0],
|
||||
[1, "(?:etc\\/\\W*passwd)", "\u76ee\u5f55\u4fdd\u62a43", 0],
|
||||
[1, "(gopher|doc|php|glob|file|phar|zlib|ftp|ldap|dict|ogg|data)\\:\\/", "PHP\u6d41\u534f\u8bae\u8fc7\u6ee41", 0],
|
||||
[1, "\\:\\$", "\u4e00\u53e5\u8bdd\u6728\u9a6c\u8fc7\u6ee41", 0],
|
||||
[1, "\\$\\{", "\u4e00\u53e5\u8bdd\u6728\u9a6c\u8fc7\u6ee42", 0],
|
||||
[1, "base64_decode\\(", "\u4e00\u53e5\u8bdd\u6728\u9a6c\u8fc7\u6ee43", 0],
|
||||
[1, "\\$_(GET|post|cookie|files|session|env|phplib|GLOBALS|SERVER)\\[", "\u4e00\u53e5\u8bdd\u6728\u9a6c\u8fc7\u6ee45", 0],
|
||||
[1, "\\b(or|xor|and)\\b.*(=|<|>|'|\")", "SQL\u6ce8\u5165\u8fc7\u6ee41", 0],
|
||||
[1, "select.+(from|limit)", "SQL\u6ce8\u5165\u8fc7\u6ee42", 0],
|
||||
[1, "(?:(union(.*?)select))", "SQL\u6ce8\u5165\u8fc7\u6ee43", 0],
|
||||
[0, "having|load_file", "SQL\u6ce8\u5165\u8fc7\u6ee44", 0],
|
||||
[1, "sleep\\((\\s*)(\\d*)(\\s*)\\)", "SQL\u6ce8\u5165\u8fc7\u6ee45", 0],
|
||||
[1, "benchmark\\((.*)\\,(.*)\\)", "SQL\u6ce8\u5165\u8fc7\u6ee46", 0],
|
||||
[1, "(?:from\\W+information_schema\\W)", "SQL\u6ce8\u5165\u8fc7\u6ee47", 0],
|
||||
[1, "(?:(?:current_)user|database|schema|connection_id)\\s*\\(", "SQL\u6ce8\u5165\u8fc7\u6ee48", 0],
|
||||
[1, "into(\\s+)+(?:dump|out)file\\s*", "SQL\u6ce8\u5165\u8fc7\u6ee49", 0],
|
||||
[1, "group\\s+by.+\\(", "SQL\u6ce8\u5165\u8fc7\u6ee410", 0],
|
||||
[0, "\\<(iframe|script|body|img|layer|div|meta|style|base|object|input)", "XSS\u8fc7\u6ee41", 0],
|
||||
[1, "(onmouseover|onerror|onload)\\=", "XSS\u8fc7\u6ee42", 0]
|
||||
]
|
||||
@@ -1 +1,23 @@
|
||||
[[1, "(gopher|doc|php|glob|file|phar|zlib|ftp|ldap|dict|ogg|data)\\:\\/", "PHP\u6d41\u534f\u8bae\u8fc7\u6ee41", 0], [1, "base64_decode\\(", "\u4e00\u53e5\u8bdd*\u5c4f\u853d\u7684\u5173\u952e\u5b57*\u8fc7\u6ee41", 0], [1, "(?:define|eval|file_get_contents|include|require_once|shell_exec|phpinfo|system|passthru|chr|char|preg_\\w+|execute|echo|print|print_r|var_dump|(fp)open|alert|showmodaldialog|file_put_contents|fopen|urldecode|scandir)\\(", "\u4e00\u53e5\u8bdd*\u5c4f\u853d\u7684\u5173\u952e\u5b57*\u8fc7\u6ee42", 0], [1, "\\$_(GET|post|cookie|files|session|env|phplib|GLOBALS|SERVER)", "\u4e00\u53e5\u8bdd*\u5c4f\u853d\u7684\u5173\u952e\u5b57*\u8fc7\u6ee43", 0], [1, "\\s+(or|xor|and)\\s+(=|<|>|'|\")", "SQL\u6ce8\u5165\u8fc7\u6ee41", 0], [1, "select\\s+.+(from|limit)\\s+", "SQL\u6ce8\u5165\u8fc7\u6ee42", 0], [1, "(?:(union(.*?)select))", "SQL\u6ce8\u5165\u8fc7\u6ee43", 0], [1, "sleep\\((\\s*)(\\d*)(\\s*)\\)", "SQL\u6ce8\u5165\u8fc7\u6ee45", 0], [1, "benchmark\\((.*)\\,(.*)\\)", "SQL\u6ce8\u5165\u8fc7\u6ee46", 0], [1, "(?:from\\W+information_schema\\W)", "SQL\u6ce8\u5165\u8fc7\u6ee47", 0], [1, "(?:(?:current_)user|database|schema|connection_id)\\s*\\(", "SQL\u6ce8\u5165\u8fc7\u6ee48", 0], [1, "into(\\s+)+(?:dump|out)file\\s*", "SQL\u6ce8\u5165\u8fc7\u6ee49", 0], [1, "group\\s+by.+\\(", "SQL\u6ce8\u5165\u8fc7\u6ee410", 0], [0, "\\<(iframe|script|body|img|layer|div|meta|style|base|object|input)", "XSS\u8fc7\u6ee41", 0], [0, "(onmouseover|onerror|onload)\\=", "XSS\u8fc7\u6ee42", 0], [1, "(extractvalue\\(|concat\\(0x|user\\(\\)|substring\\(|count\\(\\*\\)|substring\\(hex\\(|updatexml\\()", "SQL\u62a5\u9519\u6ce8\u5165\u8fc7\u6ee401", 0], [1, "(@@version|load_file\\(|NAME_CONST\\(|exp\\(\\~|floor\\(rand\\(|geometrycollection\\(|multipoint\\(|polygon\\(|multipolygon\\(|linestring\\(|multilinestring\\()", "SQL\u62a5\u9519\u6ce8\u5165\u8fc7\u6ee402", 0], [1, "(substr\\()", "SQL\u6ce8\u5165\u8fc7\u6ee410", 0], [1, "(ORD\\(|MID\\(|IFNULL\\(|CAST\\(|CHAR\\))", "SQL\u6ce8\u5165\u8fc7\u6ee41", 0], [1, "(EXISTS\\(|SELECT\\#|\\(SELECT)", "SQL\u6ce8\u5165\u8fc7\u6ee41", 0], [1, "(array_map\\(\"ass)", "\u83dc\u5200\u6d41\u91cf\u8fc7\u6ee4", 0], [1, "(?:define|eval|file_get_contents|include|require_once|shell_exec|phpinfo|system|passthru|chr|char|preg_\\w+|execute|echo|print|print_r|var_dump|(fp)open|alert|showmodaldialog|file_put_contents|fopen|urldecode)\\(", "\u4e00\u53e5\u8bdd*\u5c4f\u853d\u7684\u5173\u952e\u5b57*\u8fc7\u6ee42", 0]]
|
||||
[
|
||||
[1, "(gopher|doc|php|glob|file|phar|zlib|ftp|ldap|dict|ogg|data)\\:\\/", "PHP\u6d41\u534f\u8bae\u8fc7\u6ee41", 0],
|
||||
[1, "base64_decode\\(", "\u4e00\u53e5\u8bdd*\u5c4f\u853d\u7684\u5173\u952e\u5b57*\u8fc7\u6ee41", 0],
|
||||
[1, "(?:define|eval|file_get_contents|include|require_once|shell_exec|phpinfo|system|passthru|chr|char|preg_\\w+|execute|echo|print|print_r|var_dump|(fp)open|alert|showmodaldialog|file_put_contents|fopen|urldecode|scandir)\\(", "\u4e00\u53e5\u8bdd*\u5c4f\u853d\u7684\u5173\u952e\u5b57*\u8fc7\u6ee42", 0],
|
||||
[1, "\\$_(GET|post|cookie|files|session|env|phplib|GLOBALS|SERVER)", "\u4e00\u53e5\u8bdd*\u5c4f\u853d\u7684\u5173\u952e\u5b57*\u8fc7\u6ee43", 0], [1, "\\s+(or|xor|and)\\s+(=|<|>|'|\")", "SQL\u6ce8\u5165\u8fc7\u6ee41", 0],
|
||||
[1, "select\\s+.+(from|limit)\\s+", "SQL\u6ce8\u5165\u8fc7\u6ee42", 0],
|
||||
[1, "(?:(union(.*?)select))", "SQL\u6ce8\u5165\u8fc7\u6ee43", 0],
|
||||
[1, "sleep\\((\\s*)(\\d*)(\\s*)\\)", "SQL\u6ce8\u5165\u8fc7\u6ee45", 0],
|
||||
[1, "benchmark\\((.*)\\,(.*)\\)", "SQL\u6ce8\u5165\u8fc7\u6ee46", 0],
|
||||
[1, "(?:from\\W+information_schema\\W)", "SQL\u6ce8\u5165\u8fc7\u6ee47", 0],
|
||||
[1, "(?:(?:current_)user|database|schema|connection_id)\\s*\\(", "SQL\u6ce8\u5165\u8fc7\u6ee48", 0],
|
||||
[1, "into(\\s+)+(?:dump|out)file\\s*", "SQL\u6ce8\u5165\u8fc7\u6ee49", 0],
|
||||
[1, "group\\s+by.+\\(", "SQL\u6ce8\u5165\u8fc7\u6ee410", 0],
|
||||
[0, "\\<(iframe|script|body|img|layer|div|meta|style|base|object|input)", "XSS\u8fc7\u6ee41", 0],
|
||||
[0, "(onmouseover|onerror|onload)\\=", "XSS\u8fc7\u6ee42", 0],
|
||||
[1, "(extractvalue\\(|concat\\(0x|user\\(\\)|substring\\(|count\\(\\*\\)|substring\\(hex\\(|updatexml\\()", "SQL\u62a5\u9519\u6ce8\u5165\u8fc7\u6ee401", 0],
|
||||
[1, "(@@version|load_file\\(|NAME_CONST\\(|exp\\(\\~|floor\\(rand\\(|geometrycollection\\(|multipoint\\(|polygon\\(|multipolygon\\(|linestring\\(|multilinestring\\()", "SQL\u62a5\u9519\u6ce8\u5165\u8fc7\u6ee402", 0],
|
||||
[1, "(substr\\()", "SQL\u6ce8\u5165\u8fc7\u6ee410", 0],
|
||||
[1, "(ORD\\(|MID\\(|IFNULL\\(|CAST\\(|CHAR\\))", "SQL\u6ce8\u5165\u8fc7\u6ee41", 0],
|
||||
[1, "(EXISTS\\(|SELECT\\#|\\(SELECT)", "SQL\u6ce8\u5165\u8fc7\u6ee41", 0],
|
||||
[1, "(array_map\\(\"ass)", "\u83dc\u5200\u6d41\u91cf\u8fc7\u6ee4", 0],
|
||||
[1, "(?:define|eval|file_get_contents|include|require_once|shell_exec|phpinfo|system|passthru|chr|char|preg_\\w+|execute|echo|print|print_r|var_dump|(fp)open|alert|showmodaldialog|file_put_contents|fopen|urldecode)\\(", "\u4e00\u53e5\u8bdd*\u5c4f\u853d\u7684\u5173\u952e\u5b57*\u8fc7\u6ee42", 0]
|
||||
]
|
||||
@@ -1 +1,6 @@
|
||||
[[1,"(HTTrack|Apache-HttpClient|harvest|audit|dirbuster|pangolin|nmap|sqln|hydra|Parser|libwww|BBBike|sqlmap|w3af|owasp|Nikto|fimap|havij|zmeu|BabyKrokodil|netsparker|httperf| SF/)","关键词过滤1",0],[1,"(ApacheBench)","AB测试",0]]
|
||||
[
|
||||
[1,"(HTTrack|Apache-HttpClient|harvest|audit|dirbuster|pangolin|nmap|sqln|hydra|Parser|libwww|BBBike|sqlmap|w3af|owasp|Nikto|fimap|havij|zmeu|BabyKrokodil|netsparker|httperf| SF/)","关键词过滤1",0],
|
||||
[1,"(ApacheBench)","AB测试",0],
|
||||
[1,"(Amazonbot)","Amazon爬虫",0],
|
||||
[1,"(SemrushBot)","Semrush爬虫",0]
|
||||
]
|
||||
@@ -8,10 +8,10 @@
|
||||
"install_pre_inspection":true,
|
||||
"checks":"server/openresty",
|
||||
"path":"server/openresty",
|
||||
"author":"agentzh",
|
||||
"author":"nginx/agentzh",
|
||||
"home":"http://openresty.org",
|
||||
"date":"2017-11-24",
|
||||
"pid": "1",
|
||||
"versions": ["1.17.8.2","1.19.3.1","1.21.4.2","1.21.4.3"],
|
||||
"updates": ["1.17.8.2","1.19.3.1","1.21.4.2","1.21.4.3"]
|
||||
"versions": ["1.17.8.2","1.19.3.1","1.21.4.2","1.21.4.3","1.25.3.1"],
|
||||
"updates": ["1.17.8.2","1.19.3.1","1.21.4.2","1.21.4.3","1.25.3.1"]
|
||||
}
|
||||
@@ -91,6 +91,7 @@ Install_openresty()
|
||||
|
||||
|
||||
opensslVersion="1.1.1p"
|
||||
libresslVersion="3.9.1"
|
||||
pcreVersion='8.38'
|
||||
if [ "$sysName" == "Darwin" ];then
|
||||
|
||||
@@ -119,8 +120,38 @@ Install_openresty()
|
||||
# brew info openssl@1.1 | grep /opt/homebrew/Cellar/openssl@1.1 | cut -d \ -f 1 | awk 'END {print}'
|
||||
# OPENSSL_LIB_DEPEND_DIR=`brew info openssl@1.1 | grep ${BREW_DIR}/Cellar/openssl@1.1 | cut -d \ -f 1 | awk 'END {print}'`
|
||||
# OPTIONS="${OPTIONS} --with-openssl=${OPENSSL_LIB_DEPEND_DIR}"
|
||||
else
|
||||
if [ "$VERSION" == "1.25.3.1" ]; then
|
||||
OPTIONS="${OPTIONS} --with-http_v3_module"
|
||||
|
||||
|
||||
|
||||
if [ ! -f ${openrestyDir}/libressl-${libresslVersion}.tar.gz ];then
|
||||
wget --no-check-certificate -O ${openrestyDir}/libressl-${libresslVersion}.tar.gz https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${libresslVersion}.tar.gz
|
||||
fi
|
||||
|
||||
if [ ! -d ${openrestyDir}/libressl-${libresslVersion} ];then
|
||||
cd ${openrestyDir} && tar -zxvf libressl-${libresslVersion}.tar.gz
|
||||
fi
|
||||
|
||||
if [ ! -f ${openrestyDir}/openssl-${opensslVersion}.tar.gz ];then
|
||||
wget --no-check-certificate -O ${openrestyDir}/openssl-${opensslVersion}.tar.gz https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz
|
||||
fi
|
||||
|
||||
if [ ! -d ${openrestyDir}/openssl-${opensslVersion} ];then
|
||||
cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz
|
||||
fi
|
||||
|
||||
OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}"
|
||||
OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/include"
|
||||
OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/lib"
|
||||
|
||||
# --with-cc-opt="-I../libressl/build/include"
|
||||
# --with-ld-opt="-L../libressl/build/lib"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# --with-openssl=$serverPath/source/lib/openssl-1.0.2q
|
||||
cd ${openrestyDir}/openresty-${VERSION} && ./configure \
|
||||
--prefix=$serverPath/openresty \
|
||||
@@ -162,6 +193,10 @@ Install_openresty()
|
||||
if [ -d ${openrestyDir}/openssl-${opensslVersion} ];then
|
||||
rm -rf ${openrestyDir}/openssl-${opensslVersion}
|
||||
fi
|
||||
|
||||
if [ -d ${openrestyDir}/libressl-${libresslVersion} ];then
|
||||
rm -rf ${openrestyDir}/libressl-${libresslVersion}
|
||||
fi
|
||||
echo '安装完成'
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ LOCAL_ADDR=common
|
||||
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
|
||||
LOCAL_ADDR=cn
|
||||
HTTP_PREFIX="https://ghproxy.com/"
|
||||
HTTP_PREFIX="https://mirror.ghproxy.com/"
|
||||
fi
|
||||
|
||||
if [ ! -d ${SERVER_ROOT}/icu ];then
|
||||
|
||||
@@ -20,7 +20,7 @@ LOCAL_ADDR=common
|
||||
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
|
||||
LOCAL_ADDR=cn
|
||||
HTTP_PREFIX="https://ghproxy.com/"
|
||||
HTTP_PREFIX="https://mirror.ghproxy.com/"
|
||||
fi
|
||||
|
||||
if [ ! -d ${SERVER_ROOT}/libiconv ];then
|
||||
|
||||
@@ -20,7 +20,7 @@ LOCAL_ADDR=common
|
||||
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
|
||||
LOCAL_ADDR=cn
|
||||
HTTP_PREFIX="https://ghproxy.com/"
|
||||
HTTP_PREFIX="https://mirror.ghproxy.com/"
|
||||
fi
|
||||
# HTTP_PREFIX="https://"
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ SOURCE_ROOT=$rootPath/source/lib
|
||||
HTTP_PREFIX="https://"
|
||||
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
|
||||
HTTP_PREFIX="https://ghproxy.com/"
|
||||
HTTP_PREFIX="https://mirror.ghproxy.com/"
|
||||
fi
|
||||
|
||||
which onig-config
|
||||
|
||||
@@ -19,7 +19,7 @@ LOCAL_ADDR=common
|
||||
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
|
||||
LOCAL_ADDR=cn
|
||||
HTTP_PREFIX="https://ghproxy.com/"
|
||||
HTTP_PREFIX="https://mirror.ghproxy.com/"
|
||||
fi
|
||||
|
||||
if [ ! -d ${SERVER_ROOT}/openssl10 ];then
|
||||
|
||||
@@ -20,7 +20,7 @@ LOCAL_ADDR=common
|
||||
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
|
||||
LOCAL_ADDR=cn
|
||||
HTTP_PREFIX="https://ghproxy.com/"
|
||||
HTTP_PREFIX="https://mirror.ghproxy.com/"
|
||||
fi
|
||||
# HTTP_PREFIX="https://"
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)"
|
||||
function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; }
|
||||
|
||||
|
||||
version=8.2.15
|
||||
version=8.2.17
|
||||
PHP_VER=82
|
||||
Install_php()
|
||||
{
|
||||
@@ -57,7 +57,7 @@ if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
fi
|
||||
|
||||
#检测文件是否损坏.
|
||||
md5_file_ok=eca5deac02d77d806838275f8a3024b38b35ac0a5d9853dcc71c6cbe3f1f8765
|
||||
md5_file_ok=1cc4ef733ba58f6557db648012471f1916e5bac316303aa165535bedab08ee35
|
||||
if [ -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
md5_file=`sha256sum $sourcePath/php/php-${version}.tar.xz | awk '{print $1}'`
|
||||
if [ "${md5_file}" != "${md5_file_ok}" ]; then
|
||||
|
||||
@@ -15,7 +15,7 @@ function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)"
|
||||
function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; }
|
||||
function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; }
|
||||
|
||||
version=8.3.2
|
||||
version=8.3.4
|
||||
PHP_VER=83
|
||||
Install_php()
|
||||
{
|
||||
@@ -56,7 +56,7 @@ if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
fi
|
||||
|
||||
#检测文件是否损坏.
|
||||
md5_file_ok=4ffa3e44afc9c590e28dc0d2d31fc61f0139f8b335f11880a121b9f9b9f0634e
|
||||
md5_file_ok=39a337036a546e5c28aea76cf424ac172db5156bd8a8fd85252e389409a5ba63
|
||||
if [ -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
md5_file=`sha256sum $sourcePath/php/php-${version}.tar.xz | awk '{print $1}'`
|
||||
if [ "${md5_file}" != "${md5_file_ok}" ]; then
|
||||
|
||||
@@ -60,8 +60,13 @@ Install_lib()
|
||||
fi
|
||||
|
||||
$serverPath/php/$version/bin/phpize
|
||||
./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS
|
||||
|
||||
if [ "$version" == "83" ];then
|
||||
CFLAGS="-std=c99" ./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS
|
||||
else
|
||||
./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS
|
||||
fi
|
||||
|
||||
make clean && make && make install && make clean
|
||||
|
||||
if [ -d $sourcePath/php${version} ];then
|
||||
|
||||
@@ -20,7 +20,7 @@ LIBNAME=zip
|
||||
LIBV=0
|
||||
|
||||
|
||||
if [ "$version" -lt "73" ];then
|
||||
if [ "$version" -lt "72" ];then
|
||||
echo "not need"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -724,6 +724,7 @@
|
||||
{
|
||||
"name": "zip",
|
||||
"versions": [
|
||||
"72",
|
||||
"83"
|
||||
],
|
||||
"type": "压缩",
|
||||
|
||||
@@ -446,9 +446,37 @@ def errorLog():
|
||||
return getServerDir() + '/error.log'
|
||||
|
||||
|
||||
def Version():
|
||||
def installVersion():
|
||||
return mw.readFile(getServerDir() + '/version.pl')
|
||||
|
||||
def pluginsDbSupport():
|
||||
data = {}
|
||||
|
||||
data['installed'] = 'no'
|
||||
install_path = getServerDir()
|
||||
if not os.path.exists(install_path):
|
||||
return mw.returnJson(True, 'ok', data)
|
||||
|
||||
data['installed'] = 'ok'
|
||||
data['status'] = status()
|
||||
if (data['status'] == 'stop'):
|
||||
return mw.returnJson(True, 'ok', data)
|
||||
|
||||
data['cfg'] = getCfg()
|
||||
port = getPort()
|
||||
ip = '127.0.0.1'
|
||||
if not mw.isAppleSystem():
|
||||
ip = mw.getLocalIp()
|
||||
|
||||
cfg = data['cfg']
|
||||
auth = cfg['username']+':'+cfg['password']
|
||||
rand_path = cfg['path']
|
||||
home_page = 'http://' + auth + '@' + ip + ':' + port + '/' + rand_path + '/index.php'
|
||||
|
||||
data['home_page'] = home_page
|
||||
data['version'] = installVersion().strip()
|
||||
|
||||
return mw.returnJson(True, 'ok', data)
|
||||
|
||||
if __name__ == "__main__":
|
||||
func = sys.argv[1]
|
||||
@@ -465,7 +493,7 @@ if __name__ == "__main__":
|
||||
elif func == 'conf':
|
||||
print(getConf())
|
||||
elif func == 'version':
|
||||
print(Version())
|
||||
print(installVersion())
|
||||
elif func == 'get_cfg':
|
||||
print(returnCfg())
|
||||
elif func == 'config_inc':
|
||||
@@ -494,5 +522,7 @@ if __name__ == "__main__":
|
||||
print(accessLog())
|
||||
elif func == 'error_log':
|
||||
print(errorLog())
|
||||
elif func == 'plugins_db_support':
|
||||
print(pluginsDbSupport())
|
||||
else:
|
||||
print('error')
|
||||
|
||||
@@ -84,7 +84,8 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
resetPluginWinWidth(700);
|
||||
resetPluginWinWidth(800);
|
||||
resetPluginWinHeight(400);
|
||||
// $.getScript("/plugins/file?name=rsyncd&f=js/base64.js", function() {
|
||||
// console.log('base64 load');
|
||||
// });
|
||||
|
||||
@@ -42,11 +42,15 @@ def send_msg(bot, tag='ad', trigger_time=300):
|
||||
# 信号只在一个周期内执行一次|end
|
||||
|
||||
# https://t.me/gjgzs2022 | 22/m | @GJ_gzs
|
||||
# https://zhaoziyuan.pw/ | web | 15/m | 2m | next,3/15 | @baleite
|
||||
# 腾云机场 |9/m
|
||||
# https://zhaoziyuan1.cc | web | 15/m | 2m | next,5/15 | @baleite
|
||||
# 综合包网/NG接口开户 | 28/m | 3m | next,4/28 | @aabbcx888
|
||||
# 实名认证/过人脸🕵️♀️各种账号处理✅ | 30/m| next,6/30 | @nngzs
|
||||
# 海外服务器 高防CDN 解决移动屏蔽 | 19/m | next,4/19 | @YYCDNFW
|
||||
keyboard = [
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="海外服务器 高防CDN 解决移动屏蔽", url='https://t.me/kltfuwuqi')
|
||||
],
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="👑 综合包网/NG接口开户", url='https://t.me/NG_Tony')
|
||||
|
||||
@@ -51,11 +51,16 @@ def send_msg(bot, tag='ad', trigger_time=300):
|
||||
# 信号只在一个周期内执行一次|end
|
||||
|
||||
# https://t.me/gjgzs2022 | 22/m | @GJ_gzs
|
||||
# https://zhaoziyuan.pw/ | web | 15/m | 2m | next,3/15 | @baleite
|
||||
# 腾云机场 |9/m
|
||||
# https://zhaoziyuan1.cc | web | 15/m | 2m | next,5/15 | @baleite
|
||||
# 综合包网/NG接口开户 | 28/m | 3m | next,4/28 | @aabbcx888
|
||||
# 实名认证/过人脸🕵️♀️各种账号处理✅ | 30/m| next,6/30 | @nngzs
|
||||
# 海外服务器 高防CDN 解决移动屏蔽 | 19/m | next,4/19 | @YYCDNFW
|
||||
# 群内置顶AD| 16/m | @YYCDNFW
|
||||
keyboard = [
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="海外服务器 高防CDN 解决移动屏蔽", url='https://t.me/kltfuwuqi')
|
||||
],
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="🚀 综合包网/NG接口开户", url='https://t.me/NG_Tony')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"global": {
|
||||
"monitor": true,
|
||||
"save_day": 180,
|
||||
"save_day": 1,
|
||||
"autorefresh": false,
|
||||
"refresh_interval": 3,
|
||||
"cdn": true,
|
||||
|
||||
+2
-1
@@ -21,7 +21,7 @@ configparser==5.2.0
|
||||
python-engineio==4.3.2
|
||||
python-socketio>=4.2.0
|
||||
flask-socketio==5.2.0
|
||||
flask_sockets==0.2.1
|
||||
flask-sockets==0.2.1
|
||||
zmq==0.0.0
|
||||
paramiko>=2.8.0
|
||||
pymongo
|
||||
@@ -31,6 +31,7 @@ pillow
|
||||
Jinja2>=2.11.2
|
||||
PyMySQL==1.0.2
|
||||
whitenoise==5.3.0
|
||||
pyotp
|
||||
pytz
|
||||
pyTelegramBotAPI
|
||||
telebot
|
||||
+41
-15
@@ -187,8 +187,7 @@ def requestAfter(response):
|
||||
|
||||
def isLogined():
|
||||
if 'login' in session and 'username' in session and session['login'] == True:
|
||||
userInfo = mw.M('users').where(
|
||||
"id=?", (1,)).field('id,username,password').find()
|
||||
userInfo = mw.M('users').where("id=?", (1,)).field('id,username,password').find()
|
||||
# print(userInfo)
|
||||
if userInfo['username'] != session['username']:
|
||||
return False
|
||||
@@ -312,6 +311,34 @@ def checkLogin():
|
||||
return "false"
|
||||
|
||||
|
||||
@app.route("/verify_login", methods=['POST'])
|
||||
def verifyLogin():
|
||||
username = request.form.get('username', '').strip()
|
||||
password = request.form.get('password', '').strip()
|
||||
password = mw.md5(password)
|
||||
|
||||
userInfo = mw.M('users').where("id=?", (1,)).field('id,username,password').find()
|
||||
if userInfo['username'] != username or userInfo['password'] != password:
|
||||
return mw.returnJson(-1, "密码错误?")
|
||||
|
||||
auth = request.form.get('auth', '').strip()
|
||||
|
||||
import pyotp
|
||||
auth_file = 'data/auth_secret.pl'
|
||||
if os.path.exists(auth_file):
|
||||
content = mw.readFile(auth_file)
|
||||
sec = mw.deDoubleCrypt('mdserver-web', content)
|
||||
totp = pyotp.TOTP(sec)
|
||||
if totp.verify(auth):
|
||||
userInfo = mw.M('users').where("id=?", (1,)).field('id,username,password').find()
|
||||
session['login'] = True
|
||||
session['username'] = userInfo['username']
|
||||
session['overdue'] = int(time.time()) + 7 * 24 * 60 * 60
|
||||
return mw.returnJson(1, '二次验证成功!')
|
||||
|
||||
return mw.returnJson(-1, '二次验证失败!')
|
||||
|
||||
|
||||
@app.route("/do_login", methods=['POST'])
|
||||
def doLogin():
|
||||
login_cache_count = 5
|
||||
@@ -343,13 +370,8 @@ def doLogin():
|
||||
mw.writeLog('用户登录', code_msg)
|
||||
return mw.returnJson(False, code_msg)
|
||||
|
||||
userInfo = mw.M('users').where(
|
||||
"id=?", (1,)).field('id,username,password').find()
|
||||
|
||||
# print(userInfo)
|
||||
# print(password)
|
||||
userInfo = mw.M('users').where("id=?", (1,)).field('id,username,password').find()
|
||||
password = mw.md5(password)
|
||||
# print('md5-pass', password)
|
||||
|
||||
if userInfo['username'] != username or userInfo['password'] != password:
|
||||
msg = "<a style='color: red'>密码错误</a>,帐号:{1},密码:{2},登录IP:{3}", ((
|
||||
@@ -367,17 +389,23 @@ def doLogin():
|
||||
cache.set('login_cache_limit', login_cache_limit, timeout=10000)
|
||||
login_cache_limit = cache.get('login_cache_limit')
|
||||
mw.writeLog('用户登录', mw.getInfo(msg))
|
||||
return mw.returnJson(False, mw.getInfo("用户名或密码错误,您还可以尝试[{1}]次!", (str(login_cache_count - login_cache_limit))))
|
||||
return mw.returnJson(-1, mw.getInfo("用户名或密码错误,您还可以尝试[{1}]次!", (str(login_cache_count - login_cache_limit))))
|
||||
|
||||
|
||||
|
||||
cache.delete('login_cache_limit')
|
||||
# 二次验证密钥
|
||||
auth_secret = 'data/auth_secret.pl'
|
||||
if os.path.exists(auth_secret):
|
||||
return mw.returnJson(2, '绑定二次验证了...')
|
||||
|
||||
session['login'] = True
|
||||
session['username'] = userInfo['username']
|
||||
session['overdue'] = int(time.time()) + 7 * 24 * 60 * 60
|
||||
# session['overdue'] = int(time.time()) + 7
|
||||
|
||||
# fix 跳转时,数据消失,可能是跨域问题
|
||||
# mw.writeFile('data/api_login.txt', userInfo['username'])
|
||||
return mw.returnJson(True, '登录成功,正在跳转...')
|
||||
return mw.returnJson(1, '登录成功,正在跳转...')
|
||||
|
||||
|
||||
@app.errorhandler(404)
|
||||
@@ -419,8 +447,7 @@ def login_temp_user(token):
|
||||
return '连续10次验证失败,禁止1小时'
|
||||
|
||||
stime = int(time.time())
|
||||
data = mw.M('temp_login').where('state=? and expire>?',
|
||||
(0, stime)).field('id,token,salt,expire,addtime').find()
|
||||
data = mw.M('temp_login').where('state=? and expire>?',(0, stime)).field('id,token,salt,expire,addtime').find()
|
||||
if not data:
|
||||
setErrorNum(skey)
|
||||
return '验证失败!'
|
||||
@@ -434,8 +461,7 @@ def login_temp_user(token):
|
||||
setErrorNum(skey)
|
||||
return '验证失败!'
|
||||
|
||||
userInfo = mw.M('users').where(
|
||||
"id=?", (1,)).field('id,username').find()
|
||||
userInfo = mw.M('users').where("id=?", (1,)).field('id,username').find()
|
||||
session['login'] = True
|
||||
session['username'] = userInfo['username']
|
||||
session['tmp_login'] = True
|
||||
|
||||
@@ -1002,7 +1002,7 @@ function setTempAccess(){
|
||||
shift: 0,
|
||||
type: 1,
|
||||
content: "<div class=\"login_view_table pd20\">\
|
||||
<button class=\"btn btn-success btn-sm create_temp_login\" >临时访问授权</button>\
|
||||
<button class=\"btn btn-success btn-sm create_temp_login\">临时访问授权</button>\
|
||||
<div class=\"divtable mt10\">\
|
||||
<table class=\"table table-hover\">\
|
||||
<thead>\
|
||||
@@ -1062,6 +1062,64 @@ function setTempAccess(){
|
||||
});
|
||||
}
|
||||
|
||||
//二次验证
|
||||
function setAuthBind(){
|
||||
$.post('/config/get_auth_secret', {}, function(rdata){
|
||||
console.log(rdata);
|
||||
var tip = layer.open({
|
||||
area: ['500px', '355px'],
|
||||
title: '二次验证设置',
|
||||
closeBtn:1,
|
||||
shift: 0,
|
||||
type: 1,
|
||||
content: '<div class="bt-form pd20">\
|
||||
<div class="line">\
|
||||
<span class="tname">绑定密钥</span>\
|
||||
<div class="info-r">\
|
||||
<input class="bt-input-text mr5" name="secret" type="text" style="width: 310px;" disabled>\
|
||||
<button class="btn btn-success btn-xs reset_secret" style="margin-left: -50px;">重置</button>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="line">\
|
||||
<span class="tname" style="width: 90px; overflow: initial; height: 20px; line-height: 20px;">二维码</span>\
|
||||
<div class="info-r"><div class="qrcode"></div></div>\
|
||||
</div>\
|
||||
<ul class="help-info-text c7">\
|
||||
</ul>\
|
||||
</div>',
|
||||
success:function(layero,index){
|
||||
|
||||
$('input[name="secret"]').val(rdata.data['secret']);
|
||||
$('.qrcode').qrcode({ text: rdata.data['url']});
|
||||
|
||||
$('.reset_secret').click(function(){
|
||||
layer.confirm('您确定要重置当前密钥吗?<br/><span style="color: red; ">重置密钥后,已关联密钥产品,将失效,请重新添加新密钥至产品。</span>',{title:'重置密钥',closeBtn:2,icon:13,cancel:function(){
|
||||
}}, function() {
|
||||
$.post('/config/get_auth_secret', {'reset':"1"},function(rdata){
|
||||
showMsg("接口密钥已生成,重置密钥后,已关联密钥产品,将失效,请重新添加新密钥至产品。", function(){
|
||||
$('input[name="secret"]').val(rdata.data['secret']);
|
||||
$('.qrcode').html('').qrcode({ text: rdata.data['url']});
|
||||
} ,{icon:1}, 2000);
|
||||
},'json');
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
},'json');
|
||||
}
|
||||
|
||||
function setAuthSecretApi(){
|
||||
var cfg_panel_auth = $('#cfg_panel_auth').prop("checked");
|
||||
$.post('/config/set_auth_secret', {'op_type':"2"},function(rdata){
|
||||
showMsg(rdata.msg, function(){
|
||||
if (rdata.data == 1){
|
||||
setAuthBind();
|
||||
}
|
||||
} ,{icon:rdata.status?1:2}, 1000);
|
||||
},'json');
|
||||
}
|
||||
|
||||
function setBasicAuthTip(callback){
|
||||
var tip = layer.open({
|
||||
area: ['500px', '385px'],
|
||||
|
||||
+67
-28
@@ -1,33 +1,73 @@
|
||||
var num = 0;
|
||||
//查看任务日志
|
||||
function getLogs(id){
|
||||
layer.msg('正在获取,请稍候...',{icon:16,time:0,shade: [0.3, '#000']});
|
||||
var data='&id='+id;
|
||||
$.post('/crontab/logs', data, function(rdata){
|
||||
layer.closeAll();
|
||||
if(!rdata.status) {
|
||||
layer.msg(rdata.msg,{icon:2, time:2000});
|
||||
return;
|
||||
};
|
||||
layer.open({
|
||||
type:1,
|
||||
title:lan.crontab.task_log_title,
|
||||
area: ['60%','500px'],
|
||||
shadeClose:false,
|
||||
closeBtn:1,
|
||||
content:'<div class="setchmod bt-form pd20 pb70">'
|
||||
+'<pre id="crontab-log" style="overflow: auto; border: 0px none; line-height:23px;padding: 15px; margin: 0px; white-space: pre-wrap; height: 405px; background-color: rgb(51,51,51);color:#f1f1f1;border-radius:0px;font-family:"></pre>'
|
||||
+'<div class="bt-form-submit-btn" style="margin-top: 0px;">'
|
||||
+'<button type="button" class="btn btn-success btn-sm" onclick="closeLogs('+id+')">清空</button>'
|
||||
+'<button type="button" class="btn btn-danger btn-sm" onclick="layer.closeAll()">关闭</button>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
});
|
||||
|
||||
setTimeout(function(){
|
||||
$("#crontab-log").html(rdata.msg);
|
||||
},200);
|
||||
},'json');
|
||||
var reqTimer = null;
|
||||
var reqCount = 0;
|
||||
|
||||
var tips = layer.msg('正在获取,请稍候...',{icon:16,time:0,shade: [0.3, '#000']});
|
||||
var req_log_args = 'id='+id;
|
||||
function requestLogs(layerIndex){
|
||||
|
||||
$.post('/crontab/logs', req_log_args, function(rdata){
|
||||
|
||||
if (reqCount == 0){
|
||||
layer.close(tips);
|
||||
}
|
||||
|
||||
if(!rdata.status) {
|
||||
layer.close(layerIndex);
|
||||
layer.msg(rdata.msg,{icon:2, time:2000});
|
||||
clearInterval(reqTimer);
|
||||
return;
|
||||
};
|
||||
|
||||
if (rdata.msg == ''){
|
||||
rdata.msg = '暂无数据!';
|
||||
}
|
||||
|
||||
$("#crontab_log").html(rdata.msg);
|
||||
//滚动到最低
|
||||
var ob = document.getElementById('crontab_log');
|
||||
ob.scrollTop = ob.scrollHeight;
|
||||
reqCount++;
|
||||
},'json');
|
||||
|
||||
}
|
||||
|
||||
|
||||
layer.open({
|
||||
type:1,
|
||||
title:"任务执行日志",
|
||||
area: ['60%','500px'],
|
||||
shadeClose:false,
|
||||
btn:["清空","关闭"],
|
||||
closeBtn:1,
|
||||
end: function(){
|
||||
if (reqTimer){
|
||||
clearInterval(reqTimer);
|
||||
}
|
||||
},
|
||||
content:'<div class="setchmod bt-form" style="padding:5px;">'
|
||||
+'<pre id="crontab_log" style="overflow: auto; border: 0px none; line-height:23px;padding: 5px; margin: 0px; white-space: pre-wrap; height: 395px; background-color: rgb(51,51,51);color:#f1f1f1;border-radius:0px;font-family:"></pre>'
|
||||
// +'<div class="bt-form-submit-btn" style="margin-top: 0px;">'
|
||||
// +'<button type="button" class="btn btn-success btn-sm" onclick="closeLogs('+id+')">清空</button>'
|
||||
// +'<button type="button" class="btn btn-danger btn-sm" onclick="layer.closeAll()">关闭</button>'
|
||||
// +'</div>'
|
||||
+'</div>',
|
||||
success:function(index,layer_index){
|
||||
requestLogs(layer_index);
|
||||
reqTimer = setInterval(function(){
|
||||
requestLogs(layer_index);
|
||||
},3000);
|
||||
},
|
||||
|
||||
yes:function(index){
|
||||
clearInterval(reqTimer);
|
||||
closeLogs(id);
|
||||
layer.close(index);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +159,6 @@ function startTask(id){
|
||||
var data='id='+id;
|
||||
$.post('/crontab/start_task',data,function(rdata){
|
||||
showMsg(rdata.msg, function(){
|
||||
layer.closeAll();
|
||||
},{icon:rdata.status?1:2,time:2000});
|
||||
},'json');
|
||||
}
|
||||
@@ -131,7 +170,7 @@ function closeLogs(id){
|
||||
var data='id='+id;
|
||||
$.post('/crontab/del_logs',data,function(rdata){
|
||||
showMsg(rdata.msg, function(){
|
||||
layer.closeAll();
|
||||
// layer.closeAll();
|
||||
},{icon:rdata.status?1:2,time:2000});
|
||||
},'json');
|
||||
}
|
||||
|
||||
+174
-94
@@ -26,15 +26,15 @@ function recycleBin(type){
|
||||
if(shortwebname.length > 20) shortwebname = shortwebname.substring(0, 20) + "...";
|
||||
if(shortpath.length > 20) shortpath = shortpath.substring(0, 20) + "...";
|
||||
body += '<tr>\
|
||||
<td><span class=\'ico ico-folder\'></span><span class="tname" title="'+rdata.dirs[i].name+'">'+shortwebname+'</span></td>\
|
||||
<td><span title="'+rdata.dirs[i].dname+'">'+shortpath+'</span></td>\
|
||||
<td>'+toSize(rdata.dirs[i].size)+'</td>\
|
||||
<td>'+getLocalTime(rdata.dirs[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.dirs[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.dirs[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>'
|
||||
<td><span class=\'ico ico-folder\'></span><span class="tname" title="'+rdata.dirs[i].name+'">'+shortwebname+'</span></td>\
|
||||
<td><span title="'+rdata.dirs[i].dname+'">'+shortpath+'</span></td>\
|
||||
<td>'+toSize(rdata.dirs[i].size)+'</td>\
|
||||
<td>'+getLocalTime(rdata.dirs[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.dirs[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.dirs[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>';
|
||||
}
|
||||
for(var i=0;i<rdata.files.length;i++){
|
||||
if(rdata.files[i].name.indexOf('BTDB_') != -1){
|
||||
@@ -43,15 +43,15 @@ function recycleBin(type){
|
||||
if(shortwebname.length > 20) shortwebname = shortwebname.substring(0, 20) + "...";
|
||||
if(shortpath.length > 20) shortpath = shortpath.substring(0, 20) + "...";
|
||||
body += '<tr>\
|
||||
<td><span class="ico ico-'+(getExtName(rdata.files[i].name))+'"></span><span class="tname" title="'+rdata.files[i].name+'">'+shortwebname.replace('BTDB_','')+'</span></td>\
|
||||
<td><span title="'+rdata.files[i].dname+'">mysql://'+shortpath.replace('BTDB_','')+'</span></td>\
|
||||
<td>-</td>\
|
||||
<td>'+getLocalTime(rdata.files[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>'
|
||||
<td><span class="ico ico-'+(getExtName(rdata.files[i].name))+'"></span><span class="tname" title="'+rdata.files[i].name+'">'+shortwebname.replace('BTDB_','')+'</span></td>\
|
||||
<td><span title="'+rdata.files[i].dname+'">mysql://'+shortpath.replace('BTDB_','')+'</span></td>\
|
||||
<td>-</td>\
|
||||
<td>'+getLocalTime(rdata.files[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>';
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -80,15 +80,15 @@ function recycleBin(type){
|
||||
if(shortwebname.length > 20) shortwebname = shortwebname.substring(0, 20) + "...";
|
||||
if(shortpath.length > 20) shortpath = shortpath.substring(0, 20) + "...";
|
||||
body += '<tr>\
|
||||
<td><span class=\'ico ico-folder\'></span><span class="tname" title="'+rdata.dirs[i].name+'">'+shortwebname+'</span></td>\
|
||||
<td><span title="'+rdata.dirs[i].dname+'">'+shortpath+'</span></td>\
|
||||
<td>'+toSize(rdata.dirs[i].size)+'</td>\
|
||||
<td>'+getLocalTime(rdata.dirs[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.dirs[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.dirs[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>'
|
||||
<td><span class=\'ico ico-folder\'></span><span class="tname" title="'+rdata.dirs[i].name+'">'+shortwebname+'</span></td>\
|
||||
<td><span title="'+rdata.dirs[i].dname+'">'+shortpath+'</span></td>\
|
||||
<td>'+toSize(rdata.dirs[i].size)+'</td>\
|
||||
<td>'+getLocalTime(rdata.dirs[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.dirs[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.dirs[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>'
|
||||
}
|
||||
$("#RecycleBody").html(body);
|
||||
return;
|
||||
@@ -101,15 +101,15 @@ function recycleBin(type){
|
||||
if(shortwebname.length > 20) shortwebname = shortwebname.substring(0, 20) + "...";
|
||||
if(shortpath.length > 20) shortpath = shortpath.substring(0, 20) + "...";
|
||||
body += '<tr>\
|
||||
<td><span class="ico ico-'+(getExtName(rdata.files[i].name))+'"></span><span class="tname" title="'+rdata.files[i].name+'">'+shortwebname+'</span></td>\
|
||||
<td><span title="'+rdata.files[i].dname+'">'+shortpath+'</span></td>\
|
||||
<td>'+toSize(rdata.files[i].size)+'</td>\
|
||||
<td>'+getLocalTime(rdata.files[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>'
|
||||
<td><span class="ico ico-'+(getExtName(rdata.files[i].name))+'"></span><span class="tname" title="'+rdata.files[i].name+'">'+shortwebname+'</span></td>\
|
||||
<td><span title="'+rdata.files[i].dname+'">'+shortpath+'</span></td>\
|
||||
<td>'+toSize(rdata.files[i].size)+'</td>\
|
||||
<td>'+getLocalTime(rdata.files[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>';
|
||||
}
|
||||
$("#RecycleBody").html(body);
|
||||
return;
|
||||
@@ -122,15 +122,15 @@ function recycleBin(type){
|
||||
if(shortwebname.length > 20) shortwebname = shortwebname.substring(0, 20) + "...";
|
||||
if(shortpath.length > 20) shortpath = shortpath.substring(0, 20) + "...";
|
||||
body += '<tr>\
|
||||
<td><span class="ico ico-'+(getExtName(rdata.files[i].name))+'"></span><span class="tname" title="'+rdata.files[i].name+'">'+shortwebname+'</span></td>\
|
||||
<td><span title="'+rdata.files[i].dname+'">'+shortpath+'</span></td>\
|
||||
<td>'+toSize(rdata.files[i].size)+'</td>\
|
||||
<td>'+getLocalTime(rdata.files[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>'
|
||||
<td><span class="ico ico-'+(getExtName(rdata.files[i].name))+'"></span><span class="tname" title="'+rdata.files[i].name+'">'+shortwebname+'</span></td>\
|
||||
<td><span title="'+rdata.files[i].dname+'">'+shortpath+'</span></td>\
|
||||
<td>'+toSize(rdata.files[i].size)+'</td>\
|
||||
<td>'+getLocalTime(rdata.files[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
$("#RecycleBody").html(body);
|
||||
@@ -222,6 +222,7 @@ function getFileName(name){
|
||||
text = text[n];
|
||||
return text;
|
||||
}
|
||||
|
||||
//判断图片文件
|
||||
function reisImage(fileName){
|
||||
var exts = ['jpg','jpeg','png','bmp','gif','tiff','ico'];
|
||||
@@ -328,87 +329,141 @@ function searchFile(p){
|
||||
getFiles(p);
|
||||
}
|
||||
|
||||
//处理排序
|
||||
function listFileOrder(skey, obj){
|
||||
var or = getCookie('file_order');
|
||||
var orderType = 'desc';
|
||||
if(or){
|
||||
var or_arr = or.split('|');
|
||||
if(or.split('|')[1] == 'desc'){
|
||||
orderType = 'asc';
|
||||
} else if (or_arr[1] == 'asc'){
|
||||
orderType = 'none';
|
||||
} else {
|
||||
orderType = 'desc';
|
||||
}
|
||||
}
|
||||
setCookie('file_order',skey + '|' + orderType);
|
||||
getFiles(1);
|
||||
// console.log(obj,orderType);
|
||||
// if(orderType == 'desc'){
|
||||
// $(obj).find(".glyphicon-triangle-top").remove();
|
||||
// $(obj).append("<span class='glyphicon glyphicon-triangle-bottom' style='margin-left:5px;color:#bbb'></span>");
|
||||
// } else {
|
||||
// $(obj).find(".glyphicon-triangle-bottom").remove();
|
||||
// $(obj).append("<span class='glyphicon glyphicon-triangle-top' style='margin-left:5px;color:#bbb'></span>");
|
||||
// }
|
||||
}
|
||||
|
||||
function makeFilePage(showRow, page = ''){
|
||||
var rows = ['10','50','100','200','500','1000','2000'];
|
||||
var rowOption = '';
|
||||
for(var i=0;i<rows.length;i++){
|
||||
var rowSelected = '';
|
||||
if(showRow == rows[i]) rowSelected = 'selected';
|
||||
rowOption += '<option value="'+rows[i]+'" '+rowSelected+'>'+rows[i]+'</option>';
|
||||
}
|
||||
|
||||
//分页
|
||||
$("#filePage").html(page);
|
||||
$("#filePage div").append("<span class='Pcount-item'>每页<select style='margin-left: 3px;margin-right: 3px;border:#ddd 1px solid' class='showRow'>"+rowOption+"</select>条</span>");
|
||||
$("#filePage .Pcount").css("left","16px");
|
||||
}
|
||||
|
||||
//取数据
|
||||
function getFiles(Path) {
|
||||
var searchtype = Path;
|
||||
if(isNaN(Path)){
|
||||
var p = 1;
|
||||
Path = encodeURIComponent(Path);
|
||||
} else {
|
||||
var p = Path;
|
||||
Path = getCookie('open_dir_path');
|
||||
Path = encodeURIComponent(Path);
|
||||
}
|
||||
|
||||
var search = '';
|
||||
var searchV = $("#SearchValue").val();
|
||||
if(searchV.length > 1 && searchtype == '1'){
|
||||
search = "&search="+searchV;
|
||||
}
|
||||
var showRow = getCookie('showRow');
|
||||
if(!showRow) {
|
||||
showRow = '100';
|
||||
|
||||
var args = {};
|
||||
args['p'] = p;
|
||||
var post = {};
|
||||
post['path'] = Path;
|
||||
|
||||
var file_row = $.cookie('file_row');
|
||||
if(!file_row) {
|
||||
file_row = '100';
|
||||
}
|
||||
args['row'] = file_row;
|
||||
|
||||
var body = '';
|
||||
var data = 'path=' + Path;
|
||||
var totalSize = 0;
|
||||
|
||||
var search = '';
|
||||
var search_file = $("#search_file").val();
|
||||
|
||||
if(search_file.length > 0){
|
||||
args['search'] = search_file;
|
||||
}
|
||||
|
||||
var search_all = '';
|
||||
var all = $('#search_all').hasClass('active');
|
||||
if(all){
|
||||
search_all = "&all=yes";
|
||||
args['all'] = 'yes';
|
||||
}
|
||||
|
||||
var file_order = $.cookie('file_order');
|
||||
if (file_order){
|
||||
post['order'] = file_order.replace('|',' ');
|
||||
}
|
||||
|
||||
var query_str = toUrlParam(args);
|
||||
|
||||
var loadT = layer.load();
|
||||
$.post('/files/get_dir?p=' + p + '&showRow=' + showRow + search + search_all, data, function(rdata) {
|
||||
$.post('/files/get_dir?' + query_str, post, function(rdata) {
|
||||
layer.close(loadT);
|
||||
|
||||
var rows = ['10','50','100','200','500','1000','2000'];
|
||||
var rowOption = '';
|
||||
for(var i=0;i<rows.length;i++){
|
||||
var rowSelected = '';
|
||||
if(showRow == rows[i]) rowSelected = 'selected';
|
||||
rowOption += '<option value="'+rows[i]+'" '+rowSelected+'>'+rows[i]+'</option>';
|
||||
//构建分页
|
||||
makeFilePage(file_row,rdata.PAGE);
|
||||
|
||||
if(rdata.DIR == null) {
|
||||
rdata.DIR = [];
|
||||
}
|
||||
|
||||
$("#filePage").html(rdata.PAGE);
|
||||
$("#filePage div").append("<span class='Pcount-item'>每页<select style='margin-left: 3px;margin-right: 3px;border:#ddd 1px solid' class='showRow'>"+rowOption+"</select>条</span>");
|
||||
$("#filePage .Pcount").css("left","16px");
|
||||
if(rdata.DIR == null) rdata.DIR = [];
|
||||
|
||||
for (var i = 0; i < rdata.DIR.length; i++) {
|
||||
|
||||
var fmp = rdata.DIR[i].split(";");
|
||||
var cnametext =fmp[0] + fmp[5];
|
||||
|
||||
fmp[0] = fmp[0].replace(/'/, "\\'");
|
||||
if(cnametext.length>20){
|
||||
cnametext = cnametext.substring(0,20) + '...';
|
||||
}
|
||||
|
||||
if(isChineseChar(cnametext)){
|
||||
if(cnametext.length>10){
|
||||
cnametext = cnametext.substring(0,10) + '...';
|
||||
}
|
||||
}
|
||||
|
||||
var timetext ='--';
|
||||
if(getCookie('rank') == 'a'){
|
||||
$("#set_list").addClass("active");
|
||||
$("#set_icon").removeClass("active");
|
||||
body += "<tr class='folderBoxTr' data-path='" + rdata.PATH + "/" + fmp[0] + "' filetype='dir'>\
|
||||
<td><input type='checkbox' name='id' value='"+fmp[0]+"'></td>\
|
||||
<td class='column-name'><span class='cursor' onclick=\"getFiles('" + rdata.PATH + "/" + fmp[0] + "')\">\
|
||||
<span class='ico ico-folder'></span><a class='text' title='" + fmp[0] + fmp[5] + "'>" + cnametext + "</a></span></td>\
|
||||
<td>"+toSize(fmp[1])+"</td>\
|
||||
<td>"+getLocalTime(fmp[2])+"</td>\
|
||||
<td>"+fmp[3]+"</td>\
|
||||
<td>"+fmp[4]+"</td>\
|
||||
<td class='editmenu'><span>\
|
||||
<a class='btlink' href='javascript:;' onclick=\"copyFile('" + rdata.PATH +"/"+ fmp[0] + "')\">复制</a> | \
|
||||
<a class='btlink' href='javascript:;' onclick=\"cutFile('" + rdata.PATH +"/"+ fmp[0]+ "')\">剪切</a> | \
|
||||
<a class='btlink' href='javascript:;' onclick=\"reName(0,'" + fmp[0] + "');\">重命名</a> | \
|
||||
<a class='btlink' href='javascript:;' onclick=\"setChmod(0,'" + rdata.PATH + "/"+fmp[0] + "');\">权限</a> | \
|
||||
<a class='btlink' href='javascript:;' onclick=\"zip('" + rdata.PATH +"/" +fmp[0] + "');\">压缩</a> | \
|
||||
<a class='btlink' href='javascript:;' onclick=\"deleteDir('" + rdata.PATH +"/"+ fmp[0] + "')\">删除</a></span>\
|
||||
</td>\
|
||||
</tr>";
|
||||
//列表展示
|
||||
$("#set_list").addClass("active");
|
||||
$("#set_icon").removeClass("active");
|
||||
body += "<tr class='folderBoxTr' data-path='" + rdata.PATH + "/" + fmp[0] + "' filetype='dir'>\
|
||||
<td><input type='checkbox' name='id' value='"+fmp[0]+"'></td>\
|
||||
<td class='column-name'><span class='cursor' onclick=\"getFiles('" + rdata.PATH + "/" + fmp[0] + "')\">\
|
||||
<span class='ico ico-folder'></span><a class='text' title='" + fmp[0] + fmp[5] + "'>" + cnametext + "</a></span></td>\
|
||||
<td>"+toSize(fmp[1])+"</td>\
|
||||
<td>"+getLocalTime(fmp[2])+"</td>\
|
||||
<td>"+fmp[3]+"</td>\
|
||||
<td>"+fmp[4]+"</td>\
|
||||
<td class='editmenu'><span>\
|
||||
<a class='btlink' href='javascript:;' onclick=\"copyFile('" + rdata.PATH +"/"+ fmp[0] + "')\">复制</a> | \
|
||||
<a class='btlink' href='javascript:;' onclick=\"cutFile('" + rdata.PATH +"/"+ fmp[0]+ "')\">剪切</a> | \
|
||||
<a class='btlink' href='javascript:;' onclick=\"reName(0,'" + fmp[0] + "');\">重命名</a> | \
|
||||
<a class='btlink' href='javascript:;' onclick=\"setChmod(0,'" + rdata.PATH + "/"+fmp[0] + "');\">权限</a> | \
|
||||
<a class='btlink' href='javascript:;' onclick=\"zip('" + rdata.PATH +"/" +fmp[0] + "');\">压缩</a> | \
|
||||
<a class='btlink' href='javascript:;' onclick=\"deleteDir('" + rdata.PATH +"/"+ fmp[0] + "')\">删除</a></span>\
|
||||
</td>\
|
||||
</tr>";
|
||||
} else {
|
||||
//图标展示
|
||||
$("#set_icon").addClass("active");
|
||||
$("#set_list").removeClass("active");
|
||||
body += "<div class='file folderBox menufolder' data-path='" + rdata.PATH + "/" + fmp[0] + "' filetype='dir' title='"+lan.files.file_name+":" + fmp[0]+" "+lan.files.file_size+":"
|
||||
@@ -421,6 +476,7 @@ function getFiles(Path) {
|
||||
</div>";
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < rdata.FILES.length; i++) {
|
||||
if(rdata.FILES[i] == null) continue;
|
||||
var fmp = rdata.FILES[i].split(";");
|
||||
@@ -490,13 +546,37 @@ function getFiles(Path) {
|
||||
+ (toSize(totalSize))+'<a class="btlink ml5" onClick="getPathSize()">获取</a></font>)';
|
||||
$("#dir_info").html(dirInfo);
|
||||
if( getCookie('rank') == 'a' ){
|
||||
|
||||
// console.log(post['order']);
|
||||
var size_icon = '<span class="glyphicon glyphicon-triangle-top" style="margin-left:5px;color:#bbb">';
|
||||
if (post['order'] == 'size desc'){
|
||||
size_icon = '<span class="glyphicon glyphicon-triangle-bottom" style="margin-left:5px;color:#bbb">';
|
||||
} else if (post['order'] == 'size asc'){
|
||||
size_icon = '<span class="glyphicon glyphicon-triangle-top" style="margin-left:5px;color:#bbb">';
|
||||
} else {
|
||||
size_icon = '<span class="glyphicon glyphicon-option-horizontal" style="top:3px;margin-left:5px;color:#bbb">';
|
||||
}
|
||||
|
||||
var mtime_icon = '<span class="glyphicon glyphicon-triangle-top" style="margin-left:5px;color:#bbb">';
|
||||
if (post['order'] == 'mtime desc'){
|
||||
mtime_icon = '<span class="glyphicon glyphicon-triangle-bottom" style="margin-left:5px;color:#bbb">';
|
||||
} else if (post['order'] == 'mtime asc'){
|
||||
mtime_icon = '<span class="glyphicon glyphicon-triangle-top" style="margin-left:5px;color:#bbb">';
|
||||
} else {
|
||||
mtime_icon = '<span class="glyphicon glyphicon-option-horizontal" style="top:3px;margin-left:5px;color:#bbb">';
|
||||
}
|
||||
|
||||
var tablehtml = '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="table table-hover">\
|
||||
<thead>\
|
||||
<tr>\
|
||||
<th width="30"><input type="checkbox" id="setBox" placeholder=""></th>\
|
||||
<th>文件名</th>\
|
||||
<th>大小</th>\
|
||||
<th>修改时间</th>\
|
||||
<th onclick="listFileOrder(\'size\',this)" style="cursor: pointer;">大小\
|
||||
'+size_icon+'\
|
||||
</th>\
|
||||
<th onclick="listFileOrder(\'mtime\',this)" style="cursor: pointer;">修改时间\
|
||||
'+mtime_icon+'\
|
||||
</th>\
|
||||
<th>权限</th>\
|
||||
<th>所有者</th>\
|
||||
<th style="text-align: right;" width="330">操作</th>\
|
||||
@@ -613,12 +693,12 @@ function getFiles(Path) {
|
||||
|
||||
//每页行数
|
||||
$(".showRow").change(function(){
|
||||
setCookie('showRow',$(this).val());
|
||||
setCookie('file_row',$(this).val());
|
||||
getFiles(p);
|
||||
});
|
||||
pathPlaceBtn(rdata.PATH);
|
||||
},'json');
|
||||
setTimeout(function(){getCookie('open_dir_path');},200);
|
||||
// setTimeout(function(){getCookie('open_dir_path');},200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -825,6 +825,7 @@ function isAction() {
|
||||
}
|
||||
$("#memuA" + name).addClass("current")
|
||||
}
|
||||
|
||||
var W_window = $(window).width();
|
||||
if(W_window <= 980) {
|
||||
$(window).scroll(function() {
|
||||
@@ -1868,6 +1869,10 @@ function showSpeedWindow(msg, speed_log_func_name, callback){
|
||||
|
||||
/*** 其中功能,针对插件通过库使用 start ***/
|
||||
|
||||
function toUrlParam(json) {
|
||||
return Object.keys(json).map(key => key + '=' + json[key]).join('&');
|
||||
}
|
||||
|
||||
//字符串转数组对象
|
||||
function toArrayObject(str){
|
||||
var data = {};
|
||||
|
||||
@@ -1094,20 +1094,21 @@ html .menu .menu_exit:hover {
|
||||
}
|
||||
|
||||
.table .btlinkbed:hover {
|
||||
border: #ddd 1px solid
|
||||
border: #ddd 1px solid;
|
||||
}
|
||||
|
||||
.dataTables_paginate {
|
||||
display: block;
|
||||
height: 30px;
|
||||
height: 35px;
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0px;
|
||||
margin-top: 5px;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
#filePage{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.page {
|
||||
/* line-height: 16px; */
|
||||
text-align: right;
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 7.1 KiB |
+2
@@ -0,0 +1,2 @@
|
||||
/*! jquery.cookie v1.4.1 | MIT */
|
||||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?a(require("jquery")):a(jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setTime(+k+864e5*j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}});
|
||||
@@ -128,7 +128,7 @@
|
||||
|
||||
<p class="mtb15">
|
||||
<span class="set-tit text-right" title="API接口" style="float: left;">API接口</span>
|
||||
<input class="btswitch btswitch-ios" id="cfg_panel_api" type="checkbox" {{data['api_token']}}/>
|
||||
<input class="btswitch btswitch-ios" id="cfg_panel_api" type="checkbox" {{data['api_token']}}/>
|
||||
<label class="btswitch-btn ml5" for="cfg_panel_api" style="float: left;margin-top:4px;" onclick="setPanelApi()"></label>
|
||||
<button ype="button" class="btn btn-default btn-xs panel_api_btn" style="vertical-align: middle; margin-left: 10px" onclick="showPanelApi();">API接口配置</button>
|
||||
<span class="set-info c7">提供面板API接口访问的支持</span>
|
||||
@@ -146,6 +146,14 @@
|
||||
<button type="button" class="btn btn-success btn-sm ml5" onclick="setTempAccess()">临时访问授权管理</button>
|
||||
<span class="set-info c7">为非管理员临时提供面板访问权限</span>
|
||||
</p>
|
||||
|
||||
<p class="mtb15">
|
||||
<span class="set-tit text-right" title="二次验证" style="float: left;">二次验证</span>
|
||||
<input class="btswitch btswitch-ios" id="cfg_panel_auth" type="checkbox" {{data['auth_secret']}}/>
|
||||
<label class="btswitch-btn ml5" for="cfg_panel_auth" style="float: left;margin-top:4px;" onclick="setAuthSecretApi()"></label>
|
||||
<button type="button" class="btn btn-default btn-xs panel_api_btn" style="vertical-align: middle; margin-left: 10px" onclick="setAuthBind();">绑定设置</button>
|
||||
<span class="set-info c7">二次验证,加强安全登录</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<div class="pull-left mlr15" style="line-height:26px"><span id='dir_info'></span></div>
|
||||
<div class="search pull-right" style="position: absolute; top: 6px; right: 5px;">
|
||||
<form target="hid">
|
||||
<input type="text" id="SearchValue" class="ser-text pull-left" placeholder="搜索文件/目录" />
|
||||
<input type="text" id="search_file" class="ser-text pull-left" placeholder="搜索文件/目录" />
|
||||
<button type="button" class="ser-sub pull-left" onclick='searchFile(1)'></button>
|
||||
<div class="file_search" draggable="false">
|
||||
<div id="search_all" class="file_search_checked"></div>
|
||||
@@ -43,6 +43,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 文件展示 -->
|
||||
<div class="divtable pd15" id="fileCon"></div>
|
||||
<div class="dataTables_paginate paging_bootstrap pagination plr15" style="position: relative; top: -6px;">
|
||||
<ul id="filePage" class="page"></ul>
|
||||
@@ -65,7 +66,7 @@
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
$("#SearchValue").focus().keyup(function(e){
|
||||
$("#search_file").focus().keyup(function(e){
|
||||
if(e.keyCode == 13) searchFile(1);
|
||||
});
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
<link rel="stylesheet" href="/static/build/xterm.css?v={{config.version}}">
|
||||
<link rel="stylesheet" href="/static/build/addons/fullscreen/fullscreen.css?v={{config.version}}">
|
||||
<script src="/static/js/jquery-1.10.2.min.js"></script>
|
||||
<script src="/static/js/jquery.cookie-1.4.1.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
<script src="/static/layer/layer.js"></script>
|
||||
<script src="/static/js/jquery.fly.min.js"></script>
|
||||
@@ -89,9 +90,9 @@
|
||||
<script src="/static/js/echarts.min.js"></script>
|
||||
<!-- <script src="//cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/route/static/js/echarts.min.js"></script> -->
|
||||
<!-- <script src="//unpkg.com/echarts@5.4.3/dist/echarts.min.js"></script> -->
|
||||
|
||||
|
||||
<script src="/static/js/jquery.dragsort-0.5.2.min.js"></script>
|
||||
<script src="/static/js/jquery-qrcode-0.18.0.min.js?v={{config.version}}"></script>
|
||||
<script src="/static/js/xm-select.js"></script>
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<link rel="icon" href="/static/favicon.ico" type="image/x-icon" />
|
||||
<link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon" />
|
||||
<title>{{data['title']}}</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/layer/skin/default/layer.css?v={{config.version}}">
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/site.css?v={{config.version}}">
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/login.css?v={{config.version}}">
|
||||
<style type="text/css">
|
||||
@@ -29,6 +30,7 @@
|
||||
.bg_img.pc:hover{
|
||||
background-position: -60px -60px;
|
||||
}
|
||||
|
||||
.qrCode{
|
||||
text-align: center;
|
||||
padding-top: 20px;
|
||||
@@ -70,9 +72,11 @@
|
||||
padding: 20px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.list_scan .weChatSamll img{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.list_scan .weChatSamll em{
|
||||
position: absolute;
|
||||
border: 7px solid #ececec;
|
||||
@@ -83,6 +87,7 @@
|
||||
bottom: -14px;
|
||||
margin-left: -6px;
|
||||
}
|
||||
|
||||
.tips{
|
||||
width: 115px;
|
||||
position: absolute;
|
||||
@@ -94,6 +99,7 @@
|
||||
text-align: center;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.tips em{
|
||||
position: absolute;
|
||||
border: 6px solid #dff0d8;
|
||||
@@ -104,6 +110,7 @@
|
||||
top: 8px;
|
||||
margin-left: -6px;
|
||||
}
|
||||
|
||||
.tips img{
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
@@ -115,6 +122,10 @@
|
||||
margin-top: 15px;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.layui-layer .layui-layer-btn{
|
||||
width: 235px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -123,11 +134,14 @@
|
||||
<div class="account">
|
||||
<form class="loginform" method="post" action="/login" onsubmit="return false;">
|
||||
<div class="rlogo">{{data['title']}}</div>
|
||||
<div class="line"><input class="inputtxt" value="" name="username" datatype="*" nullmsg="请填写账户" errormsg="请填写账户" placeholder="账户" type="text"><div class="Validform_checktip"></div></div>
|
||||
<div class="line">
|
||||
<input class="inputtxt" value="" name="username" datatype="*" nullmsg="请填写账户" errormsg="请填写账户" placeholder="账户" type="text">
|
||||
<div class="Validform_checktip"></div>
|
||||
</div>
|
||||
<div class="line"><input class="inputtxt" name="password" value="" datatype="*" nullmsg="请填写密码" errormsg="请填写密码" placeholder="密码" type="password">
|
||||
<div class="Validform_checktip"></div>
|
||||
</div>
|
||||
<div style="color: red;position: relative;top: -14px;" id="errorStr"></div>
|
||||
<div style="color: red;position: relative;top: -14px;" id="error"></div>
|
||||
<div class="line yzm" style="top: -5px;{% if not session['code'] %}display:none;{% endif %}">
|
||||
<input type="text" class="inputtxt" name="code" nullmsg="请填写4位验证码" errormsg="验证码" datatype="*" placeholder="验证码">
|
||||
<div class="Validform_checktip"></div>
|
||||
@@ -150,6 +164,7 @@
|
||||
$(function(){
|
||||
wreset();
|
||||
})
|
||||
|
||||
window.onresize=function(){
|
||||
wreset();
|
||||
}
|
||||
@@ -188,19 +203,21 @@ $('#login-button').click(function(){
|
||||
}
|
||||
|
||||
var data = 'username='+username+'&password='+password+'&code='+code;
|
||||
var loadT = layer.msg("正在登录中",{icon:16,time:0,shade: [0.3, '#000']});
|
||||
var loadT = layer.msg("正在登录中...",{icon:16,time:0,shade: [0.3, '#000']});
|
||||
$.post('/do_login',data,function(rdata){
|
||||
console.log(rdata);
|
||||
layer.close(loadT);
|
||||
if(!rdata.status){
|
||||
if(status < 0){
|
||||
if(username == 'admin' && rdata.msg.indexOf('用户名') != -1){
|
||||
rdata.msg += ', <br>获取默认用户和密码命令: mw default';
|
||||
}
|
||||
$("#errorStr").html(rdata.msg);
|
||||
$("#error").html(rdata.msg);
|
||||
$("input[name='password']").val('');
|
||||
num = rdata.msg.substring(rdata.msg.indexOf('[')+1,rdata.msg.indexOf(']'))
|
||||
if(num < 5){
|
||||
$('#mw_yzm').html('<img width="100" height="40" class="passcode" onClick="this.src=this.src.split(\'?\')[0] + \'?\'+new Date().getTime()" src="/code" style="border: 1px solid #ccc; float: right;" title="" >');
|
||||
$(".login").css("height","332px");
|
||||
var code_html = '<img width="100" height="40" class="passcode" onClick="this.src=this.src.split(\'?\')[0] + \'?\'+new Date().getTime()" src="/code" style="border: 1px solid #ccc; float: right;">';
|
||||
$('#mw_yzm').html(code_html);
|
||||
// $(".login").css("height","332px");
|
||||
$("input[name='code']").val('');
|
||||
$(".passcode").click();
|
||||
}
|
||||
@@ -209,6 +226,26 @@ $('#login-button').click(function(){
|
||||
layer.msg(rdata.msg,{icon:2,time:5000});
|
||||
return;
|
||||
}
|
||||
|
||||
if (rdata.status == 2){
|
||||
layer.prompt({
|
||||
formType: 3,
|
||||
value: '',
|
||||
title: '二次验证',
|
||||
}, function(value, index, elem){
|
||||
$.post('/verify_login',{'auth':value,'username':username,'password':password},function(vdata){
|
||||
if (vdata.status < 0){
|
||||
layer.msg(vdata.msg,{icon:2,time:5000});
|
||||
return;
|
||||
}
|
||||
|
||||
layer.close(index);
|
||||
window.location.href = '/';
|
||||
},'json');
|
||||
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
layer.msg(rdata.msg,{icon:16,time:0,shade: [0.3, '#000']});
|
||||
window.location.href = '/';
|
||||
|
||||
+2
-2
@@ -64,7 +64,7 @@ fi
|
||||
# ping -c 1 github.com > /dev/null 2>&1
|
||||
# if [ "$?" != "0" ];then
|
||||
# LOCAL_ADDR=cn
|
||||
# HTTP_PREFIX="https://ghproxy.com/"
|
||||
# HTTP_PREFIX="https://mirror.ghproxy.com/"
|
||||
# fi
|
||||
|
||||
HTTP_PREFIX="https://"
|
||||
@@ -72,7 +72,7 @@ LOCAL_ADDR=common
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
|
||||
LOCAL_ADDR=cn
|
||||
HTTP_PREFIX="https://ghproxy.com/"
|
||||
HTTP_PREFIX="https://mirror.ghproxy.com/"
|
||||
fi
|
||||
|
||||
echo "local:${LOCAL_ADDR}"
|
||||
|
||||
@@ -53,6 +53,7 @@ if [ ! -f /usr/sbin/iptables ];then
|
||||
|
||||
firewall-cmd --permanent --zone=public --add-port=80/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/udp
|
||||
# firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||
|
||||
sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf
|
||||
|
||||
@@ -62,6 +62,7 @@ if [ ! -f /usr/sbin/firewalld ];then
|
||||
|
||||
firewall-cmd --permanent --zone=public --add-port=80/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/udp
|
||||
# firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||
|
||||
sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf
|
||||
|
||||
@@ -94,6 +94,7 @@ if [ ! -f /usr/sbin/firewalld ];then
|
||||
|
||||
firewall-cmd --permanent --zone=public --add-port=80/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/udp
|
||||
# firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||
|
||||
sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf
|
||||
|
||||
@@ -66,6 +66,7 @@ if [ ! -f /usr/sbin/firewalld ];then
|
||||
|
||||
firewall-cmd --permanent --zone=public --add-port=80/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/udp
|
||||
# firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||
|
||||
|
||||
|
||||
@@ -92,6 +92,7 @@ if [ ! -f /usr/sbin/ufw ];then
|
||||
fi
|
||||
firewall-cmd --permanent --zone=public --add-port=80/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/udp
|
||||
# firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||
|
||||
systemctl start firewalld
|
||||
|
||||
@@ -65,6 +65,7 @@ if [ ! -f /usr/sbin/firewalld ];then
|
||||
|
||||
firewall-cmd --permanent --zone=public --add-port=80/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/udp
|
||||
# firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ if [ ! -f /usr/sbin/iptables ];then
|
||||
|
||||
firewall-cmd --permanent --zone=public --add-port=80/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/udp
|
||||
# firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||
firewall-cmd --reload
|
||||
fi
|
||||
|
||||
@@ -74,6 +74,7 @@ if [ ! -f /usr/sbin/firewalld ];then
|
||||
|
||||
firewall-cmd --permanent --zone=public --add-port=80/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/udp
|
||||
# firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||
|
||||
sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf
|
||||
|
||||
@@ -125,6 +125,7 @@ if [ -f /usr/sbin/firewalld ];then
|
||||
fi
|
||||
firewall-cmd --permanent --zone=public --add-port=80/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/udp
|
||||
# firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||
# firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
||||
# firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||
|
||||
@@ -49,6 +49,7 @@ if [ ! -f /usr/sbin/iptables ];then
|
||||
firewall-cmd --permanent --zone=public --add-port=22/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=80/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/udp
|
||||
# firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||
# firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
||||
# firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||
|
||||
@@ -62,6 +62,7 @@ if [ ! -f /usr/sbin/ufw ];then
|
||||
|
||||
firewall-cmd --permanent --zone=public --add-port=80/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=443/udp
|
||||
# firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||
|
||||
systemctl start firewalld
|
||||
|
||||
@@ -67,7 +67,7 @@ fi
|
||||
# ping -c 1 github.com > /dev/null 2>&1
|
||||
# if [ "$?" != "0" ];then
|
||||
# LOCAL_ADDR=cn
|
||||
# HTTP_PREFIX="https://ghproxy.com/"
|
||||
# HTTP_PREFIX="https://mirror.ghproxy.com/"
|
||||
# fi
|
||||
|
||||
HTTP_PREFIX="https://"
|
||||
@@ -75,7 +75,7 @@ LOCAL_ADDR=common
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
|
||||
LOCAL_ADDR=cn
|
||||
HTTP_PREFIX="https://ghproxy.com/"
|
||||
HTTP_PREFIX="https://mirror.ghproxy.com/"
|
||||
fi
|
||||
|
||||
echo "local:${LOCAL_ADDR}"
|
||||
|
||||
+2
-2
@@ -62,14 +62,14 @@ fi
|
||||
# ping -c 1 github.com > /dev/null 2>&1
|
||||
# if [ "$?" != "0" ];then
|
||||
# LOCAL_ADDR=cn
|
||||
# HTTP_PREFIX="https://ghproxy.com/"
|
||||
# HTTP_PREFIX="https://mirror.ghproxy.com/"
|
||||
# fi
|
||||
HTTP_PREFIX="https://"
|
||||
LOCAL_ADDR=common
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
|
||||
LOCAL_ADDR=cn
|
||||
HTTP_PREFIX="https://ghproxy.com/"
|
||||
HTTP_PREFIX="https://mirror.ghproxy.com/"
|
||||
fi
|
||||
|
||||
PIPSRC="https://pypi.python.org/simple"
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ LOCAL_ADDR=common
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
|
||||
LOCAL_ADDR=cn
|
||||
HTTP_PREFIX="https://ghproxy.com/"
|
||||
HTTP_PREFIX="https://mirror.ghproxy.com/"
|
||||
fi
|
||||
echo "local:${LOCAL_ADDR}"
|
||||
|
||||
|
||||
@@ -61,14 +61,14 @@ fi
|
||||
# ping -c 1 github.com > /dev/null 2>&1
|
||||
# if [ "$?" != "0" ];then
|
||||
# LOCAL_ADDR=cn
|
||||
# HTTP_PREFIX="https://ghproxy.com/"
|
||||
# HTTP_PREFIX="https://mirror.ghproxy.com/"
|
||||
# fi
|
||||
HTTP_PREFIX="https://"
|
||||
LOCAL_ADDR=common
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
|
||||
LOCAL_ADDR=cn
|
||||
HTTP_PREFIX="https://ghproxy.com/"
|
||||
HTTP_PREFIX="https://mirror.ghproxy.com/"
|
||||
fi
|
||||
|
||||
echo "local:${LOCAL_ADDR}"
|
||||
|
||||
@@ -61,6 +61,7 @@ def mwcli(mw_input=0):
|
||||
print("(22) 开启IPV6支持")
|
||||
print("(23) 关闭IPV6支持")
|
||||
print("(24) 开启防火墙SSH端口")
|
||||
print("(25) 关闭二次验证")
|
||||
print("(100) 开启PHP52显示")
|
||||
print("(101) 关闭PHP52显示")
|
||||
print("(200) 切换Linux系统软件源")
|
||||
@@ -74,7 +75,7 @@ def mwcli(mw_input=0):
|
||||
except:
|
||||
mw_input = 0
|
||||
|
||||
nums = [1, 2, 3, 4, 5, 10, 11, 12, 13, 20, 21, 22, 23, 24, 100, 101, 200, 201]
|
||||
nums = [1, 2, 3, 4, 5, 10, 11, 12, 13, 20, 21, 22, 23, 24, 25, 100, 101, 200, 201]
|
||||
if not mw_input in nums:
|
||||
print(raw_tip)
|
||||
print("已取消!")
|
||||
@@ -145,6 +146,13 @@ def mwcli(mw_input=0):
|
||||
elif mw_input == 24:
|
||||
open_ssh_port()
|
||||
print("|-已开启!")
|
||||
elif mw_input == 25:
|
||||
auth_secret = 'data/auth_secret.pl'
|
||||
if os.path.exists(auth_secret):
|
||||
os.remove(auth_secret)
|
||||
print("|-关闭二次验证成功!")
|
||||
else:
|
||||
print("|-二次验证已关闭!")
|
||||
elif mw_input == 100:
|
||||
php_conf = 'plugins/php/info.json'
|
||||
if os.path.exists(php_conf):
|
||||
@@ -169,7 +177,7 @@ def mwcli(mw_input=0):
|
||||
|
||||
def open_ssh_port():
|
||||
import firewall_api
|
||||
find_ssh_port_cmd = "cat /etc/ssh/sshd_config | grep '^Port \d*' | tail -1"
|
||||
find_ssh_port_cmd = "cat /etc/ssh/sshd_config | grep '^Port \\d*' | tail -1"
|
||||
cmd_data = mw.execShell(find_ssh_port_cmd)
|
||||
ssh_port = cmd_data[0].replace("Port ", '').strip()
|
||||
if ssh_port == '':
|
||||
|
||||
Reference in New Issue
Block a user