add support for cloudlinux x-ray

This commit is contained in:
usmannasir
2024-04-05 22:46:38 +04:00
parent 8c7c814eac
commit 9af02d00b1

View File

@@ -26,16 +26,40 @@ class CloudLinuxDomains(CLMain):
def listAll(self): def listAll(self):
data = {} data = {}
if self.owner !=None: if self.owner != None:
websites = Websites.objects.filter(externalApp=self.owner) websites = Websites.objects.filter(externalApp=self.owner)
else: else:
websites = Websites.objects.all() websites = Websites.objects.all()
for webs in websites: for webs in websites:
if self.name != None: if self.name != None:
if self.name != webs.domain: if self.name != webs.domain:
continue continue
if self.with_php:
completePathToConfigFile = f'/usr/local/lsws/conf/vhosts/{webs.domain}/vhost.conf'
from plogical.phpUtilities import phpUtilities
from managePHP.phpManager import PHPManager
phpVersion = phpUtilities.WrapGetPHPVersionFromFileToGetVersionWithPHP(completePathToConfigFile)
php = PHPManager.getPHPString(phpVersion)
data[webs.domain] = {
"owner": webs.externalApp,
"document_root": "/home/%s/public_html/" % (webs.domain),
"is_main": True,
"php": {
"version": php,
"ini_path": f"/usr/local/lsws/lsphp{php}/etc/php.d ",
"is_native": False
}
}
for webs in webs.childdomains_set.all():
data[webs.domain] = {"owner": webs.master.externalApp,
"document_root": webs.path,
"is_main": False}
else:
data[webs.domain] = {"owner": webs.externalApp, data[webs.domain] = {"owner": webs.externalApp,
"document_root": "/home/%s/public_html/" % (webs.domain), "document_root": "/home/%s/public_html/" % (webs.domain),
"is_main": True} "is_main": True}
@@ -64,4 +88,3 @@ if __name__ == '__main__':
pi.listAll() pi.listAll()
except: except:
pi.listAll() pi.listAll()