Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration reference

Every setting drusite-server reads, made from the server’s own code, so it matches the version these docs are for. The self-hosting guides say when you’d want each one.

How values are read

  • One TOML file, named by --config or DRUSITE_CONFIG. drusite.example.toml is a commented example.
  • Any key from the environment. DRUSITE__, then the table and the key, separated by double underscores, in capitals: [auth.password] enabled is DRUSITE__AUTH__PASSWORD__ENABLED. true, false, numbers and [...] lists are read as TOML; anything else is a string (quote it, '"123"', to force one). The environment wins over the file.
  • Any key from a file. Add _file to a key to read its value from that file, with the trailing newline removed: url_file = "/run/secrets/database-url", or DRUSITE__DATABASE__URL_FILE. Setting both url and url_file is an error. Use it for every secret, so none sits in the config.
  • Unknown keys are errors, so a typo stops the server instead of being ignored. drusite-server check-config loads a config, says what’s wrong with it, and exits.
  • Tables written <id> are named by you: [auth.oidc.<id>] might be [auth.oidc.keycloak], and its variables are then DRUSITE__AUTH__OIDC__KEYCLOAK__….
  • unset means the key has no value unless you give it one; what that means is in its row.

Top level

Environment: DRUSITE__<KEY>.

KeyTypeDefaultWhat it does
public_urlURLrequiredWhere users and apps reach this server, e.g. https://notes.example.com. Links in emails, OAuth redirects and passkey origins are built from it.

[server]

Environment: DRUSITE__SERVER__<KEY>.

KeyTypeDefaultWhat it does
listenstring"0.0.0.0:8080"The address and port the server listens on, for the apps, the API and the web app.
request_timeout_secsinteger30Longest a plain HTTP request may take. WebSockets aren’t subject to it.

[database]

Environment: DRUSITE__DATABASE__<KEY>.

KeyTypeDefaultWhat it does
urlstring (secret)requiredA PostgreSQL URL, e.g. postgres://drusite@db/drusite. Usually from url_file or DRUSITE__DATABASE__URL, since it carries the password.
max_connectionsinteger16The most connections to PostgreSQL this server node opens. Each node has its own pool, so several replicas open this many each.
migrate_on_startbooleantrueApply pending migrations when the server starts. Turn off to run drusite-server migrate as a separate step instead.
allow_rls_bypassbooleanfalseRow-level security is Drusite’s second line between workspaces, and a superuser or a role with BYPASSRLS skips it. The server refuses such a role unless this is set.

[storage]

Any S3-compatible object store: AWS S3, Cloudflare R2, Garage, SeaweedFS, Ceph, …

Environment: DRUSITE__STORAGE__<KEY>.

KeyTypeDefaultWhat it does
bucketstringrequiredThe bucket. It must exist already; the server checks it can write there when it starts.
endpointURLunsetThe store’s endpoint. Leave out for AWS S3.
regionstring"us-east-1"The region, for AWS S3. Most self-hosted stores ignore it.
access_key_idstring (secret)unsetCredentials. Leave both out to use the standard AWS_* variables, a web identity token or instance metadata.
secret_access_keystring (secret)unsetThe secret half of the credentials: set both, or neither.
virtual_hosted_stylebooleanfalsehttps://bucket.endpoint/key instead of https://endpoint/bucket/key. Most self-hosted stores want path style, the default.
prefixstring""A prefix for every object key, to share a bucket.

[keys]

Where the master key comes from. Each workspace’s own key is wrapped by it.

Environment: DRUSITE__KEYS__<KEY>.

source = "env"

Master keys in an environment variable (DRUSITE_MASTER_KEY unless var says otherwise).

KeyTypeDefaultWhat it does
varstring"DRUSITE_MASTER_KEY"The variable that holds the master keys: id:key entries (drusite-server keys generate makes one), separated by whitespace or commas, the current one first.

source = "file"

Master keys in a file, such as a Kubernetes or Docker secret.

KeyTypeDefaultWhat it does
pathstringrequiredThe file that holds the master keys, written as for var.

source = "transit"

A key management service that wraps and unwraps workspace keys itself, so the master key never reaches Drusite: the Transit engine of OpenBao or HashiCorp Vault.

KeyTypeDefaultWhat it does
addressURLrequiredThe OpenBao or Vault server, e.g. https://bao.example.com.
keystringrequiredThe Transit key’s name.
mountstring"transit"Where the Transit engine is mounted.
tokenstring (secret)requiredA token allowed to encrypt and decrypt with the key. Give it with token_file.
namespacestringunsetA Vault Enterprise / OpenBao namespace.

[auth]

Every login method is a switch. A method that’s off has no routes at all.

Environment: DRUSITE__AUTH__<KEY>.

KeyTypeDefaultWhat it does
self_signupbooleanfalseLet anyone create an account with a password, a passkey or a magic link. OIDC providers decide for themselves (auto_create). Off by default: accounts come from an OIDC provider or drusite-server account create.
access_token_minutesinteger10How long an app’s access token lasts. Apps refresh it with their device key.
device_idle_daysinteger30A device that hasn’t connected for this long is signed out.
device_max_daysinteger365Every device signs in again after this long, however often it connects.
session_hoursinteger12How long a browser stays signed in to the sign-in pages and account settings.
browser_idle_daysinteger14The web app in a browser that hasn’t been used for this long is signed out. Shorter than a device’s: a browser on someone else’s computer is likelier to be left behind.
browser_max_daysinteger90The web app signs in again after this long, however often it’s used.

[auth.password]

Environment: DRUSITE__AUTH__PASSWORD__<KEY>.

KeyTypeDefaultWhat it does
enabledbooleanfalseSign in with an email and a password (hashed with argon2id).
require_totpbooleanfalseEvery password account must also set up TOTP.

[auth.passkeys]

Environment: DRUSITE__AUTH__PASSKEYS__<KEY>.

KeyTypeDefaultWhat it does
enabledbooleanfalseSign in with a passkey (WebAuthn). Passkeys belong to public_url’s domain, so it must be a domain name, not an IP address (localhost works for testing).

Environment: DRUSITE__AUTH__MAGIC_LINK__<KEY>.

KeyTypeDefaultWhat it does
enabledbooleanfalseSign in with a one-time link sent by email. Needs [smtp].
ttl_minutesinteger15How long a link works, in minutes (1 to 1440).

[auth.oidc.<id>]

OIDC providers by ID (lowercase letters, digits and _), e.g. [auth.oidc.authentik].

Environment: DRUSITE__AUTH__OIDC__<ID>__<KEY>.

KeyTypeDefaultWhat it does
enabledbooleantrueShow this provider’s button. Off keeps its settings but removes it. On unless set.
display_namestringrequiredThe name on the sign-in button, e.g. “Authentik” or “Google”.
issuerstringrequiredThe issuer exactly as the provider states it. Providers compare it character for character, trailing slash included (Authentik’s and Auth0’s have one, Keycloak’s and Google’s don’t), so it stays a string rather than a parsed URL, which would add or keep a slash on its own.
client_idstringrequiredThe client ID the provider gave Drusite.
client_secretstring (secret)unsetLeave out for a public client.
scopeslist of string["openid", "email", "profile"]The scopes asked for. They must include openid; add the one that puts groups in the ID token if the provider needs it for allowed_groups.
auto_createbooleanfalseCreate an account on someone’s first sign-in through this provider.
link_by_verified_emailbooleanfalseLet a first sign-in through this provider join the existing account with the same email. Only when the provider says it has verified the email (email_verified), and only for a provider you trust to verify emails properly: anyone who can make an account there with your email could otherwise take over your Drusite account. Off by default.
allowed_email_domainslist of string[]Only people whose verified email is in one of these domains may sign in through this provider (empty: any).
allowed_groupslist of string[]Only members of these provider groups may sign in through this provider (empty: any). Checked at every sign-in, so removing someone from the group locks them out.
groups_claimstring"groups"The ID-token claim that lists the user’s groups.

[smtp]

Environment: DRUSITE__SMTP__<KEY>.

KeyTypeDefaultWhat it does
hoststringrequiredThe mail server’s host name.
portintegerunsetIts port; unset, the usual one for tls (465 for tls, 587 for starttls, 25 for none).
usernamestringunsetThe user to sign in to it as: set both this and password, or neither.
passwordstring (secret)unsetIts password. Give it with password_file.
fromstringrequiredThe sender, e.g. Drusite <notes@example.com>.
tls"tls", "starttls", "none""starttls"How the connection is encrypted: tls (from the first byte), starttls (upgraded, and refused if the server can’t) or none (for a relay on the same host or network only).

[telemetry]

Environment: DRUSITE__TELEMETRY__<KEY>.

KeyTypeDefaultWhat it does
service_namestring"drusite-server"service.name in traces, metrics and logs.
log_format"json", "pretty""json"Logs on stderr: json for log collectors, pretty for people.
otlpbooleanunsetSend traces, metrics and logs over OTLP/HTTP. On when the standard OTEL_EXPORTER_OTLP_ENDPOINT is set, unless this says otherwise; the endpoint, headers and the rest come from the standard OTEL_* variables.

Search over the live documents: Postgres full-text search, plus semantic search when an embedding model is configured.

Environment: DRUSITE__SEARCH__<KEY>.

KeyTypeDefaultWhat it does
enabledbooleantrueOff keeps even derived data (words and embeddings) out of the database.
text_configstring"simple"The PostgreSQL text search configuration: simple (any language, no stemming) or a language’s, such as english.

[search.embeddings]

The embedding model search indexes with, on any provider that makes embeddings: OpenAI, Google, Mistral, OpenRouter, or an OpenAI-compatible endpoint (LiteLLM, Ollama, vLLM, …).

Environment: DRUSITE__SEARCH__EMBEDDINGS__<KEY>.

KeyTypeDefaultWhat it does
provider"anthropic", "openai", "google", "mistral", "openrouter", "openai-compatible""openai-compatible"openai, google, mistral, openrouter or openai-compatible (the default).
base_urlURLunsetThe API’s base URL, e.g. http://litellm:4000/v1. Needed for openai-compatible; for a vendor it replaces the vendor’s own address (a proxy, a regional endpoint).
modelstringrequiredThe embedding model’s ID, as the provider names it.
idstringunsetNames the vector space stored with every vector; the model name unless set. Changing it (or the model) embeds everything again.
api_keystring (secret)unsetThe provider’s API key: needed for a vendor, optional for openai-compatible. Give it with api_key_file.
dimensionsintegerunsetAsks for vectors of this size, for models that can shorten them.
batchinteger64How many blocks go in one request.
min_similaritynumber0.3How close in meaning (cosine similarity, -1 to 1) a block must be to count as a match. Nearest neighbours always exist; this keeps unrelated ones out. Models differ: raise it if searches return unrelated pages, lower it if they miss related ones.

[attachments]

Files on pages.

Environment: DRUSITE__ATTACHMENTS__<KEY>.

KeyTypeDefaultWhat it does
max_bytesinteger104857600The largest file a page can hold, in bytes. 100 MiB unless set.

[agents]

Agents (MCP clients) reading and writing notes at /mcp.

Environment: DRUSITE__AGENTS__<KEY>.

KeyTypeDefaultWhat it does
enabledbooleantrueAgents can connect. On unless set.
allow_insecure_client_idsbooleanfalseFor development and tests only: accept client ID metadata documents served over plain HTTP, or from loopback and private addresses.
max_token_daysinteger365The longest an agent token made on the account page may last, in days.

[ask]

Ask your notes: answers from the asker’s pages, made by a chat model, with citations to the blocks they came from. Finds the blocks with server search, so it needs [search] on; an embedding model ([search.embeddings]) helps but isn’t needed.

Environment: DRUSITE__ASK__<KEY>.

KeyTypeDefaultWhat it does
enabledbooleantrueOn unless set; without [ask.chat] it’s unavailable anyway, and the apps say how to set it up.
sourcesinteger12How many blocks an answer may draw on.
max_context_charsinteger24000The most text from pages sent with one question, in characters.
history_turnsinteger4How many earlier questions and answers of the conversation go with a new question.
per_minuteinteger10Questions one person may ask a minute, and a day.
per_dayinteger500Questions one person may ask a day.
timeout_secsinteger300The longest an answer may take, in seconds, and the longest the model may go quiet partway.
idle_secsinteger120The longest the model may go quiet once it has started answering, in seconds.
audit_daysinteger90How long the record of what was sent to which provider is kept, in days.

[ask.chat]

The chat model that writes the answers.

Environment: DRUSITE__ASK__CHAT__<KEY>.

KeyTypeDefaultWhat it does
provider"anthropic", "openai", "google", "mistral", "openrouter", "openai-compatible""openai-compatible"anthropic, openai, google, mistral, openrouter or openai-compatible (the default).
base_urlURLunsetNeeded for openai-compatible; for a vendor it replaces the vendor’s own address.
modelstringrequiredThe chat model’s ID, as the provider names it.
api_keystring (secret)unsetThe provider’s API key: needed for a vendor, optional for openai-compatible. Give it with api_key_file.
namestringunsetWhat the apps show it as; the model name unless set.
max_tokensinteger4096The longest answer, in tokens. Reasoning models count their thinking in it too.
temperaturenumberunsetThe sampling temperature sent with each request; the model’s own unless set.

[ai]

The AI the server offers: its own providers and models, the defaults for new chats and meetings, and whether people may add providers of their own to their account. Providers are a table keyed by an ID, so each value can come from the environment too: DRUSITE__AI__PROVIDERS__LAB__BASE_URL=http://llm.internal:4000/v1.

[ai.providers.<id>]

One provider the server offers to everyone signed in to it.

Environment: DRUSITE__AI__PROVIDERS__<ID>__<KEY>.

KeyTypeDefaultWhat it does
namestringunsetWhat the apps show it as; the kind’s name unless set.
kind"anthropic", "openai", "google", "mistral", "openrouter", "openai-compatible""openai-compatible"anthropic, openai, google, mistral, openrouter or openai-compatible (the default).
base_urlURLunsetNeeded for openai-compatible; for a vendor it replaces the vendor’s own address.
api_keystring (secret)unsetIts API key: needed for a vendor, optional for openai-compatible. Give it with api_key_file.
modelsstring or list of string or table { id, name, use }unsetWhich of its models to offer. Unset or "listed": whatever the provider lists. Or a list of IDs (["model-a", "model-b"]) or of tables ({ id = "…", name = "…", use = "transcription" }).
max_tokensinteger4096The longest answer, in tokens. Reasoning models count their thinking in it too.
temperaturenumberunsetThe sampling temperature sent with each request; the model’s own unless set.

[ai.defaults]

The models new chats and meetings start with, as provider/model (lab/big-model). People can pick their own.

Environment: DRUSITE__AI__DEFAULTS__<KEY>.

KeyTypeDefaultWhat it does
chatstringunsetThe model new chats in Ask start with. Unset, [ask.chat]’s, if there is one.
summariesstringunsetThe model that summarises meetings. Unset, the chat default.
transcriptionstringunsetThe model that transcribes meetings.

[ai.accounts]

Providers people add to their own account, kept on this server with their keys encrypted.

Environment: DRUSITE__AI__ACCOUNTS__<KEY>.

KeyTypeDefaultWhat it does
enabledbooleantrueOn unless set.
reach"public", "any""public"Which addresses this server will call for them: public (the public internet only, so nobody can point it at the server’s own network) or any (private addresses too: a home lab where the owner is the only user).

[publish]

Publish to web: pages shared as read-only links, rendered by this server as plain HTML. With public_url set, published pages live only there, and that host serves nothing else: a deployment can put just that on the internet and keep the app, the API and sign-in private. It’s served on listen if set (its own port, optionally with TLS), and also on the main port to requests for its host name. Without it, pages are under /p/ on public_url.

Environment: DRUSITE__PUBLISH__<KEY>.

KeyTypeDefaultWhat it does
enabledbooleantruePages can be published. On unless set.
public_urlURLunsetWhere published pages are read, e.g. https://pages.example.com. Only its scheme, host and port are used; links are <public_url>/p/<token>.
listenstringunsetA listener of its own for the public host, e.g. 0.0.0.0:8443. It serves published pages whatever host name a request names.
tls_certstringunsetA PEM certificate chain and key for listen, to serve TLS without a reverse proxy. Both or neither; they’re read again when the files change.
tls_keystringunsetThe PEM private key for tls_cert.
cache_secsinteger15How long a reader’s browser may keep a page before asking again (an ETag makes that cheap). Unpublishing takes a page down at once on the server; a browser that has it may show it this much longer.
per_minuteinteger300Requests a minute one address may make to published pages.
client_ip_headerstringunsetBehind a reverse proxy: take the reader’s address from this header (the last entry of X-Forwarded-For, say) for the rate limits. Only set it when the proxy always sets it.

[web]

The browser version: the app itself, served from this server at /, signing in through it with a session cookie (see auth::web).

Environment: DRUSITE__WEB__<KEY>.

KeyTypeDefaultWhat it does
enabledbooleantrueServe it, when there’s one in dir. On unless set.
dirstringunsetThe built web app (ui/dist-web): index.html, sw.js and app/. The container image has it at /usr/share/drusite/web. Unset (or enabled = false), there’s no web app: nothing at /, and no browser sign-in routes.

[workspaces]

Workspaces with other people.

Environment: DRUSITE__WORKSPACES__<KEY>.

KeyTypeDefaultWhat it does
invites_create_accountsbooleantrueAn invitation lets its email make an account, with any login method this server has on, even when [auth] self_signup is off. On unless set.
guestsbooleantruePages can be shared with guests (people outside the workspace). Each workspace’s owners can turn it off for theirs; off here, it’s off for every workspace. On unless set.

[analytics]

Page analytics: views counted per page per day, and who viewed (for those who allow it).

Environment: DRUSITE__ANALYTICS__<KEY>.

KeyTypeDefaultWhat it does
enabledbooleantrueCount views. Off, nothing is recorded, the apps hide Analytics, and what was recorded is deleted. On unless set.
count_public_viewsbooleantrueCount views of published pages, as a number per day and nothing else. On unless set.
keep_daysinteger365How long daily counts are kept.

[e2ee]

End-to-end encrypted workspaces (docs/phase11.md).

Environment: DRUSITE__E2EE__<KEY>.

KeyTypeDefaultWhat it does
enabledbooleantrueEnd-to-end encrypted workspaces at all: off, nobody can make one or convert one (those that exist keep working). On unless set.
new_workspaces"ask", "encrypted", "standard""ask"What a new workspace is: ask (the person chooses), encrypted or standard.
server_aibooleantrueOwners of an encrypted workspace may let this server’s AI read its pages when asked (Ask, search by meaning, meeting notes): one request at a time, kept for none. On unless set; off removes the option.
agent_devicesbooleantruePeople may add agent devices (docs/phase11.md §6.4): headless Drusite processes that hold keys for what they’re given and serve MCP for encrypted workspaces. On unless set.