mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-16 02:06:13 +01:00
set default pass forward by custom
This commit is contained in:
@@ -483,36 +483,6 @@ class preFlightsChecks:
|
|||||||
|
|
||||||
def fixCyberPanelPermissions(self):
|
def fixCyberPanelPermissions(self):
|
||||||
|
|
||||||
try:
|
|
||||||
|
|
||||||
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()
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
###### fix Core CyberPanel permissions
|
###### fix Core CyberPanel permissions
|
||||||
|
|
||||||
command = "usermod -G lscpd,lsadm,nobody lscpd"
|
command = "usermod -G lscpd,lsadm,nobody lscpd"
|
||||||
@@ -661,9 +631,6 @@ echo $oConfig->Save() ? 'Done' : 'Error';
|
|||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
command = '/usr/local/lsws/lsphp72/bin/php /usr/local/CyberCP/public/rainloop.php'
|
|
||||||
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:
|
||||||
@@ -2378,6 +2345,40 @@ def main():
|
|||||||
|
|
||||||
checks.installCLScripts()
|
checks.installCLScripts()
|
||||||
#checks.disablePackegeUpdates()
|
#checks.disablePackegeUpdates()
|
||||||
|
|
||||||
|
try:
|
||||||
|
|
||||||
|
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!")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user