# --- Required --- # The URL of the backend service you want to protect TARGET_URL=http://localhost:8081 # A long, random string for securing session cookies and JWTs # For production, generate a new key using: openssl rand -base64 45 SESSION_SECRET= # --- Database --- # Use ONE of the following options: # Option 1: PostgreSQL or MySQL (Recommended) # Example: postgres://user:password@host:port/dbname?sslmode=disable # Example: mysql://user:password@tcp(host:port)/dbname?charset=utf8mb4&parseTime=true # DATABASE_URL= # Option 2: SQLite (Default if DATABASE_URL is not set) DATABASE_PATH=./auth.db # --- Frontend & Proxy --- # Frontend mode: "js" (default) or "php" FRONTEND_TYPE=js # If true, protects the frontend path with session authentication PROTECT_FRONTEND=false # If true, protects the API path with bearer token authentication PROTECT_API=false # Base path for frontend routes to be protected FRONT_PATH=/ # Base path for API routes to be protected API_PATH=/api/ # --- Security Policies --- # Brute-force protection settings MAX_LOGIN_ATTEMPTS=5 LOCKOUT_DURATION_MINUTES=10 # User creation rate limit settings USER_CREATION_RATE_LIMIT_MAX_REQUESTS=5 USER_CREATION_RATE_LIMIT_WINDOW_SECONDS=3600 # Password policy (none, standard, enhanced, strict) PASSWORD_POLICY=standard # --- Token Durations --- # Duration for the web session cookie TOKEN_DURATION_HOURS=24 # Duration for the API JWT access token ACCESS_TOKEN_DURATION_MINUTES=15 # Duration for the API JWT refresh token REFRESH_TOKEN_DURATION_DAYS=7 # --- PHP Frontend Settings (only needed if FRONTEND_TYPE=php) --- # PHP_FPM_SOCKET=/run/php-fpm/php-fpm.sock # PHP_DOC_ROOT= # --- Optional: Path Overrides --- # Uncomment and change these to avoid URL conflicts with your backend application. # AUTH_PATH_LOGIN=/login # AUTH_PATH_REGISTER=/register # AUTH_PATH_LOGOUT=/logout # AUTH_PATH_ACCOUNT=/account # AUTH_PATH_ACCOUNT_PASSWORD=/account/password # AUTH_PATH_ADMIN=/admin # AUTH_PATH_ADMIN_USERS_API=/api/admin/users # AUTH_ASSETS_PATH=/assets