mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-11 07:46:10 +01:00
tld extract bug fix
This commit is contained in:
@@ -2859,18 +2859,11 @@ class CloudManager:
|
|||||||
|
|
||||||
zones = cf.zones.get(params = {'per_page':100})
|
zones = cf.zones.get(params = {'per_page':100})
|
||||||
|
|
||||||
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.6/site-packages/tldextract/.suffix_cache'
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
|
|
||||||
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache'
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
|
|
||||||
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python*/site-packages/tldextract/.suffix_cache'
|
|
||||||
ProcessUtilities.executioner(command, None, True)
|
|
||||||
|
|
||||||
for website in Websites.objects.all():
|
for website in Websites.objects.all():
|
||||||
import tldextract
|
import tldextract
|
||||||
extractDomain = tldextract.extract(website.domain)
|
no_cache_extract = tldextract.TLDExtract(cache_dir=None)
|
||||||
|
extractDomain = no_cache_extract(website.domain)
|
||||||
topLevelDomain = extractDomain.domain + '.' + extractDomain.suffix
|
topLevelDomain = extractDomain.domain + '.' + extractDomain.suffix
|
||||||
|
|
||||||
for zone in zones:
|
for zone in zones:
|
||||||
@@ -2920,7 +2913,8 @@ class CloudManager:
|
|||||||
for website in ChildDomains.objects.all():
|
for website in ChildDomains.objects.all():
|
||||||
|
|
||||||
import tldextract
|
import tldextract
|
||||||
extractDomain = tldextract.extract(website.domain)
|
no_cache_extract = tldextract.TLDExtract(cache_dir=None)
|
||||||
|
extractDomain = no_cache_extract(website.domain)
|
||||||
topLevelDomain = extractDomain.domain + '.' + extractDomain.suffix
|
topLevelDomain = extractDomain.domain + '.' + extractDomain.suffix
|
||||||
|
|
||||||
for zone in zones:
|
for zone in zones:
|
||||||
|
|||||||
@@ -171,20 +171,9 @@ class DNSManager:
|
|||||||
finalData['domainsList'] = []
|
finalData['domainsList'] = []
|
||||||
import tldextract
|
import tldextract
|
||||||
|
|
||||||
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.6/site-packages/tldextract/.suffix_cache'
|
no_cache_extract = tldextract.TLDExtract(cache_dir=None)
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
|
|
||||||
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache'
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
|
|
||||||
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python*/site-packages/tldextract/.suffix_cache'
|
|
||||||
ProcessUtilities.executioner(command, None, True)
|
|
||||||
|
|
||||||
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache'
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
|
|
||||||
for items in tempList:
|
for items in tempList:
|
||||||
extractDomain = tldextract.extract(items)
|
extractDomain = no_cache_extract(items)
|
||||||
subDomain = extractDomain.subdomain
|
subDomain = extractDomain.subdomain
|
||||||
if len(subDomain) == 0:
|
if len(subDomain) == 0:
|
||||||
finalData['domainsList'].append(items)
|
finalData['domainsList'].append(items)
|
||||||
|
|||||||
@@ -693,18 +693,12 @@ class MailServerManager(multi.Thread):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.6/site-packages/tldextract/.suffix_cache'
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
|
|
||||||
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache'
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
|
|
||||||
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python*/site-packages/tldextract/.suffix_cache'
|
|
||||||
ProcessUtilities.executioner(command, None, True)
|
|
||||||
|
|
||||||
import tldextract
|
import tldextract
|
||||||
|
|
||||||
extractDomain = tldextract.extract(domainName)
|
no_cache_extract = tldextract.TLDExtract(cache_dir=None)
|
||||||
|
|
||||||
|
extractDomain = no_cache_extract(domainName)
|
||||||
domainName = extractDomain.domain + '.' + extractDomain.suffix
|
domainName = extractDomain.domain + '.' + extractDomain.suffix
|
||||||
|
|
||||||
path = "/etc/opendkim/keys/" + domainName + "/default.txt"
|
path = "/etc/opendkim/keys/" + domainName + "/default.txt"
|
||||||
@@ -772,7 +766,9 @@ class MailServerManager(multi.Thread):
|
|||||||
|
|
||||||
import tldextract
|
import tldextract
|
||||||
|
|
||||||
extractDomain = tldextract.extract(domainName)
|
no_cache_extract = tldextract.TLDExtract(cache_dir=None)
|
||||||
|
|
||||||
|
extractDomain = no_cache_extract(domainName)
|
||||||
topLevelDomain = extractDomain.domain + '.' + extractDomain.suffix
|
topLevelDomain = extractDomain.domain + '.' + extractDomain.suffix
|
||||||
|
|
||||||
zone = dnsDomains.objects.get(name=topLevelDomain)
|
zone = dnsDomains.objects.get(name=topLevelDomain)
|
||||||
|
|||||||
@@ -115,21 +115,12 @@ class DNS:
|
|||||||
ipData = f.read()
|
ipData = f.read()
|
||||||
ipAddress = ipData.split('\n', 1)[0]
|
ipAddress = ipData.split('\n', 1)[0]
|
||||||
|
|
||||||
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.6/site-packages/tldextract/.suffix_cache'
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
|
|
||||||
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache'
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
|
|
||||||
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python*/site-packages/tldextract/.suffix_cache'
|
|
||||||
ProcessUtilities.executioner(command, None, True)
|
|
||||||
|
|
||||||
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache'
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
|
|
||||||
import tldextract
|
import tldextract
|
||||||
|
|
||||||
extractDomain = tldextract.extract(domain)
|
no_cache_extract = tldextract.TLDExtract(cache_dir=None)
|
||||||
|
|
||||||
|
extractDomain = no_cache_extract(domain)
|
||||||
topLevelDomain = extractDomain.domain + '.' + extractDomain.suffix
|
topLevelDomain = extractDomain.domain + '.' + extractDomain.suffix
|
||||||
subDomain = extractDomain.subdomain
|
subDomain = extractDomain.subdomain
|
||||||
|
|
||||||
@@ -582,7 +573,9 @@ class DNS:
|
|||||||
|
|
||||||
import tldextract
|
import tldextract
|
||||||
|
|
||||||
extractDomain = tldextract.extract(domain)
|
no_cache_extract = tldextract.TLDExtract(cache_dir=None)
|
||||||
|
|
||||||
|
extractDomain = no_cache_extract(domain)
|
||||||
topLevelDomain = extractDomain.domain + '.' + extractDomain.suffix
|
topLevelDomain = extractDomain.domain + '.' + extractDomain.suffix
|
||||||
subDomain = extractDomain.subdomain
|
subDomain = extractDomain.subdomain
|
||||||
|
|
||||||
|
|||||||
@@ -401,19 +401,13 @@ class mailUtilities:
|
|||||||
try:
|
try:
|
||||||
## Generate DKIM Keys
|
## Generate DKIM Keys
|
||||||
|
|
||||||
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.6/site-packages/tldextract/.suffix_cache'
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
|
|
||||||
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache'
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
|
|
||||||
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python*/site-packages/tldextract/.suffix_cache'
|
|
||||||
ProcessUtilities.executioner(command, None, True)
|
|
||||||
|
|
||||||
import tldextract
|
import tldextract
|
||||||
|
|
||||||
|
no_cache_extract = tldextract.TLDExtract(cache_dir=None)
|
||||||
|
|
||||||
actualDomain = virtualHostName
|
actualDomain = virtualHostName
|
||||||
extractDomain = tldextract.extract(virtualHostName)
|
extractDomain = no_cache_extract(virtualHostName)
|
||||||
virtualHostName = extractDomain.domain + '.' + extractDomain.suffix
|
virtualHostName = extractDomain.domain + '.' + extractDomain.suffix
|
||||||
|
|
||||||
if not os.path.exists("/etc/opendkim/keys/" + virtualHostName + "/default.txt"):
|
if not os.path.exists("/etc/opendkim/keys/" + virtualHostName + "/default.txt"):
|
||||||
|
|||||||
@@ -339,10 +339,11 @@ class sslUtilities:
|
|||||||
import tldextract
|
import tldextract
|
||||||
|
|
||||||
RetStatus, SAVED_CF_Key, SAVED_CF_Email = ACLManager.FetchCloudFlareAPIKeyFromAcme()
|
RetStatus, SAVED_CF_Key, SAVED_CF_Email = ACLManager.FetchCloudFlareAPIKeyFromAcme()
|
||||||
|
no_cache_extract = tldextract.TLDExtract(cache_dir=None)
|
||||||
|
|
||||||
if RetStatus:
|
if RetStatus:
|
||||||
|
|
||||||
extractDomain = tldextract.extract(virtualHostName)
|
extractDomain = no_cache_extract(virtualHostName)
|
||||||
topLevelDomain = extractDomain.domain + '.' + extractDomain.suffix
|
topLevelDomain = extractDomain.domain + '.' + extractDomain.suffix
|
||||||
logging.CyberCPLogFileWriter.writeToFile(f'top level domain in cf: {topLevelDomain}')
|
logging.CyberCPLogFileWriter.writeToFile(f'top level domain in cf: {topLevelDomain}')
|
||||||
import CloudFlare
|
import CloudFlare
|
||||||
@@ -375,7 +376,8 @@ class sslUtilities:
|
|||||||
|
|
||||||
from plogical.dnsUtilities import DNS
|
from plogical.dnsUtilities import DNS
|
||||||
from dns.models import Domains
|
from dns.models import Domains
|
||||||
extractDomain = tldextract.extract(virtualHostName)
|
no_cache_extract = tldextract.TLDExtract(cache_dir=None)
|
||||||
|
extractDomain = no_cache_extract(virtualHostName)
|
||||||
topLevelDomain = extractDomain.domain + '.' + extractDomain.suffix
|
topLevelDomain = extractDomain.domain + '.' + extractDomain.suffix
|
||||||
zone = Domains.objects.get(name=topLevelDomain)
|
zone = Domains.objects.get(name=topLevelDomain)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user