88c1ea297e
All feature containers now POST messages to ai-service (port 8010) instead of calling AI providers directly. ai-service routes to LM Studio, Ollama, or Anthropic based on /config/ai_service_config.json. doc-service AI providers removed; replaced by httpx ai_client.py. Backend settings restructured to /api/settings/ai. Frontend gets dedicated AIAdminSettingsPage and AI Service card in AppsPage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
31 lines
1.0 KiB
Python
31 lines
1.0 KiB
Python
from pydantic import field_validator
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
PROJECT_NAME: str = "destroying_sap"
|
|
|
|
DATABASE_URL: str = "postgresql+asyncpg://postgres:password@localhost:5432/destroying_sap"
|
|
|
|
# RS256 asymmetric signing — generate keys with scripts/generate_jwt_keys.py
|
|
ALGORITHM: str = "RS256"
|
|
JWT_PRIVATE_KEY: str = "" # PEM, required; set via env var
|
|
JWT_PUBLIC_KEY: str = "" # PEM, required; set via env var
|
|
ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 8 # 8 hours — no permanent sessions
|
|
|
|
CORS_ORIGINS: list[str] = ["http://localhost:5173"]
|
|
|
|
AI_SERVICE_URL: str = "http://ai-service:8010"
|
|
|
|
@field_validator("JWT_PRIVATE_KEY", "JWT_PUBLIC_KEY", mode="before")
|
|
@classmethod
|
|
def expand_newlines(cls, v: str) -> str:
|
|
"""Allow PEM keys stored on a single line with literal \\n in .env."""
|
|
return v.replace("\\n", "\n") if isinstance(v, str) else v
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
|
|
|
|
settings = Settings()
|