- Anzeigename, Paketname, Token-Key, DB-/Volume-Namen auf project_good - README Clone-Abschnitt mit git.scarriffle.com/Scarriffle/project-good Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
35 lines
913 B
Python
35 lines
913 B
Python
from functools import lru_cache
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
|
|
|
|
# Database
|
|
database_url: str = "postgresql+psycopg2://project_good:project_good@localhost:5432/project_good"
|
|
|
|
# Auth / JWT
|
|
jwt_secret: str = "change-me-in-production"
|
|
jwt_algorithm: str = "HS256"
|
|
jwt_expire_minutes: int = 60 * 24 * 7 # 7 days
|
|
|
|
# First admin, created on startup if no users exist
|
|
admin_username: str = "admin"
|
|
admin_password: str = "changeme"
|
|
|
|
# Open Food Facts
|
|
off_base_url: str = "https://world.openfoodfacts.org"
|
|
off_timeout_seconds: float = 8.0
|
|
|
|
# Behaviour
|
|
expiry_warning_days_default: int = 7
|
|
|
|
# CORS (comma separated); "*" allows all
|
|
cors_origins: str = "*"
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings()
|