This commit is contained in:
usman@cyberpersons.com 2023-04-04 13:47:48 +05:00
parent b386a1963c
commit 80f66589a8
3 changed files with 195 additions and 145 deletions

View File

@ -7,135 +7,184 @@
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
<div class="container">
<div id="page-title">
<h2>{% trans "SSL v2" %} - <a target="_blank" href="http://go.cyberpanel.net/dns-records"
style="height: 23px;line-height: 21px;"
class="btn btn-border btn-alt border-red btn-link font-red"
title=""><span>{% trans "DNS Docs" %}</span></a></h2>
<p>{% trans "On this page, you have the option to configure DNS providers that CyberPanel can utilize for issuing SSL certificates, providing enhanced flexibility and ease of renewal." %}</p>
</div>
<div ng-controller="sslIssueCtrlV2" class="panel">
<div class="panel-body">
<h3 class="content-box-header">
{% trans "SSL v2" %}
</h3>
<div class="example-box-wrapper">
{% if SaveSuccess %}
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-6">
<div class="alert alert-success">
<p>{% trans "Changes saved succesfully." %}</p>
{% if PremStat %}
<div class="container">
<div id="page-title">
<h2>{% trans "SSL v2" %} - <a target="_blank" href="http://go.cyberpanel.net/dns-records"
style="height: 23px;line-height: 21px;"
class="btn btn-border btn-alt border-red btn-link font-red"
title=""><span>{% trans "DNS Docs" %}</span></a></h2>
<p>{% trans "On this page, you have the option to configure DNS providers that CyberPanel can utilize for issuing SSL certificates, providing enhanced flexibility and ease of renewal." %}</p>
</div>
<div ng-controller="sslIssueCtrlV2" class="panel">
<div class="panel-body">
<h3 class="content-box-header">
{% trans "SSL v2" %}
</h3>
<div class="example-box-wrapper">
{% if SaveSuccess %}
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-6">
<div class="alert alert-success">
<p>{% trans "Changes saved succesfully." %}</p>
</div>
</div>
</div>
</div>
{% endif %}
<ul class="nav nav-tabs">
{% endif %}
<ul class="nav nav-tabs">
<li class="col-md-4 nav-item tab-mod active">
<a href="#tab-example-1" data-toggle="tab" class="h4 nav-link">
<i class="fa fa-cog btn-icon"></i>
<span>{% trans "Issue SSL" %}</span>
</a>
<li class="col-md-4 nav-item tab-mod active">
<a href="#tab-example-1" data-toggle="tab" class="h4 nav-link">
<i class="fa fa-cog btn-icon"></i>
<span>{% trans "Issue SSL" %}</span>
</a>
</li>
<li class="col-md-4 tab-mod nav-item">
<a href="#tab-example-3" data-toggle="tab" class="h4 nav-link">
<i class="fa fa-cogs btn-icon"></i>
<span>{% trans "API Settings" %}</span>
</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade active in" id="tab-example-1">
<div class="example-box-wrapper">
</li>
<li class="col-md-4 tab-mod nav-item">
<a href="#tab-example-3" data-toggle="tab" class="h4 nav-link">
<i class="fa fa-cogs btn-icon"></i>
<span>{% trans "API Settings" %}</span>
</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade active in" id="tab-example-1">
<div class="example-box-wrapper">
<form action="/" class="form-horizontal bordered-row panel-body">
<form action="/" class="form-horizontal bordered-row panel-body">
<div class="form-group">
<label class="col-sm-2 control-label">{% trans "Select Domain" %} </label>
<div class="col-sm-6">
<select ng-model="virtualHost"
class="form-control">
{% for items in websiteList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
<div class="col-sm-4">
<button style="width: 100%;" type="button"
ng-click="issueSSL()"
class="btn btn-primary">{% trans "Issue SSL" %} <img
ng-hide="manageSSLLoading" src="{% static 'images/loading.gif' %}">
</button>
<div class="form-group">
<label class="col-sm-2 control-label">{% trans "Select Domain" %} </label>
<div class="col-sm-6">
<select ng-model="virtualHost"
class="form-control">
{% for items in websiteList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
<div class="col-sm-4">
<button style="width: 100%;" type="button"
ng-click="issueSSL()"
class="btn btn-primary">{% trans "Issue SSL" %} <img
ng-hide="manageSSLLoading"
src="{% static 'images/loading.gif' %}">
</button>
</div>
</div>
</div>
<div class="form-group">
<div class="form-group">
<div class="col-sm-12">
<h3 style="margin: 2%">SSL Status: {$ sslStatus $}</h3>
<div class="col-sm-12">
<textarea ng-model="sslLogs" class="form-control" rows="20"></textarea>
<h3 style="margin: 2%">SSL Status: {$ sslStatus $}</h3>
<div class="col-sm-12">
<textarea ng-model="sslLogs" class="form-control"
rows="20"></textarea>
</div>
</div>
</div>
</form>
</div>
</div>
<div class="tab-pane fade" id="tab-example-3">
<form method="post" action="{% url 'v2ManageSSL' %}"
class="form-horizontal bordered-row panel-body">
{% csrf_token %}
<h2 style="margin-bottom: 2%">{% trans "Cloudflare Settings" %}</h2>
<div class="form-group">
<label class="col-sm-3 control-label">{% trans "CloudFlare Email" %}</label>
<div class="col-sm-6">
<input name="SAVED_CF_Email" type="text" class="form-control"
value="{{ SAVED_CF_Email }}" required>
</div>
</div>
</form>
<div class="form-group">
<label class="col-sm-3 control-label">{% trans "API Token" %}</label>
<div class="col-sm-6">
<input name="SAVED_CF_Key" type="text" class="form-control"
value="{{ SAVED_CF_Key }}" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-4">
<button type="submit"
class="btn btn-primary btn-lg">{% trans "Save" %}</button>
</div>
</div>
</form>
</div>
</div>
<div class="tab-pane fade" id="tab-example-3">
<form method="post" action="{% url 'v2ManageSSL' %}"
class="form-horizontal bordered-row panel-body">
{% csrf_token %}
<h2 style="margin-bottom: 2%">{% trans "Cloudflare Settings" %}</h2>
<div class="form-group">
<label class="col-sm-3 control-label">{% trans "CloudFlare Email" %}</label>
<div class="col-sm-6">
<input name="SAVED_CF_Email" type="text" class="form-control"
value="{{ SAVED_CF_Email }}" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{% trans "API Token" %}</label>
<div class="col-sm-6">
<input name="SAVED_CF_Key" type="text" class="form-control"
value="{{ SAVED_CF_Key }}" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-4">
<button type="submit" class="btn btn-primary btn-lg">{% trans "Save" %}</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
{% else %}
<style>
.feturecard {
width: 30%;
padding: 46px;
margin: 15px
}
</style>
<div class="container">
<div id="page-title" align="center">
<h1 style="color: black"><strong>SSLv2 Comes with Full Automation + Wildcard SSLs! </strong></h1>
<p style="font-size: 15px; color: black; margin-top: 1%">Are you tired of the hassle that comes with
setting up SSL certificates for your website? Do you want a faster and easier way to secure your
website without the need for manual verification? <br><br>
Introducing CyberPanel's new feature, SSL v2! With SSL v2, you can automatically issue SSL
certificates using the ACME DNS verification method. This means that you no longer have to worry
about going through the manual process of verifying ownership of your domain. <br><br>
</div>
What's even better is that we've integrated two of the most popular domain registrars, Cloudflare
and Namecheap, so you can easily issue SSL certificates with just a few clicks. No more fiddling
around with complicated settings and DNS configurations! <br><br>
With SSL v2, you can rest easy knowing that your website is secure and your visitors' data is
protected. Don't wait any longer to upgrade your website's security - get SSL v2 today!<br></p>
</div>
<p align="center">
<iframe width="788.54" height="443" src="https://www.youtube.com/embed/c-ffIKgjrBU"
title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe>
</p>
<div style="margin-top: 2%">
<stripe-pricing-table pricing-table-id="prctbl_1MQtdYJMfY1fWGMszc4tx78j"
publishable-key="pk_live_51ITXBmJMfY1fWGMs2G0LAydJweIDMp2WaYocM0xyzdn03WaHUbMw6uxfVuktAkgpRyUql7tz7gF5OwdccEZLd6Ot00XX6tGoZx">
</stripe-pricing-table>
<stripe-pricing-table pricing-table-id="prctbl_1LpSqSJMfY1fWGMsxSNhPLsc"
publishable-key="pk_live_51ITXBmJMfY1fWGMs2G0LAydJweIDMp2WaYocM0xyzdn03WaHUbMw6uxfVuktAkgpRyUql7tz7gF5OwdccEZLd6Ot00XX6tGoZx">
</stripe-pricing-table>
<stripe-pricing-table pricing-table-id="prctbl_1M6WpCJMfY1fWGMsQXFlZWcW"
publishable-key="pk_live_51ITXBmJMfY1fWGMs2G0LAydJweIDMp2WaYocM0xyzdn03WaHUbMw6uxfVuktAkgpRyUql7tz7gF5OwdccEZLd6Ot00XX6tGoZx">
</stripe-pricing-table>
</div>
</div>
{% endif %}
{% endblock %}

View File

@ -34,6 +34,11 @@ def v2ManageSSL(request):
data = {}
if ACLManager.CheckForPremFeature('all'):
data['PremStat'] = 1
else:
data['PremStat'] = 0
if request.method == 'POST':
SAVED_CF_Key = request.POST.get('SAVED_CF_Key')
SAVED_CF_Email = request.POST.get('SAVED_CF_Email')
@ -42,7 +47,6 @@ def v2ManageSSL(request):
data['SaveSuccess'] = 1
RetStatus, SAVED_CF_Key, SAVED_CF_Email = ACLManager.FetchCloudFlareAPIKeyFromAcme()
from plogical.dnsUtilities import DNS
DNS.ConfigurePowerDNSInAcme()
@ -60,56 +64,55 @@ def v2IssueSSL(request):
userID = request.session['userID']
admin = Administrator.objects.get(pk=userID)
try:
if request.method == 'POST':
currentACL = ACLManager.loadedACL(userID)
if ACLManager.CheckForPremFeature('all'):
if request.method == 'POST':
currentACL = ACLManager.loadedACL(userID)
if currentACL['admin'] == 1:
pass
elif currentACL['manageSSL'] == 1:
pass
else:
return ACLManager.loadErrorJson('SSL', 0)
if currentACL['admin'] == 1:
pass
elif currentACL['manageSSL'] == 1:
pass
else:
return ACLManager.loadErrorJson('SSL', 0)
data = json.loads(request.body)
virtualHost = data['virtualHost']
data = json.loads(request.body)
virtualHost = data['virtualHost']
if ACLManager.checkOwnership(virtualHost, admin, currentACL) == 1:
pass
else:
return ACLManager.loadErrorJson()
if ACLManager.checkOwnership(virtualHost, admin, currentACL) == 1:
pass
else:
return ACLManager.loadErrorJson()
try:
website = ChildDomains.objects.get(domain=virtualHost)
adminEmail = website.master.adminEmail
path = website.path
except:
website = Websites.objects.get(domain=virtualHost)
adminEmail = website.adminEmail
path = "/home/" + virtualHost + "/public_html"
try:
website = ChildDomains.objects.get(domain=virtualHost)
adminEmail = website.master.adminEmail
path = website.path
except:
website = Websites.objects.get(domain=virtualHost)
adminEmail = website.adminEmail
path = "/home/" + virtualHost + "/public_html"
## ssl issue
## ssl issue
execPath = "/usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"
execPath = execPath + " issueSSLv2 --virtualHostName " + virtualHost + " --administratorEmail " + adminEmail + " --path " + path
output = ProcessUtilities.outputExecutioner(execPath)
execPath = "/usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"
execPath = execPath + " issueSSLv2 --virtualHostName " + virtualHost + " --administratorEmail " + adminEmail + " --path " + path
output = ProcessUtilities.outputExecutioner(execPath)
if output.find("1,") > -1:
## ssl issue ends
website.ssl = 1
website.save()
data_ret = {'status': 1, "SSL": 1,
'error_message': "None", 'sslLogs': output}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
else:
data_ret = {'status': 0, "SSL": 0,
'error_message': output, 'sslLogs': output}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
if output.find("1,") > -1:
## ssl issue ends
website.ssl = 1
website.save()
data_ret = {'status': 1, "SSL": 1,
'error_message': "None", 'sslLogs': output}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
else:
data_ret = {'status': 0, "SSL": 0,
'error_message': output, 'sslLogs': output}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
except BaseException as msg:
data_ret = {'status': 0, "SSL": 0,
'error_message': str(msg)}

View File

@ -156,8 +156,6 @@
</div>
</div>