mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-03-02 02:10:48 +01:00
config issue
This commit is contained in:
@@ -54,8 +54,6 @@ class CPBackupsV2(multi.Thread):
|
||||
from websiteFunctions.models import Websites
|
||||
self.website = Websites.objects.get(domain=self.data['domain'])
|
||||
|
||||
|
||||
|
||||
# Resresh gdive access_token code
|
||||
try:
|
||||
self.LocalRclonePath = f'/home/{self.website.domain}/.config/rclone'
|
||||
@@ -77,7 +75,6 @@ class CPBackupsV2(multi.Thread):
|
||||
token_dict = json.loads(token_str)
|
||||
refresh_token = token_dict['refresh_token']
|
||||
|
||||
|
||||
new_Acess_token = self.refresh_V2Gdive_token(refresh_token)
|
||||
|
||||
old_access_token = token_dict['access_token']
|
||||
@@ -149,20 +146,14 @@ class CPBackupsV2(multi.Thread):
|
||||
command = f'mkdir -p {self.LocalRclonePath}'
|
||||
ProcessUtilities.executioner(command, self.website.externalApp)
|
||||
|
||||
command = f'cat {self.ConfigFilePath}'
|
||||
CurrentContent = ProcessUtilities.outputExecutioner(command, self.website.externalApp)
|
||||
try:
|
||||
|
||||
if CurrentContent.find('No such file or directory'):
|
||||
CurrentContent = ''
|
||||
except:
|
||||
CurrentContent = ''
|
||||
if type == CPBackupsV2.SFTP:
|
||||
## config = {"name":, "host":, "user":, "port":, "path":, "password":,}
|
||||
command = f'rclone obscure {config["password"]}'
|
||||
ObsecurePassword = ProcessUtilities.outputExecutioner(command).rstrip('\n')
|
||||
|
||||
content = f'''{CurrentContent}
|
||||
content = f'''
|
||||
|
||||
[{config["Repo_Name"]}]
|
||||
type = sftp
|
||||
host = {config["host"]}
|
||||
@@ -180,7 +171,7 @@ pass = {ObsecurePassword}
|
||||
token = """{"access_token":"%s","token_type":"Bearer","refresh_token":"%s", "expiry":"2024-04-08T21:53:00.123456789Z"}""" % (
|
||||
config["token"], config["refresh_token"])
|
||||
|
||||
content = f'''{CurrentContent}
|
||||
content = f'''
|
||||
[{config["accountname"]}]
|
||||
type = drive
|
||||
scope = drive
|
||||
@@ -195,8 +186,6 @@ team_drive =
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + ' [Configure.run]')
|
||||
|
||||
|
||||
|
||||
@staticmethod
|
||||
def FetchCurrentTimeStamp():
|
||||
import time
|
||||
|
||||
Reference in New Issue
Block a user