diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d9f146..6527336 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ Conventional Commits by release-please. ## Unreleased +- Self-hosted server: other accounts on the same computer can no longer read your words. + The database (with the `-wal` and `-shm` files next to it), the model list cache and a + new data folder are now readable only by you, like the API token and the backups + already were. At start, the server makes these files private again if an older version + left them readable, and logs what it changed. It leaves a data folder that also holds + other files as it is and warns with the command to fix it. `run.sh` and the service + from `install-service.sh` now start the server with umask `077`; run + `install-service.sh` again to update the service. + - Self-hosted server: your keys can now live in their own files instead of `.env`. Set `LLM_API_KEY_FILE=/path/to/file` in place of `LLM_API_KEY=...`, and the same for `API_TOKEN`, `TELEGRAM_BOT_TOKEN` and `TRANSCRIBE_API_KEY`; this is how Docker secrets diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md index 966624f..4df295f 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md @@ -180,7 +180,7 @@ The folder that holds your words and the server's files (see - Default: `$XDG_DATA_HOME/kotiko`, or `~/.local/share/kotiko` when `XDG_DATA_HOME` isn't set (or isn't an absolute path, which the XDG Base Directory spec says to ignore). The - server creates it if it's missing. + server creates it if it's missing, readable only by you (`0700`). - Words already in `~/.local/share/kotiko` stay there: while `$XDG_DATA_HOME/kotiko` has no `kotiko.db` and `~/.local/share/kotiko` has one, the server keeps using `~/.local/share/kotiko`. To move them, stop the server and move the folder. @@ -291,11 +291,29 @@ check. | File | What it is | Permissions | |---|---|---| -| `kotiko.db` (with `kotiko.db-wal` and `kotiko.db-shm` while running) | Your words, kept responses for repeated adds (24 hours), cached lookups (30 days), and the background jobs' state. SQLite | Created with your umask: usually readable by other users of the computer unless your umask is `077`. The default folder is inside your home folder. To keep it private: `chmod 700` the data folder (usually `~/.local/share/kotiko`) | +| `kotiko.db` (with `kotiko.db-wal` and `kotiko.db-shm` while running) | Your words, kept responses for repeated adds (24 hours), cached lookups (30 days), and the background jobs' state. SQLite | `0600`. The server creates it empty and private before SQLite opens it, and SQLite gives `-wal` and `-shm` the database's permissions | | `api-token` | The generated API token, when `API_TOKEN` isn't set | `0600`, written so no other user can read it at any moment | -| `models-cache.json` | OpenRouter's model list as last read, used when the server starts offline | Your umask | +| `models-cache.json` | OpenRouter's model list as last read, used when the server starts offline | `0600` | | `backups/kotiko-pre--