mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-12 21:53:16 +00:00
fix: from review
This commit is contained in:
parent
82a0b557e1
commit
416a0a8725
|
@ -3,14 +3,14 @@ from selfprivacy_api.migrations.migration import Migration
|
||||||
from selfprivacy_api.utils import ReadUserData, WriteUserData
|
from selfprivacy_api.utils import ReadUserData, WriteUserData
|
||||||
|
|
||||||
|
|
||||||
class UpdateServicesFlakeList(Migration):
|
class AddRoundcubeToUserdata(Migration):
|
||||||
"""Check if all required services are in the flake list"""
|
"""Add Roundcube to userdata.json if it does not exist"""
|
||||||
|
|
||||||
def get_migration_name(self):
|
def get_migration_name(self):
|
||||||
return "update_services_flake_list"
|
return "add_roundcube_to_userdata"
|
||||||
|
|
||||||
def get_migration_description(self):
|
def get_migration_description(self):
|
||||||
return "Check if all required services are in the flake list"
|
return "Add Roundcube to userdata.json if it does not exist"
|
||||||
|
|
||||||
def is_migration_needed(self):
|
def is_migration_needed(self):
|
||||||
with ReadUserData() as data:
|
with ReadUserData() as data:
|
||||||
|
@ -20,6 +20,5 @@ class UpdateServicesFlakeList(Migration):
|
||||||
def migrate(self):
|
def migrate(self):
|
||||||
with WriteUserData() as data:
|
with WriteUserData() as data:
|
||||||
data["modules"]["roundcube"] = {
|
data["modules"]["roundcube"] = {
|
||||||
"enable": True,
|
|
||||||
"subdomain": "roundcube",
|
"subdomain": "roundcube",
|
||||||
}
|
}
|
|
@ -25,7 +25,6 @@ class UpdateServicesFlakeList(Migration):
|
||||||
return "Check if all required services are in the flake list"
|
return "Check if all required services are in the flake list"
|
||||||
|
|
||||||
def is_migration_needed(self):
|
def is_migration_needed(self):
|
||||||
# this do not delete custom links for testing
|
|
||||||
for key, value in manager.services.items():
|
for key, value in manager.services.items():
|
||||||
if key not in CORRECT_SERVICES_LIST:
|
if key not in CORRECT_SERVICES_LIST:
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -44,9 +44,13 @@ class Roundcube(Service):
|
||||||
def is_required() -> bool:
|
def is_required() -> bool:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def can_be_backed_up() -> bool:
|
||||||
|
return False
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_backup_description() -> str:
|
def get_backup_description() -> str:
|
||||||
return "Secrets that are used to encrypt the communication."
|
return "Nothing to backup."
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_status() -> ServiceStatus:
|
def get_status() -> ServiceStatus:
|
||||||
|
|
Loading…
Reference in a new issue