Initial commit with Phase 0 Scaffolding
Some checks failed
Automated Container Build / build-and-push (push) Failing after 3s
CI / Backend (Python) (push) Failing after 28s
CI / Frontend (TypeScript) (push) Failing after 5m8s

This commit is contained in:
Elijah 2026-06-10 18:28:17 -07:00
parent b393607602
commit c545d4b17d
51 changed files with 7064 additions and 4 deletions

47
backend/app/config.py Normal file
View file

@ -0,0 +1,47 @@
"""
PaperJet backend configuration.
All settings are driven by environment variables (see .env.example).
"""
from pathlib import Path
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
"""Application settings loaded from environment variables."""
# --- Security ---
SECRET_KEY: str = "change-me-in-production"
# --- Upload ---
MAX_UPLOAD_MB: int = 200
# --- Retention ---
TRASH_RETENTION_DAYS: int = 30
AUTO_VERSION_RETENTION_DAYS: int = 30
# --- Cookie ---
COOKIE_SECURE: bool = False # Set True in production (behind HTTPS proxy)
COOKIE_MAX_AGE_SECONDS: int = 7 * 24 * 60 * 60 # 7 days
COOKIE_NAME: str = "paperjet_session"
# --- Database ---
DATABASE_PATH: Path = Path("/data/db/app.sqlite")
# --- Storage ---
PDF_STORAGE_PATH: Path = Path("/data/pdfs")
THUMBNAILS_PATH: Path = Path("/data/thumbnails")
# --- App ---
APP_VERSION: str = "0.1.0"
DEBUG: bool = False
# --- Rate Limiting ---
LOGIN_MAX_ATTEMPTS: int = 5
LOGIN_LOCKOUT_SECONDS: int = 900 # 15 minutes
model_config = {"env_prefix": "PAPERJET_", "env_file": ".env", "extra": "ignore"}
settings = Settings()