Skip to content

Environment reference ​

The server reads these from docker/.env. docker-compose.yaml sets a few itself (DATABASE_URL, MEILI_URL, APP_CONFIG_PATH, NODE_ENV), so you don't need to.

Core ​

VariableDefaultWhat it is
BASE_DOMAINnone (required)The instance's domain, e.g. chat.example.com. Every ID it creates contains it, so it can't change once there's data
BASE_URLnoneThe address people open, e.g. https://chat.example.com
SERVER_PORT8778The API's port
SERVER_HOSTall interfacesThe address the API and webhook listener bind to
LOG_LEVELwarnerror, warn, info or debug
NODE_ENVdevelopmentproduction in the Docker setup
DATABASE_URLset by ComposeThe MariaDB connection, mariadb://user:password@host:3306/database, built from the DB_* variables
APP_CONFIG_PATHset by ComposeWhere app.config.yaml is. Compose mounts it at /config/app.config.yaml

The Compose file also reads DOCKER_TAG (which image) and DB_USER, DB_PASSWORD, DB_DATABASE and DB_ROOT_PASSWORD for MariaDB.

Security ​

VariableDefaultWhat it is
JWT_SECRETnone (required)Signs sign-in tokens. A long random string; changing it signs everyone out
INSTANCE_SETTINGS_SECRETJWT_SECRETEncrypts secrets saved in the admin settings, such as a GIF API key
CORS_ORIGIN_VALUEhttps://${BASE_DOMAIN}Comma-separated web origins allowed to call the API and Socket.IO; refract://app is also allowed for the desktop app
TRUST_PROXYfalsetrue behind a reverse proxy, so client IPs come from its forwarded header
TRUST_PROXY_IPS127.0.0.1,::1The proxies to trust: addresses or CIDR ranges, comma-separated
TRUST_PROXY_HEADERX-Forwarded-ForThe header to read the client IP from first
SECURITY_HEADERS_ENABLEDtrueSecurity headers. Always on in production
CSP_DIRECTIVESbuilt inReplaces the whole Content-Security-Policy: keep the frame, media and voice sources it needs
REFERRER_POLICYstrict-origin-when-cross-originThe Referrer-Policy header
ACTIVITY_BASE_URLBASE_URLOrigin packaged activities are served from; set a separate host for Watch Together

See Reverse proxy & TLS for the proxy settings.

For multiple web clients, set CORS_ORIGIN_VALUE=https://chat.example.com,https://other.example.com. The desktop origin is included automatically, so the default supports both the web and desktop apps. A * entry allows every origin and is intended for development. Restart the backend after changing this setting.

VariableDefaultWhat it is
REDIS_URLnone (required)redis://redis:6379 in the Docker setup
MEILI_URLset by ComposeMeilisearch's address. The server won't start without it
MEILI_MASTER_KEYnone (required)Shared by the search container and the server. At least 16 characters
MEILI_INDEX_PREFIXrefract_Prefix for index names, so several instances can share one Meilisearch

LiveKit ​

VariableDefaultWhat it is
LIVEKIT_PUBLIC_URLwss://livekit.${BASE_DOMAIN}Where people's apps connect for calls
LIVEKIT_API_URLLIVEKIT_PUBLIC_URLWhere the server calls LiveKit's API. Use the internal address, http://livekit:7866
LIVEKIT_API_KEYnone (required)A key name from keys: in livekit-server.yaml
LIVEKIT_API_SECRETnone (required)That key's secret
LIVEKIT_WEBHOOK_PORT8779The webhook listener. Never publish it
LIVEKIT_WEBHOOK_API_KEYnone (required)The key LiveKit signs webhooks with: webhook.api_key in livekit-server.yaml
LIVEKIT_WEBHOOK_API_SECRETnone (required)That key's secret
LIVEKIT_ENABLE_ENCRYPTIONtrueEnd-to-end encrypted call media. Only false turns it off

See Voice & LiveKit for how these fit together.

Email ​

VariableDefaultWhat it is
EMAIL_PROVIDERsmtpsmtp, or ses for Amazon SES
SMTP_FROMnoneThe sender, e.g. "Refract.Chat <noreply@example.com>"
SMTP_HOST, SMTP_PORTnoneThe SMTP server
SMTP_USER, SMTP_PASSWORDnoneSMTP credentials, if it needs them
AWS_SES_ACCESS_KEY_IDAWS_ACCESS_KEY_IDSES credentials
AWS_SES_SECRET_ACCESS_KEYAWS_SECRET_ACCESS_KEYSES credentials
AWS_SES_REGIONus-east-1The SES region

See Email, search & push.

Media ​

VariableDefaultWhat it is
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKENnoneS3 credentials, when media is stored in S3 and the host has no IAM role
MEDIA_ATTACHMENT_EXTENSIONSfrom the configAccepted attachment types, e.g. png,jpg,pdf. Wins over app.config.yaml
MEDIA_IMAGE_EXTENSIONSfrom the configAccepted avatar, icon and banner types
MEDIA_MAX_ATTACHMENTS_PER_MESSAGEfrom the configAttachments per message
FFMPEG_PATH, FFPROBE_PATHffmpeg, ffprobeFor re-encoding video avatars. The Docker image includes both

See Media storage.

Features ​

VariableDefaultWhat it is
KLIPY_API_KEYnoneTurns on GIF search, from KLIPY. Wins over the config file and admin settings
GIFGOODER_URLnoneThe address of a gifgooder server, such as https://gif.example.com, with no path. Needed with GIFGOODER_TOKEN
GIFGOODER_TOKENnoneAdds gifgooder to GIF search, with GIFGOODER_URL. With both providers set up, the picker has a tab for each
BUZZ_COOLDOWN_SECONDSfrom the configSeconds between one person's /buzz nudges in a conversation. Wins over app.config.yaml
PUSH_RELAY_URLhttps://relay.refract.chatThe push relay for mobile notifications
PUSH_RELAY_STATE_FILEbeside the federation keyWhere the relay credentials are saved. Keep it on /data

Released under the GNU Affero General Public License v3.0.