Skip to content
Permalink
Browse files

centralized execution ph1

  • Loading branch information...
usmannasir
usmannasir committed Mar 21, 2019
1 parent b37907a commit 520bd2b7971edfbfc95b1794b5cf7723fab5eaba
Showing with 813 additions and 679 deletions.
  1. +13 −39 api/views.py
  2. +70 −74 backup/backupManager.py
  3. +2 −1 baseTemplate/views.py
  4. +2 −2 cli/cliLogger.py
  5. +8 −6 cloudAPI/cloudManager.py
  6. +5 −5 containerization/views.py
  7. +2 −1 databases/databaseManager.py
  8. +1 −1 dockerManager/container.py
  9. +2 −1 emailMarketing/emailMarketing.py
  10. +7 −7 emailPremium/views.py
  11. +3 −3 filemanager/filemanager.py
  12. +2 −2 filemanager/views.py
  13. +44 −44 firewall/firewallManager.py
  14. +1 −1 ftp/ftpManager.py
  15. +4 −4 highAvailability/haManager.py
  16. +1 −2 install/composer.sh
  17. +1 −1 install/firewallUtilities.py
  18. +294 −163 install/install.py
  19. +5 −5 install/installCyberPanel.py
  20. +3 −3 install/mysqlUtilities.py
  21. +1 −1 install/test.py
  22. +6 −6 install/unInstall.py
  23. +0 −24 loginSystem/views.py
  24. +7 −7 mailServer/mailserverManager.py
  25. +5 −5 managePHP/views.py
  26. +3 −3 manageSSL/views.py
  27. +1 −1 manageServices/serviceManager.py
  28. +10 −10 manageServices/views.py
  29. +1 −1 plogical/CyberCPLogFileWriter.py
  30. +41 −41 plogical/applicationInstaller.py
  31. +2 −2 plogical/backupSchedule.py
  32. +12 −12 plogical/backupUtilities.py
  33. +7 −6 plogical/csf.py
  34. +1 −1 plogical/dnsUtilities.py
  35. +1 −1 plogical/findBWUsage.py
  36. +1 −1 plogical/firewallUtilities.py
  37. +4 −4 plogical/ftpUtilities.py
  38. +12 −12 plogical/installUtilities.py
  39. +32 −32 plogical/mailUtilities.py
  40. +8 −8 plogical/modSec.py
  41. +4 −4 plogical/mysqlUtilities.py
  42. +2 −2 plogical/phpUtilities.py
  43. +22 −14 plogical/processUtilities.py
  44. +1 −1 plogical/remoteBackup.py
  45. +1 −1 plogical/remoteTransferUtilities.py
  46. +6 −6 plogical/sslUtilities.py
  47. +4 −4 plogical/tuning.py
  48. +2 −2 plogical/upgrade.py
  49. +44 −0 plogical/upgradeCritical.py
  50. +19 −19 plogical/vhost.py
  51. +16 −16 plogical/virtualHostUtilities.py
  52. +37 −37 plogical/website.py
  53. +10 −10 pluginInstaller/pluginInstaller.py
  54. +2 −2 serverLogs/views.py
  55. +4 −4 serverStatus/serverStatusUtil.py
  56. +12 −12 serverStatus/views.py
  57. +2 −2 tuning/tuning.py
@@ -21,6 +21,7 @@
from firewall.models import FirewallRules
from s3Backups.s3Backups import S3Backups
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
from plogical.processUtilities import ProcessUtilities
# Create your views here.


@@ -120,8 +121,6 @@ def changeUserPassAPI(request):
websiteOwn.password = hashPassword.hash_password(ownerPassword)
websiteOwn.save()



data_ret = {'changeStatus': 1, 'error_message': "None"}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
@@ -260,7 +259,7 @@ def fetchSSHkey(request):

pubKey = os.path.join("/root",".ssh",'cyberpanel.pub')
execPath = "sudo cat " + pubKey
data = subprocess.check_output(shlex.split(execPath))
data = ProcessUtilities.outputExecutioner(execPath)

data_ret = {
'status': 1,
@@ -313,7 +312,7 @@ def remoteTransfer(request):

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/remoteTransferUtilities.py"
execPath = execPath + " remoteTransfer --ipAddress " + ipAddress + " --dir " + dir + " --accountsToTransfer " + path
subprocess.Popen(shlex.split(execPath))
ProcessUtilities.popenExecutioner(execPath)

return HttpResponse(json.dumps({"transferStatus": 1, "dir": dir}))

@@ -381,8 +380,8 @@ def FetchRemoteTransferStatus(request):
dir = "/home/backup/transfer-"+str(data['dir'])+"/backup_log"

try:
command = "sudo cat "+ dir
status = subprocess.check_output(shlex.split(command))
execPath = "sudo cat "+ dir
status = ProcessUtilities.outputExecutioner(execPath)

admin = Administrator.objects.get(userName=username)
if hashPassword.check_password(admin.password, password):
@@ -418,14 +417,14 @@ def cancelRemoteTransfer(request):

path = dir + "/pid"

command = "sudo cat " + path
pid = subprocess.check_output(shlex.split(command))
execPath = "sudo cat " + path
pid = ProcessUtilities.outputExecutioner(execPath)

command = "sudo kill -KILL " + pid
subprocess.call(shlex.split(command))
execPath = "sudo kill -KILL " + pid
ProcessUtilities.executioner(execPath)

command = "sudo rm -rf " + dir
subprocess.call(shlex.split(command))
execPath = "sudo rm -rf " + dir
ProcessUtilities.executioner(execPath)

data = {'cancelStatus': 1, 'error_message': "None"}
json_data = json.dumps(data)
@@ -525,9 +524,8 @@ def putSSHkey(request):

##

command = "sudo chmod g-w /home/cyberpanel"
cmd = shlex.split(command)
res = subprocess.call(cmd)
execPath = "sudo chmod g-w /home/cyberpanel"
ProcessUtilities.executioner(execPath)

os.chmod(keyPath,0700)
os.chmod(authorized_keys, 0600)
@@ -590,30 +588,6 @@ def changeAdminPassword(request):
newFWRule = FirewallRules(name="ftp", proto="tcp", port="21")
newFWRule.save()

newFWRule = FirewallRules(name="smtp", proto="tcp", port="25")
newFWRule.save()

newFWRule = FirewallRules(name="smtps", proto="tcp", port="587")
newFWRule.save()

newFWRule = FirewallRules(name="ssmtp", proto="tcp", port="465")
newFWRule.save()

newFWRule = FirewallRules(name="pop3", proto="tcp", port="110")
newFWRule.save()

newFWRule = FirewallRules(name="imap", proto="tcp", port="143")
newFWRule.save()

newFWRule = FirewallRules(name="simap", proto="tcp", port="993")
newFWRule.save()

newFWRule = FirewallRules(name="dns", proto="udp", port="53")
newFWRule.save()

newFWRule = FirewallRules(name="dnstcp", proto="tcp", port="53")
newFWRule.save()

newFWRule = FirewallRules(name="ftptls", proto="tcp", port="40110-40210")
newFWRule.save()

Oops, something went wrong.

0 comments on commit 520bd2b

Please sign in to comment.
You can’t perform that action at this time.