mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-10 23:36:11 +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:
|
class InstallLog:
|
||||||
fileName = "/var/log/installLogs.txt"
|
fileName = "/var/log/installLogs.txt"
|
||||||
currentPercent = '10'
|
currentPercent = '10'
|
||||||
LogURL = 'https://cloud.cyberpanel.net/servers/RecvData'
|
LogURL = 'https://platform.cyberpersons.com/servers/RecvData'
|
||||||
ServerIP = ''
|
ServerIP = ''
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
@@ -1290,34 +1290,71 @@ def getExtensionsInformation(request):
|
|||||||
data = json.loads(request.body)
|
data = json.loads(request.body)
|
||||||
phpVers = data['phpSelection']
|
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 = "["
|
json_data = "["
|
||||||
checker = 0
|
checker = 0
|
||||||
|
counter = 1
|
||||||
|
|
||||||
for items in records:
|
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"
|
||||||
|
|
||||||
if items.status == 0:
|
dic = {'id': counter,
|
||||||
status = "Not-Installed"
|
'phpVers': phpVers,
|
||||||
|
'extensionName': items.split('/')[0],
|
||||||
|
'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
|
||||||
else:
|
else:
|
||||||
status = "Installed"
|
ResultExt = items.split(' ')
|
||||||
|
extesnion = ResultExt[0]
|
||||||
|
|
||||||
dic = {'id': items.id,
|
if extesnion.find(phpVers) > -1:
|
||||||
'phpVers': items.phpVers.phpVers,
|
if resultInstalled.find(extesnion) == -1:
|
||||||
'extensionName': items.extensionName,
|
status = "Not-Installed"
|
||||||
'description': items.description,
|
else:
|
||||||
'status': status
|
status = "Installed"
|
||||||
}
|
|
||||||
|
|
||||||
if checker == 0:
|
dic = {'id': counter,
|
||||||
json_data = json_data + json.dumps(dic)
|
'phpVers': phpVers,
|
||||||
checker = 1
|
'extensionName': extesnion,
|
||||||
else:
|
'description': items,
|
||||||
json_data = json_data + ',' + json.dumps(dic)
|
'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 + ']'
|
json_data = json_data + ']'
|
||||||
final_json = json.dumps({'fetchStatus': 1, 'error_message': "None", "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
|
command = "sudo rm -f " + phpUtilities.installLogPath
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
if ProcessUtilities.outputExecutioner(checkCommand).find(extensionName) > -1:
|
# if ProcessUtilities.outputExecutioner(checkCommand).find(extensionName) > -1:
|
||||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||||
ext.status = 1
|
# ext.status = 1
|
||||||
ext.save()
|
# ext.save()
|
||||||
else:
|
# else:
|
||||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||||
ext.status = 0
|
# ext.status = 0
|
||||||
ext.save()
|
# ext.save()
|
||||||
|
|
||||||
final_json = json.dumps({'finished': 1, 'extensionRequestStatus': 1,
|
final_json = json.dumps({'finished': 1, 'extensionRequestStatus': 1,
|
||||||
'error_message': "None",
|
'error_message': "None",
|
||||||
@@ -1429,15 +1466,15 @@ def getRequestStatus(request):
|
|||||||
command = "sudo rm -f " + phpUtilities.installLogPath
|
command = "sudo rm -f " + phpUtilities.installLogPath
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
if ProcessUtilities.outputExecutioner(checkCommand).find(extensionName) > -1:
|
# if ProcessUtilities.outputExecutioner(checkCommand).find(extensionName) > -1:
|
||||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||||
ext.status = 1
|
# ext.status = 1
|
||||||
ext.save()
|
# ext.save()
|
||||||
|
#
|
||||||
else:
|
# else:
|
||||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||||
ext.status = 0
|
# ext.status = 0
|
||||||
ext.save()
|
# ext.save()
|
||||||
|
|
||||||
final_json = json.dumps({'finished': 1, 'extensionRequestStatus': 1,
|
final_json = json.dumps({'finished': 1, 'extensionRequestStatus': 1,
|
||||||
'error_message': "None",
|
'error_message': "None",
|
||||||
@@ -1449,15 +1486,15 @@ def getRequestStatus(request):
|
|||||||
command = "sudo rm -f " + phpUtilities.installLogPath
|
command = "sudo rm -f " + phpUtilities.installLogPath
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
if ProcessUtilities.outputExecutioner(checkCommand).find(extensionName) > -1:
|
# if ProcessUtilities.outputExecutioner(checkCommand).find(extensionName) > -1:
|
||||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||||
ext.status = 1
|
# ext.status = 1
|
||||||
ext.save()
|
# ext.save()
|
||||||
|
#
|
||||||
else:
|
# else:
|
||||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||||
ext.status = 0
|
# ext.status = 0
|
||||||
ext.save()
|
# ext.save()
|
||||||
|
|
||||||
final_json = json.dumps({'finished': 1, 'extensionRequestStatus': 1,
|
final_json = json.dumps({'finished': 1, 'extensionRequestStatus': 1,
|
||||||
'error_message': "None",
|
'error_message': "None",
|
||||||
@@ -1469,9 +1506,9 @@ def getRequestStatus(request):
|
|||||||
command = "sudo rm -f " + phpUtilities.installLogPath
|
command = "sudo rm -f " + phpUtilities.installLogPath
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||||
ext.status = 0
|
# ext.status = 0
|
||||||
ext.save()
|
# ext.save()
|
||||||
|
|
||||||
final_json = json.dumps({'finished': 1, 'extensionRequestStatus': 1,
|
final_json = json.dumps({'finished': 1, 'extensionRequestStatus': 1,
|
||||||
'error_message': "None",
|
'error_message': "None",
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
|
|||||||
from plogical.mysqlUtilities import mysqlUtilities
|
from plogical.mysqlUtilities import mysqlUtilities
|
||||||
class ClusterManager:
|
class ClusterManager:
|
||||||
|
|
||||||
LogURL = "https://cloud.cyberpanel.net/HighAvailability/RecvData"
|
LogURL = "https://platform.cyberpersons.com/HighAvailability/RecvData"
|
||||||
UptimeURL = "https://cloud.cyberpanel.net/servers/UptimeReport"
|
UptimeURL = "https://platform.cyberpersons.com/servers/UptimeReport"
|
||||||
ClusterFile = '/home/cyberpanel/cluster'
|
ClusterFile = '/home/cyberpanel/cluster'
|
||||||
CloudConfig = '/home/cyberpanel/cloud'
|
CloudConfig = '/home/cyberpanel/cloud'
|
||||||
vhostConfPath = '/usr/local/lsws/conf/vhosts'
|
vhostConfPath = '/usr/local/lsws/conf/vhosts'
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings")
|
|||||||
|
|
||||||
class UpgradeCyberPanel:
|
class UpgradeCyberPanel:
|
||||||
|
|
||||||
LogURL = "https://cloud.cyberpanel.net/settings/RecvData"
|
LogURL = "https://platform.cyberpersons.com/settings/RecvData"
|
||||||
|
|
||||||
def __init__(self, branch, mail, dns, ftp):
|
def __init__(self, branch, mail, dns, ftp):
|
||||||
ipFile = "/etc/cyberpanel/machineIP"
|
ipFile = "/etc/cyberpanel/machineIP"
|
||||||
|
|||||||
@@ -2156,7 +2156,6 @@ $parameters = array(
|
|||||||
statusFile.close()
|
statusFile.close()
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
def DeploytoProduction(self):
|
def DeploytoProduction(self):
|
||||||
|
|
||||||
try:
|
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