33 lines
901 B
Python
33 lines
901 B
Python
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
from pathlib import Path
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")
|
|
|
|
database_url: str = "postgresql+asyncpg://homehub:homehub@localhost:5432/homehub"
|
|
upload_dir: str = "/data/uploads"
|
|
data_dir: str = "/data"
|
|
redis_url: str = "redis://redis:6379"
|
|
cors_origins: str = "http://localhost:3000"
|
|
mcp_api_key: str = ""
|
|
|
|
@property
|
|
def cors_origins_list(self) -> list[str]:
|
|
return [o.strip() for o in self.cors_origins.split(",")]
|
|
|
|
@property
|
|
def upload_path(self) -> Path:
|
|
return Path(self.upload_dir)
|
|
|
|
@property
|
|
def notes_md_path(self) -> Path:
|
|
return Path(self.data_dir) / "notes"
|
|
|
|
@property
|
|
def backup_path(self) -> Path:
|
|
return Path(self.data_dir) / "backup"
|
|
|
|
|
|
settings = Settings()
|