mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-05-10 14:17:05 +02:00
Merge branch 'v2.3.2' into v2.3.3-dev
This commit is contained in:
@@ -77,7 +77,7 @@
|
||||
|
||||
<!-- HELPERS -->
|
||||
|
||||
{% with version="2.3.2.2" %}
|
||||
{% with version="2.3.2.3" %}
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'baseTemplate/assets/finalBase/finalBase.css' %}">
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div style="margin-top: 11%;" class="server-message">
|
||||
<h1 style="font-size: 85px;margin: 0;font-weight: 300; line-height: 1.1;color:grey;text-align: center;">CyberPanel Installed</h1>
|
||||
<h2 style="margin-top: 2%;margin-bottom: 2%;font-weight: 300; line-height: 1.1;color: #a56565;;text-align: center;">You have successfully installed CyberPanel, please remove this page and upload your website. :)</h2>
|
||||
<p style="font-size: 35px;margin: 1%;font-weight: 300; line-height: 1.1;color:grey;text-align: center;"><a href="http://cyberpanel.net">CyberPanel</a> <a href="http://forums.cyberpanel.net">Forums</a> <a href="http://docs.cyberpanel.net">Documentation</a></p>
|
||||
<p style="font-size: 35px;margin: 1%;font-weight: 300; line-height: 1.1;color:grey;text-align: center;"><a href="http://cyberpanel.net">CyberPanel</a> <a href="https://community.cyberpanel.net/">Forums</a> <a href="https://community.cyberpanel.net/docs">Documentation</a></p>
|
||||
</div>
|
||||
@@ -1368,6 +1368,22 @@ autocreate_system_folders = On
|
||||
pass
|
||||
return True
|
||||
|
||||
|
||||
def findSSHPort(self):
|
||||
try:
|
||||
sshData = subprocess.check_output(shlex.split('cat /etc/ssh/sshd_config')).decode("utf-8").split('\n')
|
||||
|
||||
for items in sshData:
|
||||
if items.find('Port') > -1:
|
||||
if items[0] == 0:
|
||||
pass
|
||||
else:
|
||||
return items.split(' ')[1]
|
||||
|
||||
return '22'
|
||||
except BaseException as msg:
|
||||
return '22'
|
||||
|
||||
def installFirewalld(self):
|
||||
|
||||
if self.distro == ubuntu:
|
||||
@@ -1417,6 +1433,15 @@ autocreate_system_folders = On
|
||||
FirewallUtilities.addRule("udp", "443")
|
||||
FirewallUtilities.addRule("tcp", "40110-40210")
|
||||
|
||||
try:
|
||||
SSHPort = self.findSSHPort()
|
||||
if SSHPort != '22':
|
||||
FirewallUtilities.addRule('tcp', SSHPort)
|
||||
except BaseException as msg:
|
||||
logging.InstallLog.writeToFile(f'[Error Custom SSH port] {str(msg)}')
|
||||
preFlightsChecks.stdOut(f'[Error Custom SSH port] {str(msg)}')
|
||||
|
||||
|
||||
logging.InstallLog.writeToFile("FirewallD installed and configured!")
|
||||
preFlightsChecks.stdOut("FirewallD installed and configured!")
|
||||
|
||||
@@ -1988,8 +2013,8 @@ milter_default_action = accept
|
||||
if os.access('/usr/local/lsws/lsphp72/bin/php7.2', os.R_OK):
|
||||
os.symlink('/usr/local/lsws/lsphp72/bin/php7.2', '/usr/local/lsws/lsphp72/bin/php')
|
||||
|
||||
command = "cp /usr/local/lsws/lsphp71/bin/php /usr/bin/"
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
#command = "cp /usr/local/lsws/lsphp71/bin/php /usr/bin/"
|
||||
#preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
os.chdir(self.cwd)
|
||||
|
||||
|
||||
@@ -211,6 +211,16 @@ class PackagesManager:
|
||||
|
||||
modifyPack.save()
|
||||
|
||||
## Fix https://github.com/usmannasir/cyberpanel/issues/998
|
||||
|
||||
# from plogical.IncScheduler import IncScheduler
|
||||
# isPU = IncScheduler('CalculateAndUpdateDiskUsage', {})
|
||||
# isPU.start()
|
||||
|
||||
from plogical.processUtilities import ProcessUtilities
|
||||
command = '/usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/IncScheduler.py UpdateDiskUsageForce'
|
||||
ProcessUtilities.outputExecutioner(command)
|
||||
|
||||
data_ret = {'status': 1, 'saveStatus': 1, 'error_message': "None"}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#!/usr/local/CyberCP/bin/python
|
||||
import os.path
|
||||
import sys
|
||||
|
||||
sys.path.append('/usr/local/CyberCP')
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings")
|
||||
import django
|
||||
|
||||
django.setup()
|
||||
from IncBackups.IncBackupsControl import IncJobs
|
||||
from IncBackups.models import BackupJob
|
||||
@@ -56,8 +54,10 @@ class IncScheduler(multi.Thread):
|
||||
self.data = extraArgs
|
||||
|
||||
def run(self):
|
||||
if self.function == 'startBackup':
|
||||
if self.function == "startBackup":
|
||||
IncScheduler.startBackup(self.data['freq'])
|
||||
elif self.function == "CalculateAndUpdateDiskUsage":
|
||||
IncScheduler.CalculateAndUpdateDiskUsage()
|
||||
|
||||
@staticmethod
|
||||
def startBackup(type):
|
||||
@@ -727,8 +727,11 @@ Automatic backup failed for %s on %s.
|
||||
domain, time.strftime("%m.%d.%Y_%H-%M-%S"))).save()
|
||||
|
||||
jobConfig = json.loads(backupjob.config)
|
||||
if jobConfig['pid']:
|
||||
del jobConfig['pid']
|
||||
try:
|
||||
if jobConfig['pid']:
|
||||
del jobConfig['pid']
|
||||
except:
|
||||
pass
|
||||
jobConfig[IncScheduler.currentStatus] = 'Not running'
|
||||
backupjob.config = json.dumps(jobConfig)
|
||||
backupjob.save()
|
||||
@@ -1352,12 +1355,6 @@ Automatic backup failed for %s on %s.
|
||||
|
||||
except BaseException as msg:
|
||||
print("Version ID Error: %s"%str(msg))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
except BaseException as msg:
|
||||
print('%s. [SendToS3Cloud]' % (str(msg)))
|
||||
logging.writeToFile('%s. [SendToS3Cloud]' % (str(msg)))
|
||||
@@ -1369,6 +1366,10 @@ def main():
|
||||
parser.add_argument('--planName', help='Plan name for AWS!')
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.function == 'UpdateDiskUsageForce':
|
||||
IncScheduler.CalculateAndUpdateDiskUsage()
|
||||
return 0
|
||||
|
||||
if args.function == '30 Minutes' or args.function == '30 Minutes' or args.function == '1 Hour' or args.function == '6 Hours' or args.function == '12 Hours' or args.function == '1 Day' or args.function == '3 Days' or args.function == '1 Week':
|
||||
IncScheduler.RemoteBackup(args.function)
|
||||
return 0
|
||||
|
||||
@@ -435,7 +435,14 @@ class backupUtilities:
|
||||
|
||||
completPathToConf = f'{backupUtilities.Server_root}/conf/vhosts/{domainName}/vhost.conf'
|
||||
|
||||
copy(completPathToConf, tempStoragePath + '/vhost.conf')
|
||||
### If domain is suspended, this path wont exists, so please check for other
|
||||
|
||||
if os.path.exists(completPathToConf):
|
||||
copy(completPathToConf, tempStoragePath + '/vhost.conf')
|
||||
else:
|
||||
completPathToConf = f'{backupUtilities.Server_root}/conf/vhosts/{domainName}-suspended/vhost.conf'
|
||||
if os.path.exists(completPathToConf):
|
||||
copy(completPathToConf, tempStoragePath + '/vhost.conf')
|
||||
|
||||
childDomains = backupMetaData.findall('ChildDomains/domain')
|
||||
|
||||
@@ -447,9 +454,15 @@ class backupUtilities:
|
||||
|
||||
|
||||
completPathToConf = f'{backupUtilities.Server_root}/conf/vhosts/{actualChildDomain}/vhost.conf'
|
||||
copy(completPathToConf, f'{tempStoragePath}/{actualChildDomain}.vhost.conf')
|
||||
if os.path.exists(completPathToConf):
|
||||
copy(completPathToConf, f'{tempStoragePath}/{actualChildDomain}.vhost.conf')
|
||||
else:
|
||||
completPathToConf = f'{backupUtilities.Server_root}/conf/vhosts/{actualChildDomain}-suspended/vhost.conf'
|
||||
if os.path.exists(completPathToConf):
|
||||
copy(completPathToConf, f'{tempStoragePath}/{actualChildDomain}.vhost.conf')
|
||||
|
||||
### Storing SSL for child domainsa
|
||||
|
||||
### Storing SSL for child domainsa
|
||||
|
||||
sslStoragePath = f'/etc/letsencrypt/live/{actualChildDomain}'
|
||||
|
||||
@@ -776,6 +789,15 @@ class backupUtilities:
|
||||
1] + ". Not able to create Account, Databases and DNS Records, aborting. [575][5009]")
|
||||
return 0
|
||||
|
||||
#### Find out web server from backup conf
|
||||
|
||||
CurrentServer = ProcessUtilities.OLS
|
||||
|
||||
if os.path.exists(completPath + '/vhost.conf'):
|
||||
if open(f'{completPath}/vhost.conf', 'r').read().find('ServerName') > -1:
|
||||
CurrentServer = ProcessUtilities.ent
|
||||
|
||||
|
||||
########### Creating child/sub/addon/parked domains
|
||||
|
||||
logging.CyberCPLogFileWriter.statusWriter(status, "Creating Child Domains!")
|
||||
@@ -819,7 +841,8 @@ class backupUtilities:
|
||||
|
||||
if os.path.exists(completPath + '/' + domain + '.vhost.conf'):
|
||||
completPathToConf = backupUtilities.Server_root + '/conf/vhosts/' + domain + '/vhost.conf'
|
||||
copy(completPath + '/' + domain + '.vhost.conf', completPathToConf)
|
||||
if CurrentServer == ProcessUtilities.decideServer():
|
||||
copy(completPath + '/' + domain + '.vhost.conf', completPathToConf)
|
||||
|
||||
sslStoragePath = completPath + "/" + domain + ".cert.pem"
|
||||
|
||||
@@ -1030,7 +1053,8 @@ class backupUtilities:
|
||||
|
||||
completPathToConf = backupUtilities.Server_root + '/conf/vhosts/' + masterDomain + '/vhost.conf'
|
||||
if os.path.exists(completPath + '/vhost.conf'):
|
||||
copy(completPath + '/vhost.conf', completPathToConf)
|
||||
if CurrentServer == ProcessUtilities.decideServer():
|
||||
copy(completPath + '/vhost.conf', completPathToConf)
|
||||
|
||||
logging.CyberCPLogFileWriter.statusWriter(status, "Done")
|
||||
|
||||
|
||||
@@ -102,6 +102,8 @@ class cPanelImporter:
|
||||
self.PHPVersion = 'PHP 7.4'
|
||||
elif self.PHPVersion.find('80') > -1:
|
||||
self.PHPVersion = 'PHP 8.0'
|
||||
elif self.PHPVersion.find('81') > -1:
|
||||
self.PHPVersion = 'PHP 8.1'
|
||||
|
||||
if self.PHPVersion == '':
|
||||
if self.InheritPHP != '':
|
||||
|
||||
@@ -320,8 +320,8 @@ modsecurity_rules_file /usr/local/lsws/conf/modsec/rules.conf
|
||||
|
||||
for items in confData:
|
||||
if items.find('/usr/local/lsws/conf/modsec/rules.conf') > -1:
|
||||
conf.writelines(items)
|
||||
conf.write(owaspRulesConf)
|
||||
conf.writelines(items)
|
||||
continue
|
||||
else:
|
||||
conf.writelines(items)
|
||||
@@ -547,21 +547,36 @@ modsecurity_rules_file /usr/local/lsws/conf/modsec/owasp-modsecurity-crs-3.0-mas
|
||||
@staticmethod
|
||||
def disableOWASP():
|
||||
try:
|
||||
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
||||
confFile = os.path.join(virtualHostUtilities.Server_root, "conf/httpd_config.conf")
|
||||
confData = open(confFile).readlines()
|
||||
conf = open(confFile, 'w')
|
||||
|
||||
confFile = os.path.join(virtualHostUtilities.Server_root, "conf/httpd_config.conf")
|
||||
confData = open(confFile).readlines()
|
||||
conf = open(confFile, 'w')
|
||||
for items in confData:
|
||||
if items.find('modsec/owasp') > -1:
|
||||
continue
|
||||
else:
|
||||
conf.writelines(items)
|
||||
|
||||
for items in confData:
|
||||
if items.find('modsec/owasp') > -1:
|
||||
continue
|
||||
else:
|
||||
conf.writelines(items)
|
||||
conf.close()
|
||||
installUtilities.reStartLiteSpeed()
|
||||
|
||||
conf.close()
|
||||
installUtilities.reStartLiteSpeed()
|
||||
print("1,None")
|
||||
else:
|
||||
confFile = os.path.join("/usr/local/lsws/conf/modsec.conf")
|
||||
confData = open(confFile).readlines()
|
||||
conf = open(confFile, 'w')
|
||||
|
||||
print("1,None")
|
||||
for items in confData:
|
||||
if items.find('modsec/owasp') > -1:
|
||||
continue
|
||||
else:
|
||||
conf.writelines(items)
|
||||
|
||||
conf.close()
|
||||
installUtilities.reStartLiteSpeed()
|
||||
|
||||
print("1,None")
|
||||
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
|
||||
@@ -2339,9 +2339,9 @@ echo $oConfig->Save() ? 'Done' : 'Error';
|
||||
CentOSPath = '/etc/redhat-release'
|
||||
openEulerPath = '/etc/openEuler-release'
|
||||
|
||||
if not os.path.exists(CentOSPath) or not os.path.exists(openEulerPath):
|
||||
command = 'cp /usr/local/lsws/lsphp71/bin/php /usr/bin/'
|
||||
Upgrade.executioner(command, 'Set default PHP 7.0, 0')
|
||||
#if not os.path.exists(CentOSPath) or not os.path.exists(openEulerPath):
|
||||
#command = 'cp /usr/local/lsws/lsphp71/bin/php /usr/bin/'
|
||||
#Upgrade.executioner(command, 'Set default PHP 7.0, 0')
|
||||
|
||||
@staticmethod
|
||||
def someDirectories():
|
||||
|
||||
@@ -2181,8 +2181,8 @@ echo $oConfig->Save() ? 'Done' : 'Error';
|
||||
CentOSPath = '/etc/redhat-release'
|
||||
|
||||
if not os.path.exists(CentOSPath):
|
||||
command = 'cp /usr/local/lsws/lsphp71/bin/php /usr/bin/'
|
||||
Upgrade.executioner(command, 'Set default PHP 7.0, 0')
|
||||
#command = 'cp /usr/local/lsws/lsphp71/bin/php /usr/bin/'
|
||||
#Upgrade.executioner(command, 'Set default PHP 7.0, 0')
|
||||
|
||||
@staticmethod
|
||||
def someDirectories():
|
||||
|
||||
@@ -8,17 +8,21 @@
|
||||
<!-- Current language: {{ LANGUAGE_CODE }} -->
|
||||
|
||||
<style>
|
||||
.feturecard {
|
||||
width: 30%; padding: 46px; margin: 15px
|
||||
}
|
||||
.feturecard {
|
||||
width: 30%;
|
||||
padding: 46px;
|
||||
margin: 15px
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="container">
|
||||
<div id="page-title" align="center">
|
||||
<h2 style="color: black"><strong>Managing Your WordPress sites was never so easy!</strong></h2>
|
||||
<p style="font-size: 18px; color: black; margin-top: 1%">43% of all Websites on the Internet are built with WordPress, so
|
||||
<p style="font-size: 18px; color: black; margin-top: 1%">43% of all Websites on the Internet are built with
|
||||
WordPress, so
|
||||
it deserves some love! With CyberPanel WordPress Manager, you can easily Monitor, Analyze, Optimize and
|
||||
keep your website in Top-Notch performance, all the time.</p>
|
||||
keep your website in Top-Notch performance, all the time. (The lifetime plan does not include a trial;
|
||||
please see below for subscription-based plans)</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -29,19 +33,25 @@
|
||||
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 class="col-lg-12" style="margin: 1%; border-radius: 10px; box-shadow: rgba(66, 135, 245, 0.2) 0px 2px 8px 0px;">
|
||||
<div class="col-lg-12"
|
||||
style="margin: 1%; border-radius: 10px; box-shadow: rgba(66, 135, 245, 0.2) 0px 2px 8px 0px;">
|
||||
<h2 align="center" style="margin-top: 2%; color: black"><strong>Features You’ll Love</strong></h2>
|
||||
|
||||
<div class="center-content" style="display: flex; flex-wrap: wrap; margin: auto">
|
||||
|
||||
|
||||
<div align="center" style="margin-bottom: -15px;" class="feturecard" >
|
||||
<div align="center" style="margin-bottom: -15px;" class="feturecard">
|
||||
<div style="margin: 2%">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="3em" height="3em"
|
||||
preserveAspectRatio="xMidYMid meet" viewBox="0 0 512 512">
|
||||
@@ -57,7 +67,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div align="center" style="margin-bottom: -15px;"class="feturecard">
|
||||
<div align="center" style="margin-bottom: -15px;" class="feturecard">
|
||||
<div style="margin: 2%">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="3em" height="3em"
|
||||
preserveAspectRatio="xMidYMid meet" viewBox="0 0 1024 1024">
|
||||
@@ -75,7 +85,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div align="center" style="margin-bottom: -15px;"class="feturecard">
|
||||
<div align="center" style="margin-bottom: -15px;" class="feturecard">
|
||||
<div style="margin: 2%">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="3em" height="3em"
|
||||
preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24">
|
||||
@@ -142,7 +152,6 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@
|
||||
class="current-pack">{% trans "Invalid Domain (Note: You don't need to add 'http' or 'https')" %}</div>
|
||||
</div>
|
||||
<div ng-if="{{ test_domain_data }} == 0 ">
|
||||
<center>Looks like you have not subscripted to temporary domain feature,<a
|
||||
<center>Looks like you have not subscribed to temporary domain feature,<a
|
||||
href="https://go.cyberpanel.net/TempDomain">click here</a>
|
||||
for more details.
|
||||
</center>
|
||||
|
||||
@@ -452,7 +452,7 @@
|
||||
class="current-pack">{% trans "Invalid Domain (Note: You don't need to add 'http' or 'https')" %}</div>
|
||||
</div>
|
||||
<div ng-if="{{ test_domain_data }} == 0 ">
|
||||
<center>Looks like you have not subscripted to temporary domain feature,
|
||||
<center>Looks like you have not subscribed to temporary domain feature,
|
||||
<a
|
||||
href="https://go.cyberpanel.net/TempDomain">click here</a>
|
||||
for more details.
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
class="current-pack">{% trans "Invalid Domain (Note: You don't need to add 'http' or 'https')" %}</div>
|
||||
</div>
|
||||
<div ng-if="{{ test_domain_data }} == 0 ">
|
||||
<center>Looks like you have not subscripted to temporary domain feature, <a
|
||||
<center>Looks like you have not subscribed to temporary domain feature, <a
|
||||
href="https://go.cyberpanel.net/TempDomain">click here</a>
|
||||
for more details.
|
||||
</center>
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
class="current-pack">{% trans "Invalid Domain (Note: You don't need to add 'http' or 'https')" %}</div>
|
||||
</div>
|
||||
<div ng-if="{{ test_domain_data }} == 0 ">
|
||||
<center>Looks like you have not subscripted to temporary domain feature, <a
|
||||
<center>Looks like you have not subscribed to temporary domain feature, <a
|
||||
href="https://go.cyberpanel.net/TempDomain">click here</a>
|
||||
for more details.
|
||||
</center>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<div class="panel-body">
|
||||
<h3 class="title-hero">
|
||||
{% trans "Set up SSH access for " %} {{ domainName }}.</span> <img ng-hide="wpInstallLoading"
|
||||
src="{% static 'images/loading.gif' %}">
|
||||
src="{% static 'images/loading.gif' %}"> - <a target="_blank" href="https://go.cyberpanel.net/SFTPAccess" style="height: 23px;line-height: 21px;" class="btn btn-border btn-alt border-red btn-link font-red" title=""><span>SFTP Docs</span></a>
|
||||
</h3>
|
||||
<div class="example-box-wrapper">
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
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; margin-left: 2%" 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>
|
||||
href="/websites/{{ domain }}/sshAccess" title=""><span>{% trans "Set up SSH/SFTP Access" %}</span></a>
|
||||
<a style="float: right" class="btn btn-border btn-alt border-black btn-link font-black"
|
||||
href="https://go.cyberpanel.net/StessTest" title=""><span>{% trans "Stress Test" %}</span></a>
|
||||
</h3>
|
||||
|
||||
@@ -1286,42 +1286,48 @@ class WebsiteManager:
|
||||
|
||||
RemoteBackupConfigobj = RemoteBackupConfig.objects.get(pk=RemoteConfigID)
|
||||
Rconfig = json.loads(RemoteBackupConfigobj.config)
|
||||
provider = Rconfig['Provider']
|
||||
if provider == "Backblaze":
|
||||
EndURl = Rconfig['EndUrl']
|
||||
elif provider == "Amazon":
|
||||
EndURl = "https://s3.us-east-1.amazonaws.com"
|
||||
elif provider == "Wasabi":
|
||||
EndURl = "https://s3.wasabisys.com"
|
||||
|
||||
AccessKey = Rconfig['AccessKey']
|
||||
SecertKey = Rconfig['SecertKey']
|
||||
|
||||
session = boto3.session.Session()
|
||||
|
||||
client = session.client(
|
||||
's3',
|
||||
endpoint_url=EndURl,
|
||||
aws_access_key_id=AccessKey,
|
||||
aws_secret_access_key=SecertKey,
|
||||
verify=False
|
||||
)
|
||||
|
||||
############Creating Bucket
|
||||
BucketName = randomPassword.generate_pass().lower()
|
||||
|
||||
try:
|
||||
client.create_bucket(Bucket=BucketName)
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile("Creating Bucket Error: %s" % str(msg))
|
||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
#This code is only supposed to run if backups are s3, not for SFTP
|
||||
provider = Rconfig['Provider']
|
||||
if provider == "Backblaze":
|
||||
EndURl = Rconfig['EndUrl']
|
||||
elif provider == "Amazon":
|
||||
EndURl = "https://s3.us-east-1.amazonaws.com"
|
||||
elif provider == "Wasabi":
|
||||
EndURl = "https://s3.wasabisys.com"
|
||||
|
||||
config = {
|
||||
'BackupType': BackupType,
|
||||
'BucketName': BucketName
|
||||
}
|
||||
AccessKey = Rconfig['AccessKey']
|
||||
SecertKey = Rconfig['SecertKey']
|
||||
|
||||
session = boto3.session.Session()
|
||||
|
||||
client = session.client(
|
||||
's3',
|
||||
endpoint_url=EndURl,
|
||||
aws_access_key_id=AccessKey,
|
||||
aws_secret_access_key=SecertKey,
|
||||
verify=False
|
||||
)
|
||||
|
||||
############Creating Bucket
|
||||
BucketName = randomPassword.generate_pass().lower()
|
||||
|
||||
try:
|
||||
client.create_bucket(Bucket=BucketName)
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile("Creating Bucket Error: %s" % str(msg))
|
||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
config = {
|
||||
'BackupType': BackupType,
|
||||
'BucketName': BucketName
|
||||
}
|
||||
except BaseException as msg:
|
||||
config = {}
|
||||
pass
|
||||
|
||||
svobj = RemoteBackupSchedule(RemoteBackupConfig=RemoteBackupConfigobj, Name=ScheduleName,
|
||||
timeintervel=Backfrequency, fileretention=FileRetention,
|
||||
@@ -2796,6 +2802,17 @@ class WebsiteManager:
|
||||
|
||||
modifyWeb.save()
|
||||
|
||||
## Fix https://github.com/usmannasir/cyberpanel/issues/998
|
||||
|
||||
#from plogical.IncScheduler import IncScheduler
|
||||
#isPU = IncScheduler('CalculateAndUpdateDiskUsage', {})
|
||||
#isPU.start()
|
||||
|
||||
command = '/usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/IncScheduler.py UpdateDiskUsageForce'
|
||||
ProcessUtilities.outputExecutioner(command)
|
||||
|
||||
##
|
||||
|
||||
data_ret = {'status': 1, 'saveStatus': 1, 'error_message': "None"}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
Reference in New Issue
Block a user