mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-10 15:26:13 +01:00
Merge branch 'v2.3.2-dev' of https://github.com/usmannasir/cyberpanel into v2.3.2-dev
This commit is contained in:
@@ -7,7 +7,7 @@ import requests
|
||||
class InstallLog:
|
||||
fileName = "/var/log/installLogs.txt"
|
||||
currentPercent = '10'
|
||||
LogURL = 'https://cloud.cyberpanel.net/servers/RecvData'
|
||||
LogURL = 'https://platform.cyberpersons.com/servers/RecvData'
|
||||
ServerIP = ''
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -1290,26 +1290,38 @@ def getExtensionsInformation(request):
|
||||
data = json.loads(request.body)
|
||||
phpVers = data['phpSelection']
|
||||
|
||||
phpVers = "php" + PHPManager.getPHPString(phpVers)
|
||||
phpVers = f"lsphp{PHPManager.getPHPString(phpVers)}"
|
||||
|
||||
php = PHP.objects.get(phpVers=phpVers)
|
||||
# php = PHP.objects.get(phpVers=phpVers)
|
||||
|
||||
records = php.installedpackages_set.all()
|
||||
if os.path.exists('/etc/lsb-release'):
|
||||
command = f'apt list | grep {phpVers}'
|
||||
else:
|
||||
command = 'yum list installed'
|
||||
resultInstalled = ProcessUtilities.outputExecutioner(command)
|
||||
|
||||
command = f'yum list | grep {phpVers} | xargs -n3 | column -t'
|
||||
|
||||
result = ProcessUtilities.outputExecutioner(command).split('\n')
|
||||
|
||||
#records = php.installedpackages_set.all()
|
||||
|
||||
json_data = "["
|
||||
checker = 0
|
||||
counter = 1
|
||||
|
||||
for items in records:
|
||||
|
||||
if items.status == 0:
|
||||
for items in result:
|
||||
if os.path.exists('/etc/lsb-release'):
|
||||
if items.find(phpVers) > -1:
|
||||
if items.find('installed') == -1:
|
||||
status = "Not-Installed"
|
||||
else:
|
||||
status = "Installed"
|
||||
|
||||
dic = {'id': items.id,
|
||||
'phpVers': items.phpVers.phpVers,
|
||||
'extensionName': items.extensionName,
|
||||
'description': items.description,
|
||||
dic = {'id': counter,
|
||||
'phpVers': phpVers,
|
||||
'extensionName': items.split('/')[0],
|
||||
'description': items,
|
||||
'status': status
|
||||
}
|
||||
|
||||
@@ -1318,6 +1330,31 @@ def getExtensionsInformation(request):
|
||||
checker = 1
|
||||
else:
|
||||
json_data = json_data + ',' + json.dumps(dic)
|
||||
counter += 1
|
||||
else:
|
||||
ResultExt = items.split(' ')
|
||||
extesnion = ResultExt[0]
|
||||
|
||||
if extesnion.find(phpVers) > -1:
|
||||
if resultInstalled.find(extesnion) == -1:
|
||||
status = "Not-Installed"
|
||||
else:
|
||||
status = "Installed"
|
||||
|
||||
dic = {'id': counter,
|
||||
'phpVers': phpVers,
|
||||
'extensionName': extesnion,
|
||||
'description': items,
|
||||
'status': status
|
||||
}
|
||||
|
||||
|
||||
if checker == 0:
|
||||
json_data = json_data + json.dumps(dic)
|
||||
checker = 1
|
||||
else:
|
||||
json_data = json_data + ',' + json.dumps(dic)
|
||||
counter += 1
|
||||
|
||||
json_data = json_data + ']'
|
||||
final_json = json.dumps({'fetchStatus': 1, 'error_message': "None", "data": json_data})
|
||||
@@ -1410,14 +1447,14 @@ def getRequestStatus(request):
|
||||
command = "sudo rm -f " + phpUtilities.installLogPath
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
if ProcessUtilities.outputExecutioner(checkCommand).find(extensionName) > -1:
|
||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
ext.status = 1
|
||||
ext.save()
|
||||
else:
|
||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
ext.status = 0
|
||||
ext.save()
|
||||
# if ProcessUtilities.outputExecutioner(checkCommand).find(extensionName) > -1:
|
||||
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
# ext.status = 1
|
||||
# ext.save()
|
||||
# else:
|
||||
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
# ext.status = 0
|
||||
# ext.save()
|
||||
|
||||
final_json = json.dumps({'finished': 1, 'extensionRequestStatus': 1,
|
||||
'error_message': "None",
|
||||
@@ -1429,15 +1466,15 @@ def getRequestStatus(request):
|
||||
command = "sudo rm -f " + phpUtilities.installLogPath
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
if ProcessUtilities.outputExecutioner(checkCommand).find(extensionName) > -1:
|
||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
ext.status = 1
|
||||
ext.save()
|
||||
|
||||
else:
|
||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
ext.status = 0
|
||||
ext.save()
|
||||
# if ProcessUtilities.outputExecutioner(checkCommand).find(extensionName) > -1:
|
||||
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
# ext.status = 1
|
||||
# ext.save()
|
||||
#
|
||||
# else:
|
||||
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
# ext.status = 0
|
||||
# ext.save()
|
||||
|
||||
final_json = json.dumps({'finished': 1, 'extensionRequestStatus': 1,
|
||||
'error_message': "None",
|
||||
@@ -1449,15 +1486,15 @@ def getRequestStatus(request):
|
||||
command = "sudo rm -f " + phpUtilities.installLogPath
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
if ProcessUtilities.outputExecutioner(checkCommand).find(extensionName) > -1:
|
||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
ext.status = 1
|
||||
ext.save()
|
||||
|
||||
else:
|
||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
ext.status = 0
|
||||
ext.save()
|
||||
# if ProcessUtilities.outputExecutioner(checkCommand).find(extensionName) > -1:
|
||||
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
# ext.status = 1
|
||||
# ext.save()
|
||||
#
|
||||
# else:
|
||||
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
# ext.status = 0
|
||||
# ext.save()
|
||||
|
||||
final_json = json.dumps({'finished': 1, 'extensionRequestStatus': 1,
|
||||
'error_message': "None",
|
||||
@@ -1469,9 +1506,9 @@ def getRequestStatus(request):
|
||||
command = "sudo rm -f " + phpUtilities.installLogPath
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
ext.status = 0
|
||||
ext.save()
|
||||
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
# ext.status = 0
|
||||
# ext.save()
|
||||
|
||||
final_json = json.dumps({'finished': 1, 'extensionRequestStatus': 1,
|
||||
'error_message': "None",
|
||||
|
||||
@@ -16,8 +16,8 @@ from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
|
||||
from plogical.mysqlUtilities import mysqlUtilities
|
||||
class ClusterManager:
|
||||
|
||||
LogURL = "https://cloud.cyberpanel.net/HighAvailability/RecvData"
|
||||
UptimeURL = "https://cloud.cyberpanel.net/servers/UptimeReport"
|
||||
LogURL = "https://platform.cyberpersons.com/HighAvailability/RecvData"
|
||||
UptimeURL = "https://platform.cyberpersons.com/servers/UptimeReport"
|
||||
ClusterFile = '/home/cyberpanel/cluster'
|
||||
CloudConfig = '/home/cyberpanel/cloud'
|
||||
vhostConfPath = '/usr/local/lsws/conf/vhosts'
|
||||
|
||||
@@ -9,7 +9,7 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings")
|
||||
|
||||
class UpgradeCyberPanel:
|
||||
|
||||
LogURL = "https://cloud.cyberpanel.net/settings/RecvData"
|
||||
LogURL = "https://platform.cyberpersons.com/settings/RecvData"
|
||||
|
||||
def __init__(self, branch, mail, dns, ftp):
|
||||
ipFile = "/etc/cyberpanel/machineIP"
|
||||
|
||||
@@ -2156,7 +2156,6 @@ $parameters = array(
|
||||
statusFile.close()
|
||||
return 0
|
||||
|
||||
|
||||
def DeploytoProduction(self):
|
||||
|
||||
try:
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import subprocess, shlex
|
||||
command = 'yum list | grep lsphp | xargs -n3 | column -t'
|
||||
result = subprocess.check_output(command, shell=True).splitlines()
|
||||
for item in result:
|
||||
print(item.split(b' '))
|
||||
|
||||
Reference in New Issue
Block a user