upgrade install source

This commit is contained in:
Usman Nasir 2019-11-07 14:47:02 +05:00
parent ef74af9313
commit 8ccfdc95c2
7 changed files with 56 additions and 1091 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
*.pyc
ApachController/
.idea

View File

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="FacetManager">
<facet type="django" name="Django">
<configuration>
<option name="rootFolder" value="$MODULE_DIR$" />
<option name="settingsModule" value="CyberCP/settings.py" />
<option name="manageScript" value="$MODULE_DIR$/manage.py" />
<option name="environment" value="&lt;map/&gt;" />
<option name="doNotUseTestRunner" value="false" />
<option name="trackFilePattern" value="migrations" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 2.7" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_CONFIGURATION" value="Django" />
<option name="TEMPLATE_FOLDERS">
<list>
<option value="$MODULE_DIR$/dns/templates" />
</list>
</option>
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 2.7" project-jdk-type="Python SDK" />
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/CyberCP.iml" filepath="$PROJECT_DIR$/.idea/CyberCP.iml" />
</modules>
</component>
</project>

File diff suppressed because it is too large Load Diff

View File

@ -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:

View File

@ -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