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 |
Upgrading from Cord
Koko was called Cord before. Nothing is lost on upgrade, and old names keep working.
| What | Old | New | What happens |
|---|---|---|---|
| Environment variables | CORD_* |
KOKO_* |
Both are read. KOKO_* wins if both are set. |
| Server database | cord.db |
koko.db |
If koko.db does not exist and cord.db sits next to it, the server renames it (and its -wal and -shm files) on start. Set KOKO_DB or CORD_DB to a custom path and that path is used as is. Docker users with an existing volume: set KOKO_DB=/data/cord.db or let the default rename it. |
| Desktop data folder | ~/.config/cord |
~/.config/koko |
Moved on first start, so you stay signed in and keep drafts and the cache. |
| Desktop cache file | cord-cache.db |
koko-cache.db |
Renamed on first start. |
| Web storage | cord.* in localStorage, IndexedDB cord |
koko.*, IndexedDB koko |
Copied on first load (session, unsent messages, drafts, message cache, settings), then the old data is deleted. |
The binary is now koko-server (was cord-server) and koko-client. Update service files and scripts that call the old name.