31 lines
1.0 KiB
Python
31 lines
1.0 KiB
Python
from functools import lru_cache
|
|
|
|
from pydantic import AliasChoices, AnyHttpUrl, Field
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
|
|
|
|
orbitward_env: str = Field(default="development", validation_alias=AliasChoices("ORBITWARD_ENV", "ORBITALWARD_ENV"))
|
|
orbitward_secret_key: str = Field(
|
|
default="change-me",
|
|
min_length=8,
|
|
validation_alias=AliasChoices("ORBITWARD_SECRET_KEY", "ORBITALWARD_SECRET_KEY"),
|
|
)
|
|
database_url: str = "postgresql+psycopg://orbitward:orbitward@postgres:5432/orbitward"
|
|
redis_url: str = "redis://redis:6379/0"
|
|
frontend_url: AnyHttpUrl | str = "http://localhost:5173"
|
|
backend_url: AnyHttpUrl | str = "http://localhost:8000"
|
|
initial_admin_email: str = "admin@example.com"
|
|
initial_admin_password: str = "change-me"
|
|
access_token_expire_minutes: int = 60 * 12
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings()
|
|
|
|
|
|
settings = get_settings()
|