Update to add Magento 2.4 installation process

Update to add Magento 2.4 installation process with elasticsearch factored in. Some things i recommend are to detect the current user's language and timezone and use that to set the  language, timezone variables. These variables might also be helpful for other installations in the application manager and warrant adding dropdown menu for these on the application installer page for apps that support setting these during installation.

Imagine if your primary language is chinese/Japanese and defaults to English if hardcoded or unset during installation navigating to those settings upon first login is going to be a pain. We should ideally detect the current language and use that as default or allow user selectable option which defaults to the current language and timezone of their cyberpanel user profile.

Other things I recommend.  
adding check if ElasticSearch is already installed and if not firing off the ElasticSearch install script which is fired off by the button in the Application manager as its a requirement for Magento 2.4
This commit is contained in:
WhatTheServer
2020-08-22 11:17:42 -04:00
committed by GitHub
parent 2f6a923e79
commit ae84cd4727

View File

@@ -905,24 +905,14 @@ class ApplicationInstaller(multi.Thread):
#### ####
statusFile = open(tempStatusPath, 'w') statusFile = open(tempStatusPath, 'w')
statusFile.writelines('Downloading and extracting Magento Core..,30') statusFile.writelines('Downloading Magento Community Core via composer to document root ..,30')
statusFile.close() statusFile.close()
if sampleData: command = 'composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition %s' % (finalPath)
command = "wget http://cyberpanelsh.b-cdn.net/latest-sample.tar.gz -P %s" % (finalPath)
else:
command = "wget http://cyberpanelsh.b-cdn.net/latest.tar.gz -P %s" % (finalPath)
ProcessUtilities.executioner(command, externalApp) ProcessUtilities.executioner(command, externalApp)
if sampleData: ###
command = 'tar -xf %slatest-sample.tar.gz --directory %s' % (finalPath, finalPath)
else:
command = 'tar -xf %slatest.tar.gz --directory %s' % (finalPath, finalPath)
ProcessUtilities.executioner(command, externalApp)
##
statusFile = open(tempStatusPath, 'w') statusFile = open(tempStatusPath, 'w')
statusFile.writelines('Configuring the installation,40') statusFile.writelines('Configuring the installation,40')
@@ -939,21 +929,17 @@ class ApplicationInstaller(multi.Thread):
statusFile.writelines('Installing and configuring Magento..,60') statusFile.writelines('Installing and configuring Magento..,60')
statusFile.close() statusFile.close()
command = '/usr/local/lsws/lsphp72/bin/php -d memory_limit=512M %sbin/magento setup:install --backend-frontname="admin" ' \ command = '/usr/local/lsws/lsphp73/bin/php -d memory_limit=512M %sbin/magento setup:install --base-url="http://%s" ' \
'--db-host="localhost" --db-name="%s" --db-user="%s" --db-password="%s" ' \ ' --db-host="localhost" --db-name="%s" --db-user="%s" --db-password="%s" --admin-firstname="%s" ' \
'--base-url="http://%s" --base-url-secure="https://%s/" --admin-user="%s" ' \ ' --admin-lastname="%s" --admin-email="%s" --admin-user="%s" --admin-password="%s" --language="%s" --timezone="%s" ' \
'--admin-password="%s" --admin-email="%s" --admin-firstname="%s" --admin-lastname="%s"' \ ' --use-rewrites=1 --search-engine="elasticsearch7" --elasticsearch-host="localhost" --elasticsearch-port="9200" ' \
% (finalPath, dbName, dbUser, dbPassword, finalURL, finalURL, username, password, email, firstName, lastName) ' --elasticsearch-index-prefix="%s"' \
% (finalPath, finalURL, dbName, dbUser, dbPassword, firstName, lastName, email, username, password, language, timezone, dbName )
result = ProcessUtilities.outputExecutioner(command, externalApp) result = ProcessUtilities.outputExecutioner(command, externalApp)
logging.writeToFile(result) logging.writeToFile(result)
## ##
if sampleData:
command = 'rm -rf %slatest-sample.tar.gz' % (finalPath)
else:
command = 'rm -rf %slatest.tar.gz' % (finalPath)
ProcessUtilities.executioner(command, externalApp) ProcessUtilities.executioner(command, externalApp)
## ##