final v2backups and sslv2

This commit is contained in:
usman@cyberpersons.com
2023-04-11 22:47:14 +05:00
parent db6762ebdf
commit 9105d8e4de
8 changed files with 443 additions and 301 deletions

View File

@@ -24,7 +24,8 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">{% trans "Select Website" %} </label> <label class="col-sm-3 control-label">{% trans "Select Website" %} </label>
<div class="col-sm-6"> <div class="col-sm-6">
<select id="selwebsite" ng-change="selectwebsite()" ng-model="selwebsite" class="form-control"> <select id="selwebsite" ng-change="selectwebsite()" ng-model="selwebsite"
class="form-control">
{% for items in websiteList %} {% for items in websiteList %}
<option value="{{ items }}">{{ items }}</option> <option value="{{ items }}">{{ items }}</option>
{% endfor %} {% endfor %}

View File

@@ -13,24 +13,36 @@
<div class="container"> <div class="container">
<div id="page-title"> <div id="page-title">
<h2>{% trans "Create V2 Backup" %} - <a target="_blank" href="http://go.cyberpanel.net/backup" style="height: 23px;line-height: 21px;" class="btn btn-border btn-alt border-red btn-link font-red" title=""><span>{% trans "Backup Docs" %}</span></a></h2> <h2>{% trans "Create V2 Backup" %} - <a target="_blank" href="http://go.cyberpanel.net/backup"
style="height: 23px;line-height: 21px;"
class="btn btn-border btn-alt border-red btn-link font-red"
title=""><span>{% trans "Backup Docs" %}</span></a></h2>
<p>{% trans "This page can be used to create your backup" %}</p> <p>{% trans "This page can be used to create your backup" %}</p>
</div> </div>
<div ng-controller="CreateV2Backup" class="panel"> <div ng-controller="CreateV2Backup" class="panel">
<div class="panel-body"> <div class="panel-body">
<h3 class="title-hero"> <h3 class="title-hero">
{% trans "Create v2 Backup" %} <img ng-hide="backupLoading" src="{% static 'images/loading.gif' %}"> - <a href="{% url 'RestoreV2backupSite' %}">Restore Backups</a> {% trans "Create v2 Backup" %} <img ng-hide="backupLoading" src="{% static 'images/loading.gif' %}">
- <a href="{% url 'RestoreV2backupSite' %}">Restore Backups</a>
</h3> </h3>
<div class="example-box-wrapper"> <div class="example-box-wrapper">
<p align="center" style="margin-top: 2%; margin-bottom: 2%">
<iframe width="788.54" height="443" src="https://youtu.be/kDUANNvtOwE"
title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe>
</p>
<form class="form-horizontal bordered-row"> <form class="form-horizontal bordered-row">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">{% trans "Select Website" %} </label> <label class="col-sm-3 control-label">{% trans "Select Website" %} </label>
<div class="col-sm-6"> <div class="col-sm-6">
<select id="create-backup-select" ng-change="selectwebsite()" ng-model="selwebsite" class="form-control"> <select id="create-backup-select" ng-change="selectwebsite()" ng-model="selwebsite"
class="form-control">
{% for items in websiteList %} {% for items in websiteList %}
<option value="{{ items }}">{{ items }}</option> <option value="{{ items }}">{{ items }}</option>
{% endfor %} {% endfor %}
@@ -40,7 +52,8 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">{% trans "Select Repo" %} </label> <label class="col-sm-3 control-label">{% trans "Select Repo" %} </label>
<div class="col-sm-6"> <div class="col-sm-6">
<select id="reposelectbox" ng-change="selectrepo()" ng-model="testhabbi" class="form-control"> <select id="reposelectbox" ng-change="selectrepo()" ng-model="testhabbi"
class="form-control">
</select> </select>
</div> </div>
</div> </div>
@@ -86,7 +99,10 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">{% trans " " %} </label> <label class="col-sm-3 control-label">{% trans " " %} </label>
<div class="col-sm-6"> <div class="col-sm-6">
<button class="btn" id="CreateV2BackupButton" ng-click="CreateV2BackupButton()" style="border-radius: 6px;background-color: #3447b7;color: white !important;"> Create Backup</button> <button class="btn" id="CreateV2BackupButton" ng-click="CreateV2BackupButton()"
style="border-radius: 6px;background-color: #3447b7;color: white !important;">
Create Backup
</button>
</div> </div>
</div> </div>
@@ -134,7 +150,6 @@
</form> </form>
</div> </div>
</div> </div>

View File

@@ -11,16 +11,21 @@
</style> </style>
{% if BackupStat %}
<div class="container"> <div class="container">
<div id="page-title"> <div id="page-title">
<h2>{% trans "Restore V2 Backups" %} - <a target="_blank" href="http://go.cyberpanel.net/backup" style="height: 23px;line-height: 21px;" class="btn btn-border btn-alt border-red btn-link font-red" title=""><span>{% trans "Backup Docs" %}</span></a></h2> <h2>{% trans "Restore V2 Backups" %} - <a target="_blank" href="http://go.cyberpanel.net/backup"
style="height: 23px;line-height: 21px;"
class="btn btn-border btn-alt border-red btn-link font-red"
title=""><span>{% trans "Backup Docs" %}</span></a></h2>
<p>{% trans "This page can be used to restore your backup sites" %}</p> <p>{% trans "This page can be used to restore your backup sites" %}</p>
</div> </div>
<div ng-controller="restorev2backupoage" class="panel"> <div ng-controller="restorev2backupoage" class="panel">
<div class="panel-body"> <div class="panel-body">
<h3 class="title-hero"> <h3 class="title-hero">
{% trans "Restore V2 Backups" %} <img ng-hide="backupLoading" src="{% static 'images/loading.gif' %}"> {% trans "Restore V2 Backups" %} <img ng-hide="backupLoading"
src="{% static 'images/loading.gif' %}">
</h3> </h3>
<div class="example-box-wrapper"> <div class="example-box-wrapper">
@@ -30,7 +35,8 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">{% trans "Select Website" %} </label> <label class="col-sm-3 control-label">{% trans "Select Website" %} </label>
<div class="col-sm-6"> <div class="col-sm-6">
<select id="create-backup-select" ng-change="selectwebsite()" ng-model="selwebsite" class="form-control"> <select id="create-backup-select" ng-change="selectwebsite()" ng-model="selwebsite"
class="form-control">
{% for items in websiteList %} {% for items in websiteList %}
<option value="{{ items }}">{{ items }}</option> <option value="{{ items }}">{{ items }}</option>
{% endfor %} {% endfor %}
@@ -41,7 +47,8 @@
<label class="col-sm-3 control-label">{% trans "Select Repo" %} </label> <label class="col-sm-3 control-label">{% trans "Select Repo" %} </label>
<div class="col-sm-6"> <div class="col-sm-6">
<select id="reposelectbox" ng-change="selectrepo()" ng-model="testhabbi" class="form-control"> <select id="reposelectbox" ng-change="selectrepo()" ng-model="testhabbi"
class="form-control">
</select> </select>
</div> </div>
@@ -50,7 +57,6 @@
</form> </form>
</div> </div>
<div ng-hide="runningSnapshot" class="form-group"> <div ng-hide="runningSnapshot" class="form-group">
@@ -80,15 +86,19 @@
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times; <button type="button" class="close" data-dismiss="modal">&times;
</button> </button>
<h4 id="restore_header_text" class="modal-title">{% trans "Restore" %} <img ng-hide="backupLoading" src="{% static 'images/loading.gif' %}"></h4> <h4 id="restore_header_text" class="modal-title">{% trans "Restore" %} <img
ng-hide="backupLoading" src="{% static 'images/loading.gif' %}"></h4>
</div> </div>
<div class="modal-body" style=""> <div class="modal-body" style="">
<span style="font-weight: bolder">ID: <span style="font-weight: normal" id="Snapshot_id"></span></span><br> <span style="font-weight: bolder">ID: <span style="font-weight: normal"
<span style="font-weight: bolder">PATH: <span style="font-weight: normal" id="Snapshot_Path_id"></span></span><br> id="Snapshot_id"></span></span><br>
<span style="font-weight: bolder">PATH: <span style="font-weight: normal"
id="Snapshot_Path_id"></span></span><br>
<span style="display: flex;justify-content: center;margin-top: 20px;font-weight: bolder">{% trans "Are you ready to restore the backup? This may overwrite existing files." %} </span> <span style="display: flex;justify-content: center;margin-top: 20px;font-weight: bolder">{% trans "Are you ready to restore the backup? This may overwrite existing files." %} </span>
<div style="display: flex;justify-content: center;margin-top: 10px;margin-bottom: 20px"> <div style="display: flex;justify-content: center;margin-top: 10px;margin-bottom: 20px">
<button type="button" class="btn btn-primary "style="margin-right: 20px!important;" <button type="button" class="btn btn-primary "
style="margin-right: 20px!important;"
ng-click="RestorePathV2()">Yes <img ng-click="RestorePathV2()">Yes <img
ng-hide="backupLoading" ng-hide="backupLoading"
src=""> src="">
@@ -109,7 +119,8 @@
</div> </div>
<div class="progress"> <div class="progress">
<div id="installProgress" class="progress-bar" role="progressbar" aria-valuenow="70" <div id="installProgress" class="progress-bar" role="progressbar"
aria-valuenow="70"
aria-valuemin="0" aria-valuemax="100" style="width:0%"> aria-valuemin="0" aria-valuemax="100" style="width:0%">
<span class="sr-only">70% Complete</span> <span class="sr-only">70% Complete</span>
</div> </div>
@@ -158,6 +169,56 @@
</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>Backups v2 - Incremental Backups! </strong></h1>
<p style="font-size: 15px; color: black; margin-top: 1%">Is your website's data protection strategy up
to par? Are you tired of dealing with slow and unreliable backup solutions that don't offer the
level of robustness you need? <br><br>
Introducing CyberPanel's latest feature, Backups v2! With Backups v2, you can ensure that your
website's data is protected like never before. Our advanced incremental backup system utilizes
rclone, a powerful backup tool that supports over 30+ backends, including popular cloud storage
providers like Google Drive, Dropbox, Amazon S3, and more!<br><br>
Gone are the days of slow and cumbersome full backups. With Backups v2, you can take advantage of
incremental backups that only capture changes to your data, making the process lightning-fast and
highly efficient. This means you can save time and bandwidth while still maintaining the highest
level of data integrity.<br><br>
Whether you have a small blog or a large e-commerce website, Backups v2 is tailored to meet your
needs. With its robustness and versatility, you can have peace of mind knowing that your website's
data is backed up securely and can be easily restored whenever you need it.
<br></p>
</div>
<p align="center">
<iframe width="788.54" height="443" src="https://www.youtube.com/watch?v=7dI1013xvUc"
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 %} {% endblock %}

View File

@@ -11,6 +11,7 @@
</style> </style>
{% if BackupStat %}
<div class="container"> <div class="container">
<div id="page-title"> <div id="page-title">
<h2>{% trans "Schedule V2 Backup" %} - <a target="_blank" href="http://go.cyberpanel.net/backup" <h2>{% trans "Schedule V2 Backup" %} - <a target="_blank" href="http://go.cyberpanel.net/backup"
@@ -164,7 +165,8 @@
<!-- Modal content--> <!-- Modal content-->
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times; <button type="button" class="close" data-dismiss="modal">
&times;
</button> </button>
<h4 class="modal-title">{% trans "Set up account" %}</h4> <h4 class="modal-title">{% trans "Set up account" %}</h4>
</div> </div>
@@ -172,7 +174,8 @@
<form name="containerSettingsForm" action="/" <form name="containerSettingsForm" action="/"
class="form-horizontal"> class="form-horizontal">
<div ng-hide="installationDetailsForm" class="form-group"> <div ng-hide="installationDetailsForm"
class="form-group">
<label class="col-sm-3 control-label">{% trans "Are you sure?" %}</label> <label class="col-sm-3 control-label">{% trans "Are you sure?" %}</label>
</div> </div>
@@ -211,6 +214,56 @@
</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>Backups v2 - Incremental Backups! </strong></h1>
<p style="font-size: 15px; color: black; margin-top: 1%">Is your website's data protection strategy up
to par? Are you tired of dealing with slow and unreliable backup solutions that don't offer the
level of robustness you need? <br><br>
Introducing CyberPanel's latest feature, Backups v2! With Backups v2, you can ensure that your
website's data is protected like never before. Our advanced incremental backup system utilizes
rclone, a powerful backup tool that supports over 30+ backends, including popular cloud storage
providers like Google Drive, Dropbox, Amazon S3, and more!<br><br>
Gone are the days of slow and cumbersome full backups. With Backups v2, you can take advantage of
incremental backups that only capture changes to your data, making the process lightning-fast and
highly efficient. This means you can save time and bandwidth while still maintaining the highest
level of data integrity.<br><br>
Whether you have a small blog or a large e-commerce website, Backups v2 is tailored to meet your
needs. With its robustness and versatility, you can have peace of mind knowing that your website's
data is backed up securely and can be easily restored whenever you need it.
<br></p>
</div>
<p align="center">
<iframe width="788.54" height="443" src="https://www.youtube.com/watch?v=7dI1013xvUc"
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 %} {% endblock %}

View File

@@ -721,6 +721,13 @@ def ConfigureV2Backup(request):
if ACLManager.currentContextPermission(current_acl, 'createBackup') == 0: if ACLManager.currentContextPermission(current_acl, 'createBackup') == 0:
return ACLManager.loadError() return ACLManager.loadError()
data = {}
if ACLManager.CheckForPremFeature('all'):
data['BackupStat'] = 1
else:
data['BackupStat'] = 0
websites = ACLManager.findAllSites(current_acl, user_id) websites = ACLManager.findAllSites(current_acl, user_id)
# #
# destinations = _get_destinations(local=True) # destinations = _get_destinations(local=True)

View File

@@ -65,9 +65,15 @@ class BackupManager:
return proc.render() return proc.render()
def schedulev2Backups(self, request=None, userID=None, data=None): def schedulev2Backups(self, request=None, userID=None, data=None):
if ACLManager.CheckForPremFeature('all'):
BackupStat = 1
else:
BackupStat = 0
currentACL = ACLManager.loadedACL(userID) currentACL = ACLManager.loadedACL(userID)
websitesName = ACLManager.findAllSites(currentACL, userID) websitesName = ACLManager.findAllSites(currentACL, userID)
proc = httpProc(request, 'IncBackups/ScheduleV2Backup.html', {'websiteList': websitesName}, 'createBackup') proc = httpProc(request, 'IncBackups/ScheduleV2Backup.html', {'websiteList': websitesName, "BackupStat": BackupStat}, 'createBackup')
return proc.render() return proc.render()
def gDrive(self, request=None, userID=None, data=None): def gDrive(self, request=None, userID=None, data=None):

View File

@@ -1232,7 +1232,6 @@ team_drive =
return 1, None return 1, None
except BaseException as msg: except BaseException as msg:
print('Error: %s' % msg) print('Error: %s' % msg)
return 0, str(msg) return 0, str(msg)

View File

@@ -436,7 +436,7 @@ class sslUtilities:
subprocess.check_output(shlex.split(command)) subprocess.check_output(shlex.split(command))
try: try:
command = acmePath + f" --issue -d *.{virtualHostName}" \ command = acmePath + f" --issue -d {virtualHostName} -d *.{virtualHostName}" \
+ ' --cert-file ' + existingCertPath + '/cert.pem' + ' --key-file ' + existingCertPath + '/privkey.pem' \ + ' --cert-file ' + existingCertPath + '/cert.pem' + ' --key-file ' + existingCertPath + '/privkey.pem' \
+ ' --fullchain-file ' + existingCertPath + '/fullchain.pem' + f' --dns {DNS_TO_USE} -k ec-256 --force --server letsencrypt' + ' --fullchain-file ' + existingCertPath + '/fullchain.pem' + f' --dns {DNS_TO_USE} -k ec-256 --force --server letsencrypt'
#ResultText = open(logging.CyberCPLogFileWriter.fileName, 'r').read() #ResultText = open(logging.CyberCPLogFileWriter.fileName, 'r').read()