From 765eaedf56f34ec08d4171577de87ece7522ebff Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Mon, 6 Apr 2020 19:16:49 +0500 Subject: [PATCH 01/13] change permission for backup file --- plogical/backupUtilities.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plogical/backupUtilities.py b/plogical/backupUtilities.py index 6ee5b2583..08621d459 100755 --- a/plogical/backupUtilities.py +++ b/plogical/backupUtilities.py @@ -482,6 +482,9 @@ class backupUtilities: 1024.0 * 1024.0))) + "MB" items.save() + command = 'chmod 600 %s' % (os.path.join(backupPath,backupName+".tar.gz")) + ProcessUtilities.executioner(command) + logging.CyberCPLogFileWriter.statusWriter(status, "Completed\n") os.remove(pidFile) From 104bc44b17aba2966d89ee50e40ed3bd8434d807 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 8 Apr 2020 23:41:05 +0500 Subject: [PATCH 02/13] bug fix: permissions --- filemanager/filemanager.py | 17 +- plogical/applicationInstaller.py | 300 ++----------------------------- 2 files changed, 30 insertions(+), 287 deletions(-) diff --git a/filemanager/filemanager.py b/filemanager/filemanager.py index fd4d2fbb8..ef5ea7139 100755 --- a/filemanager/filemanager.py +++ b/filemanager/filemanager.py @@ -518,8 +518,21 @@ class FileManager: command = "find %s -type f -exec chmod 0644 {} \;" % ("/home/" + domainName + "/public_html") ProcessUtilities.popenExecutioner(command) - command = 'chown %s:%s /home/%s/public_html' % (externalApp,groupName, domainName) + command = 'chown %s:%s /home/%s/public_html' % (externalApp, groupName, domainName) ProcessUtilities.executioner(command) command = 'chmod 750 /home/%s/public_html' % (domainName) - ProcessUtilities.executioner(command) \ No newline at end of file + ProcessUtilities.executioner(command) + + for childs in website.childdomains_set.all(): + command = 'chown -R %s:%s %s/*' % (externalApp, externalApp, childs.path) + ProcessUtilities.popenExecutioner(command) + + command = 'chown -R %s:%s %s/.[^.]*' % (externalApp, externalApp, childs.path) + ProcessUtilities.popenExecutioner(command) + + command = 'chmod 750 %s' % (childs.path) + ProcessUtilities.popenExecutioner(command) + + command = 'chmod %s:%s %s' % (externalApp, groupName, childs.path) + ProcessUtilities.popenExecutioner(command) \ No newline at end of file diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index a48eb85b8..3e817d665 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -248,6 +248,7 @@ class ApplicationInstaller(multi.Thread): try: website = ChildDomains.objects.get(domain=domainName) externalApp = website.master.externalApp + self.masterDomain = website.master.domain if home == '0': path = self.extraArgs['path'] @@ -270,6 +271,7 @@ class ApplicationInstaller(multi.Thread): except: website = Websites.objects.get(domain=domainName) externalApp = website.externalApp + self.masterDomain = website.domain if home == '0': path = self.extraArgs['path'] @@ -351,17 +353,10 @@ class ApplicationInstaller(multi.Thread): ## - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: - groupName = 'nobody' - else: - groupName = 'nogroup' + from filemanager.filemanager import FileManager - if home != '0': - command = "chown " + externalApp + ":" + groupName + " " + finalPath - ProcessUtilities.executioner(command, externalApp) - - command = 'chmod 750 %s' % (self.permPath) - ProcessUtilities.executioner(command) + fm = FileManager(None, None) + fm.fixPermissions(self.masterDomain) statusFile = open(tempStatusPath, 'w') statusFile.writelines("Successfully Installed. [200]") @@ -429,6 +424,7 @@ class ApplicationInstaller(multi.Thread): try: website = ChildDomains.objects.get(domain=domainName) externalApp = website.master.externalApp + self.masterDomain = website.master.domain if home == '0': path = self.extraArgs['path'] @@ -451,6 +447,7 @@ class ApplicationInstaller(multi.Thread): except: website = Websites.objects.get(domain=domainName) externalApp = website.externalApp + self.masterDomain = website.domain if home == '0': path = self.extraArgs['path'] @@ -533,20 +530,10 @@ class ApplicationInstaller(multi.Thread): ## - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: - groupName = 'nobody' - else: - groupName = 'nogroup' + from filemanager.filemanager import FileManager - if home == '0': - command = "chown -R " + externalApp + ":" + groupName + " " + finalPath - ProcessUtilities.executioner(command, externalApp) - - command = "rm -f prestashop_1.7.4.2.zip" - ProcessUtilities.executioner(command, externalApp) - - command = 'chmod 750 %s' % (self.permPath) - ProcessUtilities.executioner(command) + fm = FileManager(None, None) + fm.fixPermissions(self.masterDomain) statusFile = open(tempStatusPath, 'w') statusFile.writelines("Successfully Installed. [200]") @@ -583,228 +570,6 @@ class ApplicationInstaller(multi.Thread): statusFile.close() return 0 - def setupGit(self): - try: - admin = self.extraArgs['admin'] - domainName = self.extraArgs['domainName'] - username = self.extraArgs['username'] - reponame = self.extraArgs['reponame'] - branch = self.extraArgs['branch'] - tempStatusPath = self.extraArgs['tempStatusPath'] - defaultProvider = self.extraArgs['defaultProvider'] - self.tempStatusPath = tempStatusPath - - statusFile = open(tempStatusPath, 'w') - statusFile.writelines('Checking if GIT installed..,0') - statusFile.close() - - ### Check git - - try: - command = 'git --help' - output = ProcessUtilities.outputExecutioner(command) - - if output.find('command not found') > -1: - statusFile = open(tempStatusPath, 'w') - statusFile.writelines('Installing GIT..,0') - statusFile.close() - self.installGit() - statusFile = open(tempStatusPath, 'w') - statusFile.writelines('GIT successfully installed,20') - statusFile.close() - - except BaseException as msg: - statusFile = open(tempStatusPath, 'w') - statusFile.writelines('Installing GIT..,0') - statusFile.close() - self.installGit() - statusFile = open(tempStatusPath, 'w') - statusFile.writelines('GIT successfully installed.,20') - statusFile.close() - - ## Open Status File - - statusFile = open(tempStatusPath, 'w') - statusFile.writelines('Setting up directories..,20') - statusFile.close() - - try: - website = ChildDomains.objects.get(domain=domainName) - externalApp = website.master.externalApp - finalPath = website.path - - except: - website = Websites.objects.get(domain=domainName) - externalApp = website.externalApp - finalPath = "/home/" + domainName + "/public_html/" - - ## Security Check - - if finalPath.find("..") > -1: - raise BaseException('Specified path must be inside virtual host home.') - - permPath = '/home/%s/public_html' % (domainName) - command = 'chmod 755 %s' % (permPath) - ProcessUtilities.executioner(command) - - command = 'mkdir -p ' + finalPath - ProcessUtilities.executioner(command, externalApp) - - ## checking for directories/files - - if self.dataLossCheck(finalPath, tempStatusPath) == 0: - raise BaseException('Directory is not empty.') - - #### - - statusFile = open(tempStatusPath, 'w') - statusFile.writelines('Cloning the repo..,40') - statusFile.close() - - try: - command = 'git clone --depth 1 --no-single-branch git@' + defaultProvider + '.com:' + username + '/' + reponame + '.git -b ' + branch + ' ' + finalPath - output = ProcessUtilities.outputExecutioner(command, externalApp) - finalPathGit = '%s/.git' % (finalPath.rstrip('/')) - if not os.path.exists(finalPathGit): - raise BaseException(output) - except BaseException as msg: - raise BaseException('Failed to clone repository, make sure you deployed your key to repository. Error: %s' % (str(msg))) - - ## - - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: - groupName = 'nobody' - else: - groupName = 'nogroup' - - command = "chown -R " + externalApp + ":" + groupName + " " + finalPath - ProcessUtilities.executioner(command, externalApp) - - vhost.addRewriteRules(domainName) - installUtilities.reStartLiteSpeed() - - mailUtilities.checkHome() - - gitPath = '/home/cyberpanel/' + domainName + '.git' - writeToFile = open(gitPath, 'w') - writeToFile.write(username + ':' + reponame) - writeToFile.close() - - permPath = '/home/%s/public_html' % (domainName) - command = 'chmod 750 %s' % (permPath) - ProcessUtilities.executioner(command) - - statusFile = open(tempStatusPath, 'w') - statusFile.writelines("GIT Repository successfully attached. [200]") - statusFile.close() - return 0 - - - except BaseException as msg: - try: - os.remove('/home/cyberpanel/' + domainName + '.git') - except: - pass - - permPath = '/home/%s/public_html' % (domainName) - command = 'chmod 750 %s' % (permPath) - ProcessUtilities.executioner(command) - - statusFile = open(self.tempStatusPath, 'w') - statusFile.writelines(str(msg) + " [404]") - statusFile.close() - return 0 - - def gitPull(self): - try: - domain = self.extraArgs['domain'] - - try: - website = Websites.objects.get(domain=domain) - finalPath = "/home/" + domain + "/public_html/" - externalApp = website.externalApp - except: - childDomain = ChildDomains.objects.get(domain=domain) - finalPath = childDomain.path - externalApp = website.externalApp - - path = '/home/cyberpanel/' + domain + '.git' - - if not os.path.exists(path): - logging.writeToFile('Git is not setup for this website.') - return 0 - - command = 'git --git-dir=' + finalPath + '.git --work-tree=' + finalPath + ' pull' - ProcessUtilities.executioner(command, externalApp) - - ## - - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: - groupName = 'nobody' - else: - groupName = 'nogroup' - - website = Websites.objects.get(domain=domain) - externalApp = website.externalApp - - command = "chown -R " + externalApp + ":" + groupName + " " + finalPath - ProcessUtilities.executioner(command, externalApp) - - return 0 - - - except BaseException as msg: - logging.writeToFile(str(msg) + " [ApplicationInstaller.gitPull]") - return 0 - - def detachRepo(self): - try: - domain = self.extraArgs['domainName'] - admin = self.extraArgs['admin'] - - try: - website = ChildDomains.objects.get(domain=domain) - externalApp = website.master.externalApp - - - except: - website = Websites.objects.get(domain=domain) - externalApp = website.externalApp - - try: - website = Websites.objects.get(domain=domain) - finalPath = "/home/" + domain + "/public_html/" - except: - childDomain = ChildDomains.objects.get(domain=domain) - finalPath = childDomain.path - - command = 'rm -rf ' + finalPath - ProcessUtilities.executioner(command, website.externalApp) - - command = 'mkdir ' + finalPath - ProcessUtilities.executioner(command, website.externalApp) - - ## - - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: - groupName = 'nobody' - else: - groupName = 'nogroup' - - command = "chown -R " + externalApp + ":" + groupName + " " + finalPath - ProcessUtilities.executioner(command, website.externalApp) - - gitPath = '/home/cyberpanel/' + domain + '.git' - - os.remove(gitPath) - - return 0 - - - except BaseException as msg: - logging.writeToFile(str(msg) + " [ApplicationInstaller.gitPull]") - return 0 - def installJoomla(self): try: @@ -993,36 +758,6 @@ class ApplicationInstaller(multi.Thread): logging.writeToFile(str(msg)) return 0 - def changeBranch(self): - try: - domainName = self.extraArgs['domainName'] - githubBranch = self.extraArgs['githubBranch'] - admin = self.extraArgs['admin'] - - try: - website = Websites.objects.get(domain=domainName) - finalPath = "/home/" + domainName + "/public_html/" - externalApp = website.externalApp - except: - childDomain = ChildDomains.objects.get(domain=domainName) - finalPath = childDomain.path - externalApp = childDomain.master.externalApp - - try: - command = 'git --git-dir=' + finalPath + '/.git checkout -b ' + githubBranch - ProcessUtilities.executioner(command, externalApp) - except: - try: - command = 'git --git-dir=' + finalPath + '/.git checkout ' + githubBranch - ProcessUtilities.executioner(command, externalApp) - except subprocess.CalledProcessError as msg: - logging.writeToFile('Failed to change branch: ' + str(msg)) - return 0 - return 0 - except BaseException as msg: - logging.writeToFile('Failed to change branch: ' + str(msg)) - return 0 - def installMagento(self): try: @@ -1051,6 +786,7 @@ class ApplicationInstaller(multi.Thread): try: website = ChildDomains.objects.get(domain=domainName) externalApp = website.master.externalApp + self.masterDomain = website.master.domain if home == '0': path = self.extraArgs['path'] @@ -1073,6 +809,7 @@ class ApplicationInstaller(multi.Thread): except: website = Websites.objects.get(domain=domainName) externalApp = website.externalApp + self.masterDomain = website.domain if home == '0': path = self.extraArgs['path'] @@ -1165,20 +902,13 @@ class ApplicationInstaller(multi.Thread): ## - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: - groupName = 'nobody' - else: - groupName = 'nogroup' + from filemanager.filemanager import FileManager - if home != '0': - command = "chown -R " + externalApp + ":" + groupName + " " + finalPath - ProcessUtilities.executioner(command, externalApp) + fm = FileManager(None, None) + fm.fixPermissions(self.masterDomain) installUtilities.reStartLiteSpeed() - command = 'chmod 750 %s' % (self.permPath) - ProcessUtilities.executioner(command) - statusFile = open(tempStatusPath, 'w') statusFile.writelines("Successfully Installed. [200]") statusFile.close() From 4400bd70883ef1409d6500184f642b1f1bfd6294 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 9 Apr 2020 00:10:53 +0500 Subject: [PATCH 03/13] bug fix: permissions --- filemanager/filemanager.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/filemanager/filemanager.py b/filemanager/filemanager.py index ef5ea7139..32b9aad41 100755 --- a/filemanager/filemanager.py +++ b/filemanager/filemanager.py @@ -525,13 +525,19 @@ class FileManager: ProcessUtilities.executioner(command) for childs in website.childdomains_set.all(): + command = "find %s -type d -exec chmod 0755 {} \;" % (childs.path) + ProcessUtilities.popenExecutioner(command) + + command = "find %s -type f -exec chmod 0644 {} \;" % (childs.path) + ProcessUtilities.popenExecutioner(command) + command = 'chown -R %s:%s %s/*' % (externalApp, externalApp, childs.path) ProcessUtilities.popenExecutioner(command) command = 'chown -R %s:%s %s/.[^.]*' % (externalApp, externalApp, childs.path) ProcessUtilities.popenExecutioner(command) - command = 'chmod 750 %s' % (childs.path) + command = 'chmod 755 %s' % (childs.path) ProcessUtilities.popenExecutioner(command) command = 'chmod %s:%s %s' % (externalApp, groupName, childs.path) From 8ad564d549cf80c3826e31e9cef424b6a0b66246 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 16 Apr 2020 19:00:25 +0500 Subject: [PATCH 04/13] 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 05/13] 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 06/13] 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 07/13] 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 08/13] 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 09/13] 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 10/13] 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: From acaf8e80d250b969e189dc342a286950c1b78f88 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 6 May 2020 15:51:11 +0500 Subject: [PATCH 11/13] bug fix: inc backups --- plogical/processUtilities.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plogical/processUtilities.py b/plogical/processUtilities.py index 1bfe9b31b..9ff4437e4 100755 --- a/plogical/processUtilities.py +++ b/plogical/processUtilities.py @@ -190,10 +190,15 @@ class ProcessUtilities(multi.Thread): sock = ret[0] if user == None: - if command.find('sudo') == -1: + + if command.find('export') > -1: + pass + elif command.find('sudo') == -1: command = 'sudo %s' % (command) + if os.path.exists(ProcessUtilities.debugPath): logging.writeToFile(ProcessUtilities.token + command) + sock.sendall((ProcessUtilities.token + command).encode('utf-8')) else: command = '%s-u %s %s' % (ProcessUtilities.token, user, command) From 1cd065298d64dc1d5a2cfa12dc4444f75e623ecf Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 13 May 2020 01:42:41 +0500 Subject: [PATCH 12/13] update repo version for cent7 --- install/install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/install.py b/install/install.py index 724897789..bef8f5683 100755 --- a/install/install.py +++ b/install/install.py @@ -327,7 +327,7 @@ class preFlightsChecks: os._exit(os.EX_SOFTWARE) elif self.distro == centos: - command = 'rpm -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm' + command = 'rpm -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.2-1.el7.noarch.rpm' preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) elif self.distro == cent8: command = 'rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm' From 2338f1a6b4cc21355b052a65fa20f76183cf331e Mon Sep 17 00:00:00 2001 From: Muttahir Aon Syed Date: Wed, 20 May 2020 10:33:39 +0500 Subject: [PATCH 13/13] Fixed IUS Repo Location --- cyberpanel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 87fad78fe..c3372abab 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -445,7 +445,7 @@ if [[ $DEV == "ON" ]] ; then if [[ $SERVER_COUNTRY == "CN" ]] ; then wget -O /etc/yum.repos.d/ius.repo https://$DOWNLOAD_SERVER/ius/ius.repo else - yum -y install https://centos7.iuscommunity.org/ius-release.rpm + yum -y install https://repo.ius.io/ius-release-el7.rpm fi yum -y install python36u python36u-pip python36u-devel check_return