|
16 | 16 | from databases.models import Databases |
17 | 17 | from plogical.installUtilities import installUtilities |
18 | 18 | import shutil |
19 | | -from plogical.mailUtilities import mailUtilities |
20 | 19 | from plogical.processUtilities import ProcessUtilities |
21 | 20 |
|
22 | 21 | class ApplicationInstaller(multi.Thread): |
23 | 22 |
|
| 23 | + LOCALHOST = 'localhost' |
| 24 | + |
24 | 25 | def __init__(self, installApp, extraArgs): |
25 | 26 | multi.Thread.__init__(self) |
26 | 27 | self.installApp = installApp |
@@ -220,6 +221,17 @@ def installGit(self): |
220 | 221 | logging.writeToFile(str(msg) + ' [ApplicationInstaller.installGit]') |
221 | 222 |
|
222 | 223 | def dbCreation(self, tempStatusPath, website): |
| 224 | + passFile = "/etc/cyberpanel/mysqlPassword" |
| 225 | + |
| 226 | + try: |
| 227 | + import json |
| 228 | + jsonData = json.loads(open(passFile, 'r').read()) |
| 229 | + |
| 230 | + mysqlhost = jsonData['mysqlhost'] |
| 231 | + ApplicationInstaller.LOCALHOST = mysqlhost |
| 232 | + except: |
| 233 | + pass |
| 234 | + |
223 | 235 | try: |
224 | 236 | dbName = randomPassword.generate_pass() |
225 | 237 | dbUser = dbName |
@@ -367,7 +379,7 @@ def installWordPress(self): |
367 | 379 | statusFile.writelines('Configuring the installation,40') |
368 | 380 | statusFile.close() |
369 | 381 |
|
370 | | - command = "wp core config --dbname=" + dbName + " --dbuser=" + dbUser + " --dbpass=" + dbPassword + " --dbhost=localhost --dbprefix=wp_ --allow-root --path=" + finalPath |
| 382 | + command = "wp core config --dbname=" + dbName + " --dbuser=" + dbUser + " --dbpass=" + dbPassword + " --dbhost=%s --dbprefix=wp_ --allow-root --path=" % (ApplicationInstaller.LOCALHOST) + finalPath |
371 | 383 | ProcessUtilities.executioner(command, externalApp) |
372 | 384 |
|
373 | 385 | if home == '0': |
|
0 commit comments