From 57ee76b2fd1af2267dee839025c79d6c094ada7c Mon Sep 17 00:00:00 2001 From: dettlaff Date: Thu, 30 Jan 2025 16:04:19 +0400 Subject: [PATCH] refactor: remove auth migration --- selfprivacy_api/migrations/add_auth.py | 35 -------------------------- 1 file changed, 35 deletions(-) delete mode 100644 selfprivacy_api/migrations/add_auth.py diff --git a/selfprivacy_api/migrations/add_auth.py b/selfprivacy_api/migrations/add_auth.py deleted file mode 100644 index fce44e9..0000000 --- a/selfprivacy_api/migrations/add_auth.py +++ /dev/null @@ -1,35 +0,0 @@ -from selfprivacy_api.migrations.migration import Migration - -from selfprivacy_api.services.flake_service_manager import FlakeServiceManager -from selfprivacy_api.utils import ReadUserData, WriteUserData - - -class AddAuth(Migration): - """Adds auth (kanidm) service if it is not present.""" - - def get_migration_name(self) -> str: - return "add_auth" - - def get_migration_description(self) -> str: - return "Adds the auth (Kanidm) if it is not present." - - def is_migration_needed(self) -> bool: - with FlakeServiceManager() as manager: - if "auth" not in manager.services: - return True - with ReadUserData() as data: - if "auth" not in data["modules"]: - return True - return False - - def migrate(self) -> None: - with FlakeServiceManager() as manager: - if "auth" not in manager.services: - manager.services["monitoring"] = ( - "git+https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-config.git?ref=sso&rev=f795bc977f03de64c10a62528bfa04a88f2611ca&dir=sp-modules/auth" - ) - with WriteUserData() as data: - if "monitoring" not in data["modules"]: - data["modules"]["monitoring"] = { - "enable": False, - }