Skip to main content

Environment Variables

All configuration is done via environment variables. In Docker deployments, these are loaded from the .env file via env_file.

Required Variables

VariableDescription
DATABASE_URLPostgreSQL connection string (e.g., postgresql://portal:pass@db:5432/invite_portal)
SESSION_SECRETSecret for iron-session cookies and AES-256-GCM encryption. Minimum 32 characters. Generate with openssl rand -hex 32.
ADMIN_EMAILEmail address for the admin seed account
ADMIN_PASSWORDPassword for the admin seed account (bcrypt-hashed at seed time)

Optional Variables

VariableDefaultDescription
APP_NAMERiDDiX - Matrix Synapse PanelApplication display name
APP_URLhttp://localhost:3000Public URL of the application
RATE_LIMIT_WINDOW_MS900000Rate limit window in milliseconds (15 min)
RATE_LIMIT_MAX_REQUESTS15Maximum requests per rate limit window
CAPTCHA_SITE_KEYhCaptcha or reCAPTCHA site key (placeholder for future use)
CAPTCHA_SECRETCAPTCHA secret key
COOKIE_SECURE(auto)Override the Secure flag on session cookies. true or false. Auto-detected from APP_URL if not set.
SYNAPSE_CONFIG_DIRPath to Synapse config directory (for managed integration mode)
SYNAPSE_APPSERVICE_DIRPath to Synapse appservice registration directory

Legacy Single-Server Variables

These variables are optional when using multi-server management (Admin → Servers). They serve as fallback for backward compatibility with single-server deployments where no ManagedServer is configured in the database.

VariableDescription
SYNAPSE_INTERNAL_URLSynapse URL reachable from the app (e.g., http://synapse:8008)
SYNAPSE_PUBLIC_URLPublic Synapse URL shown to users (e.g., https://matrix.example.com)
SYNAPSE_SERVER_NAMEMatrix server name (e.g., example.com)
SYNAPSE_ADMIN_ACCESS_TOKENSynapse admin user access token
info

In multi-server mode, each homeserver's connection details (URL, admin token, server name) are stored in the database as ManagedServer records. The legacy env vars are only used if no server can be resolved from the request.

Docker Compose Variables

These are used by the docker-compose.yml to configure the PostgreSQL container:

VariableDefaultDescription
POSTGRES_USERportalPostgreSQL username
POSTGRES_PASSWORDportalPostgreSQL password
POSTGRES_DBinvite_portalPostgreSQL database name

Security Notes

  • SESSION_SECRET is critical. It is used to derive the AES-256-GCM encryption key for all encrypted data (server admin tokens, integration secrets, bot access tokens). Changing it after deployment will make existing encrypted data unreadable.
  • Never commit .env files to version control.
  • Use strong, unique values for all secrets.
  • The .env.example file contains CHANGE_ME placeholders — replace every one of them.