ruff.toml has declared `quote-style = "single"` and line-length 120 since the lint job landed, and 118 of 128 files follow it. The panel backend and the netbox configuration were written in black/prettier style instead, so a `ruff format --check` would have failed on them from the start. Bring them onto the style the repository already declares, which is what makes the check adoptable at all. Formatting only: apart from quote style the diff is multi-line expressions joined where they fit inside 120 columns. Both suites still pass afterwards (25 pytest, and ruff check is clean). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
45 lines
1.4 KiB
Python
45 lines
1.4 KiB
Python
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()
|