mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 05:45:59 +01:00
bug fix in do check
This commit is contained in:
@@ -585,7 +585,7 @@ $parameters = array(
|
|||||||
statusFile.writelines('Configuring the installation,40')
|
statusFile.writelines('Configuring the installation,40')
|
||||||
statusFile.close()
|
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)
|
result = ProcessUtilities.outputExecutioner(command, externalApp)
|
||||||
|
|
||||||
if result.find('Success:') == -1:
|
if result.find('Success:') == -1:
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class mysqlUtilities:
|
|||||||
|
|
||||||
LOCALHOST = 'localhost'
|
LOCALHOST = 'localhost'
|
||||||
RDS = 0
|
RDS = 0
|
||||||
|
REMOTEHOST = ''
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getPagination(records, toShow):
|
def getPagination(records, toShow):
|
||||||
@@ -67,6 +68,7 @@ class mysqlUtilities:
|
|||||||
mysqlpassword = jsonData['mysqlpassword']
|
mysqlpassword = jsonData['mysqlpassword']
|
||||||
mysqlport = jsonData['mysqlport']
|
mysqlport = jsonData['mysqlport']
|
||||||
mysqlhost = jsonData['mysqlhost']
|
mysqlhost = jsonData['mysqlhost']
|
||||||
|
mysqlUtilities.REMOTEHOST = mysqlhost
|
||||||
|
|
||||||
if mysqlhost.find('rds.amazon') > -1:
|
if mysqlhost.find('rds.amazon') > -1:
|
||||||
mysqlUtilities.RDS = 1
|
mysqlUtilities.RDS = 1
|
||||||
@@ -117,8 +119,17 @@ class mysqlUtilities:
|
|||||||
cursor.execute("CREATE USER '" + dbuser + "'@'%s' IDENTIFIED BY '" % (mysqlUtilities.LOCALHOST) + dbpassword+ "'")
|
cursor.execute("CREATE USER '" + dbuser + "'@'%s' IDENTIFIED BY '" % (mysqlUtilities.LOCALHOST) + dbpassword+ "'")
|
||||||
|
|
||||||
if mysqlUtilities.RDS == 0:
|
if mysqlUtilities.RDS == 0:
|
||||||
|
cursor.execute(
|
||||||
|
"CREATE USER '" + dbuser + "'@'%s' IDENTIFIED BY '" % (mysqlUtilities.LOCALHOST) + dbpassword + "'")
|
||||||
cursor.execute("GRANT ALL PRIVILEGES ON " + dbname + ".* TO '" + dbuser + "'@'%s'" % (mysqlUtilities.LOCALHOST))
|
cursor.execute("GRANT ALL PRIVILEGES ON " + dbname + ".* TO '" + dbuser + "'@'%s'" % (mysqlUtilities.LOCALHOST))
|
||||||
else:
|
else:
|
||||||
|
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)
|
||||||
|
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
"GRANT INDEX, DROP, UPDATE, ALTER, CREATE, SELECT, INSERT, DELETE ON " + dbname + ".* TO '" + dbuser + "'@'%s'" % (mysqlUtilities.LOCALHOST))
|
"GRANT INDEX, DROP, UPDATE, ALTER, CREATE, SELECT, INSERT, DELETE ON " + dbname + ".* TO '" + dbuser + "'@'%s'" % (mysqlUtilities.LOCALHOST))
|
||||||
connection.close()
|
connection.close()
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class StagingSetup(multi.Thread):
|
|||||||
|
|
||||||
dbNameRestore, dbUser, dbPassword = ApplicationInstaller(None, None).dbCreation(tempStatusPath, website)
|
dbNameRestore, dbUser, dbPassword = ApplicationInstaller(None, None).dbCreation(tempStatusPath, website)
|
||||||
|
|
||||||
command = 'wp core config --dbname=%s --dbuser=%s --dbpass=%s --dbhost=%s --path=%s' % (dbNameRestore, dbUser, dbPassword, ApplicationInstaller.LOCALHOST, 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)
|
ProcessUtilities.executioner(command, website.externalApp)
|
||||||
|
|
||||||
## Exporting and importing database
|
## Exporting and importing database
|
||||||
|
|||||||
Reference in New Issue
Block a user