mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-15 09:46:11 +01:00
Merge branch 'v2.0.3' into v2.0.4-dev
This commit is contained in:
@@ -629,6 +629,8 @@ class preFlightsChecks:
|
|||||||
command = 'chmod 640 /usr/local/lscp/cyberpanel/logs/access.log'
|
command = 'chmod 640 /usr/local/lscp/cyberpanel/logs/access.log'
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
def install_unzip(self):
|
def install_unzip(self):
|
||||||
self.stdOut("Install unzip")
|
self.stdOut("Install unzip")
|
||||||
try:
|
try:
|
||||||
@@ -2343,6 +2345,42 @@ def main():
|
|||||||
|
|
||||||
checks.installCLScripts()
|
checks.installCLScripts()
|
||||||
#checks.disablePackegeUpdates()
|
#checks.disablePackegeUpdates()
|
||||||
|
|
||||||
|
# try:
|
||||||
|
# command = 'mkdir -p /usr/local/lscp/cyberpanel/rainloop/data/data/default/configs/'
|
||||||
|
# subprocess.call(shlex.split(command))
|
||||||
|
#
|
||||||
|
# writeToFile = open('/usr/local/lscp/cyberpanel/rainloop/data/data/default/configs/application.ini', 'a')
|
||||||
|
# writeToFile.write("""
|
||||||
|
# [security]
|
||||||
|
# admin_login = "admin"
|
||||||
|
# admin_password = "12345789"
|
||||||
|
# """)
|
||||||
|
# writeToFile.close()
|
||||||
|
#
|
||||||
|
# import randomPassword
|
||||||
|
#
|
||||||
|
# content = """<?php
|
||||||
|
#
|
||||||
|
# $_ENV['RAINLOOP_INCLUDE_AS_API'] = true;
|
||||||
|
# include '/usr/local/CyberCP/public/rainloop/index.php';
|
||||||
|
#
|
||||||
|
# $oConfig = \RainLoop\Api::Config();
|
||||||
|
# $oConfig->SetPassword('%s');
|
||||||
|
# echo $oConfig->Save() ? 'Done' : 'Error';
|
||||||
|
#
|
||||||
|
# ?>""" % (randomPassword.generate_pass())
|
||||||
|
#
|
||||||
|
# writeToFile = open('/usr/local/CyberCP/public/rainloop.php', 'w')
|
||||||
|
# writeToFile.write(content)
|
||||||
|
# writeToFile.close()
|
||||||
|
#
|
||||||
|
# command = '/usr/local/lsws/lsphp72/bin/php /usr/local/CyberCP/public/rainloop.php'
|
||||||
|
# subprocess.call(shlex.split(command))
|
||||||
|
#
|
||||||
|
# except:
|
||||||
|
# pass
|
||||||
|
|
||||||
logging.InstallLog.writeToFile("CyberPanel installation successfully completed!")
|
logging.InstallLog.writeToFile("CyberPanel installation successfully completed!")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1651,6 +1651,28 @@ imap_folder_list_limit = 0
|
|||||||
def fixPermissions():
|
def fixPermissions():
|
||||||
try:
|
try:
|
||||||
|
|
||||||
|
try:
|
||||||
|
def generate_pass(length=14):
|
||||||
|
chars = string.ascii_uppercase + string.ascii_lowercase + string.digits
|
||||||
|
size = length
|
||||||
|
return ''.join(random.choice(chars) for x in range(size))
|
||||||
|
|
||||||
|
content = """<?php
|
||||||
|
$_ENV['RAINLOOP_INCLUDE_AS_API'] = true;
|
||||||
|
include '/usr/local/CyberCP/public/rainloop/index.php';
|
||||||
|
|
||||||
|
$oConfig = \RainLoop\Api::Config();
|
||||||
|
$oConfig->SetPassword('%s');
|
||||||
|
echo $oConfig->Save() ? 'Done' : 'Error';
|
||||||
|
|
||||||
|
?>""" % (generate_pass())
|
||||||
|
|
||||||
|
writeToFile = open('/usr/local/CyberCP/public/rainloop.php', 'w')
|
||||||
|
writeToFile.write(content)
|
||||||
|
writeToFile.close()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
Upgrade.stdOut("Fixing permissions..")
|
Upgrade.stdOut("Fixing permissions..")
|
||||||
|
|
||||||
command = "usermod -G lscpd,lsadm,nobody lscpd"
|
command = "usermod -G lscpd,lsadm,nobody lscpd"
|
||||||
@@ -1802,6 +1824,9 @@ imap_folder_list_limit = 0
|
|||||||
command = 'chmod 640 /usr/local/lscp/cyberpanel/logs/access.log'
|
command = 'chmod 640 /usr/local/lscp/cyberpanel/logs/access.log'
|
||||||
Upgrade.executioner(command, 0)
|
Upgrade.executioner(command, 0)
|
||||||
|
|
||||||
|
command = '/usr/local/lsws/lsphp72/bin/php /usr/local/CyberCP/public/rainloop.php'
|
||||||
|
Upgrade.executioner(command, 0)
|
||||||
|
|
||||||
|
|
||||||
Upgrade.stdOut("Permissions updated.")
|
Upgrade.stdOut("Permissions updated.")
|
||||||
|
|
||||||
|
|||||||
@@ -1079,4 +1079,4 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user