mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 14:26:16 +01:00
renew
This commit is contained in:
@@ -34,10 +34,14 @@ class Renew:
|
|||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
diff = finalDate - now
|
diff = finalDate - now
|
||||||
|
|
||||||
if int(diff.days) >= 15:
|
SSLProvider = x509.get_issuer().get_components()[1][1].decode('utf-8')
|
||||||
|
|
||||||
|
print(f"Provider: {x509.get_issuer().get_components()[1][1].decode('utf-8')}, Days : {diff.days}")
|
||||||
|
|
||||||
|
if int(diff.days) >= 15 and SSLProvider!='Denial':
|
||||||
logging.writeToFile(
|
logging.writeToFile(
|
||||||
'SSL exists for %s and is not ready to renew, skipping..' % (website.domain), 0)
|
'SSL exists for %s and is not ready to renew, skipping..' % (website.domain), 0)
|
||||||
elif x509.get_issuer().get_components()[1][1].decode('utf-8') == 'Denial':
|
elif SSLProvider == 'Denial':
|
||||||
logging.writeToFile(
|
logging.writeToFile(
|
||||||
'SSL exists for %s and ready to renew..' % (website.domain), 0)
|
'SSL exists for %s and ready to renew..' % (website.domain), 0)
|
||||||
logging.writeToFile(
|
logging.writeToFile(
|
||||||
@@ -45,7 +49,7 @@ class Renew:
|
|||||||
|
|
||||||
virtualHostUtilities.issueSSL(website.domain, '/home/%s/public_html' % (website.domain),
|
virtualHostUtilities.issueSSL(website.domain, '/home/%s/public_html' % (website.domain),
|
||||||
website.adminEmail)
|
website.adminEmail)
|
||||||
elif x509.get_issuer().get_components()[1][1].decode('utf-8') != "Let's Encrypt":
|
elif SSLProvider != "Let's Encrypt":
|
||||||
logging.writeToFile(
|
logging.writeToFile(
|
||||||
'Custom SSL exists for %s and ready to renew..' % (website.domain), 1)
|
'Custom SSL exists for %s and ready to renew..' % (website.domain), 1)
|
||||||
else:
|
else:
|
||||||
@@ -101,6 +105,7 @@ class Renew:
|
|||||||
'SSL does not exist for %s. Obtaining now..' % (website.domain), 0)
|
'SSL does not exist for %s. Obtaining now..' % (website.domain), 0)
|
||||||
virtualHostUtilities.issueSSL(website.domain, website.path,
|
virtualHostUtilities.issueSSL(website.domain, website.path,
|
||||||
website.master.adminEmail)
|
website.master.adminEmail)
|
||||||
|
|
||||||
self.file = logging.writeToFile('Restarting mail services for them to see new SSL.', 0)
|
self.file = logging.writeToFile('Restarting mail services for them to see new SSL.', 0)
|
||||||
|
|
||||||
from plogical.processUtilities import ProcessUtilities
|
from plogical.processUtilities import ProcessUtilities
|
||||||
|
|||||||
Reference in New Issue
Block a user