mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 21:35:55 +01:00
Merge branch 'v2.0.4-dev' into v2.0.5-dev
This commit is contained in:
@@ -114,7 +114,7 @@ DATABASES = {
|
||||
'USER': 'cyberpanel',
|
||||
'PASSWORD': 'Bz9gF7Hr7X4RtD',
|
||||
'HOST': 'localhost',
|
||||
'PORT':''
|
||||
'PORT': ''
|
||||
},
|
||||
'rootdb': {
|
||||
'ENGINE': 'django.db.backends.mysql',
|
||||
|
||||
@@ -1 +1 @@
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3txFD2sk0fG9MX4l8vpvXYn8ymRN8107PCYywxvwIVN2KnWcPvsKreOajdJr6wj07jqXpviolQdkCM+qPRodHmTX5gpRz0GQobik1S1bihc2wTC4CA9WWAolXxBxnUO5FnMJMoB3tWmg+1tpJZnr+ZATFHjCbmTH+Ra5KO/bROt/gYoiiZvEAzLJNrLYOKBZ9Ik6/GBWFLALosjM8wFK6LQrrOzeNSOK7+aActliF0RjssHwi/65H0Hv172GsIecWvWTnOXrkhi134OtQmbSRtnVAMtjaPsWGO1PEJZya2iRa41fslolH2iQV9Bwe5m0pclceE14UV0cEvO7CqavF cyberso@ip-172-26-3-119.eu-west-2.compute.internal
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCR0LGYoTUe8ZBhH1D9q/QxbmKzKLQS7TMEyPMCv3NidL+LHy60B5upmflIfIf7oRtyDXWGlH564CFQB8YDnXJBrUgCxpRWtT7MYLWMu9WA8OTtJnGi6r10maLp4RJi7yzuOZ36n+IW/ZdxxVgKgfVeUAtaYXZjrsOLepD4YfXjw4D0MYD7VPcYUdPjRf3m5vClaawvmMtNXh2d2a2BFDJCzX3YgAJdbNe9rJeVrigSWUahU6fPVKxbqEdb7E+l8YIUzNtnpjaxcaaBtLKbc4GiAzLmNOdG01F09/y3GTnHcZJSORLGowioZMpB+T8Q9pvW9lJDSw3k7GbUitpfMHT cloud
|
||||
@@ -446,7 +446,7 @@ class preFlightsChecks:
|
||||
command = "sed -i 's|root|%s|g' %s" % (self.mysqluser, path)
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
|
||||
command = "sed -i 's|'PORT':''|'PORT':'%s'|g' %s" % (self.mysqlport, path)
|
||||
command = "sed -i \"s|'PORT': ''|'PORT':'%s'|g\" %s" % (self.mysqlport, path)
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
|
||||
logging.InstallLog.writeToFile("settings.py updated!")
|
||||
|
||||
@@ -274,7 +274,6 @@ class InstallCyberPanel:
|
||||
|
||||
def changeMYSQLRootPassword(self):
|
||||
if self.remotemysql == 'OFF':
|
||||
|
||||
if self.distro == ubuntu:
|
||||
passwordCMD = "use mysql;DROP DATABASE IF EXISTS test;DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%%';GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '%s';UPDATE user SET plugin='' WHERE User='root';flush privileges;" % (InstallCyberPanel.mysql_Root_password)
|
||||
else:
|
||||
|
||||
@@ -14,7 +14,6 @@ class mysqlUtilities:
|
||||
from json import loads
|
||||
mysqlData = loads(open("/etc/cyberpanel/mysqlPassword", 'r').read())
|
||||
|
||||
|
||||
initCommand = 'mysql -h %s --port %s -u %s -p%s -e "' % (mysqlData['mysqlhost'], mysqlData['mysqlport'], mysqlData['mysqluser'], mysqlData['mysqlpassword'])
|
||||
remote = 1
|
||||
except:
|
||||
@@ -56,7 +55,26 @@ class mysqlUtilities:
|
||||
if res == 1:
|
||||
return 0
|
||||
else:
|
||||
|
||||
if remote:
|
||||
|
||||
### DO Check
|
||||
|
||||
if mysqlData['mysqlhost'].find('ondigitalocean') > -1:
|
||||
|
||||
alterUserPassword = "ALTER USER 'cyberpanel'@'%s' IDENTIFIED WITH mysql_native_password BY '%s'" % (
|
||||
publicip, dbpassword)
|
||||
command = initCommand + alterUserPassword + '"'
|
||||
|
||||
if install.preFlightsChecks.debug:
|
||||
print(command)
|
||||
time.sleep(10)
|
||||
|
||||
cmd = shlex.split(command)
|
||||
subprocess.call(cmd)
|
||||
|
||||
## RDS Check
|
||||
|
||||
if mysqlData['mysqlhost'].find('rds.amazon') == -1:
|
||||
dropDB = "GRANT ALL PRIVILEGES ON " + dbname + ".* TO '" + dbuser + "'@'%s'" % (publicip)
|
||||
else:
|
||||
|
||||
@@ -22,6 +22,8 @@ import hashlib
|
||||
class ApplicationInstaller(multi.Thread):
|
||||
|
||||
LOCALHOST = 'localhost'
|
||||
REMOTE = 0
|
||||
PORT = '3306'
|
||||
|
||||
def __init__(self, installApp, extraArgs):
|
||||
multi.Thread.__init__(self)
|
||||
@@ -421,9 +423,10 @@ $parameters = array(
|
||||
try:
|
||||
import json
|
||||
jsonData = json.loads(open(passFile, 'r').read())
|
||||
|
||||
mysqlhost = jsonData['mysqlhost']
|
||||
ApplicationInstaller.LOCALHOST = mysqlhost
|
||||
ApplicationInstaller.REMOTE = 1
|
||||
ApplicationInstaller.PORT = jsonData['mysqlport']
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -582,7 +585,7 @@ $parameters = array(
|
||||
statusFile.writelines('Configuring the installation,40')
|
||||
statusFile.close()
|
||||
|
||||
command = "wp core config --dbname=" + dbName + " --dbuser=" + dbUser + " --dbpass=" + dbPassword + " --dbhost=%s --dbprefix=wp_ --allow-root --path=" % (ApplicationInstaller.LOCALHOST) + finalPath
|
||||
command = "wp core config --dbname=" + dbName + " --dbuser=" + dbUser + " --dbpass=" + dbPassword + " --dbhost=%s:%s --dbprefix=wp_ --allow-root --path=" % (ApplicationInstaller.LOCALHOST, ApplicationInstaller.PORT) + finalPath
|
||||
result = ProcessUtilities.outputExecutioner(command, externalApp)
|
||||
|
||||
if result.find('Success:') == -1:
|
||||
@@ -1377,7 +1380,6 @@ $parameters = array(
|
||||
wm.submitWebsiteDeletion(1, self.extraArgs)
|
||||
logging.statusWriter(self.extraArgs['tempStatusPath'], '%s [404].' % (str(msg)))
|
||||
|
||||
|
||||
def installWhmcs(self):
|
||||
try:
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ class mysqlUtilities:
|
||||
|
||||
LOCALHOST = 'localhost'
|
||||
RDS = 0
|
||||
REMOTEHOST = ''
|
||||
|
||||
@staticmethod
|
||||
def getPagination(records, toShow):
|
||||
@@ -67,6 +68,7 @@ class mysqlUtilities:
|
||||
mysqlpassword = jsonData['mysqlpassword']
|
||||
mysqlport = jsonData['mysqlport']
|
||||
mysqlhost = jsonData['mysqlhost']
|
||||
mysqlUtilities.REMOTEHOST = mysqlhost
|
||||
|
||||
if mysqlhost.find('rds.amazon') > -1:
|
||||
mysqlUtilities.RDS = 1
|
||||
@@ -114,7 +116,15 @@ class mysqlUtilities:
|
||||
return 0
|
||||
|
||||
cursor.execute("CREATE DATABASE " + dbname)
|
||||
cursor.execute("CREATE USER '" + dbuser + "'@'%s' IDENTIFIED BY '" % (mysqlUtilities.LOCALHOST) + dbpassword+ "'")
|
||||
|
||||
if mysqlUtilities.REMOTEHOST.find('ondigitalocean') > -1:
|
||||
query = "CREATE USER '%s'@'%s' IDENTIFIED WITH mysql_native_password BY '%s'" % (
|
||||
dbuser, mysqlUtilities.LOCALHOST, dbpassword)
|
||||
else:
|
||||
query = "CREATE USER '" + dbuser + "'@'%s' IDENTIFIED BY '" % (
|
||||
mysqlUtilities.LOCALHOST) + dbpassword + "'"
|
||||
|
||||
cursor.execute(query)
|
||||
|
||||
if mysqlUtilities.RDS == 0:
|
||||
cursor.execute("GRANT ALL PRIVILEGES ON " + dbname + ".* TO '" + dbuser + "'@'%s'" % (mysqlUtilities.LOCALHOST))
|
||||
|
||||
@@ -98,7 +98,7 @@ class StagingSetup(multi.Thread):
|
||||
|
||||
dbNameRestore, dbUser, dbPassword = ApplicationInstaller(None, None).dbCreation(tempStatusPath, website)
|
||||
|
||||
command = 'wp core config --dbname=%s --dbuser=%s --dbpass=%s --path=%s' % (dbNameRestore, dbUser, dbPassword, path)
|
||||
command = 'wp core config --dbname=%s --dbuser=%s --dbpass=%s --dbhost=%s:%s --path=%s' % (dbNameRestore, dbUser, dbPassword, ApplicationInstaller.LOCALHOST, ApplicationInstaller.PORT, path)
|
||||
ProcessUtilities.executioner(command, website.externalApp)
|
||||
|
||||
## Exporting and importing database
|
||||
|
||||
Reference in New Issue
Block a user