From 8ad564d549cf80c3826e31e9cef424b6a0b66246 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 16 Apr 2020 19:00:25 +0500 Subject: [PATCH 1/7] ftp fix --- install/installCyberPanel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index 4cbfc2c9e..e49db88db 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -452,10 +452,10 @@ class InstallCyberPanel: command = 'wget http://mirrors.kernel.org/ubuntu/pool/universe/p/pure-ftpd/pure-ftpd-mysql_1.0.47-3build1_amd64.deb' install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - command = 'dpkg --install --force-confold pure-ftpd-common_1.0.47-3_all.deb' + command = 'dpkg --install --force-confold pure-ftpd-common_1.0.47-3build1_all.deb' install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - command = 'dpkg --install --force-confold pure-ftpd-mysql_1.0.47-3_amd64.deb' + command = 'dpkg --install --force-confold pure-ftpd-mysql_1.0.47-3build1_amd64.deb' install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) command = 'systemctl restart pure-ftpd-mysql.service' From aa15d710d5d0c873356a5a871f13d24ec2fa8fdb Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 16 Apr 2020 20:35:37 +0500 Subject: [PATCH 2/7] ftp fix --- install/installCyberPanel.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index 413513217..c955cc92e 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -449,13 +449,13 @@ class InstallCyberPanel: command = 'wget https://ubuntu.cyberpanel.net/pool/main/p/pure-ftpd/pure-ftpd-common_1.0.47-3_all.deb' install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - command = 'wget https://ubuntu.cyberpanel.net/pool/main/p/pure-ftpd/pure-ftpd-common_1.0.47-3_all.deb' + command = 'wget https://ubuntu.cyberpanel.net/pool/main/p/pure-ftpd/pure-ftpd-mysql_1.0.47-3_amd64.deb' install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - command = 'dpkg --install --force-confold pure-ftpd-common_1.0.47-3build1_all.deb' + command = 'dpkg --install --force-confold pure-ftpd-common_1.0.47-3_all.deb' install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - command = 'dpkg --install --force-confold pure-ftpd-mysql_1.0.47-3build1_amd64.deb' + command = 'dpkg --install --force-confold pure-ftpd-mysql_1.0.47-3_amd64.deb' install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) command = 'systemctl restart pure-ftpd-mysql.service' From 975f8c33824898f3b59f89983cbab77e31174634 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 16 Apr 2020 21:41:11 +0500 Subject: [PATCH 3/7] ftp fix --- install/installCyberPanel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index c955cc92e..c8305cf6c 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -428,7 +428,7 @@ class InstallCyberPanel: writeDataToFile.close() if self.distro == ubuntu: - command = 'apt install pure-ftpd-mysql -y' + command = 'apt install pure-ftpd-mysql libmariadb3 -y' install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) if os.path.exists('/etc/pure-ftpd/db/mysql.conf'): From 8fd2e73d5f82ce11fb562605ed570ebe7d37dbb1 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 17 Apr 2020 07:33:59 +0500 Subject: [PATCH 4/7] bug fix: ftp --- install/install.py | 2 +- install/installCyberPanel.py | 24 +++++++++++------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/install/install.py b/install/install.py index cf6663b32..724897789 100755 --- a/install/install.py +++ b/install/install.py @@ -190,7 +190,7 @@ class preFlightsChecks: @staticmethod def pureFTPDServiceName(distro): if distro == ubuntu: - return 'pure-ftpd' + return 'pure-ftpd-mysql' return 'pure-ftpd' @staticmethod diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index c8305cf6c..ee9cce381 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -348,11 +348,11 @@ class InstallCyberPanel: def installPureFTPD(self): if self.distro == ubuntu: - command = 'apt-get -y install ' + install.preFlightsChecks.pureFTPDServiceName(self.distro) + command = 'DEBIAN_FRONTEND=noninteractive apt install pure-ftpd-mysql -y' + os.system(command) else: command = "yum install -y pure-ftpd" - - install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) ####### Install pureftpd to system startup @@ -428,8 +428,6 @@ class InstallCyberPanel: writeDataToFile.close() if self.distro == ubuntu: - command = 'apt install pure-ftpd-mysql libmariadb3 -y' - install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) if os.path.exists('/etc/pure-ftpd/db/mysql.conf'): os.remove('/etc/pure-ftpd/db/mysql.conf') @@ -446,16 +444,16 @@ class InstallCyberPanel: command = 'echo "40110 40210" > /etc/pure-ftpd/conf/PassivePortRange' subprocess.call(command, shell=True) - command = 'wget https://ubuntu.cyberpanel.net/pool/main/p/pure-ftpd/pure-ftpd-common_1.0.47-3_all.deb' + command = 'echo "no" > /etc/pure-ftpd/conf/UnixAuthentication' + subprocess.call(command, shell=True) + + command = 'echo "/etc/pure-ftpd/db/mysql.conf" > /etc/pure-ftpd/conf/MySQLConfigFile' + subprocess.call(command, shell=True) + + command = 'ln -s /etc/pure-ftpd/conf/MySQLConfigFile /etc/pure-ftpd/auth/30mysql' install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - command = 'wget https://ubuntu.cyberpanel.net/pool/main/p/pure-ftpd/pure-ftpd-mysql_1.0.47-3_amd64.deb' - install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - - command = 'dpkg --install --force-confold pure-ftpd-common_1.0.47-3_all.deb' - install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - - command = 'dpkg --install --force-confold pure-ftpd-mysql_1.0.47-3_amd64.deb' + command = 'ln -s /etc/pure-ftpd/conf/UnixAuthentication /etc/pure-ftpd/auth/65unix' install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) command = 'systemctl restart pure-ftpd-mysql.service' From a94c567bcfda0be42992292b3269f9f3f3cc1e35 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 17 Apr 2020 23:10:08 +0500 Subject: [PATCH 5/7] swtich pure-ftpd to 1.0.47-3 --- install/installCyberPanel.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index ee9cce381..5a63e856a 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -350,6 +350,19 @@ class InstallCyberPanel: if self.distro == ubuntu: command = 'DEBIAN_FRONTEND=noninteractive apt install pure-ftpd-mysql -y' os.system(command) + + command = 'wget https://ubuntu.cyberpanel.net/pool/main/p/pure-ftpd/pure-ftpd-common_1.0.47-3_all.deb' + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + + command = 'wget https://ubuntu.cyberpanel.net/pool/main/p/pure-ftpd/pure-ftpd-mysql_1.0.47-3_amd64.deb' + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + + command = 'dpkg --install --force-confold pure-ftpd-common_1.0.47-3_all.deb' + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + + command = 'dpkg --install --force-confold pure-ftpd-mysql_1.0.47-3_amd64.deb' + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + else: command = "yum install -y pure-ftpd" install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) From 32598e6865280fd62d5f7509496670ecc73e45af Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sat, 25 Apr 2020 14:18:23 +0500 Subject: [PATCH 6/7] update to cdn url --- install/installCyberPanel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index 5a63e856a..b7b5e2058 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -351,10 +351,10 @@ class InstallCyberPanel: command = 'DEBIAN_FRONTEND=noninteractive apt install pure-ftpd-mysql -y' os.system(command) - command = 'wget https://ubuntu.cyberpanel.net/pool/main/p/pure-ftpd/pure-ftpd-common_1.0.47-3_all.deb' + command = 'wget https://rep.cyberpanel.net/pure-ftpd-common_1.0.47-3_all.deb' install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - command = 'wget https://ubuntu.cyberpanel.net/pool/main/p/pure-ftpd/pure-ftpd-mysql_1.0.47-3_amd64.deb' + command = 'wget https://rep.cyberpanel.net/pure-ftpd-mysql_1.0.47-3_amd64.deb' install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) command = 'dpkg --install --force-confold pure-ftpd-common_1.0.47-3_all.deb' From 577e1425cf2bc653a9034f63eca2bc0aff5fc9bc Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 28 Apr 2020 04:37:21 +0500 Subject: [PATCH 7/7] bug fix: permissions issue in file manager --- filemanager/filemanager.py | 6 +++--- plogical/remoteTransferUtilities.py | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/filemanager/filemanager.py b/filemanager/filemanager.py index 32b9aad41..5a8b1c2c7 100755 --- a/filemanager/filemanager.py +++ b/filemanager/filemanager.py @@ -386,10 +386,10 @@ class FileManager: domainName = self.data['domainName'] website = Websites.objects.get(domain=domainName) - command = 'chown %s:%s %s' % (website.externalApp, website.externalApp, self.data['completePath'] + '/' + myfile.name) + command = 'chown %s:%s %s' % (website.externalApp, website.externalApp, self.returnPathEnclosed(self.data['completePath'] + '/' + myfile.name)) ProcessUtilities.executioner(command) - self.changeOwner(self.data['completePath'] + '/' + myfile.name) + self.changeOwner(self.returnPathEnclosed(self.data['completePath'] + '/' + myfile.name)) json_data = json.dumps(finalData) return HttpResponse(json_data) @@ -421,7 +421,7 @@ class FileManager: ProcessUtilities.executioner(command, website.externalApp) - self.changeOwner(self.data['extractionLocation']) + self.fixPermissions(domainName) json_data = json.dumps(finalData) return HttpResponse(json_data) diff --git a/plogical/remoteTransferUtilities.py b/plogical/remoteTransferUtilities.py index 5df7b9b91..76a1ef5c0 100755 --- a/plogical/remoteTransferUtilities.py +++ b/plogical/remoteTransferUtilities.py @@ -193,6 +193,9 @@ class remoteTransferUtilities: command = "sudo scp -o StrictHostKeyChecking=no -i /root/.ssh/cyberpanel " + completedPathToSend + " root@" + IPAddress + ":/home/backup/transfer-" + folderNumber + "/" subprocess.call(shlex.split(command), stdout=writeToFile) + if os.path.exists(ProcessUtilities.debugPath): + logging.CyberCPLogFileWriter.writeToFile(command) + os.remove(completedPathToSend) except BaseException as msg: