From 5fd7b6c4edd8893d46e6650066634c300ec95853 Mon Sep 17 00:00:00 2001 From: Houkime <> Date: Fri, 3 Feb 2023 18:03:13 +0000 Subject: [PATCH] feat(backup): allow no auth --- selfprivacy_api/backup/restic_backuper.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/selfprivacy_api/backup/restic_backuper.py b/selfprivacy_api/backup/restic_backuper.py index 99a29ab..fd42791 100644 --- a/selfprivacy_api/backup/restic_backuper.py +++ b/selfprivacy_api/backup/restic_backuper.py @@ -15,8 +15,15 @@ class ResticBackuper(AbstractBackuper): def rclone_args(self): return "rclone.args=serve restic --stdio" + self.backend_rclone_args() - def backend_rclone_args(self, account: str, key: str): - return f"{self.login_flag} {account} {self.key_flag} {key}" + def backend_rclone_args(self, account: str, key: str) -> str: + acc_arg = "" + key_arg = "" + if account != "": + acc_arg = f"{self.login_flag} {account}" + if key != "": + key_arg = f"{self.key_flag} {key}" + + return f"{acc_arg} {key_arg}" def restic_command(self, account: str, key: str, *args): return [