mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 13:25:51 +01:00
fix csf menu while upgrade
This commit is contained in:
@@ -96,8 +96,9 @@ class secMiddleware:
|
|||||||
|
|
||||||
response = self.get_response(request)
|
response = self.get_response(request)
|
||||||
|
|
||||||
|
#response['Strict-Transport-Security'] = "max-age=31536000; includeSubDomains; preload"
|
||||||
response['X-XSS-Protection'] = "1; mode=block"
|
response['X-XSS-Protection'] = "1; mode=block"
|
||||||
response['Strict-Transport-Security'] = "max-age=31536000; includeSubDomains; preload"
|
response['X-Frame-Options'] = "sameorigin"
|
||||||
response['X-Frame-Options'] = "DENY"
|
response['Content-Security-Policy'] = "frame-ancestors jsdelivr.com"
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div id="page-title">
|
<div id="page-title">
|
||||||
<h2>{% trans "Restore Remote Incremental Backups" %} - <a target="_blank"
|
<h2>{% trans "Restore Remote Incremental Backups" %} - <a target="_blank"
|
||||||
href="https://cyberpanel.net/docs/2-create-restore-incremental-backups/"
|
href="https://cyberpanel.net/docs/3-restore-backups-from-remote-destination/"
|
||||||
style="height: 23px;line-height: 21px;"
|
style="height: 23px;line-height: 21px;"
|
||||||
class="btn btn-border btn-alt border-red btn-link font-red"
|
class="btn btn-border btn-alt border-red btn-link font-red"
|
||||||
title=""><span>{% trans "Backup Docs" %}</span></a>
|
title=""><span>{% trans "Backup Docs" %}</span></a>
|
||||||
|
|||||||
@@ -51,8 +51,9 @@ class SSHServer(multi.Thread):
|
|||||||
def recvData(self):
|
def recvData(self):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
if self.websocket.running:
|
||||||
if os.path.exists(self.websocket.verifyPath):
|
if os.path.exists(self.websocket.verifyPath):
|
||||||
if self.websocket.filePassword == self.websocket.filePassword:
|
if self.websocket.filePassword == self.websocket.password:
|
||||||
if self.shell.recv_ready():
|
if self.shell.recv_ready():
|
||||||
if self.color == 0:
|
if self.color == 0:
|
||||||
text = '%sEnjoy your accelerated Internet by CyberPanel and LiteSpeed%s' % (SSHServer.OKGREEN, SSHServer.ENDC)
|
text = '%sEnjoy your accelerated Internet by CyberPanel and LiteSpeed%s' % (SSHServer.OKGREEN, SSHServer.ENDC)
|
||||||
@@ -63,6 +64,8 @@ class SSHServer(multi.Thread):
|
|||||||
self.websocket.sendMessage(self.shell.recv(9000).decode("utf-8"))
|
self.websocket.sendMessage(self.shell.recv(9000).decode("utf-8"))
|
||||||
else:
|
else:
|
||||||
time.sleep(0.01)
|
time.sleep(0.01)
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
except BaseException, msg:
|
except BaseException, msg:
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
@@ -84,12 +87,13 @@ class WebTerminalServer(WebSocket):
|
|||||||
self.filePassword = open(self.verifyPath, 'r').read()
|
self.filePassword = open(self.verifyPath, 'r').read()
|
||||||
else:
|
else:
|
||||||
if os.path.exists(self.verifyPath):
|
if os.path.exists(self.verifyPath):
|
||||||
if self.filePassword == self.filePassword:
|
if self.filePassword == self.password:
|
||||||
self.shell.send(str(data['data']))
|
self.shell.send(str(data['data']))
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def handleConnected(self):
|
def handleConnected(self):
|
||||||
|
self.running = 1
|
||||||
self.sh = SSHServer(self)
|
self.sh = SSHServer(self)
|
||||||
self.shell = self.sh.shell
|
self.shell = self.sh.shell
|
||||||
self.sh.start()
|
self.sh.start()
|
||||||
@@ -97,6 +101,7 @@ class WebTerminalServer(WebSocket):
|
|||||||
def handleClose(self):
|
def handleClose(self):
|
||||||
try:
|
try:
|
||||||
os.remove(self.verifyPath)
|
os.remove(self.verifyPath)
|
||||||
|
self.running = 0
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -2011,6 +2011,9 @@ failovermethod=priority
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
command = 'csf -uf'
|
||||||
|
Upgrade.executioner(command, 'fix csf if there', 0)
|
||||||
|
|
||||||
Upgrade.stdOut("Upgrade Completed.")
|
Upgrade.stdOut("Upgrade Completed.")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user