mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-29 07:21:27 +00:00
fix(backups): Providers were not initialized corretly
This commit is contained in:
parent
b86d0cd850
commit
1664f857ea
|
@ -6,8 +6,6 @@ from selfprivacy_api.graphql.queries.providers import (
|
|||
|
||||
|
||||
class Backblaze(AbstractBackupProvider):
|
||||
@property
|
||||
def backuper(self):
|
||||
return ResticBackuper("--b2-account", "--b2-key", ":b2:")
|
||||
backuper = ResticBackuper("--b2-account", "--b2-key", ":b2:")
|
||||
|
||||
name = BackupProviderEnum.BACKBLAZE
|
||||
|
|
|
@ -6,8 +6,6 @@ from selfprivacy_api.graphql.queries.providers import (
|
|||
|
||||
|
||||
class LocalFileBackup(AbstractBackupProvider):
|
||||
@property
|
||||
def backuper(self):
|
||||
return ResticBackuper("", "", ":local:")
|
||||
backuper = ResticBackuper("", "", ":local:")
|
||||
|
||||
name = BackupProviderEnum.FILE
|
||||
|
|
|
@ -6,8 +6,6 @@ from selfprivacy_api.graphql.queries.providers import (
|
|||
|
||||
|
||||
class InMemoryBackup(AbstractBackupProvider):
|
||||
@property
|
||||
def backuper(self):
|
||||
return ResticBackuper("", "", ":memory:")
|
||||
backuper = ResticBackuper("", "", ":memory:")
|
||||
|
||||
name = BackupProviderEnum.MEMORY
|
||||
|
|
|
@ -6,8 +6,6 @@ from selfprivacy_api.graphql.queries.providers import (
|
|||
|
||||
|
||||
class NoBackups(AbstractBackupProvider):
|
||||
@property
|
||||
def backuper(self):
|
||||
return NoneBackupper()
|
||||
backuper = NoneBackupper()
|
||||
|
||||
name = BackupProviderEnum.NONE
|
||||
|
|
|
@ -11,10 +11,7 @@ from selfprivacy_api.graphql.queries.providers import (
|
|||
|
||||
|
||||
class AbstractBackupProvider(ABC):
|
||||
@property
|
||||
@abstractmethod
|
||||
def backuper(self) -> AbstractBackuper:
|
||||
raise NotImplementedError
|
||||
backuper: AbstractBackuper
|
||||
|
||||
name: BackupProviderEnum
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ class BackupMutations:
|
|||
return GenericBackupConfigReturn(
|
||||
success=True,
|
||||
message="",
|
||||
code="200",
|
||||
code=200,
|
||||
configuration=Backup().configuration(),
|
||||
)
|
||||
|
||||
|
@ -70,7 +70,7 @@ class BackupMutations:
|
|||
return GenericBackupConfigReturn(
|
||||
success=True,
|
||||
message="",
|
||||
code="200",
|
||||
code=200,
|
||||
configuration=Backup().configuration(),
|
||||
)
|
||||
|
||||
|
@ -87,7 +87,7 @@ class BackupMutations:
|
|||
return GenericBackupConfigReturn(
|
||||
success=True,
|
||||
message="",
|
||||
code="200",
|
||||
code=200,
|
||||
configuration=Backup().configuration(),
|
||||
)
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class Backup:
|
|||
@strawberry.field
|
||||
def configuration(self) -> BackupConfiguration:
|
||||
return BackupConfiguration(
|
||||
provider=BackupProvider[Backups.provider().name],
|
||||
provider=Backups.provider().name,
|
||||
encryption_key=LocalBackupSecret.get(),
|
||||
is_initialized=Backups.is_initted(),
|
||||
autobackup_period=Backups.autobackup_period_minutes(),
|
||||
|
|
Loading…
Reference in a new issue