mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-29 15:31:28 +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):
|
class Backblaze(AbstractBackupProvider):
|
||||||
@property
|
backuper = ResticBackuper("--b2-account", "--b2-key", ":b2:")
|
||||||
def backuper(self):
|
|
||||||
return ResticBackuper("--b2-account", "--b2-key", ":b2:")
|
|
||||||
|
|
||||||
name = BackupProviderEnum.BACKBLAZE
|
name = BackupProviderEnum.BACKBLAZE
|
||||||
|
|
|
@ -6,8 +6,6 @@ from selfprivacy_api.graphql.queries.providers import (
|
||||||
|
|
||||||
|
|
||||||
class LocalFileBackup(AbstractBackupProvider):
|
class LocalFileBackup(AbstractBackupProvider):
|
||||||
@property
|
backuper = ResticBackuper("", "", ":local:")
|
||||||
def backuper(self):
|
|
||||||
return ResticBackuper("", "", ":local:")
|
|
||||||
|
|
||||||
name = BackupProviderEnum.FILE
|
name = BackupProviderEnum.FILE
|
||||||
|
|
|
@ -6,8 +6,6 @@ from selfprivacy_api.graphql.queries.providers import (
|
||||||
|
|
||||||
|
|
||||||
class InMemoryBackup(AbstractBackupProvider):
|
class InMemoryBackup(AbstractBackupProvider):
|
||||||
@property
|
backuper = ResticBackuper("", "", ":memory:")
|
||||||
def backuper(self):
|
|
||||||
return ResticBackuper("", "", ":memory:")
|
|
||||||
|
|
||||||
name = BackupProviderEnum.MEMORY
|
name = BackupProviderEnum.MEMORY
|
||||||
|
|
|
@ -6,8 +6,6 @@ from selfprivacy_api.graphql.queries.providers import (
|
||||||
|
|
||||||
|
|
||||||
class NoBackups(AbstractBackupProvider):
|
class NoBackups(AbstractBackupProvider):
|
||||||
@property
|
backuper = NoneBackupper()
|
||||||
def backuper(self):
|
|
||||||
return NoneBackupper()
|
|
||||||
|
|
||||||
name = BackupProviderEnum.NONE
|
name = BackupProviderEnum.NONE
|
||||||
|
|
|
@ -11,10 +11,7 @@ from selfprivacy_api.graphql.queries.providers import (
|
||||||
|
|
||||||
|
|
||||||
class AbstractBackupProvider(ABC):
|
class AbstractBackupProvider(ABC):
|
||||||
@property
|
backuper: AbstractBackuper
|
||||||
@abstractmethod
|
|
||||||
def backuper(self) -> AbstractBackuper:
|
|
||||||
raise NotImplementedError
|
|
||||||
|
|
||||||
name: BackupProviderEnum
|
name: BackupProviderEnum
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ class BackupMutations:
|
||||||
return GenericBackupConfigReturn(
|
return GenericBackupConfigReturn(
|
||||||
success=True,
|
success=True,
|
||||||
message="",
|
message="",
|
||||||
code="200",
|
code=200,
|
||||||
configuration=Backup().configuration(),
|
configuration=Backup().configuration(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ class BackupMutations:
|
||||||
return GenericBackupConfigReturn(
|
return GenericBackupConfigReturn(
|
||||||
success=True,
|
success=True,
|
||||||
message="",
|
message="",
|
||||||
code="200",
|
code=200,
|
||||||
configuration=Backup().configuration(),
|
configuration=Backup().configuration(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ class BackupMutations:
|
||||||
return GenericBackupConfigReturn(
|
return GenericBackupConfigReturn(
|
||||||
success=True,
|
success=True,
|
||||||
message="",
|
message="",
|
||||||
code="200",
|
code=200,
|
||||||
configuration=Backup().configuration(),
|
configuration=Backup().configuration(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ class Backup:
|
||||||
@strawberry.field
|
@strawberry.field
|
||||||
def configuration(self) -> BackupConfiguration:
|
def configuration(self) -> BackupConfiguration:
|
||||||
return BackupConfiguration(
|
return BackupConfiguration(
|
||||||
provider=BackupProvider[Backups.provider().name],
|
provider=Backups.provider().name,
|
||||||
encryption_key=LocalBackupSecret.get(),
|
encryption_key=LocalBackupSecret.get(),
|
||||||
is_initialized=Backups.is_initted(),
|
is_initialized=Backups.is_initted(),
|
||||||
autobackup_period=Backups.autobackup_period_minutes(),
|
autobackup_period=Backups.autobackup_period_minutes(),
|
||||||
|
|
Loading…
Reference in a new issue