fix(backups): Providers were not initialized corretly

This commit is contained in:
Inex Code 2023-06-23 14:36:16 +03:00
parent b86d0cd850
commit 1664f857ea
7 changed files with 9 additions and 20 deletions

View file

@ -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

View file

@ -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

View 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

View file

@ -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

View file

@ -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

View file

@ -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(),
)

View file

@ -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(),