Configuration

The server reads these environment variables once at start.

Variable Default Meaning
KOKO_BIND 0.0.0.0:8080 Address and port to listen on.
KOKO_DB koko.db SQLite database file. Created on first start.
KOKO_TRUST_PROXY off Set to 1 to take the client address from X-Forwarded-For. Only behind your own reverse proxy.
KOKO_CORS_ORIGIN off Origins a browser may call the API from, comma separated, for example https://chat.example.org. * allows any origin. Tokens are sent in a header, not a cookie, so no ambient credentials are exposed.
KOKO_VAPID_SUBJECT mailto:koko-admin@localhost Contact URI in the VAPID JWT for Web Push. Only with a --features push build; set it to a mailto: the push service can reach you at.

Limits

These are fixed in version 1.

Limit Value
Username 3 to 32 characters, a-z 0-9 _ . -, stored lower case
Password 8 to 128 bytes
Message 4000 bytes
Request body 16 KB
WebSocket frame 16 KB
Registration 5 per hour per address
Sign in 10 per minute per address, 10 per five minutes per username
Messages and other socket actions burst of 20, then 5 per second
History page up to 100 messages