mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 13:56:01 +01:00
v2.3.1
This commit is contained in:
@@ -114,7 +114,7 @@
|
||||
|
||||
|
||||
<div ng-hide="driveHidden" id="checkret" class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Backup File Retention" %}</label>
|
||||
<label class="col-sm-3 control-label">{% trans "Backup File Retention" %} (<a href="https://cyberpanel.net/cyberpanel-addons">Paid Feature</a> )</label>
|
||||
<div class="col-sm-6">
|
||||
<select id="fileretention" ng-model="Retentiontime" ng-change="changeRetention()" class="form-control">
|
||||
<option value="1d">1 days</option>
|
||||
|
||||
@@ -224,7 +224,8 @@ def FileManagerRoot(request):
|
||||
if(Status == 1):
|
||||
template = 'baseTemplate/FileManager.html'
|
||||
else:
|
||||
return redirect("https://cyberpanel.net/adons")
|
||||
return redirect("https://cyberpanel.net/cyberpanel-addons")
|
||||
|
||||
except BaseException as msg:
|
||||
template = 'baseTemplate/FileManager.html'
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -24,7 +22,6 @@ import requests
|
||||
import socket
|
||||
from websiteFunctions.models import NormalBackupJobs, NormalBackupJobLogs
|
||||
from boto3.s3.transfer import TransferConfig
|
||||
|
||||
try:
|
||||
from s3Backups.models import BackupPlan, BackupLogs
|
||||
import boto3
|
||||
@@ -235,6 +232,11 @@ class IncScheduler(multi.Thread):
|
||||
@staticmethod
|
||||
def runGoogleDriveBackups(type):
|
||||
|
||||
ipFile = "/etc/cyberpanel/machineIP"
|
||||
f = open(ipFile)
|
||||
ipData = f.read()
|
||||
ipAddress = ipData.split('\n', 1)[0]
|
||||
|
||||
backupRunTime = time.strftime("%m.%d.%Y_%H-%M-%S")
|
||||
backupLogPath = "/usr/local/lscp/logs/local_backup_log." + backupRunTime
|
||||
|
||||
@@ -256,6 +258,7 @@ class IncScheduler(multi.Thread):
|
||||
finalData = json.dumps({'refresh_token': gDriveData['refresh_token']})
|
||||
r = requests.post("https://platform.cyberpersons.com/refreshToken", data=finalData
|
||||
)
|
||||
|
||||
gDriveData['token'] = json.loads(r.text)['access_token']
|
||||
|
||||
credentials = google.oauth2.credentials.Credentials(gDriveData['token'],
|
||||
@@ -280,11 +283,6 @@ class IncScheduler(multi.Thread):
|
||||
folderIDIP = gDriveData['folderIDIP']
|
||||
except:
|
||||
|
||||
ipFile = "/etc/cyberpanel/machineIP"
|
||||
f = open(ipFile)
|
||||
ipData = f.read()
|
||||
ipAddress = ipData.split('\n', 1)[0]
|
||||
|
||||
## Create CyberPanel Folder
|
||||
|
||||
file_metadata = {
|
||||
@@ -349,6 +347,7 @@ class IncScheduler(multi.Thread):
|
||||
try:
|
||||
drive.files().create(body=file_metadata, media_body=media, fields='id').execute()
|
||||
except:
|
||||
import requests
|
||||
finalData = json.dumps({'refresh_token': gDriveData['refresh_token']})
|
||||
r = requests.post("https://platform.cyberpersons.com/refreshToken", data=finalData
|
||||
)
|
||||
@@ -381,7 +380,7 @@ class IncScheduler(multi.Thread):
|
||||
|
||||
print("job com[leted")
|
||||
|
||||
logging.writeToFile('job completed')
|
||||
#logging.writeToFile('job completed')
|
||||
|
||||
url = "https://platform.cyberpersons.com/CyberpanelAdOns/Adonpermission"
|
||||
data = {
|
||||
@@ -461,8 +460,6 @@ class IncScheduler(multi.Thread):
|
||||
except BaseException as msg:
|
||||
logging.writeToFile('job not completed [ERROR:]..%s'%msg)
|
||||
|
||||
|
||||
|
||||
except BaseException as msg:
|
||||
GDriveJobLogs(owner=items, status=backupSchedule.ERROR,
|
||||
message='[Completely] Job failed, Error message: %s.' % (str(msg))).save()
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":"2.1","build":1}
|
||||
{"version":"2.3","build":1}
|
||||
Reference in New Issue
Block a user