from __future__ import annotations import os from dataclasses import dataclass from pathlib import Path @dataclass(frozen=True) class Settings: namespace: str = os.environ.get('USERBOT_NAMESPACE', 'userbot') legacy_namespaces: tuple[str, ...] = tuple( value.strip() for value in os.environ.get('USERBOT_LEGACY_NAMESPACES', 'default').split(',') if value.strip() ) image: str = os.environ.get( 'USERBOT_IMAGE', 'gcr.forust.xyz/forust/userbot:latest', ) common_secret: str = os.environ.get( 'USERBOT_COMMON_SECRET', 'userbot-common-secrets', ) common_config: str = os.environ.get( 'USERBOT_COMMON_CONFIG', 'userbot-common-config', ) storage_class: str = os.environ.get( 'USERBOT_STORAGE_CLASS', 'local-path-retain', ) downloads_host_path: str = os.environ.get( 'USERBOT_DOWNLOADS_HOST_PATH', '/srv/homelab/userbot/Downloads', ) static_dir: Path = Path(os.environ.get('PANEL_STATIC_DIR', '/app/static')) auth_ttl_seconds: int = int(os.environ.get('PANEL_AUTH_TTL_SECONDS', '600')) default_storage: str = os.environ.get('USERBOT_DEFAULT_STORAGE', '1Gi') default_cpu_limit: str = os.environ.get('USERBOT_DEFAULT_CPU_LIMIT', '300m') default_memory_limit: str = os.environ.get( 'USERBOT_DEFAULT_MEMORY_LIMIT', '1536Mi', ) settings = Settings()