Skip to main content
This page provides a comprehensive reference for all environment variables used in ClassQuiz. These variables control core application settings, database connections, and feature configuration.

Core Application Settings

ROOT_ADDRESS
string
required
The base URL of your ClassQuiz installation. Used for generating links in emails and OAuth callbacks.Example: https://classquiz.example.com
Do not include a trailing slash at the end of the URL
SECRET_KEY
string
required
Secret key for JWT token signing and cryptographic operations. Must be kept secure.Default: TOP_SECRET (change this!)
Generate a secure random string using: openssl rand -hex 32
ACCESS_TOKEN_EXPIRE_MINUTES
integer
default:"30"
Duration in minutes before access tokens expire.
This is set by Docker Compose and should not be changed unless you understand the implications

Database Configuration

DB_URL
string
required
PostgreSQL database connection URL.Format: postgresql://username:password@host:port/databaseDefault: postgresql://postgres:classquiz@db:5432/classquiz
In Docker deployments, do not change this value

Redis Configuration

REDIS
string
required
Redis connection URL for caching and session management.Format: redis://host:port/db?decode_responses=TrueDefault: redis://redis:6379/0?decode_responses=True
In Docker deployments, do not change this value

Email Verification

SKIP_EMAIL_VERIFICATION
boolean
default:"false"
Whether to skip email verification for new user registrations.Set to True to allow users to immediately access their accounts without clicking a verification link.Values: True or False

User Management

REGISTRATION_DISABLED
boolean
default:"false"
Disable new user registration. When enabled, only existing users can log in.Values: True or False
MODS
array
default:"[]"
List of user emails with moderator privileges.Format: Comma-separated list or JSON array

Storage Limits

FREE_STORAGE_LIMIT
integer
default:"1074000000"
Maximum storage quota per user in bytes.Default: 1,074,000,000 bytes (~1 GB)

Worker Configuration

MAX_WORKERS
integer
default:"1"
Number of Gunicorn worker processes.
Keep this at 1 for Docker deployments to avoid issues with background tasks

Telemetry

TELEMETRY_ENABLED
boolean
default:"true"
Enable or disable anonymous usage telemetry.Values: True or False
SENTRY_DSN
string
Sentry DSN for error tracking and monitoring.Example: https://[email protected]/0

Cache Settings

CACHE_EXPIRY
integer
default:"86400"
Default cache expiration time in seconds.Default: 86400 seconds (24 hours)

Meilisearch Configuration

MEILISEARCH_URL
string
default:"http://127.0.0.1:7700"
URL for the Meilisearch instance used for search functionality.Docker default: http://meilisearch:7700
In Docker deployments, use the service name as the hostname
MEILISEARCH_INDEX
string
default:"classquiz"
Name of the Meilisearch index for storing quiz data.

Example Configuration

# Core settings
ROOT_ADDRESS=https://classquiz.example.com
SECRET_KEY=your-random-secret-key-here
ACCESS_TOKEN_EXPIRE_MINUTES=30

# Database (Docker internal)
DB_URL=postgresql://postgres:classquiz@db:5432/classquiz
REDIS=redis://redis:6379/0?decode_responses=True

# Email verification
SKIP_EMAIL_VERIFICATION=False

# Worker settings
MAX_WORKERS=1

# Search
MEILISEARCH_URL=http://meilisearch:7700

Storage Configuration

Configure local or S3 storage backends

Email Setup

Configure SMTP for sending verification emails

OAuth Providers

Set up Google, GitHub, or custom OpenID authentication

External Services

Configure Redis, PostgreSQL, Meilisearch, and more

Build docs developers (and LLMs) love