Skip to content

Commit

Permalink
7.6.15
Browse files Browse the repository at this point in the history
  • Loading branch information
showpy committed Mar 10, 2021
1 parent e91730b commit 9fd0885
Show file tree
Hide file tree
Showing 13 changed files with 1,198 additions and 936 deletions.
2 changes: 1 addition & 1 deletion BT-Panel
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ if __name__ == '__main__':
if is_ssl:
ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
ssl_context.load_cert_chain(certfile=certfile,keyfile=keyfile)
ssl_context.options |= (ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3)
ssl_context.options = (ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3 | ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1)
ssl_context.set_ciphers("ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE")
http_server = WSGIServer((HOST, PORT), app,handler_class=WebSocketHandler,ssl_context = ssl_context)
else:
Expand Down
2 changes: 1 addition & 1 deletion BTPanel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def site(pdata=None):
'GetRedirectFile', 'SaveRedirectFile', 'DeleteRedirect', 'GetRedirectList', 'CreateRedirect', 'ModifyRedirect',
'set_dir_auth', 'delete_dir_auth', 'get_dir_auth', 'modify_dir_auth_pass', 'export_domains', 'import_domains',
'GetSiteLogs', 'GetSiteDomains', 'GetSecurity', 'SetSecurity', 'ProxyCache', 'CloseToHttps', 'HttpToHttps',
'SetEdate',
'SetEdate','get_site_errlog',
'SetRewriteTel', 'GetCheckSafe', 'CheckSafe', 'GetDefaultSite', 'SetDefaultSite', 'CloseTomcat', 'SetTomcat',
'apacheAddPort',
'AddSite', 'GetPHPVersion', 'SetPHPVersion', 'DeleteSite', 'AddDomain', 'DelDomain', 'GetDirBinding',
Expand Down
9 changes: 9 additions & 0 deletions BTPanel/static/js/public_backup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5270,6 +5270,15 @@ bt.site = {
if(callback) callback(rdata);
})
},
get_site_error_logs:function(siteName,callback){
var loading = bt.load();
bt.send('GetSiteLogs','site/get_site_errlog',{siteName:siteName},function(rdata){
loading.close();
if(rdata.status !== true) rdata.msg = '';
if (rdata.msg == '') rdata.msg = '当前没有日志.';
if(callback) callback(rdata);
})
},
get_site_ssl:function(siteName,callback){
var loadT = bt.load(lan.site.the_msg);
bt.send('GetSSL', 'site/GetSSL', { siteName: siteName }, function (rdata) {
Expand Down
1,570 changes: 803 additions & 767 deletions BTPanel/static/js/site.js

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions class/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def init(self):
if ua.find('spider') != -1 or ua.find('bot') != -1:
return redirect('https://www.baidu.com')

g.version = '7.6.12'
g.version = '7.6.14'
g.title = public.GetConfigValue('title')
g.uri = request.path
g.debug = os.path.exists('data/debug.pl')
Expand Down Expand Up @@ -52,13 +52,15 @@ def other_import(self):
g.other_css = []
g.other_js = []
if g.o:
s_path = 'BTPanel/static/other/js/{}'
css_name = "{}.css".format(g.o)
css_file = s_path.format(css_name)
if os.path.exists(css_file): g.other_css.append('/static/other/css/{}'.format(css_name))
js_name = "{}.js".format(g.o)
s_path = 'BTPanel/static/other/{}'
css_name = "css/{}.css".format(g.o)
css_file = s_path.format(css_name)
if os.path.exists(css_file): g.other_css.append('/static/other/{}'.format(css_name))

js_name = "js/{}.js".format(g.o)
js_file = s_path.format(js_name)
if os.path.exists(js_file): g.other_js.append('/static/other/js/{}'.format(js_name))
if os.path.exists(js_file): g.other_js.append('/static/other/{}'.format(js_name))



class panelAdmin(panelSetup):
Expand Down
5 changes: 4 additions & 1 deletion class/panelBackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ def GetDiskInfo2(self):
arr['path'] = disk[6]
tmp1 = [disk[2],disk[3],disk[4],disk[5]]
arr['size'] = tmp1
arr['inodes'] = [inodes[1],inodes[2],inodes[3],inodes[4]]
if int(inodes[1]) == 0 and int(inodes[2]) == 0:
arr['inodes'] = [inodes[1],10000,10000,0]
else:
arr['inodes'] = [inodes[1],inodes[2],inodes[3],inodes[4]]
diskInfo.append(arr)
except:
continue
Expand Down
22 changes: 17 additions & 5 deletions class/panelSite.py
Original file line number Diff line number Diff line change
Expand Up @@ -1030,8 +1030,8 @@ def openlitespeed_domain(self, get):
listen_conf = public.readFile(listen_file)
try:
get.webname = json.loads(get.webname)
get.domain = get.webname['domain']
get.webname = get.webname['domain'] + "," + ",".join(get.webname["domainlist"])
get.domain = get.webname['domain'].replace('\r', '')
get.webname = get.domain + "," + ",".join(get.webname["domainlist"])
if get.webname[-1] == ',':
get.webname = get.webname[:-1]
except:
Expand All @@ -1049,7 +1049,7 @@ def openlitespeed_domain(self, get):
listen_conf = re.sub(rep, new_map, listen_conf)
else:
domains = get.webname.strip().split(',')
map_tmp = '\tmap\t{d} {d}\n'.format(d=domains[0])
map_tmp = '\tmap\t{d} {d}'.format(d=domains[0])
listen_rep = "secure\s*0"
listen_conf = re.sub(listen_rep,"secure 0\n"+map_tmp,listen_conf)
else:
Expand All @@ -1059,7 +1059,7 @@ def openlitespeed_domain(self, get):
secure 0
map %s %s
}
""" % (get.port,get.port,get.webname,get.domain)
""" % (get.port, get.port, get.domain, get.webname)
# 保存配置文件
public.writeFile(listen_file, listen_conf)
return True
Expand Down Expand Up @@ -4131,7 +4131,7 @@ def SetHasPwd(self,get):

if get.siteName == 'phpmyadmin':
get.configFile = self.setupPath + '/apache/conf/extra/httpd-vhosts.conf'
if os.path.exists(self.sitePath + '/panel/vhost/apache/phpmyadmin.conf'):
if os.path.exists(self.setupPath + '/panel/vhost/apache/phpmyadmin.conf'):
get.configFile = self.setupPath + '/panel/vhost/apache/phpmyadmin.conf'
else:
get.configFile = self.setupPath + '/panel/vhost/apache/' + get.siteName + '.conf'
Expand Down Expand Up @@ -4685,6 +4685,18 @@ def GetSiteLogs(self,get):
if not os.path.exists(logPath): return public.returnMsg(False,'日志为空')
return public.returnMsg(True,public.GetNumLines(logPath,1000))

#取网站错误日志
def get_site_errlog(self,get):
serverType = public.get_webserver()
if serverType == "nginx":
logPath = '/www/wwwlogs/' + get.siteName + '.error.log'
elif serverType == 'apache':
logPath = '/www/wwwlogs/' + get.siteName + '-error_log'
else:
logPath = '/www/wwwlogs/' + get.siteName + '_ols.error_log'
if not os.path.exists(logPath): return public.returnMsg(False,'日志为空')
return public.returnMsg(True,public.GetNumLines(logPath,1000))

#取网站分类
def get_site_types(self,get):
data = public.M("site_types").field("id,name").order("id asc").select()
Expand Down
Loading

0 comments on commit 9fd0885

Please sign in to comment.