diff --git a/.gitignore b/.gitignore index 9e35ca068..2c1147f95 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.pyc ApachController/ +.idea diff --git a/.idea/CyberCP.iml b/.idea/CyberCP.iml deleted file mode 100755 index 15888c8f0..000000000 --- a/.idea/CyberCP.iml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100755 index f99b31113..000000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100755 index ac5943840..000000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100755 index 86a39f4e2..000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,1032 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1559525918903 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - file://$PROJECT_DIR$/plogical/adminPass.py - 1 - - - file://$PROJECT_DIR$/serverStatus/views.py - 489 - - - file://$PROJECT_DIR$/WebTerminal/CPWebSocket.py - 100 - - - file://$PROJECT_DIR$/CLManager/templates/CLManager/createPackage.html - 46 - - - file://$PROJECT_DIR$/IncBackups/templates/IncBackups/createBackup.html - 43 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/install/install.py b/install/install.py index bb85fbdb0..9467fea6e 100755 --- a/install/install.py +++ b/install/install.py @@ -948,6 +948,27 @@ class preFlightsChecks: preFlightsChecks.stdOut("psmisc successfully installed!") break + def installGit(self): + try: + if os.path.exists("/etc/lsb-release"): + command = 'apt -y install git' + preFlightsChecks.call(command, self.distro, '[installGit]', + 'Install Git', + 1, 1, os.EX_OSERR) + else: + command = 'sudo yum -y install http://repo.iotti.biz/CentOS/7/noarch/lux-release-7-1.noarch.rpm' + preFlightsChecks.call(command, self.distro, '[installGit]', + 'Install Git', + 1, 1, os.EX_OSERR) + + command = 'sudo yum install git -y' + preFlightsChecks.call(command, self.distro, '[installGit]', + 'Install Git', + 1, 1, os.EX_OSERR) + + except BaseException, msg: + pass + def download_install_CyberPanel(self, mysqlPassword, mysql): try: ## On OpenVZ there is an issue with requests module, which needs to upgrade requests module @@ -964,19 +985,19 @@ class preFlightsChecks: os.chdir(self.path) - command = "wget http://cyberpanel.sh/CyberPanel.1.9.1.tar.gz" + self.installGit() + + os.chdir('/usr/local') + + command = "git clone https://github.com/usmannasir/cyberpanel" # command = "wget http://cyberpanel.sh/CyberPanelTemp.tar.gz" preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]', 'CyberPanel Download', 1, 1, os.EX_OSERR) - ## + shutil.move('cyberpanel', 'CyberCP') - count = 0 - command = "tar zxf CyberPanel.1.9.1.tar.gz" - # command = "tar zxf CyberPanelTemp.tar.gz" - preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]', - 'Extract CyberPanel', 1, 1, os.EX_OSERR) + ## ### update password: diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 318b0f957..8a8649ff7 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -1271,14 +1271,28 @@ class Upgrade: except: pass + @staticmethod + def installGit(): + try: + if os.path.exists("/etc/lsb-release"): + command = 'apt -y install git' + Upgrade.executioner(command, 'installGit', 0) + else: + command = 'sudo yum -y install http://repo.iotti.biz/CentOS/7/noarch/lux-release-7-1.noarch.rpm' + Upgrade.executioner(command, 'installGit', 0) + + command = 'sudo yum install git -y' + Upgrade.executioner(command, 'installGit', 0) + + except BaseException, msg: + pass + @staticmethod def downloadAndUpgrade(versionNumbring): try: ## Download latest version. - command = "wget https://cyberpanel.net/CyberPanel." + versionNumbring - # command = "wget https://cyberpanel.net/CyberPanel.1.7.4.tar.gz" - Upgrade.executioner(command, 'Download latest version', 1) + Upgrade.installGit() ## Backup settings file. @@ -1290,9 +1304,16 @@ class Upgrade: ## Extract Latest files - # command = "tar zxf CyberPanel.1.7.4.tar.gz" - command = "tar zxf CyberPanel." + versionNumbring - Upgrade.executioner(command, 'Extract latest version', 1) + os.chdir('/usr/local') + + if os.path.exists('cyberpanel'): + shutil.rmtree('cyberpanel') + + command = 'git clone https://github.com/usmannasir/cyberpanel' + Upgrade.executioner(command, 'Download CyberPanel', 1) + + shutil.move('cyberpanel', 'CyberCP') + ## Copy settings file