Skip to content

Commit

Permalink
bug fix: remote transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Aug 27, 2019
1 parent f5aaabf commit b248133
Show file tree
Hide file tree
Showing 21 changed files with 73 additions and 69 deletions.
2 changes: 1 addition & 1 deletion CLManager/CLManagerMain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
12 changes: 6 additions & 6 deletions backup/backupManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion cloudAPI/cloudManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion containerization/containerManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion databases/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion dockerManager/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions emailPremium/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand All @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
20 changes: 10 additions & 10 deletions firewall/firewallManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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"

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand All @@ -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)

Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions mailServer/mailserverManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions managePHP/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions manageSSL/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions plogical/backupUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion plogical/processUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Loading

0 comments on commit b248133

Please sign in to comment.