Skip to content

Commit

Permalink
fix csf menu while upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Nov 6, 2019
1 parent e4a375f commit 66c16a7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
7 changes: 4 additions & 3 deletions CyberCP/secMiddleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ def __call__(self, request):


response = self.get_response(request)


#response['Strict-Transport-Security'] = "max-age=31536000; includeSubDomains; preload"
response['X-XSS-Protection'] = "1; mode=block"
response['Strict-Transport-Security'] = "max-age=31536000; includeSubDomains; preload"
response['X-Frame-Options'] = "DENY"
response['X-Frame-Options'] = "sameorigin"
response['Content-Security-Policy'] = "frame-ancestors jsdelivr.com"

return response
2 changes: 1 addition & 1 deletion IncBackups/templates/IncBackups/restoreRemoteBackups.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="container">
<div id="page-title">
<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;"
class="btn btn-border btn-alt border-red btn-link font-red"
title=""><span>{% trans "Backup Docs" %}</span></a>
Expand Down
29 changes: 17 additions & 12 deletions WebTerminal/CPWebSocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,21 @@ def __init__(self, websocket):
def recvData(self):
while True:
try:
if os.path.exists(self.websocket.verifyPath):
if self.websocket.filePassword == self.websocket.filePassword:
if self.shell.recv_ready():
if self.color == 0:
text = '%sEnjoy your accelerated Internet by CyberPanel and LiteSpeed%s' % (SSHServer.OKGREEN, SSHServer.ENDC)
nText = 'Enjoy your accelerated Internet by CyberPanel'
self.websocket.sendMessage(self.shell.recv(9000).decode("utf-8").replace(nText, text))
self.color = 1
if self.websocket.running:
if os.path.exists(self.websocket.verifyPath):
if self.websocket.filePassword == self.websocket.password:
if self.shell.recv_ready():
if self.color == 0:
text = '%sEnjoy your accelerated Internet by CyberPanel and LiteSpeed%s' % (SSHServer.OKGREEN, SSHServer.ENDC)
nText = 'Enjoy your accelerated Internet by CyberPanel'
self.websocket.sendMessage(self.shell.recv(9000).decode("utf-8").replace(nText, text))
self.color = 1
else:
self.websocket.sendMessage(self.shell.recv(9000).decode("utf-8"))
else:
self.websocket.sendMessage(self.shell.recv(9000).decode("utf-8"))
else:
time.sleep(0.01)
time.sleep(0.01)
else:
return 0
except BaseException, msg:
time.sleep(0.1)

Expand All @@ -84,19 +87,21 @@ def handleMessage(self):
self.filePassword = open(self.verifyPath, 'r').read()
else:
if os.path.exists(self.verifyPath):
if self.filePassword == self.filePassword:
if self.filePassword == self.password:
self.shell.send(str(data['data']))
except:
pass

def handleConnected(self):
self.running = 1
self.sh = SSHServer(self)
self.shell = self.sh.shell
self.sh.start()

def handleClose(self):
try:
os.remove(self.verifyPath)
self.running = 0
except:
pass

Expand Down
3 changes: 3 additions & 0 deletions plogical/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -2011,6 +2011,9 @@ def upgrade():
except:
pass

command = 'csf -uf'
Upgrade.executioner(command, 'fix csf if there', 0)

Upgrade.stdOut("Upgrade Completed.")


Expand Down

0 comments on commit 66c16a7

Please sign in to comment.