mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 22:06:05 +01:00
bug fix docker install on alma/cloudlinux https://community.cyberpanel.net/t/cannot-install-docker-on-version-2-0-2/18578/3
This commit is contained in:
@@ -49,13 +49,12 @@ class CloudLinuxDomains(CLMain):
|
|||||||
"is_main": True,
|
"is_main": True,
|
||||||
"php": {
|
"php": {
|
||||||
"version": php[:2],
|
"version": php[:2],
|
||||||
"ini_path": f"/usr/local/lsws/lsphp{php[:2]}/etc/php.d ",
|
"ini_path": f"/usr/local/lsws/lsphp{php[:2]}/etc/php.d",
|
||||||
"is_native": False
|
"is_native": False
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for webs in webs.childdomains_set.all():
|
for webs in webs.childdomains_set.all():
|
||||||
completePathToConfigFile = f'/usr/local/lsws/conf/vhosts/{webs.domain}/vhost.conf'
|
completePathToConfigFile = f'/usr/local/lsws/conf/vhosts/{webs.domain}/vhost.conf'
|
||||||
from plogical.phpUtilities import phpUtilities
|
from plogical.phpUtilities import phpUtilities
|
||||||
@@ -68,7 +67,7 @@ class CloudLinuxDomains(CLMain):
|
|||||||
"is_main": False,
|
"is_main": False,
|
||||||
"php": {
|
"php": {
|
||||||
"version": php[:2],
|
"version": php[:2],
|
||||||
"ini_path": f"/usr/local/lsws/lsphp{php[:2]}/etc/php.d ",
|
"ini_path": f"/usr/local/lsws/lsphp{php[:2]}/etc/php.d",
|
||||||
"is_native": False
|
"is_native": False
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ class DockerInstall:
|
|||||||
|
|
||||||
if ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
if ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
|
||||||
command = 'dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo'
|
command = 'yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo'
|
||||||
ServerStatusUtil.executioner(command, statusFile)
|
ServerStatusUtil.executioner(command, statusFile)
|
||||||
|
|
||||||
command = 'sudo dnf install docker-ce docker-ce-cli containerd.io docker-compose-plugin --nobest'
|
command = 'sudo dnf install docker-ce docker-ce-cli containerd.io docker-compose-plugin --allowerasing -y'
|
||||||
elif ProcessUtilities.decideDistro() == ProcessUtilities.centos:
|
elif ProcessUtilities.decideDistro() == ProcessUtilities.centos:
|
||||||
command = 'sudo yum install -y docker'
|
command = 'sudo yum install -y docker'
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import os.path
|
||||||
|
|
||||||
from plogical.processUtilities import ProcessUtilities
|
from plogical.processUtilities import ProcessUtilities
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
@@ -28,12 +30,19 @@ class PHPManager:
|
|||||||
# Get the lines containing 'lsphp' in the output
|
# Get the lines containing 'lsphp' in the output
|
||||||
lsphp_lines = [line for line in result.split('\n') if 'lsphp' in line]
|
lsphp_lines = [line for line in result.split('\n') if 'lsphp' in line]
|
||||||
|
|
||||||
|
|
||||||
# Extract the version from the lines and format it as 'PHP x.y'
|
# Extract the version from the lines and format it as 'PHP x.y'
|
||||||
php_versions = ['PHP ' + line.split()[8][5] + '.' + line.split()[8][6:] for line in lsphp_lines]
|
php_versions = ['PHP ' + line.split()[8][5] + '.' + line.split()[8][6:] for line in lsphp_lines]
|
||||||
|
|
||||||
|
if os.path.exists(ProcessUtilities.debugPath):
|
||||||
|
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
|
||||||
|
logging.writeToFile(f'Found PHP versions in findPHPVersions: {php_versions}')
|
||||||
|
|
||||||
# Now php_versions contains the formatted PHP versions
|
# Now php_versions contains the formatted PHP versions
|
||||||
return php_versions
|
return php_versions
|
||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
|
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
|
||||||
|
logging.writeToFile(f'Error while finding php versions on system: {str(msg)}')
|
||||||
return ['PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1']
|
return ['PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1']
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import sys
|
||||||
|
sys.path.append('/usr/local/CyberCP')
|
||||||
|
from plogical.processUtilities import ProcessUtilities
|
||||||
|
|
||||||
|
|
||||||
|
def findPHPVersions():
|
||||||
|
# distro = ProcessUtilities.decideDistro()
|
||||||
|
# if distro == ProcessUtilities.centos:
|
||||||
|
# return ['PHP 5.3', 'PHP 5.4', 'PHP 5.5', 'PHP 5.6', 'PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1']
|
||||||
|
# elif distro == ProcessUtilities.cent8:
|
||||||
|
# return ['PHP 7.1','PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1']
|
||||||
|
# elif distro == ProcessUtilities.ubuntu20:
|
||||||
|
# return ['PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1']
|
||||||
|
# else:
|
||||||
|
# return ['PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1']
|
||||||
|
|
||||||
|
try:
|
||||||
|
|
||||||
|
# Run the shell command and capture the output
|
||||||
|
result = ProcessUtilities.outputExecutioner('ls -la /usr/local/lsws')
|
||||||
|
|
||||||
|
# Get the lines containing 'lsphp' in the output
|
||||||
|
lsphp_lines = [line for line in result.split('\n') if 'lsphp' in line]
|
||||||
|
print(lsphp_lines)
|
||||||
|
|
||||||
|
# Extract the version from the lines and format it as 'PHP x.y'
|
||||||
|
php_versions = ['PHP ' + line.split()[8][5] + '.' + line.split()[8][6:] for line in lsphp_lines]
|
||||||
|
print(php_versions)
|
||||||
|
|
||||||
|
# Now php_versions contains the formatted PHP versions
|
||||||
|
return php_versions
|
||||||
|
except BaseException as msg:
|
||||||
|
print(str(msg))
|
||||||
|
return ['PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1']
|
||||||
|
|
||||||
|
findPHPVersions()
|
||||||
Reference in New Issue
Block a user