Files
jmap-webmail/.env.example
T
Matthieu MALVACHE 512c97f656 feat: add OAUTH_ONLY mode to hide basic auth form on login page
New OAUTH_ONLY env var hides username/password fields and promotes the
SSO button as the primary login method. Useful for deployments that
want to enforce OAuth-only authentication.

Includes retry button when OAuth discovery fails to avoid dead-end
login pages.

Closes #32
2026-03-16 13:07:08 +01:00

77 lines
3.0 KiB
Bash

# JMAP Webmail Configuration
# Copy this file to .env.local and fill in your values
# =============================================================================
# Runtime Configuration (recommended for Docker)
# These are read at request time, allowing post-build configuration
# =============================================================================
# App name displayed in the UI
APP_NAME=JMAP Webmail
# JMAP server URL (required)
# This is the URL of your JMAP-compatible mail server
# Make sure your JMAP server allows CORS requests from this webmail's domain.
JMAP_SERVER_URL=https://your-jmap-server.com
# =============================================================================
# Build-time Configuration (legacy, still supported as fallback)
# These are baked into the bundle at build time
# =============================================================================
# NEXT_PUBLIC_APP_NAME=JMAP Webmail
# NEXT_PUBLIC_JMAP_SERVER_URL=https://your-jmap-server.com
# =============================================================================
# OAuth2/OIDC Configuration (optional)
# Enable SSO login via OAuth2 with PKCE. Basic Auth remains the default.
# =============================================================================
# Set to "true" to enable the SSO login button
# OAUTH_ENABLED=true
# Set to "true" to hide the username/password form and only show SSO login
# Implies OAUTH_ENABLED=true
# OAUTH_ONLY=true
# OAuth2 client ID registered with your JMAP server
# OAUTH_CLIENT_ID=webmail
# OAuth2 client secret (kept server-side, never sent to browser)
# OAUTH_CLIENT_SECRET=
# Explicit OAuth2/OIDC issuer URL (optional)
# When set, OAuth discovery (.well-known endpoints) targets this URL instead of
# JMAP_SERVER_URL. Use this when authentication is handled by an external IdP
# (e.g., Keycloak, Authentik) rather than the JMAP server itself.
# If not set, discovery falls back to JMAP_SERVER_URL.
# OAUTH_ISSUER_URL=https://keycloak.example.com/realms/mail
# =============================================================================
# Session Persistence (optional)
# Enables "Remember me" for Basic Auth login.
# Generate with: openssl rand -base64 32
# =============================================================================
# SESSION_SECRET=your-secret-key-here
# =============================================================================
# Logging Configuration
# =============================================================================
# Log format: "text" (colored, human-readable) or "json" (structured, for log aggregation)
LOG_FORMAT=text
# Log level: "error", "warn", "info", or "debug"
LOG_LEVEL=info
# =============================================================================
# Docker Configuration
# =============================================================================
# When running with Docker, set these in .env.local:
# APP_NAME=My Webmail
# JMAP_SERVER_URL=https://mail.example.com
#
# Then run:
# docker compose up -d