mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-07-09 14:23:04 +02:00
manual auto renew for SSL
This commit is contained in:
@@ -76,6 +76,14 @@
|
||||
<div class="col-md-6">
|
||||
<div class="content-box mt-5 mx-10">
|
||||
<div class="panel-body">
|
||||
{% if viewSSL == 1 %}
|
||||
<div style="margin-top: 2%" class="alert alert-success">
|
||||
<div class="alert-content">
|
||||
<h4 class="alert-title">Certificate from {{ authority }}</h4>
|
||||
<p>Your SSL will expire in {{ days }} days.</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="example-box-wrapper">
|
||||
<h3 class="title-hero">
|
||||
{% trans "Disk Usage" %}
|
||||
|
||||
@@ -26,12 +26,14 @@
|
||||
|
||||
<h3 class="content-box-header">
|
||||
{% trans "Resource Usage" %} <img ng-hide="domainLoading" src="/static/images/loading.gif">
|
||||
<a style="float: right; margin-left: 2%" class="btn btn-border btn-alt border-azure btn-link font-azure" href="/websites/{{ domain }}/setupStaging" title=""><span>{% trans "Clone/Staging" %}</span></a>
|
||||
<a style="float: right" class="btn btn-border btn-alt border-blue-alt btn-link font-blue-alt" href="/websites/{{ domain }}/sshAccess" title=""><span>{% trans "Set up SSH Access" %}</span></a>
|
||||
<a style="float: right; margin-left: 2%"
|
||||
class="btn btn-border btn-alt border-azure btn-link font-azure"
|
||||
href="/websites/{{ domain }}/setupStaging" title=""><span>{% trans "Clone/Staging" %}</span></a>
|
||||
<a style="float: right" class="btn btn-border btn-alt border-blue-alt btn-link font-blue-alt"
|
||||
href="/websites/{{ domain }}/sshAccess" title=""><span>{% trans "Set up SSH Access" %}</span></a>
|
||||
</h3>
|
||||
|
||||
|
||||
|
||||
<div class="content-box-wrapper">
|
||||
<div class="row">
|
||||
|
||||
@@ -72,6 +74,14 @@
|
||||
<div class="col-md-6">
|
||||
<div style="margin-top: 4%" class="content-box mt-5 mx-10">
|
||||
<div class="panel-body">
|
||||
{% if viewSSL == 1 %}
|
||||
<div style="margin-top: 2%" class="alert alert-success">
|
||||
<div class="alert-content">
|
||||
<h4 class="alert-title">Certificate from {{ authority }}</h4>
|
||||
<p>Your SSL will expire in {{ days }} days.</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="example-box-wrapper">
|
||||
<h3 class="title-hero">
|
||||
{% trans "Disk Usage" %}
|
||||
|
||||
@@ -712,8 +712,6 @@ class WebsiteManager:
|
||||
execPath = execPath + " findDomainBW --virtualHostName " + self.domain + " --bandwidth " + str(
|
||||
website.package.bandwidth)
|
||||
|
||||
logging.CyberCPLogFileWriter.writeToFile(execPath)
|
||||
|
||||
output = ProcessUtilities.outputExecutioner(execPath)
|
||||
bwData = output.split(",")
|
||||
except BaseException, msg:
|
||||
@@ -746,6 +744,25 @@ class WebsiteManager:
|
||||
else:
|
||||
Data['email'] = 0
|
||||
|
||||
## Getting SSL Information
|
||||
try:
|
||||
import OpenSSL
|
||||
from datetime import datetime
|
||||
filePath = '/etc/letsencrypt/live/%s/fullchain.pem' % (self.domain)
|
||||
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM,
|
||||
open(filePath, 'r').read())
|
||||
expireData = x509.get_notAfter().decode('ascii')
|
||||
finalDate = datetime.strptime(expireData, '%Y%m%d%H%M%SZ')
|
||||
|
||||
now = datetime.now()
|
||||
diff = finalDate - now
|
||||
Data['viewSSL'] = 1
|
||||
Data['days'] = str(diff.days)
|
||||
Data['authority'] = x509.get_issuer().get_components()[1][1]
|
||||
except BaseException, msg:
|
||||
Data['viewSSL'] = 0
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||
|
||||
servicePath = '/home/cyberpanel/pureftpd'
|
||||
if os.path.exists(servicePath):
|
||||
Data['ftp'] = 1
|
||||
@@ -829,6 +846,26 @@ class WebsiteManager:
|
||||
else:
|
||||
Data['ftp'] = 0
|
||||
|
||||
## Getting SSL Information
|
||||
try:
|
||||
import OpenSSL
|
||||
from datetime import datetime
|
||||
filePath = '/etc/letsencrypt/live/%s/fullchain.pem' % (self.domain)
|
||||
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM,
|
||||
open(filePath, 'r').read())
|
||||
expireData = x509.get_notAfter().decode('ascii')
|
||||
finalDate = datetime.strptime(expireData, '%Y%m%d%H%M%SZ')
|
||||
|
||||
now = datetime.now()
|
||||
diff = finalDate - now
|
||||
Data['viewSSL'] = 1
|
||||
Data['days'] = str(diff.days)
|
||||
Data['authority'] = x509.get_issuer().get_components()[1][1]
|
||||
except BaseException, msg:
|
||||
Data['viewSSL'] = 0
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||
|
||||
|
||||
return render(request, 'websiteFunctions/launchChild.html', Data)
|
||||
else:
|
||||
return render(request, 'websiteFunctions/launchChild.html',
|
||||
|
||||
Reference in New Issue
Block a user