diff --git a/IncBackups/views.py b/IncBackups/views.py index 4b53982e4..78e5d2b3c 100644 --- a/IncBackups/views.py +++ b/IncBackups/views.py @@ -718,6 +718,24 @@ def ConfigureV2Backup(request): if ACLManager.currentContextPermission(current_acl, 'createBackup') == 0: return ACLManager.loadError() + try: + req_data = {} + req_data['token'] = request.GET.get('t') + req_data['refresh_token'] = request.GET.get('r') + req_data['token_uri'] = request.GET.get('to') + req_data['scopes'] = request.GET.get('s') + req_data['name'] = request.GET.get('n') + + cpbuv2 = CPBackupsV2( + {'domain': 'cyberpanel.net', 'BasePath': '/home/backup', 'BackupDatabase': 1, 'BackupData': 1, + 'BackupEmails': 1, 'BackendName': 'testremote'}) + + # RcloneData = {"name": 'testremote', "host": "staging.cyberpanel.net", "user": "abcds2751", "port": "22", + # "password": "hosting", } + cpbuv2.SetupRcloneBackend(CPBackupsV2.GDrive, req_data) + except BaseException as msg: + logging.writeToFile(str(msg)) + # websites = ACLManager.findAllSites(current_acl, user_id) # # destinations = _get_destinations(local=True) diff --git a/plogical/Backupsv2.py b/plogical/Backupsv2.py index 14dfc5923..506de6418 100644 --- a/plogical/Backupsv2.py +++ b/plogical/Backupsv2.py @@ -98,14 +98,15 @@ pass = {ObsecurePassword} ProcessUtilities.executioner(command, self.website.externalApp) elif type == CPBackupsV2.GDrive: ## config = {"name":, "host":, "user":, "port":, "path":, "password":,} - command = f'rclone obscure {config["password"]}' - ObsecurePassword = ProcessUtilities.outputExecutioner(command).rstrip('\n') + #command = f'rclone obscure {config["password"]}' + #ObsecurePassword = ProcessUtilities.outputExecutioner(command).rstrip('\n') content = f'''[{config["name"]}] type = sftp -host = {config["host"]} -user = {config["user"]} -pass = {ObsecurePassword} +host = hey +user = hey +pass = hey +{str(self.config)} ''' command = f"echo '{content}' > {self.ConfigFilePath}" ProcessUtilities.executioner(command, self.website.externalApp, True)