Skip to content

Commit

Permalink
bug fix: dkim permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Sep 24, 2023
1 parent d87a8d8 commit 964141f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
6 changes: 3 additions & 3 deletions cloudAPI/cloudManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2832,7 +2832,7 @@ def SwitchDNS(self):
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache'
ProcessUtilities.executioner(command)

command = 'chown cyberpanel:cyberpanel /usr/local/CyberCP/lib/python3.10/site-packages/tldextract/.suffix_cache/urls/*.tldextract.json'
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python*/site-packages/tldextract/.suffix_cache'
ProcessUtilities.executioner(command, None, True)

##
Expand All @@ -2855,7 +2855,7 @@ def SwitchDNS(self):
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache'
ProcessUtilities.executioner(command)

command = 'chown cyberpanel:cyberpanel /usr/local/CyberCP/lib/python3.10/site-packages/tldextract/.suffix_cache/urls/*.tldextract.json'
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():
Expand Down Expand Up @@ -2903,7 +2903,7 @@ def SwitchDNS(self):
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache'
ProcessUtilities.executioner(command)

command = 'chown cyberpanel:cyberpanel /usr/local/CyberCP/lib/python3.10/site-packages/tldextract/.suffix_cache/urls/*.tldextract.json'
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python*/site-packages/tldextract/.suffix_cache'
ProcessUtilities.executioner(command, None, True)

from websiteFunctions.models import ChildDomains
Expand Down
4 changes: 2 additions & 2 deletions mailServer/mailserverManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ def fetchDKIMKeys(self):
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache'
ProcessUtilities.executioner(command)

command = 'chown cyberpanel:cyberpanel /usr/local/CyberCP/lib/python3.10/site-packages/tldextract/.suffix_cache/urls/*.tldextract.json'
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python*/site-packages/tldextract/.suffix_cache'
ProcessUtilities.executioner(command, None, True)

import tldextract
Expand Down Expand Up @@ -733,7 +733,7 @@ def generateDKIMKeys(self):
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache'
ProcessUtilities.executioner(command)

command = 'chown cyberpanel:cyberpanel /usr/local/CyberCP/lib/python3.10/site-packages/tldextract/.suffix_cache/urls/*.tldextract.json'
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python*/site-packages/tldextract/.suffix_cache'
ProcessUtilities.executioner(command, None, True)

import tldextract
Expand Down
7 changes: 5 additions & 2 deletions plogical/dnsUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,12 @@ def dnsTemplate(domain, admin):
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache'
ProcessUtilities.executioner(command)

command = 'chown cyberpanel:cyberpanel /usr/local/CyberCP/lib/python3.10/site-packages/tldextract/.suffix_cache/urls/*.tldextract.json'
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

extractDomain = tldextract.extract(domain)
Expand Down Expand Up @@ -529,7 +532,7 @@ def createDKIMRecords(domain):
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache'
ProcessUtilities.executioner(command)

command = 'chown cyberpanel:cyberpanel /usr/local/CyberCP/lib/python3.10/site-packages/tldextract/.suffix_cache/urls/*.tldextract.json'
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python*/site-packages/tldextract/.suffix_cache'
ProcessUtilities.executioner(command, None, True)

import tldextract
Expand Down
2 changes: 1 addition & 1 deletion plogical/mailUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def setupDKIM(virtualHostName):
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache'
ProcessUtilities.executioner(command)

command = 'chown cyberpanel:cyberpanel /usr/local/CyberCP/lib/python3.10/site-packages/tldextract/.suffix_cache/urls/*.tldextract.json'
command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python*/site-packages/tldextract/.suffix_cache'
ProcessUtilities.executioner(command, None, True)

import tldextract
Expand Down
21 changes: 21 additions & 0 deletions plogical/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import re


def extract_domain_parts(domain):
# Use a regular expression to extract the domain parts
pattern = r'(?:\w+\.)?(\w+)\.(\w+)'
match = re.match(pattern, domain)

if match:
subdomain = match.group(1)
top_level_domain = match.group(2)
return subdomain, top_level_domain
else:
return None, None


# Example usage
domain = "sub.example.ae"
subdomain, top_level_domain = extract_domain_parts(domain)
print("Subdomain:", subdomain)
print("Top-Level Domain:", top_level_domain)

0 comments on commit 964141f

Please sign in to comment.