Skip to content
Permalink
Browse files

bug fix: remote transfer

  • Loading branch information...
usmannasir committed Aug 27, 2019
1 parent f5aaabf commit b2481335b8fa37218e838a4b07f330444f391a0b
@@ -73,7 +73,7 @@ def submitCageFSInstall(self):
1)
return 0

execPath = "sudo python /usr/local/CyberCP/CLManager/CageFS.py"
execPath = "/usr/local/CyberCP/bin/python2 /usr/local/CyberCP/CLManager/CageFS.py"
execPath = execPath + " --function submitCageFSInstall"
ProcessUtilities.outputExecutioner(execPath)

@@ -379,7 +379,7 @@ def remoteTransfer(request):

## Accounts to transfer is a path to file, containing accounts.

execPath = "python " + virtualHostUtilities.cyberPanel + "/plogical/remoteTransferUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/remoteTransferUtilities.py"
execPath = execPath + " remoteTransfer --ipAddress " + ipAddress + " --dir " + dir + " --accountsToTransfer " + path
ProcessUtilities.popenExecutioner(execPath)

@@ -249,7 +249,7 @@ def cancelBackupCreation(self, userID = None, data = None):
backupCancellationDomain = data['backupCancellationDomain']
fileName = data['fileName']

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/backupUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/backupUtilities.py"
execPath = execPath + " cancelBackupCreation --backupCancellationDomain " + backupCancellationDomain + " --fileName " + fileName
subprocess.call(shlex.split(execPath))

@@ -310,7 +310,7 @@ def submitRestore(self, data = None, userID = None):
else:
return ACLManager.loadErrorJson()

execPath = "sudo nice -n 10 python " + virtualHostUtilities.cyberPanel + "/plogical/backupUtilities.py"
execPath = "sudo nice -n 10 /usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/backupUtilities.py"
execPath = execPath + " submitRestore --backupFile " + backupFile + " --dir " + dir
ProcessUtilities.popenExecutioner(execPath)
time.sleep(4)
@@ -424,7 +424,7 @@ def submitDestinationCreation(self, userID = None, data = None):
except:
port = "22"

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/backupUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/backupUtilities.py"
execPath = execPath + " submitDestinationCreation --ipAddress " + ipAddress + " --password " \
+ password + " --port " + port

@@ -503,7 +503,7 @@ def getConnectionStatus(self, userID = None, data = None):

ipAddress = data['IPAddress']

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/backupUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/backupUtilities.py"
execPath = execPath + " getConnectionStatus --ipAddress " + ipAddress

output = ProcessUtilities.executioner(execPath)
@@ -891,7 +891,7 @@ def submitRemoteBackups(self, userID = None, data = None):

##

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/remoteTransferUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/remoteTransferUtilities.py"
execPath = execPath + " writeAuthKey --pathToKey " + pathToKey
output = ProcessUtilities.outputExecutioner(execPath)

@@ -1057,7 +1057,7 @@ def remoteBackupRestore(self, userID = None, data = None):

##

execPath = "python " + virtualHostUtilities.cyberPanel + "/plogical/remoteTransferUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/remoteTransferUtilities.py"
execPath = execPath + " remoteBackupRestore --backupDirComplete " + backupDirComplete + " --backupDir " + str(
backupDir)

@@ -128,7 +128,7 @@ def fetchWebsiteData(self):
## bw usage calculation

try:
execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"
execPath = execPath + " findDomainBW --virtualHostName " + self.data[
'domainName'] + " --bandwidth " + str(
website.package.bandwidth)
@@ -124,7 +124,7 @@ def submitContainerInstall(self):
1)
return 0

execPath = "sudo python /usr/local/CyberCP/containerization/container.py"
execPath = "/usr/local/CyberCP/bin/python2 /usr/local/CyberCP/containerization/container.py"
execPath = execPath + " --function submitContainerInstall"
ProcessUtilities.outputExecutioner(execPath)

@@ -134,7 +134,7 @@ def setupPHPMYAdminSession(request):
userID = request.session['userID']
admin = Administrator.objects.get(id = userID)

execPath = "sudo python /usr/local/CyberCP/databases/databaseManager.py"
execPath = "/usr/local/CyberCP/bin/python2 /usr/local/CyberCP/databases/databaseManager.py"
execPath = execPath + " generatePHPMYAdminData --userID " + str(userID)

output = ProcessUtilities.outputExecutioner(execPath)
@@ -82,7 +82,7 @@ def submitInstallDocker(self):
writeToFile = open(ServerStatusUtil.lswsInstallStatusPath, 'w')
writeToFile.close()

execPath = "sudo python /usr/local/CyberCP/dockerManager/dockerInstall.py"
execPath = "/usr/local/CyberCP/bin/python2 /usr/local/CyberCP/dockerManager/dockerInstall.py"
ProcessUtilities.executioner(execPath)

time.sleep(2)
@@ -101,7 +101,7 @@ def savePolicyServerStatus(request):

## save configuration data

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/mailUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/mailUtilities.py"
execPath = execPath + " savePolicyServerStatus --install " + install
output = ProcessUtilities.outputExecutioner(execPath)

@@ -784,7 +784,7 @@ def installSpamAssassin(request):
return ACLManager.loadErrorJson()
try:

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/mailUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/mailUtilities.py"
execPath = execPath + " installSpamAssassin"
ProcessUtilities.popenExecutioner(execPath)

@@ -810,7 +810,7 @@ def installStatusSpamAssassin(request):

if installStatus.find("[200]")>-1:

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/mailUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/mailUtilities.py"
execPath = execPath + " configureSpamAssassin"
output = ProcessUtilities.outputExecutioner(execPath)

@@ -981,7 +981,7 @@ def saveSpamAssassinConfigurations(request):

## save configuration data

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/mailUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/mailUtilities.py"
execPath = execPath + " saveSpamAssassinConfigs --tempConfigPath " + tempConfigPath
output = ProcessUtilities.outputExecutioner(execPath)

@@ -371,7 +371,7 @@ def saveSSHConfigs(self, userID = None, data = None):
else:
rootLogin = "0"

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/firewallUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/firewallUtilities.py"
execPath = execPath + " saveSSHConfigs --type " + str(type) + " --sshPort " + sshPort + " --rootLogin " + rootLogin

output = ProcessUtilities.outputExecutioner(execPath)
@@ -418,7 +418,7 @@ def deleteSSHKey(self, userID = None, data = None):

key = data['key']

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/firewallUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/firewallUtilities.py"
execPath = execPath + " deleteSSHKey --key '" + key + "'"

output = ProcessUtilities.outputExecutioner(execPath)
@@ -512,7 +512,7 @@ def installModSec(self, userID = None, data = None):
else:
return ACLManager.loadErrorJson('installModSec', 0)

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/modSec.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/modSec.py"
execPath = execPath + " installModSec"

ProcessUtilities.popenExecutioner(execPath)
@@ -535,7 +535,7 @@ def installStatusModSec(self, userID = None, data = None):

if installStatus.find("[200]") > -1:

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/modSec.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/modSec.py"

execPath = execPath + " installModSecConfigs"

@@ -781,7 +781,7 @@ def saveModSecConfigurations(self, userID = None, data = None):

## save configuration data

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/modSec.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/modSec.py"

execPath = execPath + " saveModSecConfigs --tempConfigPath " + tempConfigPath

@@ -836,7 +836,7 @@ def saveModSecConfigurations(self, userID = None, data = None):

## save configuration data

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/modSec.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/modSec.py"

execPath = execPath + " saveModSecConfigs --tempConfigPath " + tempConfigPath

@@ -962,7 +962,7 @@ def saveModSecRules(self, userID = None, data = None):

## save configuration data

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/modSec.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/modSec.py"
execPath = execPath + " saveModSecRules"
output = ProcessUtilities.outputExecutioner(execPath)

@@ -1107,7 +1107,7 @@ def installModSecRulesPack(self, userID = None, data = None):

if ProcessUtilities.decideServer() == ProcessUtilities.OLS:

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/modSec.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/modSec.py"
execPath = execPath + " " + packName

output = ProcessUtilities.outputExecutioner(execPath)
@@ -1125,7 +1125,7 @@ def installModSecRulesPack(self, userID = None, data = None):
final_json = json.dumps({'installStatus': 0, 'error_message': "OWASP will be available later.", })
return HttpResponse(final_json)

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/modSec.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/modSec.py"
execPath = execPath + " " + packName
output = ProcessUtilities.outputExecutioner(execPath)

@@ -1265,7 +1265,7 @@ def enableDisableRuleFile(self, userID = None, data = None):
else:
functionName = 'enableRuleFile'

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/modSec.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/modSec.py"

execPath = execPath + " " + functionName + ' --packName ' + packName + ' --fileName ' + fileName

@@ -566,7 +566,7 @@ def generateDKIMKeys(self):
else:
return ACLManager.loadErrorJson()

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/mailUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/mailUtilities.py"
execPath = execPath + " generateKeys --domain " + domainName
output = ProcessUtilities.outputExecutioner(execPath)

@@ -636,7 +636,7 @@ def installStatusOpenDKIM(self):

if installStatus.find("[200]") > -1:

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/mailUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/mailUtilities.py"
execPath = execPath + " configureOpenDKIM"

output = ProcessUtilities.outputExecutioner(execPath)
@@ -1275,10 +1275,10 @@ def submitExtensionRequest(request):
type = data['type']

if type == "install":
execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/phpUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/phpUtilities.py"
execPath = execPath + " installPHPExtension --extension " + extensionName
else:
execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/phpUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/phpUtilities.py"
execPath = execPath + " unInstallPHPExtension --extension " + extensionName

ProcessUtilities.popenExecutioner(execPath)
@@ -1698,7 +1698,7 @@ def savePHPConfigBasic(request):

##

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/phpUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/phpUtilities.py"
execPath = execPath + " savePHPConfigBasic --phpVers " + phpVers + " --allow_url_fopen '" + allow_url_fopen + "' --display_errors '" + display_errors + "' --file_uploads '" + file_uploads + "' --allow_url_include '" + allow_url_include + "' --memory_limit " + memory_limit + " --max_execution_time " + max_execution_time + " --upload_max_filesize " + upload_max_filesize + " --max_input_time " + max_input_time + " --post_max_size " + post_max_size

output = ProcessUtilities.outputExecutioner(execPath)
@@ -1796,7 +1796,7 @@ def savePHPConfigAdvance(request):
vhost.write(data['configData'])
vhost.close()

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/phpUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/phpUtilities.py"
execPath = execPath + " savePHPConfigAdvance --phpVers " + path + " --tempPath " + tempPath

output = ProcessUtilities.outputExecutioner(execPath)
@@ -80,7 +80,7 @@ def issueSSL(request):

## ssl issue

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"
execPath = execPath + " issueSSL --virtualHostName " + virtualHost + " --administratorEmail " + adminEmail + " --path " + path
output = ProcessUtilities.outputExecutioner(execPath)

@@ -161,7 +161,7 @@ def obtainHostNameSSL(request):

## ssl issue

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"
execPath = execPath + " issueSSLForHostName --virtualHostName " + virtualHost + " --path " + path
output = ProcessUtilities.outputExecutioner(execPath)

@@ -236,7 +236,7 @@ def obtainMailServerSSL(request):

## ssl issue

execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"
execPath = "/usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"
execPath = execPath + " issueSSLForMailServer --virtualHostName " + virtualHost + " --path " + path
output = ProcessUtilities.outputExecutioner(execPath)

@@ -1064,7 +1064,7 @@ def submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain):
command = 'chown %s:%s %s' % (website.externalApp, website.externalApp, status)
ProcessUtilities.executioner(command)

execPath = "sudo nice -n 10 python " + virtualHostUtilities.cyberPanel + "/plogical/backupUtilities.py"
execPath = "sudo nice -n 10 /usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/backupUtilities.py"
execPath = execPath + " startBackup --tempStoragePath " + tempStoragePath + " --backupName " \
+ backupName + " --backupPath " + backupPath + ' --backupDomain ' + backupDomain + ' --metaPath %s' % (result[2])

@@ -1093,7 +1093,7 @@ def submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain):

output = ProcessUtilities.outputExecutioner(execPath, website.externalApp)
if output.find('1,None') > -1:
execPath = "sudo nice -n 10 python " + virtualHostUtilities.cyberPanel + "/plogical/backupUtilities.py"
execPath = "sudo nice -n 10 /usr/local/CyberCP/bin/python2 " + virtualHostUtilities.cyberPanel + "/plogical/backupUtilities.py"
execPath = execPath + " BackupRoot --tempStoragePath " + tempStoragePath + " --backupName " \
+ backupName + " --backupPath " + backupPath + ' --backupDomain ' + backupDomain + ' --metaPath %s' % (
result[2])
@@ -272,7 +272,7 @@ def popenExecutioner(command, user=None):

@staticmethod
def BuildCommand(path, functionName, parameters):
execPath = "python %s %s " % (path, functionName)
execPath = "/usr/local/CyberCP/bin/python2 %s %s " % (path, functionName)
for key, value in parameters.iteritems():
execPath = execPath + ' --%s %s' % (key, value)

0 comments on commit b248133

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