Skip to content

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>.

Key Type Default What it does
public_url URL required Where 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>.

Key Type Default What it does
listen string "0.0.0.0:8080" The address and port the server listens on, for the apps, the API and the web app.
request_timeout_secs integer 30 Longest a plain HTTP request may take. WebSockets aren’t subject to it.

[database]

Environment: DRUSITE__DATABASE__<KEY>.

Key Type Default What it does
url string (secret) required A PostgreSQL URL, e.g. postgres://drusite@db/drusite. Usually from url_file or DRUSITE__DATABASE__URL, since it carries the password.
max_connections integer 16 The most connections to PostgreSQL this server node opens. Each node has its own pool, so several replicas open this many each.
migrate_on_start boolean true Apply pending migrations when the server starts. Turn off to run drusite-server migrate as a separate step instead.
allow_rls_bypass boolean false Row-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>.

Key Type Default What it does
bucket string required The bucket. It must exist already; the server checks it can write there when it starts.
endpoint URL unset The store’s endpoint. Leave out for AWS S3.
region string "us-east-1" The region, for AWS S3. Most self-hosted stores ignore it.
access_key_id string (secret) unset Credentials. Leave both out to use the standard AWS_* variables, a web identity token or instance metadata.
secret_access_key string (secret) unset The secret half of the credentials: set both, or neither.
virtual_hosted_style boolean false https://bucket.endpoint/key instead of https://endpoint/bucket/key. Most self-hosted stores want path style, the default.
prefix string "" 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).

Key Type Default What it does
var string "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.

Key Type Default What it does
path string required The 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.

Key Type Default What it does
address URL required The OpenBao or Vault server, e.g. https://bao.example.com.
key string required The Transit key’s name.
mount string "transit" Where the Transit engine is mounted.
token string (secret) required A token allowed to encrypt and decrypt with the key. Give it with token_file.
namespace string unset A 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>.

Key Type Default What it does
self_signup boolean false Let 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_minutes integer 10 How long an app’s access token lasts. Apps refresh it with their device key.
device_idle_days integer 30 A device that hasn’t connected for this long is signed out.
device_max_days integer 365 Every device signs in again after this long, however often it connects.
session_hours integer 12 How long a browser stays signed in to the sign-in pages and account settings.
browser_idle_days integer 14 The 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_days integer 90 The web app signs in again after this long, however often it’s used.

[auth.password]

Environment: DRUSITE__AUTH__PASSWORD__<KEY>.

Key Type Default What it does
enabled boolean false Sign in with an email and a password (hashed with argon2id).
require_totp boolean false Every password account must also set up TOTP.

[auth.passkeys]

Environment: DRUSITE__AUTH__PASSKEYS__<KEY>.

Key Type Default What it does
enabled boolean false Sign 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>.

Key Type Default What it does
enabled boolean false Sign in with a one-time link sent by email. Needs [smtp].
ttl_minutes integer 15 How 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>.

Key Type Default What it does
enabled boolean true Show this provider’s button. Off keeps its settings but removes it. On unless set.
display_name string required The name on the sign-in button, e.g. “Authentik” or “Google”.
issuer string required The 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_id string required The client ID the provider gave Drusite.
client_secret string (secret) unset Leave out for a public client.
scopes list 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_create boolean false Create an account on someone’s first sign-in through this provider.
link_by_verified_email boolean false Let 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_domains list of string [] Only people whose verified email is in one of these domains may sign in through this provider (empty: any).
allowed_groups list 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_claim string "groups" The ID-token claim that lists the user’s groups.

[smtp]

Environment: DRUSITE__SMTP__<KEY>.

Key Type Default What it does
host string required The mail server’s host name.
port integer unset Its port; unset, the usual one for tls (465 for tls, 587 for starttls, 25 for none).
username string unset The user to sign in to it as: set both this and password, or neither.
password string (secret) unset Its password. Give it with password_file.
from string required The 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>.

Key Type Default What it does
service_name string "drusite-server" service.name in traces, metrics and logs.
log_format "json", "pretty" "json" Logs on stderr: json for log collectors, pretty for people.
otlp boolean unset Send 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>.

Key Type Default What it does
enabled boolean true Off keeps even derived data (words and embeddings) out of the database.
text_config string "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>.

Key Type Default What it does
provider "anthropic", "openai", "google", "mistral", "openrouter", "openai-compatible" "openai-compatible" openai, google, mistral, openrouter or openai-compatible (the default).
base_url URL unset The 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).
model string required The embedding model’s ID, as the provider names it.
id string unset Names the vector space stored with every vector; the model name unless set. Changing it (or the model) embeds everything again.
api_key string (secret) unset The provider’s API key: needed for a vendor, optional for openai-compatible. Give it with api_key_file.
dimensions integer unset Asks for vectors of this size, for models that can shorten them.
batch integer 64 How many blocks go in one request.
min_similarity number 0.3 How 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>.

Key Type Default What it does
max_bytes integer 104857600 The 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>.

Key Type Default What it does
enabled boolean true Agents can connect. On unless set.
allow_insecure_client_ids boolean false For development and tests only: accept client ID metadata documents served over plain HTTP, or from loopback and private addresses.
max_token_days integer 365 The longest an agent token made on the account page may last, in days.
mcp_hosts list of string [] Other host names agents may reach /mcp by, besides public_url’s: say an agent in the same Docker network or cluster that calls http://drusite:8080/mcp. Give each as the request’s Host says it, with its port where there is one (drusite:8080). A request naming any other host is refused, which stops DNS rebinding.

[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>.

Key Type Default What it does
enabled boolean true On unless set; without [ask.chat] it’s unavailable anyway, and the apps say how to set it up.
sources integer 12 How many blocks an answer may draw on.
max_context_chars integer 24000 The most text from pages sent with one question, in characters.
history_turns integer 4 How many earlier questions and answers of the conversation go with a new question.
per_minute integer 10 Questions one person may ask a minute, and a day.
per_day integer 500 Questions one person may ask a day.
timeout_secs integer 300 The longest an answer may take, in seconds, and the longest the model may go quiet partway.
idle_secs integer 120 The longest the model may go quiet once it has started answering, in seconds.
audit_days integer 90 How 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>.

Key Type Default What it does
provider "anthropic", "openai", "google", "mistral", "openrouter", "openai-compatible" "openai-compatible" anthropic, openai, google, mistral, openrouter or openai-compatible (the default).
base_url URL unset Needed for openai-compatible; for a vendor it replaces the vendor’s own address.
model string required The chat model’s ID, as the provider names it.
api_key string (secret) unset The provider’s API key: needed for a vendor, optional for openai-compatible. Give it with api_key_file.
name string unset What the apps show it as; the model name unless set.
max_tokens integer 4096 The longest answer, in tokens. Reasoning models count their thinking in it too.
temperature number unset The 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>.

Key Type Default What it does
name string unset What 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_url URL unset Needed for openai-compatible; for a vendor it replaces the vendor’s own address.
api_key string (secret) unset Its API key: needed for a vendor, optional for openai-compatible. Give it with api_key_file.
models string or list of string or table { id, name, use } unset Which 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_tokens integer 4096 The longest answer, in tokens. Reasoning models count their thinking in it too.
temperature number unset The 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>.

Key Type Default What it does
chat string unset The model new chats in Ask start with. Unset, [ask.chat]’s, if there is one.
summaries string unset The model that summarises meetings. Unset, the chat default.
transcription string unset The 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>.

Key Type Default What it does
enabled boolean true On 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>.

Key Type Default What it does
enabled boolean true Pages can be published. On unless set.
public_url URL unset Where published pages are read, e.g. https://pages.example.com. Only its scheme, host and port are used; links are <public_url>/p/<token>.
listen string unset A 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_cert string unset A 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_key string unset The PEM private key for tls_cert.
cache_secs integer 15 How 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_minute integer 300 Requests a minute one address may make to published pages.
client_ip_header string unset Behind 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>.

Key Type Default What it does
enabled boolean true Serve it, when there’s one in dir. On unless set.
dir string unset The 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>.

Key Type Default What it does
invites_create_accounts boolean true An 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.
guests boolean true Pages 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>.

Key Type Default What it does
enabled boolean true Count views. Off, nothing is recorded, the apps hide Analytics, and what was recorded is deleted. On unless set.
count_public_views boolean true Count views of published pages, as a number per day and nothing else. On unless set.
keep_days integer 365 How long daily counts are kept.

[e2ee]

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

Environment: DRUSITE__E2EE__<KEY>.

Key Type Default What it does
enabled boolean true End-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_ai boolean true Whether this server’s AI reads an encrypted workspace’s pages when asked (Ask, search by meaning, meeting notes): one request at a time, kept for none, unless an owner turns it off for the workspace. On unless set; off means it never reads any.

[calendars]

Calendars people connect, to see upcoming events and make meeting notes from them (docs/self-hosting/calendars.md). CalDAV (Nextcloud, iCloud, Fastmail…) and calendar feeds need nothing here; Google and Microsoft need an OAuth app the server’s admin registers.

Environment: DRUSITE__CALENDARS__<KEY>.

Key Type Default What it does
enabled boolean true Off: nobody can connect a calendar, and connected ones aren’t read. On unless set.
reach "public", "any" "public" Which addresses this server will call for CalDAV servers and calendar feeds: public (the public internet only) or any (private addresses too: a Nextcloud on the same home network).

[calendars.google]

Google Calendar, through an OAuth client of type “Web application” whose redirect URI is <public_url>/api/v1/calendars/oauth/callback.

Environment: DRUSITE__CALENDARS__GOOGLE__<KEY>.

Key Type Default What it does
client_id string required The OAuth client’s ID, from Google Cloud’s Credentials page.
client_secret string (secret) required Its secret. Give it with client_secret_file.

[calendars.microsoft]

Outlook and Microsoft 365, through an app registration (Microsoft Entra) whose redirect URI is <public_url>/api/v1/calendars/oauth/callback.

Environment: DRUSITE__CALENDARS__MICROSOFT__<KEY>.

Key Type Default What it does
client_id string required The app registration’s Application (client) ID, from Microsoft Entra.
client_secret string (secret) required Its secret. Give it with client_secret_file.
tenant string "common" Who may sign in: common (personal Microsoft accounts and any organisation’s), consumers (personal accounts only), organizations, or one directory’s ID. common unless set.