Skip to content
Permalink
Browse files
set remote mysql during wp installer
  • Loading branch information
usmannasir committed Jul 15, 2020
1 parent 6047a2a commit c5efc728da3ed79a884689e79d293d3160f2f6e2
Showing 1 changed file with 14 additions and 2 deletions.
@@ -16,11 +16,12 @@
from databases.models import Databases
from plogical.installUtilities import installUtilities
import shutil
from plogical.mailUtilities import mailUtilities
from plogical.processUtilities import ProcessUtilities

class ApplicationInstaller(multi.Thread):

LOCALHOST = 'localhost'

def __init__(self, installApp, extraArgs):
multi.Thread.__init__(self)
self.installApp = installApp
@@ -220,6 +221,17 @@ def installGit(self):
logging.writeToFile(str(msg) + ' [ApplicationInstaller.installGit]')

def dbCreation(self, tempStatusPath, website):
passFile = "/etc/cyberpanel/mysqlPassword"

try:
import json
jsonData = json.loads(open(passFile, 'r').read())

mysqlhost = jsonData['mysqlhost']
ApplicationInstaller.LOCALHOST = mysqlhost
except:
pass

try:
dbName = randomPassword.generate_pass()
dbUser = dbName
@@ -367,7 +379,7 @@ def installWordPress(self):
statusFile.writelines('Configuring the installation,40')
statusFile.close()

command = "wp core config --dbname=" + dbName + " --dbuser=" + dbUser + " --dbpass=" + dbPassword + " --dbhost=localhost --dbprefix=wp_ --allow-root --path=" + finalPath
command = "wp core config --dbname=" + dbName + " --dbuser=" + dbUser + " --dbpass=" + dbPassword + " --dbhost=%s --dbprefix=wp_ --allow-root --path=" % (ApplicationInstaller.LOCALHOST) + finalPath
ProcessUtilities.executioner(command, externalApp)

if home == '0':

0 comments on commit c5efc72

Please sign in to comment.