Files
bdinvite/.env.example
kiskaadee 713a582769 feat(security): harden authentication edge cases and verify deployment independence
- Add comprehensive adversarial edge case test coverage in backend/tests/test_security_hardening.py
- Enforce InvalidPKCEError (HTTP 401) on missing, invalid, or mismatched PKCE code_verifier
- Document and verify Direct Standalone and Homelab Production deployment modes in backend/app/config.py and .env.example
- Update docker-compose.yml to pass OIDC and session environment variables and route directly through Traefik
- Verify zero runtime occurrences of Remote-User in backend/app/ and frontend/src/
2026-10-03 01:25:26 -05:00

57 lines
2.5 KiB
Bash

# ==============================================================================
# BDInvite Configuration Template (.env.example)
#
# Supports two distinct deployment modes:
# 1. Direct Standalone Mode (local dev / test with mock-oauth2-server or Keycloak)
# 2. Homelab Production Mode (behind Traefik TLS proxy with Authelia / OIDC)
# ==============================================================================
# Core Application Settings
SERVICE_NAME=bdinvite
SERVICE_DOMAIN=demos.roadtotech.me
BASE_PATH=/birthday
APP_PORT=8000
DATABASE_URL=sqlite:///./data/bdinvite.db
DATA_DIR=./data
# ------------------------------------------------------------------------------
# Mode 1: Direct Standalone Mode (Default for local development & testing)
# ------------------------------------------------------------------------------
# In Direct Standalone Mode:
# - BDInvite runs directly on localhost:8000
# - Cookies are sent over plain HTTP (SESSION_COOKIE_SECURE=false)
# - OIDC IdP is a local mock or Keycloak instance
OIDC_ISSUER=http://localhost:8088/default
OIDC_CLIENT_ID=bdinvite-client
OIDC_CLIENT_SECRET=bdinvite-secret
OIDC_REDIRECT_URI=http://localhost:8000/birthday/api/auth/callback
OIDC_GROUPS_CLAIM=groups
SESSION_COOKIE_NAME=bdinvite_session
SESSION_COOKIE_SECURE=false
SESSION_COOKIE_SAMESITE=lax
SESSION_COOKIE_HTTPONLY=true
SESSION_MAX_AGE_SECONDS=86400
SESSION_SECRET_KEY=bdinvite-local-dev-secret-key-replace-in-production
# ------------------------------------------------------------------------------
# Mode 2: Homelab Production Mode (Behind Traefik TLS proxy with Authelia)
# ------------------------------------------------------------------------------
# In Homelab Production Mode:
# - Traefik terminates TLS for *.roadtotech.me and routes /birthday to container port 8000
# - Cookies must be sent with Secure flag over HTTPS (SESSION_COOKIE_SECURE=true)
# - Authelia acts as the OpenID Connect (OIDC) identity provider
# - Uncomment the following variables for production deployment:
#
# SERVICE_DOMAIN=demos.roadtotech.me
# OIDC_ISSUER=https://auth.roadtotech.me
# OIDC_CLIENT_ID=bdinvite-client
# OIDC_CLIENT_SECRET=change_to_production_client_secret
# OIDC_REDIRECT_URI=https://demos.roadtotech.me/birthday/api/auth/callback
# OIDC_GROUPS_CLAIM=groups
# SESSION_COOKIE_NAME=bdinvite_session
# SESSION_COOKIE_SECURE=true
# SESSION_COOKIE_SAMESITE=lax
# SESSION_COOKIE_HTTPONLY=true
# SESSION_MAX_AGE_SECONDS=86400
# SESSION_SECRET_KEY=generate_a_cryptographically_secure_random_hex_key_here