From 8bb916628719c1ace839898fb31241609ee05eea Mon Sep 17 00:00:00 2001 From: Inex Code Date: Wed, 26 Jun 2024 14:21:49 +0300 Subject: [PATCH] Revert "fix: remove get sub domain from services" This reverts commit 46fd7a237c6c1f8be0946313f45deac61a7d2a67. --- selfprivacy_api/services/bitwarden/__init__.py | 5 ++++- selfprivacy_api/services/gitea/__init__.py | 5 ++++- selfprivacy_api/services/jitsimeet/__init__.py | 5 ++++- selfprivacy_api/services/nextcloud/__init__.py | 5 ++++- selfprivacy_api/services/ocserv/__init__.py | 5 ++++- selfprivacy_api/services/pleroma/__init__.py | 5 ++++- selfprivacy_api/services/test_service/__init__.py | 5 ++++- 7 files changed, 28 insertions(+), 7 deletions(-) diff --git a/selfprivacy_api/services/bitwarden/__init__.py b/selfprivacy_api/services/bitwarden/__init__.py index 6c44aeb..52f1466 100644 --- a/selfprivacy_api/services/bitwarden/__init__.py +++ b/selfprivacy_api/services/bitwarden/__init__.py @@ -1,5 +1,4 @@ """Class representing Bitwarden service""" - import base64 import subprocess from typing import Optional, List @@ -44,6 +43,10 @@ class Bitwarden(Service): domain = get_domain() return f"https://password.{domain}" + @staticmethod + def get_subdomain() -> Optional[str]: + return "password" + @staticmethod def is_movable() -> bool: return True diff --git a/selfprivacy_api/services/gitea/__init__.py b/selfprivacy_api/services/gitea/__init__.py index 7029b48..311d59e 100644 --- a/selfprivacy_api/services/gitea/__init__.py +++ b/selfprivacy_api/services/gitea/__init__.py @@ -1,5 +1,4 @@ """Class representing Bitwarden service""" - import base64 import subprocess from typing import Optional, List @@ -40,6 +39,10 @@ class Gitea(Service): domain = get_domain() return f"https://git.{domain}" + @staticmethod + def get_subdomain() -> Optional[str]: + return "git" + @staticmethod def is_movable() -> bool: return True diff --git a/selfprivacy_api/services/jitsimeet/__init__.py b/selfprivacy_api/services/jitsimeet/__init__.py index 05ef2f7..53d572c 100644 --- a/selfprivacy_api/services/jitsimeet/__init__.py +++ b/selfprivacy_api/services/jitsimeet/__init__.py @@ -1,5 +1,4 @@ """Class representing Jitsi Meet service""" - import base64 import subprocess from typing import Optional, List @@ -43,6 +42,10 @@ class JitsiMeet(Service): domain = get_domain() return f"https://meet.{domain}" + @staticmethod + def get_subdomain() -> Optional[str]: + return "meet" + @staticmethod def is_movable() -> bool: return False diff --git a/selfprivacy_api/services/nextcloud/__init__.py b/selfprivacy_api/services/nextcloud/__init__.py index 6aee771..3e5b8d3 100644 --- a/selfprivacy_api/services/nextcloud/__init__.py +++ b/selfprivacy_api/services/nextcloud/__init__.py @@ -1,5 +1,4 @@ """Class representing Nextcloud service.""" - import base64 import subprocess from typing import Optional, List @@ -42,6 +41,10 @@ class Nextcloud(Service): domain = get_domain() return f"https://cloud.{domain}" + @staticmethod + def get_subdomain() -> Optional[str]: + return "cloud" + @staticmethod def is_movable() -> bool: return True diff --git a/selfprivacy_api/services/ocserv/__init__.py b/selfprivacy_api/services/ocserv/__init__.py index e21fe6e..4dd802f 100644 --- a/selfprivacy_api/services/ocserv/__init__.py +++ b/selfprivacy_api/services/ocserv/__init__.py @@ -1,5 +1,4 @@ """Class representing ocserv service.""" - import base64 import subprocess import typing @@ -34,6 +33,10 @@ class Ocserv(Service): """Return service url.""" return None + @staticmethod + def get_subdomain() -> typing.Optional[str]: + return "vpn" + @staticmethod def is_movable() -> bool: return False diff --git a/selfprivacy_api/services/pleroma/__init__.py b/selfprivacy_api/services/pleroma/__init__.py index eebd925..44a9be8 100644 --- a/selfprivacy_api/services/pleroma/__init__.py +++ b/selfprivacy_api/services/pleroma/__init__.py @@ -1,5 +1,4 @@ """Class representing Nextcloud service.""" - import base64 import subprocess from typing import Optional, List @@ -38,6 +37,10 @@ class Pleroma(Service): domain = get_domain() return f"https://social.{domain}" + @staticmethod + def get_subdomain() -> Optional[str]: + return "social" + @staticmethod def is_movable() -> bool: return True diff --git a/selfprivacy_api/services/test_service/__init__.py b/selfprivacy_api/services/test_service/__init__.py index 2058d57..caf4666 100644 --- a/selfprivacy_api/services/test_service/__init__.py +++ b/selfprivacy_api/services/test_service/__init__.py @@ -1,5 +1,4 @@ """Class representing Bitwarden service""" - import base64 import typing import subprocess @@ -64,6 +63,10 @@ class DummyService(Service): domain = "test.com" return f"https://password.{domain}" + @staticmethod + def get_subdomain() -> typing.Optional[str]: + return "password" + @classmethod def is_movable(cls) -> bool: return cls.movable