Skip to content

Commit 66c16a7

Browse files
committed
fix csf menu while upgrade
1 parent e4a375f commit 66c16a7

File tree

4 files changed

+25
-16
lines changed

4 files changed

+25
-16
lines changed

CyberCP/secMiddleware.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,10 @@ def __call__(self, request):
9595

9696

9797
response = self.get_response(request)
98-
98+
99+
#response['Strict-Transport-Security'] = "max-age=31536000; includeSubDomains; preload"
99100
response['X-XSS-Protection'] = "1; mode=block"
100-
response['Strict-Transport-Security'] = "max-age=31536000; includeSubDomains; preload"
101-
response['X-Frame-Options'] = "DENY"
101+
response['X-Frame-Options'] = "sameorigin"
102+
response['Content-Security-Policy'] = "frame-ancestors jsdelivr.com"
102103

103104
return response

IncBackups/templates/IncBackups/restoreRemoteBackups.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<div class="container">
1212
<div id="page-title">
1313
<h2>{% trans "Restore Remote Incremental Backups" %} - <a target="_blank"
14-
href="https://cyberpanel.net/docs/2-create-restore-incremental-backups/"
14+
href="https://cyberpanel.net/docs/3-restore-backups-from-remote-destination/"
1515
style="height: 23px;line-height: 21px;"
1616
class="btn btn-border btn-alt border-red btn-link font-red"
1717
title=""><span>{% trans "Backup Docs" %}</span></a>

WebTerminal/CPWebSocket.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,21 @@ def __init__(self, websocket):
5151
def recvData(self):
5252
while True:
5353
try:
54-
if os.path.exists(self.websocket.verifyPath):
55-
if self.websocket.filePassword == self.websocket.filePassword:
56-
if self.shell.recv_ready():
57-
if self.color == 0:
58-
text = '%sEnjoy your accelerated Internet by CyberPanel and LiteSpeed%s' % (SSHServer.OKGREEN, SSHServer.ENDC)
59-
nText = 'Enjoy your accelerated Internet by CyberPanel'
60-
self.websocket.sendMessage(self.shell.recv(9000).decode("utf-8").replace(nText, text))
61-
self.color = 1
54+
if self.websocket.running:
55+
if os.path.exists(self.websocket.verifyPath):
56+
if self.websocket.filePassword == self.websocket.password:
57+
if self.shell.recv_ready():
58+
if self.color == 0:
59+
text = '%sEnjoy your accelerated Internet by CyberPanel and LiteSpeed%s' % (SSHServer.OKGREEN, SSHServer.ENDC)
60+
nText = 'Enjoy your accelerated Internet by CyberPanel'
61+
self.websocket.sendMessage(self.shell.recv(9000).decode("utf-8").replace(nText, text))
62+
self.color = 1
63+
else:
64+
self.websocket.sendMessage(self.shell.recv(9000).decode("utf-8"))
6265
else:
63-
self.websocket.sendMessage(self.shell.recv(9000).decode("utf-8"))
64-
else:
65-
time.sleep(0.01)
66+
time.sleep(0.01)
67+
else:
68+
return 0
6669
except BaseException, msg:
6770
time.sleep(0.1)
6871

@@ -84,19 +87,21 @@ def handleMessage(self):
8487
self.filePassword = open(self.verifyPath, 'r').read()
8588
else:
8689
if os.path.exists(self.verifyPath):
87-
if self.filePassword == self.filePassword:
90+
if self.filePassword == self.password:
8891
self.shell.send(str(data['data']))
8992
except:
9093
pass
9194

9295
def handleConnected(self):
96+
self.running = 1
9397
self.sh = SSHServer(self)
9498
self.shell = self.sh.shell
9599
self.sh.start()
96100

97101
def handleClose(self):
98102
try:
99103
os.remove(self.verifyPath)
104+
self.running = 0
100105
except:
101106
pass
102107

plogical/upgrade.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,6 +2011,9 @@ def upgrade():
20112011
except:
20122012
pass
20132013

2014+
command = 'csf -uf'
2015+
Upgrade.executioner(command, 'fix csf if there', 0)
2016+
20142017
Upgrade.stdOut("Upgrade Completed.")
20152018

20162019

0 commit comments

Comments
 (0)