Skip to content

Commit

Permalink
correct function name
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Jan 22, 2024
1 parent 0758d88 commit 7613310
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
17 changes: 5 additions & 12 deletions cloudAPI/cloudManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,18 +345,11 @@ def statusFunc(self):
try:
statusFile = self.data['statusFile']

if not statusFile.startswith('/home/cyberpanel'):
data_ret = {'status': 0, 'abort': 0, 'installationProgress': "0", }
json_data = json.dumps(data_ret)
return HttpResponse(json_data)

TemFilePath = statusFile.split('panel/')[1]

try:
value = int(TemFilePath)
print(value)
except:
data_ret = {'status': 0, 'abort': 0, 'installationProgress': "0", }
if ACLManager.CheckStatusFilleLoc(statusFile):
pass
else:
data_ret = {'abort': 1, 'installStatus': 0, 'installationProgress': "100",
'currentStatus': 'Invalid status file.'}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)

Expand Down
8 changes: 8 additions & 0 deletions plogical/acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,14 @@ def CheckDomainBlackList(domain):

@staticmethod
def CheckStatusFilleLoc(statusFile):
TemFilePath = statusFile.split('panel/')[1]

try:
value = int(TemFilePath)
print(value)
except:
return 0

if (statusFile[:18] != "/home/cyberpanel/." or statusFile[:16] == "/home/cyberpanel" or statusFile[
:4] == '/tmp' or statusFile[
:18] == '/usr/local/CyberCP') \
Expand Down
12 changes: 12 additions & 0 deletions plogical/mailUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,10 @@ def setupDKIM(virtualHostName):
keyTable = "/etc/opendkim/KeyTable"
configToWrite = "default._domainkey." + actualDomain + " " + actualDomain + ":default:/etc/opendkim/keys/" + virtualHostName + "/default.private\n"

writeToFile = open(keyTable, 'a')
writeToFile.write("##### CyberPanel Generated File - Do not edit if you don't know what you are doing.")
writeToFile.close()

data = open(keyTable, 'r').read()

if data.find("default._domainkey." + actualDomain) == -1:
Expand All @@ -369,6 +373,10 @@ def setupDKIM(virtualHostName):
signingTable = "/etc/opendkim/SigningTable"
configToWrite = "*@" + actualDomain + " default._domainkey." + actualDomain + "\n"

writeToFile = open(signingTable, 'a')
writeToFile.write("##### CyberPanel Generated File - Do not edit if you don't know what you are doing.")
writeToFile.close()

data = open(signingTable, 'r').read()

if data.find("default._domainkey." + actualDomain) == -1:
Expand All @@ -382,6 +390,10 @@ def setupDKIM(virtualHostName):
trustedHosts = "/etc/opendkim/TrustedHosts"
configToWrite = actualDomain + "\n"

writeToFile = open(trustedHosts, 'a')
writeToFile.write("##### CyberPanel Generated File - Do not edit if you don't know what you are doing.")
writeToFile.close()

data = open(trustedHosts, 'r').read()

if data.find(actualDomain) == -1:
Expand Down

0 comments on commit 7613310

Please sign in to comment.