Files
vyryi-back/app/core/config.py
Redsandy c9f66f330e init
2026-08-12 11:26:05 +03:00

28 lines
848 B
Python

from functools import lru_cache
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")
database_url: str = "sqlite:///./vyryi.db"
jwt_secret: str = "dev-secret-change-me"
jwt_algorithm: str = "HS256"
jwt_expire_minutes: int = 60 * 24 * 7
cors_origins: str = (
"http://localhost:5173,http://127.0.0.1:5173,"
"http://localhost:5174,http://127.0.0.1:5174"
)
cors_origin_regex: str = r"http://(localhost|127\.0\.0\.1):\d+"
bot_token: str = ""
@property
def cors_origins_list(self) -> list[str]:
return [origin.strip() for origin in self.cors_origins.split(",") if origin.strip()]
@lru_cache
def get_settings() -> Settings:
return Settings()