Files
TK-Wiki-Newsletter/app/core/config.py
smueller 48410d39da Add editor exclusion defaults and newsletter filtering controls.
This makes it possible to exclude specific editors (e.g. Aranzinger) from edited-article results by default, including dashboard generation and scheduled SMTP runs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-09 10:53:01 +02:00

34 lines
1.3 KiB
Python

from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
app_name: str = "TK Wiki Newsletter Admin"
environment: str = "development"
secret_key: str = "change-me-in-production"
algorithm: str = "HS256"
access_token_expire_minutes: int = 120
jwt_issuer: str = "tk-wiki-newsletter-admin"
jwt_audience: str = "tk-wiki-newsletter-admin"
database_url: str = "sqlite:///./data/newsletter.db"
wiki_api_url: str = "https://www.thomas-krenn.com/de/wikiDE/api.php"
allowed_hosts: str = "localhost,127.0.0.1"
cookie_secure: bool = False
hsts_max_age: int = 31536000
admin_bootstrap_email: str = "admin@internal.local"
admin_bootstrap_password: str = "ChangeMe123!"
# Wenn true: setzt Passwort/Rolle/Status des Bootstrap-Admins beim Start
# auf die .env-Werte zurück (auch wenn der User bereits existiert).
admin_bootstrap_reset: bool = False
editor_tip_max_length: int = 10000
highlights_max_length: int = 5000
default_excluded_users: str = "Aranzinger"
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")
@property
def is_production(self) -> bool:
return self.environment.lower() == "production"
settings = Settings()