Configuration

All ezAuth configuration is done through environment variables. Set them in a .env file or your deployment environment.

Database & Cache

VariableDefaultDescription
DATABASE_URLPostgreSQL async connection string (e.g., postgresql+asyncpg://user:pass@host:5432/ezauth)
REDIS_URLredis://localhost:6379/0Redis connection URL

JWT & Sessions

VariableDefaultDescription
JWT_ALGORITHMRS256JWT signing algorithm
JWT_ACCESS_TOKEN_EXPIRE_MINUTES15Access token lifetime in minutes
JWT_REFRESH_TOKEN_EXPIRE_DAYS30Refresh token lifetime in days
SESSION_COOKIE_NAME__sessionName of the session cookie
SESSION_COOKIE_DOMAIN""Cookie domain (empty = inferred from request)
SESSION_COOKIE_SECUREtrueRequire HTTPS for cookies

Email (AWS SES)

VariableDefaultDescription
SES_REGIONus-east-1AWS SES region
SES_SENDERDefault sender email address
SES_SENDER_NAMEEZAuthDefault sender display name

Per-application sender settings can be configured in the dashboard. The environment variables set the defaults for new applications.

Rate Limiting

VariableDefaultDescription
SIGNUP_RATE_LIMIT_IP60:10Max signups per IP (window_seconds:max_count)
SIGNUP_RATE_LIMIT_EMAIL300:1Max signups per email (window_seconds:max_count)
SIGNIN_RATE_LIMIT_IP60:10Max sign-ins per IP

Hashcash (Proof-of-Work)

VariableDefaultDescription
HASHCASH_ENABLEDtrueRequire proof-of-work for signups
HASHCASH_DIFFICULTY5Number of leading zero bits required
HASHCASH_CHALLENGE_TTL300Challenge expiry in seconds
HASHCASH_TIME_COST2Argon2 time parameter
HASHCASH_MEMORY_COST19456Argon2 memory parameter (KiB)

Verification

VariableDefaultDescription
VERIFICATION_TOKEN_EXPIRE_MINUTES60Email verification link/code TTL
MAGIC_LINK_EXPIRE_MINUTES15Magic link TTL

Bot Authentication

VariableDefaultDescription
CONFIRMATIONS_API_URLhttps://api.confirmations.infoBot challenge verification API
BOT_AUTH_TIMESTAMP_TOLERANCE300Max age of bot auth signature (seconds)

OAuth

VariableDefaultDescription
OAUTH_STATE_TTL_SECONDS600OAuth CSRF state TTL

Object Storage (S3)

VariableDefaultDescription
S3_ENDPOINT_URL""S3-compatible endpoint URL
S3_ACCESS_KEY_ID""S3 access key
S3_SECRET_ACCESS_KEY""S3 secret key
S3_BUCKET_NAME""S3 bucket name
S3_REGIONus-east-1S3 region
OBJECT_STORAGE_MAX_OBJECT_BYTES52428800Max single object size (50 MB)
OBJECT_STORAGE_LIMIT_BYTES1073741824Total storage per app (1 GB)

Custom Tables

VariableDefaultDescription
CUSTOM_TABLES_STORAGE_LIMIT_BYTES104857600Max table storage per app (100 MB)

Dashboard

The dashboard has no shared password. Sign-in emails a single-use code to an address listed below, or to an application’s owner_email.

VariableDefaultDescription
DASHBOARD_ADMIN_EMAILS""Comma-separated addresses granted superadmin access
DASHBOARD_SESSION_TTL_SECONDS43200Dashboard session lifetime (12 hours)
DASHBOARD_ALLOWED_ORIGINS""Comma-separated origins allowed to call the dashboard cross-origin
INTERNAL_API_SECRET""Shared secret for internal endpoints reached through the proxy

Deployment

VariableDefaultDescription
ENVIRONMENTdevelopmentSet to production to reject development defaults at startup
PUBLIC_BASE_URLhttp://localhost:8000Public origin, used for email links and OAuth redirect URIs
DB_POOL_SIZE10Connection pool size
DB_MAX_OVERFLOW20Connections allowed beyond the pool size
DB_POOL_RECYCLE_SECONDS1800Recycle connections older than this

Sessions and tokens

VariableDefaultDescription
SESSION_REVOCATION_CHECKtrueConfirm the session row on each request so logout takes effect immediately
SESSION_COOKIE_PER_APPtrueSuffix cookie names per application so apps sharing a domain do not collide
REFRESH_COOKIE_NAME__refreshRefresh cookie name
REFRESH_COOKIE_PATH/v1/tokensPath the refresh cookie is scoped to
MAX_SIGNIN_TOKEN_LIFETIME_SECONDS86400Upper bound on backend-minted sign-in tokens
MAX_CODE_ATTEMPTS5Wrong guesses before a code is burned

Retention

VariableDefaultDescription
CLEANUP_INTERVAL_SECONDS3600How often the cleanup task runs
AUTH_ATTEMPT_RETENTION_DAYS7Retention for spent auth attempts
EXPIRED_SESSION_RETENTION_DAYS30Retention for expired and revoked sessions
AUDIT_LOG_RETENTION_DAYS365Retention for audit log rows