Server configuration

Environment variables for the Ceili chatserver.

Server configuration

The chatserver reads configuration from CHATSERVER_* environment variables. If a value is missing or invalid, the server uses the default shown below.

VariableDefaultDescription
CHATSERVER_HOST0.0.0.0Address where the HTTP and WebSocket server listens.
CHATSERVER_PORT8081TCP port for health checks, voice bootstrap, and WebSocket connections.
CHATSERVER_WS_READ_BUFFER1024WebSocket read buffer size in bytes.
CHATSERVER_WS_WRITE_BUFFER1024WebSocket write buffer size in bytes.
CHATSERVER_WS_MAX_MESSAGE_BYTES4096Maximum accepted WebSocket message size.
CHATSERVER_REPLAY_MESSAGE_LIMIT50Number of recent room messages sent on connect or room switch.
CHATSERVER_VOICE_LOOPBACK_SENDERtrueEchoes direct voice signaling to the sender when enabled. Useful for diagnostics.
CHATSERVER_VOICE_STUN_URLSstun:stun.l.google.com:19302Comma-separated STUN URLs returned by /voice/bootstrap.
CHATSERVER_VOICE_TURN_URLemptyOptional TURN server URL.
CHATSERVER_VOICE_TURN_USERNAMEemptyTURN username, used when a TURN URL is configured.
CHATSERVER_VOICE_TURN_PASSWORDemptyTURN credential, used when a TURN URL is configured. Keep it secret.
CHATSERVER_VOICE_EXTERNAL_IPemptyPublic IP advertised by the voice service when the host is behind NAT.
CHATSERVER_VOICE_UDP_PORT_MIN0Minimum voice UDP port. 0 lets the runtime choose.
CHATSERVER_VOICE_UDP_PORT_MAX0Maximum voice UDP port. 0 lets the runtime choose.

Local development

A minimal local configuration can use the defaults:

CHATSERVER_HOST=0.0.0.0
CHATSERVER_PORT=8081

The default STUN server is enough for development networks that permit direct traversal. Verify the server with /healthz and /readyz before connecting the client.

Public deployments

For a public deployment:

  • terminate TLS at the reverse proxy and use wss:// from clients
  • configure a TURN server when users may be behind restrictive NATs
  • set CHATSERVER_VOICE_EXTERNAL_IP when the server’s public address differs from its local interface
  • set a bounded UDP port range and publish that range through the firewall or container
  • do not expose CHATSERVER_VOICE_TURN_PASSWORD in logs or public configuration examples

The configuration controls the current chatserver only. It does not configure the separate userserver scaffold.