24 lines
656 B
Python
24 lines
656 B
Python
from __future__ import annotations
|
|
|
|
import os
|
|
from dataclasses import dataclass
|
|
from functools import lru_cache
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv()
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class Settings:
|
|
backend_mode: str = os.getenv("BFF_BACKEND_MODE", "mock").strip().lower()
|
|
auth_token: str = os.getenv("BFF_AUTH_TOKEN", "dev-token").strip()
|
|
login_password: str = os.getenv("BFF_LOGIN_PASSWORD", "dev-password").strip()
|
|
openclaw_base_url: str = os.getenv("OPENCLAW_BASE_URL", "").strip()
|
|
openclaw_api_token: str = os.getenv("OPENCLAW_API_TOKEN", "").strip()
|
|
|
|
|
|
@lru_cache(maxsize=1)
|
|
def get_settings() -> Settings:
|
|
return Settings()
|