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

Drusite

Drusite is an open-source notes app with Notion’s block model: pages made of blocks, databases whose rows are pages, a journal, a canvas, and real-time sync between your devices and the people you work with. It runs on macOS, Windows, Linux, Android and iOS, and in a browser. Your notes live on a server you run, and each workspace can be end-to-end encrypted, so that server stores what it can’t read.

These docs cover two jobs:

Every setting and command is in the Reference. Those pages are made from the code itself, and CI fails when the rest of these docs name a setting the code doesn’t have, so what you read here is what your version does.

What it’s made of

PartWhat it is
The appsOne app, built with Tauri 2, for every desktop and phone. It keeps a full, encrypted copy of your workspaces, so it works offline and syncs when it can.
The web appThe same app in a browser, served by your server.
drusite-serverThe sync server: one binary, with PostgreSQL (with pgvector) and any S3-compatible object store. It handles sign-in, sharing, search, Ask, meetings, publishing and agents.
drusite agentAn optional agent device: a headless Drusite that serves MCP to AI agents for encrypted workspaces.

How these fit together is in Architecture.

Versions

These docs are for Drusite 1.0. The server and the apps share one version number. A 1.x app works with a 1.x server; when the two differ, update the server first (Upgrading).

Drusite is licensed under the AGPL-3.0-or-later. Found something wrong in these docs? Every page has an edit button at the top right, or open an issue.

Install the apps

Drusite is one app for every platform, plus the same app in a browser. Download it from the latest release. Each file’s name has the version in it; check them against the release’s SHA256SUMS if you like.

PlatformFileUpdates
macOS 12.3 or newer (Apple silicon and Intel)Drusite-<version>-macos-universal.dmgIn the app
Windows 10 and 11 (x64)Drusite-<version>-windows-x64-setup.exeIn the app
Linux, any distribution (x86_64)Drusite-<version>-linux-x86_64.AppImageIn the app
Debian, Ubuntudrusite_<version>_amd64.debIn the app (it asks for your password)
Fedora, openSUSEdrusite-<version>.x86_64.rpmIn the app (it asks for your password)
Archdrusite-<version>-x86_64.pkg.tar.zstThe app links to the new package
Android (arm64)drusite-<version>-arm64.apkThe app links to the new APK
iPhone and iPadTestFlightThrough TestFlight
Any browserYour server’s addressWith your server

Windows and Linux in 1.0.0. The desktop app keeps the key to its encrypted local copy in the system’s key store. 1.0.0 has that only for macOS, iOS and Android: on Windows and Linux the app can’t open its notes, and says “this platform has no store key support yet”. Use the web app on those computers until a release adds it.

macOS

Open the .dmg and drag Drusite to Applications. Release builds are signed and notarized by Apple, so it opens like any app. The first time you record a meeting, macOS asks for the microphone, and, for the computer’s sound, Screen & System Audio Recording.

Windows

Run the -setup.exe. The installer isn’t code-signed yet, so Windows SmartScreen may say “Windows protected your PC”: choose More info, then Run anyway. Updates installed from inside the app don’t ask again.

Linux

  • AppImage: make it executable and run it:

    chmod +x Drusite-*-linux-x86_64.AppImage
    ./Drusite-*-linux-x86_64.AppImage
    
  • Debian and Ubuntu: sudo apt install ./drusite_*_amd64.deb

  • Fedora and openSUSE: sudo dnf install ./drusite-*.x86_64.rpm (or zypper install)

  • Arch: sudo pacman -U drusite-*-x86_64.pkg.tar.zst

Android

Download the .apk on the phone and open it. Android asks you to allow installs from your browser (or files app) the first time. Obtainium can follow the GitHub releases and keep it updated for you. The .aab in the release is for Google Play, not for installing by hand.

iPhone and iPad

iOS builds are published through Apple’s TestFlight. There’s no file to install from GitHub.

In a browser

Go to your server’s address, such as https://notes.example.com, and sign in. The web app is the full app and keeps an encrypted copy of your notes in the browser, so it works offline too. A few things only an installed app can do; the web app lists them.

First start

Drusite opens straight into a workspace on the device, which works without a server. To keep your notes in sync with your other devices, sign in: Settings → Account & sync, give the Server address (from whoever runs it), and sign in. The pages you already made become a workspace in your account. See Signing in and devices.

Don’t have a server? Run one in ten minutes.

Run a server in ten minutes

This starts a complete Drusite server on your own computer with Docker Compose: the server, PostgreSQL with pgvector, and SeaweedFS as the object store. It’s for trying Drusite out. For a server other people use, carry on with Docker Compose or Kubernetes with Helm afterwards.

You need Docker with Compose v2, git, openssl, and port 8080 free.

1. Get the Compose files

git clone --depth 1 https://github.com/pranavajk1/drusite.git
cd drusite/deploy/compose

The folder holds compose.yaml, the server’s config drusite.toml, setup.sh, and initdb/, which prepares the database on its first start.

2. Make the secrets

./setup.sh

It writes secrets/, once: passwords for PostgreSQL and the object store, the database URL, and the master key, which wraps the key of every workspace on the server. Back secrets/ up. Without master_key, the notes on this server can’t be read by anyone.

3. Start it

docker compose up -d

The first start pulls the images, creates the database and the bucket, and runs the migrations. Check that it’s ready:

curl http://localhost:8080/readyz

It answers {"status":"ok","checks":{"database":"ok","storage":"ok","keys":"ok"}}.

4. Make your account

Sign-up is off, so make the first account from the server:

docker compose run --rm drusite account create you@example.com --name "Your Name"

It prints a one-time sign-in link, good for 24 hours:

account 01a22a5e-…
one-time sign-in link, valid for 1440 minutes (give it only to the account's owner):
http://localhost:8080/auth/recover#token=…

Open it in a browser and choose Sign in. You land on your account page: add a passkey or set a password there, because the link works only once.

5. Open Drusite

  • In the browser: go to http://localhost:8080. The web app is the full app.
  • In an app: install Drusite, choose to sign in to a server, and give it http://localhost:8080.

What next

  • To reach it from other devices, it needs a domain and HTTPS: set public_url in drusite.toml and put a reverse proxy in front. Plain http works only for localhost.
  • Sign-in methods and accounts decide who else gets in.
  • Stop it with docker compose down. Your notes stay in the postgres and seaweedfs volumes; docker compose down -v deletes them.

Self-hosting: overview and requirements

Drusite’s apps sync through a server you run. This section takes you from nothing to a server other people can rely on, one step at a time. Each page stands on its own, so skip what you already have.

  1. Get it running. Docker Compose on one machine, or Kubernetes with Helm. Both start from the same image.
  2. Bring your own data services, or use the ones Compose starts: PostgreSQL with pgvector and an S3-compatible object store.
  3. Protect the keys. The master key, backups and restore. Read this one before you put real notes on the server.
  4. Put it on HTTPS behind a reverse proxy.
  5. Decide who gets in. Sign-in methods, single sign-on with OIDC, accounts and invitations, and email for magic links and invites.
  6. Turn on what you want, all optional: AI providers, search by meaning, Ask your notes, meeting transcription, agents, publish to web and the web app.
  7. Run it. End-to-end encryption, the admin’s view, logs, metrics and health checks, upgrading and releases. When something breaks, troubleshooting.

Requirements

NeededNotes
A machineamd64 or arm64, 1 CPU, 512 MB of RAM for the server itselfThe server holds no state of its own, so you can run more than one. The Helm chart asks for 50m CPU and 64 MiB, and limits memory to 512 MiB.
A container runtimeDocker with Compose v2, Podman, or KubernetesOr build the binary yourself: it’s one Rust program.
PostgreSQL16 or newer, with pgvector 0.8 or newerThe server refuses to start on anything older and says why. Details.
An object storeAnything that speaks S3SeaweedFS, MinIO, Garage, Ceph, Cloudflare R2, AWS S3. Details.
A master keyMade with drusite-server keys generate, or kept in OpenBao or Vault TransitDetails.
A domain and HTTPSFor anything beyond your own machinePasskeys need a domain name, not an IP address. http://localhost works for trying it out.
A sign-in methodAt least onePasskeys and passwords need nothing else. Magic links need email. OIDC needs an identity provider.

Optional, depending on what you turn on:

  • An SMTP server, for magic links and emailed invitations.
  • AI models, for search by meaning, Ask and meeting notes: any OpenAI-compatible server (LiteLLM, Ollama, vLLM, LocalAI, llama.cpp, LM Studio), or a vendor’s API (Anthropic, OpenAI, Google, Mistral, OpenRouter). Drusite works fully without them.
  • An OTLP collector, for traces, metrics and logs.

What the server stores, and where

WhereWhat
PostgreSQLAccounts, sign-ins, workspaces and members, and every page’s document and history, sealed with its workspace’s key. Search words and vectors, unless search is off.
The object storeAttachments and meeting recordings, each sealed with its workspace’s key.
The key sourceThe master key, which wraps each workspace’s key. Without it, a standard workspace’s data can’t be read, by you or anyone.

In an end-to-end encrypted workspace the documents and files are sealed on the members’ devices instead, and no key on the server opens them.

The images

ImageWhat it is
ghcr.io/pranavajk1/drusite-serverThe server, with the web app built in. amd64 and arm64, distroless, no shell, running as an unprivileged user (65532).
ghcr.io/pranavajk1/drusite-agentThe agent device.
oci://ghcr.io/pranavajk1/charts/drusiteThe Helm chart.

Each release is tagged with its version (1.0.0). A release also moves 1.0, 1 and latest to it; a pre-release gets only its own tag. Pin 1 to get every 1.x release as you restart, or a full version to choose when to upgrade. Releases and update channels says how to check the signatures.

Docker Compose

deploy/compose runs a whole Drusite server on one machine: drusite-server, PostgreSQL 18 with pgvector, and SeaweedFS as the S3-compatible store. This page turns the quick start into a server for real use.

Prerequisites

  • A Linux machine (or any with Docker) with Docker Engine and Compose v2.
  • A domain name pointing at it, such as notes.example.com.
  • A reverse proxy for HTTPS. The example below adds Caddy to the same Compose project; Reverse proxies and TLS covers nginx and Traefik.

1. Get the files and make the secrets

git clone --depth 1 https://github.com/pranavajk1/drusite.git
cp -r drusite/deploy/compose /srv/drusite && cd /srv/drusite
./setup.sh

setup.sh refuses to run twice, so it can’t overwrite your master key. What it writes:

File in secrets/What it is
postgres_passwordPostgreSQL’s superuser password, used only by the first start’s initdb script
db_password, database_urlThe password of drusite, the ordinary role the server connects as, and its URL
s3.json, s3_secret_keySeaweedFS’s credentials, and the server’s copy of the secret
master_keyThe master key (drusite-server keys generate)

Back up secrets/ now, somewhere other than this machine. See the master key, backups and restore.

2. Choose the version

compose.yaml runs ghcr.io/pranavajk1/drusite-server:${DRUSITE_VERSION:-1}: the newest 1.x release whenever the image is pulled. To choose when you upgrade, pin a full version in a .env file beside compose.yaml:

echo DRUSITE_VERSION=1.0.0 > .env

3. Edit drusite.toml

At least:

public_url = "https://notes.example.com"

public_url is where people and apps reach the server. Sign-in links, passkeys and OAuth redirects are built from it, so it must be the address in the browser, https included.

Then the sign-in methods. The file has passkeys and passwords on and sign-up off; see Sign-in methods to change that, add OIDC, or set up email. Every other setting is in the configuration reference. Check the result without starting anything:

docker compose run --rm drusite check-config
config OK. Login methods:
  Passkeys
  Password

4. Start it and make the first account

docker compose up -d
docker compose run --rm drusite account create you@example.com --name "Your Name"

Open the printed link, and add a passkey or a password on the account page it shows.

HTTPS with Caddy

Caddy gets a certificate on its own. Add it to the project with a compose.override.yaml beside compose.yaml:

services:
  caddy:
    image: caddy:2
    restart: unless-stopped
    ports: ["80:80", "443:443"]
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile:ro
      - caddy:/data
  drusite:
    ports: !reset []
volumes:
  caddy:

and a Caddyfile:

notes.example.com {
	request_body {
		max_size 110MB
	}
	reverse_proxy drusite:8080
}

ports: !reset [] stops the server’s port 8080 being published on the host, so only Caddy reaches it. max_size lets attachments up to [attachments] max_bytes (100 MiB by default) through. Caddy passes WebSockets as they are, which sync needs.

Day-to-day

ToRun
See the logsdocker compose logs -f drusite
Check it’s readycurl -s https://notes.example.com/readyz
Run a server commanddocker compose run --rm drusite <command> (all of them)
Let someone back indocker compose run --rm drusite account recover them@example.com
Upgradedocker compose pull && docker compose up -d (read first)
Back upThe master key, backups and restore

Using your own PostgreSQL or object store

Delete the postgres, seaweedfs or bucket service from compose.yaml (and from the server’s depends_on), then point drusite.toml at yours. PostgreSQL and object storage say what each needs.

Publishing pages on their own host

To serve published pages from a host of their own, uncomment [publish] in drusite.toml and the 8443:8443 port in compose.yaml, then expose only that port (or that host name) to the internet.

Kubernetes with Helm

The chart runs the server alone. Bring PostgreSQL with pgvector and an S3-compatible store: an operator such as CloudNativePG for the database, and SeaweedFS, MinIO, Garage, Ceph or a cloud store for files. Every value is explained in Helm chart values.

Prerequisites

  • A Kubernetes cluster, and Helm 3.8 or newer (for OCI charts).
  • PostgreSQL 16+ with pgvector 0.8+, with a database and an ordinary role for Drusite.
  • An S3-compatible bucket, and credentials for it.
  • An Ingress controller (or a Gateway) that passes WebSockets, and a certificate for your host.

1. Make the Secret

The chart mounts one Secret’s keys as files under /run/secrets/drusite/. The default config reads three:

kubectl create namespace drusite
kubectl -n drusite create secret generic drusite \
  --from-literal=database-url='postgres://drusite:PASSWORD@postgres.example.test:5432/drusite' \
  --from-literal=s3-secret-access-key='SECRET' \
  --from-literal=master-key="$(docker run --rm ghcr.io/pranavajk1/drusite-server:1 keys generate)"

Keep a copy of master-key outside the cluster: see the master key, backups and restore. If you use External Secrets, Sealed Secrets or Vault, make the same Secret with those instead.

2. Write your values

values.yaml:

config: |
  public_url = "https://notes.example.com"

  [database]
  url_file = "/run/secrets/drusite/database-url"

  [storage]
  endpoint = "https://s3.example.com"
  bucket = "drusite"
  access_key_id = "drusite"
  secret_access_key_file = "/run/secrets/drusite/s3-secret-access-key"

  [keys]
  source = "file"
  path = "/run/secrets/drusite/master-key"

  [auth.passkeys]
  enabled = true

secret:
  name: drusite

ingress:
  enabled: true
  className: nginx
  host: notes.example.com
  annotations:
    nginx.ingress.kubernetes.io/proxy-body-size: 110m
    nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
    cert-manager.io/cluster-issuer: letsencrypt
  tls:
    - hosts: [notes.example.com]
      secretName: notes-tls

config is the whole config file, so add sign-in methods, AI and anything else from the configuration reference to it. Values that change per environment can come from env instead (DRUSITE__AUTH__SELF_SIGNUP, say).

3. Install

helm install drusite oci://ghcr.io/pranavajk1/charts/drusite \
  --version 1.0.0 -n drusite -f values.yaml
kubectl -n drusite rollout status deploy/drusite

The pod runs the migrations before it listens; its startup probe allows five minutes for that. Then make the first account:

kubectl -n drusite exec deploy/drusite -- drusite-server account create you@example.com

Upgrading

helm upgrade drusite oci://ghcr.io/pranavajk1/charts/drusite \
  --version 1.0.1 -n drusite -f values.yaml

The chart’s version is the server’s: chart 1.0.1 runs server 1.0.1 unless image.tag says otherwise. Read Upgrading before a minor or major version.

More than one replica

Server pods hold no state, so replicaCount: 2 or more works behind the Service. Each pod has its own connection pool ([database] max_connections, 16 by default), so size PostgreSQL’s max_connections for all of them. Migrations take a lock, so pods starting together don’t run them twice.

Verify the chart and image

Both are signed with cosign by the workflow that built them:

cosign verify ghcr.io/pranavajk1/charts/drusite:1.0.0 \
  --certificate-identity-regexp '^https://github.com/pranavajk1/drusite/\.github/workflows/image\.yml@' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

Releases and update channels has the image’s command.

PostgreSQL with pgvector

Drusite keeps accounts, workspaces and every page’s sealed document and history in PostgreSQL, and its search index with pgvector. The Compose file starts one for you; this page is for using your own, or a managed one.

Prerequisites

  • PostgreSQL 16 or newer. CI runs on 16, the oldest Drusite supports; the Compose file runs 18.
  • pgvector 0.8 or newer, installed on the server. The pgvector/pgvector images have it, and most managed services offer it (Amazon RDS and Aurora, Google Cloud SQL, Azure Database for PostgreSQL, Supabase, Neon, CloudNativePG with an image that includes it).
  • A way to run SQL as an administrator, once.

1. Make a role and a database

Drusite should connect as an ordinary role. Row-level security is its second line between workspaces, and PostgreSQL doesn’t apply it to superusers or roles with BYPASSRLS, so the server refuses those (unless you set [database] allow_rls_bypass, which you shouldn’t). The role may own its database.

CREATE ROLE drusite LOGIN PASSWORD 'choose-a-long-password';
CREATE DATABASE drusite OWNER drusite;
\connect drusite
CREATE EXTENSION vector;

CREATE EXTENSION vector needs an administrator, because pgvector isn’t a trusted extension. If the role can create it, the server does so itself on first start; if not, it stops and says to run that line.

2. Point Drusite at it

The URL carries the password, so give it from a file or the environment, never in the config:

[database]
url_file = "/run/secrets/database-url"

The file holds one line, such as postgres://drusite:PASSWORD@db.example.test:5432/drusite?sslmode=require. URL-encode the password if it has characters such as @, / or #. Any libpq-style option in the query string works, sslmode and sslrootcert included.

3. Start the server

On every start the server checks, before it changes anything:

  1. that PostgreSQL is 16 or newer;
  2. that its role isn’t a superuser and doesn’t have BYPASSRLS;
  3. that pgvector 0.8 or newer is available, and enabled in this database (creating it if allowed);

then applies any pending migrations. Each failure stops the server with a message saying what to fix; Troubleshooting lists them.

Migrations as a separate step

By default the server migrates on start. To run migrations yourself, as a deploy step or with a more privileged role, turn that off and run migrate first:

[database]
migrate_on_start = false
drusite-server migrate

A server whose database has pending migrations and migrate_on_start = false refuses to start, and its /readyz says "database": "failing".

Connections

Each server process opens up to max_connections (16 by default). With several replicas, PostgreSQL needs room for all of them, plus a few for drusite-server commands and your own tools. A connection pooler such as PgBouncer works in session mode.

What’s in it, and what that reveals

The database holds page documents and history sealed with each workspace’s key (or, for end-to-end encrypted workspaces, with keys only the members’ devices have). It also holds, for standard workspaces, the search index: each block’s words as a tsvector and, with search by meaning, its embedding. Those are derived from the text and reveal what it’s about to anyone who can read the database or its backups. [search] enabled = false keeps them out. See Search by meaning.

Backups

Back the database up with whatever you use for PostgreSQL: pg_dump, WAL archiving with pgBackRest or Barman, or your provider’s snapshots. A backup is useless without the master key that was current when it was made: see backups and restore.

Object storage: SeaweedFS, MinIO, AWS S3

Attachments (images, PDFs, any file on a page) and meeting recordings go to an S3-compatible object store. Each is sealed with its workspace’s key before it leaves the server (or on the members’ devices, in an encrypted workspace), so the store only ever holds ciphertext. Page documents themselves live in PostgreSQL, not here.

Any store that speaks S3 works. These are three common choices; Garage, Ceph’s RGW, Cloudflare R2, Backblaze B2 and Wasabi are set up the same way.

What the server needs

  • One bucket, which exists before the server starts. The server doesn’t create it.
  • Credentials that can read, write, delete and list in it. On every start the server writes, reads back and deletes a small object under _drusite/ to prove it can, and stops if it can’t. Its readiness check reads an object that may not exist, which on AWS answers 403 rather than 404 unless the credentials may list the bucket.
  • Objects are stored under workspaces/<workspace>/blobs/<id>, after prefix if you set one to share a bucket.

SeaweedFS

What the Compose file runs. SeaweedFS’s S3 gateway listens on port 8333 and reads its users from a JSON file (setup.sh writes it as secrets/s3.json):

{"identities": [{"name": "drusite",
  "credentials": [{"accessKey": "drusite", "secretKey": "A-LONG-RANDOM-SECRET"}],
  "actions": ["Admin", "Read", "Write", "List", "Tagging"]}]}

Make the bucket with weed shell:

echo 's3.bucket.create -name drusite' | weed shell -master=seaweedfs:9333

and point Drusite at it:

[storage]
endpoint = "http://seaweedfs:8333"
bucket = "drusite"
access_key_id = "drusite"
secret_access_key_file = "/run/secrets/s3_secret_key"

MinIO

With an existing MinIO server at minio.example.test:9000, make a bucket, a policy limited to it, and a user for Drusite with the mc client:

mc alias set local https://minio.example.test:9000 ADMIN_USER ADMIN_PASSWORD
mc mb local/drusite
cat > drusite-policy.json <<'JSON'
{"Version": "2012-10-17", "Statement": [
  {"Effect": "Allow", "Action": ["s3:ListBucket"], "Resource": ["arn:aws:s3:::drusite"]},
  {"Effect": "Allow", "Action": ["s3:GetObject", "s3:PutObject", "s3:DeleteObject"],
   "Resource": ["arn:aws:s3:::drusite/*"]}]}
JSON
mc admin policy create local drusite drusite-policy.json
mc admin user add local drusite A-LONG-RANDOM-SECRET
mc admin policy attach local drusite --user drusite
[storage]
endpoint = "https://minio.example.test:9000"
bucket = "drusite"
access_key_id = "drusite"
secret_access_key_file = "/run/secrets/s3-secret-access-key"

AWS S3

Leave out endpoint, and set the bucket’s region:

[storage]
bucket = "drusite-notes-example"
region = "eu-west-1"

Without access_key_id and secret_access_key, the server finds credentials the way AWS’s own tools do: the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY variables, a web identity token (EKS’s IAM roles for service accounts), or the instance’s metadata (an EC2 instance profile or an ECS task role). Prefer a role to long-lived keys. Its policy:

{"Version": "2012-10-17", "Statement": [
  {"Effect": "Allow", "Action": ["s3:ListBucket"],
   "Resource": ["arn:aws:s3:::drusite-notes-example"]},
  {"Effect": "Allow", "Action": ["s3:GetObject", "s3:PutObject", "s3:DeleteObject"],
   "Resource": ["arn:aws:s3:::drusite-notes-example/*"]}]}

Block public access on the bucket. The server encrypts every object already, so default server-side encryption adds nothing for Drusite but costs nothing either.

Path style and virtual-hosted style

By default the server asks for https://endpoint/bucket/key (path style), which self-hosted stores expect. Set virtual_hosted_style = true for https://bucket.endpoint/key, if your store wants that.

Sizes

The largest file a page can hold is [attachments] max_bytes, 100 MiB by default, which also caps a meeting recording (about three hours of speech). Raise it and your reverse proxy’s body size limit together.

Backups

Copy the bucket with your store’s replication, rclone sync, mc mirror or aws s3 sync. The database and the bucket go together: backups and restore says how.

The master key, backups and restore

Read this before you put real notes on a server.

What the master key does

Every standard workspace has its own key, which seals its documents, history and files. The server keeps those keys in the database wrapped (encrypted) by the master key, so a copy of the database alone opens nothing. The master key also wraps each account’s own data key, which seals the API keys people save for their own AI providers.

End-to-end encrypted workspaces are different: their keys live on the members’ devices, and the master key opens none of them.

If you lose the master key, every standard workspace on the server is unreadable, for good. Nobody, including Drusite’s developers, can get it back.

Where it comes from: [keys] source

env: an environment variable

[keys]
source = "env"            # reads DRUSITE_MASTER_KEY; `var` names another

file: a file

What the Compose file and the Helm chart use, with a Docker or Kubernetes secret:

[keys]
source = "file"
path = "/run/secrets/master_key"

For both, make a key with:

docker run --rm ghcr.io/pranavajk1/drusite-server:1 keys generate

It prints one entry, mk-1a2b3c4d:<32 bytes in base64>: an ID, a colon and the key. The variable or file holds one or more entries, separated by spaces, commas or new lines. The first one wraps new keys; the others still unwrap what they wrapped.

transit: OpenBao or Vault

With the Transit engine of OpenBao or HashiCorp Vault, the master key never leaves the key management service: the server sends each workspace key to be wrapped and unwrapped there.

bao secrets enable transit
bao write -f transit/keys/drusite type=chacha20-poly1305
bao policy write drusite - <<'HCL'
path "transit/encrypt/drusite" { capabilities = ["update"] }
path "transit/decrypt/drusite" { capabilities = ["update"] }
HCL
bao token create -policy=drusite -period=768h
[keys]
source = "transit"
address = "https://bao.example.com"
key = "drusite"
token_file = "/run/secrets/bao-token"
# mount = "transit"
# namespace = "drusite"   # Vault Enterprise and OpenBao namespaces

The key type must support associated data (chacha20-poly1305 or aes256-gcm96). Renew a periodic token before its period ends, or use your platform’s agent to keep it fresh. Rotating the Transit key (bao write -f transit/keys/drusite/rotate) needs nothing from Drusite.

On every start the server wraps and unwraps a throwaway key to prove the source works, and with transit its readiness check does the same, so /readyz fails while OpenBao is unreachable.

Rotating a local master key

  1. Make a new key with keys generate.
  2. Put it first, keeping the old one after it: mk-new…:… mk-old…:…
  3. Restart the server.

New workspace keys (new workspaces, and new key versions made when someone is removed from a workspace) are wrapped with the new master key. Keys wrapped with the old one stay wrapped with it: 1.0 has no command that wraps them again, so keep every old master key in the list. To see which master keys are in use:

SELECT master_key_id, count(*) FROM workspace_keys GROUP BY 1;

What to back up

WhatWhyHow often
The master key (or OpenBao’s Transit key)Without it, standard workspaces can’t be readOnce, and after each rotation. Keep it apart from the database’s backups.
PostgreSQLAccounts, workspaces, members, documents and historyDaily, or continuously with WAL archiving
The bucketAttachments and recordingsAs often as the database
The configdrusite.toml, or your Helm valuesWhen it changes

Back up the database first, then the bucket. A file uploaded in between is a harmless extra in the bucket’s backup; the other order could leave pages pointing at files the backup lacks.

Who can read a backup

Standard workspaceEncrypted workspace
Pages, files, historySealed with workspace keys, which the master key wrapsSealed on the members’ devices; no key on the server opens them
To restore it you needThe backup and the master key that was current when it was madeThe backup; members’ devices still hold their keys
Search words and vectorsIn the database, derived from the text (search)None, unless an owner lets the server’s AI read pages

So anyone with a database backup and the master key can read standard workspaces. Store them apart. A workspace converted to end-to-end encryption can still be read from backups made before the conversion, with the master key of that time, until those backups expire.

Docker Compose

A nightly backup into backups/, from the folder with compose.yaml:

mkdir -p backups
day=$(date +%F)
docker compose exec -T postgres pg_dump -U postgres -Fc --no-comments drusite > "backups/drusite-$day.dump"
docker compose stop seaweedfs
docker run --rm -v drusite_seaweedfs:/data:ro -v "$PWD/backups:/backup" alpine \
  tar czf "/backup/seaweedfs-$day.tgz" -C /data .
docker compose start seaweedfs

SeaweedFS is stopped for the copy so its files are consistent; while it’s down, attachments can’t be opened or uploaded, and the apps retry. --no-comments leaves out the comment on the pgvector extension, which only its owner may set again on restore.

Copy backups/ and, once, secrets/ somewhere else: another machine, or an object store in another place.

Restoring

On a new machine, with the same compose.yaml, drusite.toml and the old secrets/:

docker compose up -d postgres seaweedfs
docker compose exec -T postgres pg_restore -U postgres -d drusite --no-owner --role=drusite \
  < backups/drusite-2026-11-29.dump
docker compose stop seaweedfs
docker run --rm -v drusite_seaweedfs:/data -v "$PWD/backups:/backup" alpine \
  sh -c 'rm -rf /data/* && tar xzf /backup/seaweedfs-2026-11-29.tgz -C /data'
docker compose up -d
curl -s http://localhost:8080/readyz

The first up makes an empty database with the drusite role and pgvector, as on any first start, and pg_restore fills it. If you made new secrets by mistake, put the old master_key (and db_password and database_url) back before starting the server: the restored workspaces need the old master key.

Kubernetes and managed services

Use what your platform has: CloudNativePG’s backups or your provider’s snapshots for PostgreSQL, and bucket replication or versioning for the store. Keep the master key in your secret manager and somewhere outside the cluster.

Test the restore

A backup you’ve never restored is a hope. Restore into a scratch Compose project now and then, sign in, and open a page with an attachment.

Reverse proxies and TLS

The server speaks plain HTTP on port 8080 and expects something in front of it to terminate TLS. Any reverse proxy works if it does five things.

What the proxy must do

  1. Serve public_url’s host over HTTPS, with a certificate browsers and phones trust. The apps refuse plain http except for localhost, and passkeys need HTTPS on a domain name.
  2. Pass WebSockets on /api/v1/sync, and let them stay open for hours. That connection is how the apps sync; it sends a ping now and then, but an idle timeout of a minute will keep cutting it.
  3. Accept large request bodies: at least [attachments] max_bytes (100 MiB by default), for attachments and meeting recordings.
  4. Not buffer streamed responses. Ask streams its answers as server-sent events, for up to [ask] timeout_secs (300 s).
  5. Not put a login in front of Drusite. Sign-in is Drusite’s own, and the apps can’t follow a proxy’s forward-auth or SSO redirect. Use OIDC to sign in through your identity provider instead.

Pass every path through. Agents in particular need /mcp, /oauth/… and /.well-known/oauth-protected-resource.

Caddy

notes.example.com {
	request_body {
		max_size 110MB
	}
	reverse_proxy localhost:8080 {
		flush_interval -1
	}
}

Caddy gets and renews the certificate itself and passes WebSockets as they are. flush_interval -1 sends streamed answers as they come.

nginx

server {
    listen 443 ssl;
    http2 on;
    server_name notes.example.com;
    ssl_certificate     /etc/letsencrypt/live/notes.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/notes.example.com/privkey.pem;

    client_max_body_size 110m;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_buffering off;
        proxy_read_timeout 1h;
        proxy_send_timeout 1h;
    }
}

# In the http block:
map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

On Kubernetes with ingress-nginx, the same as annotations:

nginx.ingress.kubernetes.io/proxy-body-size: 110m
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-buffering: "off"

Traefik

With Docker labels on the drusite service:

labels:
  - traefik.enable=true
  - traefik.http.routers.drusite.rule=Host(`notes.example.com`)
  - traefik.http.routers.drusite.entrypoints=websecure
  - traefik.http.routers.drusite.tls.certresolver=letsencrypt
  - traefik.http.routers.drusite.middlewares=drusite-body
  - traefik.http.middlewares.drusite-body.buffering.maxRequestBodyBytes=115343360
  - traefik.http.services.drusite.loadbalancer.server.port=8080

Traefik passes WebSockets and streams responses without more settings. Its entry points’ respondingTimeouts.readTimeout defaults to 60 s in Traefik 3; raise it if uploads of big files over slow connections fail:

entryPoints:
  websecure:
    address: ":443"
    transport:
      respondingTimeouts:
        readTimeout: 600s

Cloudflare Tunnel and other tunnels

Tunnels work: point one at http://localhost:8080 (or http://drusite:8080 inside Compose). Mind the tunnel’s own upload limit, which may be lower than max_bytes, and don’t add Cloudflare Access in front of the app’s host, for the same reason as any proxy login.

Published pages on a host of their own

Publish to web can serve published pages from a second host, say pages.example.com, on a listener of its own ([publish] listen, port 8443). Route only that host to that port, and set [publish] client_ip_header to the header your proxy sets (x-forwarded-for), so its per-reader limits see readers rather than the proxy. The server can also serve that host’s TLS itself, with no proxy: see Publish to web.

Check it

curl -s https://notes.example.com/readyz
curl -s https://notes.example.com/api/v1/version

Then sign in from an app. If sync connects and then drops every minute or so, the proxy’s WebSocket timeout is too short; if attachments fail at a certain size, its body limit is too low. More in Troubleshooting.

Sign-in methods

Every way of signing in is a switch in the config, and each is off unless you turn it on. A method that’s off has no routes at all. The server refuses to start with none on.

MethodNeedsTurn on with
Passkeyspublic_url on a domain name (or localhost)[auth.passkeys] enabled = true
Password, optionally with an authenticator appNothing[auth.password] enabled = true
Magic link by emailSMTP[auth.magic_link] enabled = true
Single sign-onAn OIDC provideran [auth.oidc.<id>] table (OIDC)

They can be combined: people sign in with any method their account has. The sign-in page shows every method that’s on, and each account can add passkeys, a password and an authenticator app from its account page (/account).

How the apps sign in

Apps don’t take passwords themselves. They open the server’s sign-in page in the system browser (or, in the web app, the page itself), and the server hands the app tokens bound to a key that never leaves the device (DPoP). So every method above works in every app, and a new method on the server needs no app update.

SettingDefault
[auth] access_token_minutes10How long an app’s access token lasts before it refreshes it
[auth] device_idle_days30A device unused this long is signed out
[auth] device_max_days365Every device signs in again after this long
[auth] session_hours12How long a browser stays signed in to the sign-in and account pages
[auth] browser_idle_days / browser_max_days14 / 90The same for the web app

People see and sign out their devices on their account page, /account.

Passkeys

[auth.passkeys]
enabled = true

Passkeys belong to public_url’s domain, so it must be a domain name, not an IP address. If you move the server to another domain, passkeys made for the old one stop working there: keep another method on while people add new ones.

Passwords

[auth.password]
enabled = true
# require_totp = true

Passwords are hashed with argon2id. With require_totp, every password account must also set up an authenticator app (TOTP) before it can be used.

[auth.magic_link]
enabled = true
# ttl_minutes = 15

[smtp]
host = "smtp.example.com"
from = "Drusite <notes@example.com>"
username = "notes@example.com"
password_file = "/run/secrets/smtp-password"

A one-time link by email, good for ttl_minutes. The server checks it can reach the SMTP server when it starts, and stops if it can’t. See Email.

Locked out

Anyone who loses every way into their account can be let back in from the server:

drusite-server account recover someone@example.com

It prints a one-time link, valid for 30 minutes (--ttl-minutes changes that), that signs them in once so they can add a method. Give it only to the account’s owner. A new link replaces any unused earlier one. It doesn’t give back encrypted workspaces: those need one of their devices or their recovery key.

Who can make an account

That’s separate from how people sign in: see Accounts, sign-up and invitations.

Single sign-on with OIDC

Drusite signs people in through any OpenID Connect provider. Each provider is a table of its own, [auth.oidc.<id>], where <id> is a name you choose (lowercase letters, digits and _). You can have several, each with its own button on the sign-in page. Authentik, Keycloak and Google are the examples here; Zitadel, Kanidm, Authelia, Okta, Entra ID and Auth0 are set up the same way.

What you need from the provider

  • A client (an “application” or “OAuth2 provider”) of the confidential kind, with the authorization code flow. Drusite uses PKCE too.

  • Its redirect URI set to:

    https://notes.example.com/api/v1/auth/oidc/<id>/callback
    

    with your public_url and the <id> you chose. It must match exactly.

  • The issuer, the client ID and the client secret.

  • The scopes openid, email and profile. Drusite needs the email, and whether the provider verified it (email_verified).

How accounts are matched

  • Someone is known by the pair (provider, subject), never by email. Changing an email at the provider keeps the same Drusite account.
  • First sign-in, when nobody has that subject yet:
    • with auto_create = true, an account is made;
    • with link_by_verified_email = true, it joins the existing account with the same email, but only if the provider says it verified the email and the existing account’s email is verified too. Turn it on only for a provider that checks emails properly: anyone who could make an account there with your email could otherwise take over your Drusite account;
    • otherwise, the sign-in is refused, unless the person has an invitation for that verified email.
  • Every sign-in checks allowed_groups and allowed_email_domains, so removing someone from a group at the provider stops their next sign-in.

Groups only gate sign-in. They decide who may sign in through a provider, not what anyone can do once in. Roles in a workspace come only from invitations and invite links. Devices that are already signed in stay signed in until their tokens lapse (device_idle_days); sign them out from the account page, or delete the account, to cut someone off at once.

Authentik

  1. In the admin interface, Applications → Providers → Create → OAuth2/OpenID Provider.
    • Client type: Confidential.
    • Redirect URIs: https://notes.example.com/api/v1/auth/oidc/authentik/callback (strict).
    • Scopes: keep openid, email and profile. Authentik’s default profile mapping puts the user’s groups in a groups claim.
  2. Applications → Applications → Create, named Drusite, with that provider. Bind the groups or users that may use it, if you like: Authentik then refuses others itself.
  3. Copy the client ID and secret. The issuer is shown on the provider’s page as OpenID Configuration Issuer, ending in a slash.
[auth.oidc.authentik]
display_name = "Authentik"
issuer = "https://auth.example.com/application/o/drusite/"
client_id = "CLIENT-ID"
client_secret_file = "/run/secrets/oidc-authentik"
auto_create = true
# allowed_groups = ["notes"]

The issuer must be exactly what the provider says, trailing slash included. Authentik’s has one; a missing slash fails discovery.

Keycloak

  1. In your realm, Clients → Create client: OpenID Connect, client ID drusite.
  2. Client authentication on, Standard flow on, other flows off.
  3. Valid redirect URIs: https://notes.example.com/api/v1/auth/oidc/keycloak/callback.
  4. From Credentials, copy the client secret.
  5. For allowed_groups: Client scopes → drusite-dedicated → Add mapper → By configuration → Group Membership, token claim name groups, Full group path off, Add to ID token on.
[auth.oidc.keycloak]
display_name = "Keycloak"
issuer = "https://sso.example.com/realms/example"
client_id = "drusite"
client_secret_file = "/run/secrets/oidc-keycloak"
auto_create = true
# allowed_groups = ["notes"]

Keycloak’s issuer has no trailing slash. Users need an email, marked verified in Keycloak (or email_verified is false, which matters for allowed_email_domains, invitations and link_by_verified_email).

Google

  1. In the Google Cloud console, APIs & Services → OAuth consent screen: set it up for your users (Internal, for a Google Workspace organization, keeps it to your domain).
  2. Credentials → Create credentials → OAuth client ID, type Web application.
  3. Authorized redirect URIs: https://notes.example.com/api/v1/auth/oidc/google/callback.
[auth.oidc.google]
display_name = "Google"
issuer = "https://accounts.google.com"
client_id = "1234567890-abc.apps.googleusercontent.com"
client_secret_file = "/run/secrets/oidc-google"
auto_create = true
allowed_email_domains = ["example.com"]

Google has no groups claim, so use allowed_email_domains (verified emails only) to say who may sign in, or leave auto_create off and invite people.

Every setting

KeyDefault
display_namerequiredThe button’s label
issuerrequiredExactly as the provider states it; must be https
client_id, client_secretrequired, noneLeave the secret out for a public client
scopes["openid", "email", "profile"]Must include openid
auto_createfalseMake an account on first sign-in
link_by_verified_emailfalseSee above
allowed_email_domains[] (any)Only verified emails in these domains
allowed_groups[] (any)Only members of these groups
groups_claim"groups"The ID token’s claim that lists them
enabledtrueHide the provider without deleting its settings

The configuration reference has them all, with their environment variables (DRUSITE__AUTH__OIDC__KEYCLOAK__CLIENT_SECRET_FILE, say).

When it fails

The sign-in page says what went wrong, and the server’s log says more. The common cases are in Troubleshooting.

Accounts, sign-up and invitations

Who may make an account is separate from how they sign in. There are four ways an account comes to exist, and you choose which are open.

WayOpen by defaultControlled by
The admin makes itAlwaysdrusite-server account create
An invitation to a workspace or a pageYes[workspaces] invites_create_accounts
First sign-in through an OIDC providerNoEach provider’s auto_create
Signing up on the sign-in pageNo[auth] self_signup

The admin makes it

drusite-server account create sam@example.com --name "Sam Rivera"

It prints a one-time sign-in link, good for 24 hours (--ttl-minutes). Send it to Sam. Opening it signs Sam in once, on the account page, where they add a passkey or a password (whichever the server has on). The email isn’t marked verified until Sam proves it some other way, such as a magic link or an OIDC provider that verified it.

Invitations

Workspace owners (and editors, if owners allow it) invite people from Settings → Members → Invite people, and anyone who can edit a page can share it with someone outside the workspace, who becomes a guest. An invitation:

  • works once, for that email, for 7 days;
  • lets that one email make an account with any sign-in method the server has on, even with self_signup off;
  • through OIDC, needs the provider’s email to be verified and to match the invitation’s;
  • can’t let in someone a provider’s allowed_groups or allowed_email_domains keep out.

If the server can send email, it sends the invitation; if not, the app shows the link to copy and send yourself. Only a hash of each link is kept, so the link is shown once.

To allow only people who already have an account:

[workspaces]
invites_create_accounts = false

Owners can also turn on a workspace’s invite link: anyone with it joins as an editor or a viewer, never an owner, until it’s turned off or reset. It can be limited to email domains. An invite link doesn’t make accounts by itself: it needs an existing account, or whatever sign-up the server allows.

Guests

Guests see only the pages shared with them, with Can edit or Can view. Owners can turn guests off for their workspace; the server’s admin can turn them off everywhere:

[workspaces]
guests = false

OIDC

With auto_create = true on a provider, anyone who can sign in there gets an account here on their first sign-in. Limit that with the provider’s own access rules, allowed_groups or allowed_email_domains. See Single sign-on.

Self sign-up

[auth]
self_signup = true

Then anyone who can reach the server can make an account with a passkey, a password or a magic link. Turn it on only for a server meant to be open, or one only trusted people can reach.

Roles

Accounts don’t have roles; workspace memberships do. Everyone in a workspace is an owner, an editor or a viewer, set by the invitation or invite link they joined with and changed by owners. Workspaces, roles and sharing has what each can do. The server has no “admin” account: whoever runs it administers it from the command line and the config.

Removing people

  • From a workspace: owners remove them in Settings → Members. It takes effect at once on the server; their devices delete their copy when they next connect.
  • The whole account: people delete their own in Settings → Account & sync → Delete account. 1.0 has no server command to delete someone else’s account; remove them from every workspace, and stop them signing in (at the OIDC provider, or by removing their sign-in methods with them).

Email

The server sends two kinds of email, and only if you give it an SMTP server:

EmailSent whenWithout SMTP
“Your Drusite sign-in link”Someone asks for a magic linkMagic links can’t be turned on
“Sam invited you to Work”Someone invites an email to a workspace or a pageThe app shows the invitation link to copy and send yourself

There’s no other mail: no newsletters, no notifications, no tracking.

Configure it

[smtp]
host = "smtp.example.com"
port = 587                  # unset: 465 for tls, 587 for starttls, 25 for none
tls = "starttls"            # or "tls" (TLS from the first byte), or "none"
username = "notes@example.com"
password_file = "/run/secrets/smtp-password"
from = "Drusite <notes@example.com>"
  • tls = "starttls" (the default) upgrades the connection and fails if the server can’t, so a password is never sent in the clear. Use "none" only for a relay on the same host or network.
  • Set username and password together, or neither (a relay that trusts your network).
  • from must be an address your provider lets you send from. Set up SPF and DKIM for its domain, or invitations will land in spam.

Every key can come from the environment: DRUSITE__SMTP__HOST, DRUSITE__SMTP__PASSWORD_FILE and so on.

Checking it

With magic links on, the server connects to the SMTP server when it starts and stops if it can’t, so a wrong password shows at once rather than when someone tries to sign in. To test sending, invite yourself to a workspace from the app, or ask for a magic link.

Providers that work: any SMTP service (Amazon SES, Postmark, Mailgun, SendGrid, Fastmail, Google Workspace with an app password), or your own Postfix. For trying things out, Mailpit catches everything locally:

docker run -d --name mailpit -p 8025:8025 -p 1025:1025 axllent/mailpit
[smtp]
host = "localhost"
port = 1025
tls = "none"
from = "Drusite <notes@example.test>"

Then open http://localhost:8025 to read what was sent.

AI providers and models

Drusite works fully without AI. With it, people get search by meaning, Ask your notes and meeting notes. Nothing is tied to one vendor: every feature takes any provider, and the apps show which provider and model each answer came from.

Three places a model can be

WhereWho sets it upWho can use itKey kept
The server’sYou, in the config ([ai], [ask.chat], [search.embeddings])Everyone signed inIn your config or secret files
An account’sEach person, in Settings → AIThat person, on all their devices and the web appOn the server, sealed with the account’s own key
A device’sEach person, in Settings → AI, on one desktop or phoneThat person, on that deviceOn that device only; the server never calls it

People pick a model for each feature in Settings → AI and in Ask’s model menu, from all three. Your config sets what new chats and meetings start with.

Provider kinds

Every provider, wherever it’s set up, is one of these kinds:

KindChatEmbeddingsTranscriptionNeeds
openai-compatible✓✓✓base_url; a key if the endpoint wants one
anthropic✓a key
openai✓✓✓a key
google✓✓✓a key
mistral✓✓✓a key
openrouter✓✓a key

openai-compatible covers self-hosted servers: LiteLLM, Ollama, vLLM, SGLang, llama.cpp’s server, LM Studio, LocalAI, Speaches (Whisper). For a vendor, base_url is optional and replaces its own address: a proxy, or a regional endpoint.

The server’s providers: [ai.providers.<id>]

Each provider has an ID you choose (lowercase letters, digits, - and _, up to 40), so every value can also come from the environment.

[ai.providers.local]
name = "Local models"                    # what the apps show
kind = "openai-compatible"
base_url = "http://ollama.example.test:11434/v1"
# Which models to offer. Unset or "listed": whatever the endpoint lists. Or name them, with what
# each is for (chat, embeddings or transcription; guessed from the ID unless said):
models = ["llama3.2", { id = "whisper-small", name = "Whisper", use = "transcription" }]

[ai.providers.anthropic]
kind = "anthropic"
api_key_file = "/run/secrets/anthropic"
models = ["claude-sonnet-5-5"]
max_tokens = 4096

[ai.defaults]                            # what new chats and meetings start with: provider/model
chat = "anthropic/claude-sonnet-5-5"
summaries = "local/llama3.2"             # meeting summaries; the chat default unless set
transcription = "local/whisper-small"

The same from the environment:

DRUSITE__AI__PROVIDERS__LOCAL__KIND=openai-compatible
DRUSITE__AI__PROVIDERS__LOCAL__BASE_URL=http://ollama.example.test:11434/v1
DRUSITE__AI__PROVIDERS__LOCAL__MODELS='["llama3.2"]'
DRUSITE__AI__DEFAULTS__CHAT=local/llama3.2

A provider whose models are "listed" is asked for them when the server starts and every hour after. Until it first answers, it offers nothing.

[ask.chat] (one chat model, from before [ai] existed) still works. It’s offered as one more provider with the ID ask, so ask can’t be one of yours, and it’s the chat default unless [ai.defaults] chat says otherwise.

People’s own providers

[ai.accounts]
enabled = true      # the default: people may add providers to their account
reach = "public"    # the default: which addresses the server will call for them

With enabled, people add a provider in Settings → AI and use it from every device and the web app. Its API key is sealed with a data key of the account’s own, which the master key wraps, so a database dump holds only ciphertext. A key is bound to its provider and address: changing the address drops it. No API returns a key; the apps show its last four characters.

reach decides where the server may connect for them:

  • "public": public internet addresses only. The server resolves names itself and refuses private, loopback and link-local addresses, and follows no redirects, so nobody can use your server to reach your own network. Right for a server with people you don’t fully trust.
  • "any": private addresses too. Right when everyone on the server may reach your network, such as a home server you share with family.

Your own [ai.providers] are never limited by reach.

What goes where

  • The provider sees what it’s sent. Ask sends the question and the blocks it found; search by meaning sends each block’s text to be embedded; meetings send the recording and its transcript. With a vendor, that’s the vendor; with a self-hosted model, it stays on your hardware.
  • Who can read what: only workspaces the person belongs to, checked with the same policy and row-level security as everything else. Journal entries are left out of Ask unless the person allows it.
  • What was sent where is recorded in an audit log: for each call that carried something from the notes, the feature, provider, host, model, the IDs of the blocks, how many characters and tokens, and how it went. Never the text. Workspace owners can read it at GET /api/v1/workspaces/<id>/ai-audit; it’s kept for [ask] audit_days (90).
  • No note text in the logs. Provider errors are logged as a category (unauthorized, rate_limited, network, …), never with the provider’s message, which can quote the request.
  • End-to-end encrypted workspaces are never read by the server’s AI unless an owner allows it, one request at a time. See End-to-end encryption.

Try it on your own machine

A small model with Ollama, for both chat and embeddings:

docker run -d --name ollama -p 11434:11434 ollama/ollama
docker exec ollama ollama pull llama3.2:1b
docker exec ollama ollama pull nomic-embed-text
[ai.providers.ollama]
kind = "openai-compatible"
base_url = "http://localhost:11434/v1"

[ai.defaults]
chat = "ollama/llama3.2:1b"

[search.embeddings]
base_url = "http://localhost:11434/v1"
model = "nomic-embed-text"

From inside Docker Compose, localhost is the container itself: use the Ollama service’s name instead.

Search by meaning

The apps always search what’s on the device. The server adds server search over every page a person can read, which the web app and Ask use, and, with an embedding model, search by meaning: pages that say the same thing in other words.

On by default: PostgreSQL full-text search over every block, kept current by a background indexer a couple of seconds after each change.

[search]
enabled = true
text_config = "simple"

text_config is a PostgreSQL text search configuration. simple works for any language without stemming; a language’s own (english, german, french, …) adds stemming for that language (so “gardening” finds “garden”) but suits notes in that language only.

Adding search by meaning

Give the server an embedding model. Any OpenAI-compatible endpoint:

[search.embeddings]
base_url = "http://ollama.example.test:11434/v1"
model = "nomic-embed-text"

Or a vendor’s API, with provider set to openai, google, mistral or openrouter (Anthropic makes no embeddings):

[search.embeddings]
provider = "openai"
model = "text-embedding-3-small"
api_key_file = "/run/secrets/openai"
dimensions = 512
KeyDefault
provider"openai-compatible"Which API it speaks
base_urlunsetNeeded for openai-compatible
modelrequiredThe embedding model’s ID
api_keyunsetNeeded for a vendor
dimensionsunsetAsk for shorter vectors, for models that can make them
batch64Blocks per request
min_similarity0.3How close in meaning (cosine, -1 to 1) a block must be to count. Raise it if searches return unrelated pages; lower it if they miss related ones. Models differ.
idthe modelNames the vector space; see below

Changing the model

Every vector is stored with its model’s ID (with @<dimensions> added when dimensions is set, since a shorter vector is another space). Changing the model, or its dimensions, embeds everything again in the background: when the server starts, it drops the old model’s vectors and indexes, and the indexer re-embeds every page. Until it’s done, search by meaning finds less and full-text search carries on. A sweep every ten minutes picks up any page left without vectors, such as after the embedding model was down for a while.

Any vector size works. Past 2,000 dimensions pgvector can’t build its HNSW index, so searches scan instead, which is fine for a personal notebook and slow for a big team.

What the database holds

The database holds each block’s words (a tsvector) and its embedding, never its text: snippets are made by opening the sealed document when someone searches. But words and embeddings are derived from the text and reveal what it’s about to anyone who can read the database or its backups. To keep them out, turn server search off:

[search]
enabled = false

The apps then search on the device only, and Ask can’t run on the server.

End-to-end encrypted workspaces

The server can’t read them, so it doesn’t index them. Their members’ devices search them, by words and, with an embedding model of their own, by meaning. An owner can let the server’s AI embed pages one request at a time; see End-to-end encryption.

Ask your notes

People ask their notes a question in the apps and get an answer written by a chat model from their own pages, with a link to each block it used. For standard workspaces the answer is made on the server, the same way for every app:

  1. The server finds blocks for the question: full-text search, plus search by meaning if an embedding model is set, only in workspaces the person can read.
  2. It sends them, with the question, to the chat model the person chose.
  3. It streams the answer back, and saves the conversation in the account, so every device has it.

The answer is written by a task of its own on the server, so if a phone sleeps or the connection drops, it’s still saved.

Set it up

Ask needs a chat model. Without one, the apps say Ask isn’t set up and point here. Add one as an AI provider and make it the default:

[ai.providers.vendor]
kind = "mistral"
api_key_file = "/run/secrets/mistral"
models = ["mistral-small-latest"]

[ai.defaults]
chat = "vendor/mistral-small-latest"

People can choose another model, from the server’s providers or their own, in Ask’s model menu.

[ask.chat] is the older, single-model form, and still works:

[ask.chat]
base_url = "http://vllm.example.test:8000/v1"
model = "meta-llama/Llama-3.1-8B-Instruct"
name = "Llama (our server)"

Limits

KeyDefault
[ask] enabledtruefalse turns Ask off
[ask] sources12The most blocks an answer draws on
[ask] max_context_chars24000The most text from pages sent with one question
[ask] history_turns4Earlier questions and answers sent with a follow-up
[ask] per_minute / per_day10 / 500Questions one person may ask; two at once at most
[ask] timeout_secs300The longest an answer may take
[ask] idle_secs120The longest the model may go quiet once it’s started
[ask] audit_days90How long the record of what was sent is kept
max_tokens (on the provider)4096The longest answer; a reasoning model’s thinking counts too

The per-person limits count the audit records, so they hold across replicas.

What to know before turning it on

  • The provider sees the blocks it’s sent: up to sources blocks, and the question. The question also goes to the embedding model.
  • Journal entries are left out unless the person turns on Settings → Journal → Ask your notes reads the journal.
  • Conversations are the asker’s alone. Other members of a workspace don’t see them. Titles and messages are sealed with the workspace’s key.
  • Text from pages is data, not instructions. Each block goes to the model inside an element named with a random tag made for that question, which a page can’t close, and the instructions say never to obey what a source says. The model has no tools, and the apps show answers as plain text with citations: nothing in an answer can load an image or follow a link.
  • Reasoning models are fine: a <think> block at the start of an answer is held back, and reasoning sent in its own field is never read. Their thinking counts toward max_tokens; if answers come back empty, raise it.

Encrypted workspaces and guests

In an end-to-end encrypted workspace, Ask runs on the person’s device: it finds the blocks there, builds the prompt there, and sends it to a model kept on that device. Only if an owner lets the server’s AI read pages when asked does the prompt go through the server, to one of its models or the person’s account providers, one request at a time. A guest has no server search or Ask; their devices search the pages shared with them.

Meeting transcription

People record a meeting (or upload a recording) in the apps, and get a page with a summary, decisions, action items and the transcript. The recording is an attachment of the page. With a model from the server’s or the person’s account providers, transcription and the summary run as a job on the server, so the app can be closed or the phone locked. With a model kept on the device, they run on the device, which must stay open. How it looks to people is in Meeting notes.

What it needs

  • A transcription model: kind openai-compatible, openai, mistral or google. Anthropic and OpenRouter take no audio.
  • A chat model for the summary: any kind.
  • Both as AI providers, with defaults if you like:
[ai.providers.speech]
name = "Whisper (self-hosted)"
kind = "openai-compatible"
base_url = "http://speaches.example.test:8000/v1"
models = [{ id = "Systran/faster-whisper-small", name = "Whisper small", use = "transcription" }]

[ai.defaults]
transcription = "speech/Systran/faster-whisper-small"
summaries = "vendor/mistral-small-latest"

The default’s form is provider/model, split at the first /, so model IDs with slashes in them work.

How it’s transcribed

  • OpenAI, Mistral and OpenAI-compatible servers: POST /audio/transcriptions. Any server with that endpoint works: Speaches (faster-whisper), vLLM, LocalAI, or a gateway such as LiteLLM in front of one.
  • Google Gemini: the audio goes inline with a transcription instruction, in parts of up to 7 minutes to fit its request size.
  • Long recordings are cut into parts of about ten minutes, at pauses, and sent one at a time, each with the end of the one before as context so names carry over. A part that fails is retried three times; after that only that part is sent again when someone presses Try again. A job interrupted by a server restart picks up where it stopped.
  • Speakers are labelled only when the model gives them.

Sizes

Recordings are mono speech at 16 kHz, about 11 MB an hour on desktops and in the browser (Opus) and 15 MB on phones (AAC). [attachments] max_bytes (100 MiB) caps one, so about six hours. Uploads (m4a, mp3, wav, flac, ogg, and mp4 or mov video, whose sound alone is kept) are checked against the same limit. Raise it together with your proxy’s body limit.

Privacy

  • The transcription provider gets the audio; the summary model gets the transcript and the person’s notes from the meeting. The start screen says which provider each goes to before anything is recorded.
  • Calls are recorded in the AI audit log, as for Ask, without the content.
  • In an end-to-end encrypted workspace the server can’t read the recording. The person’s device transcribes it with a model kept on the device, or, if an owner allows the server’s AI to read pages when asked, uploads the audio for that one job; the server seals the result to the person, and their device writes it into the page.

Testing your setup

CI runs this path for real: a Speaches server with faster-whisper’s tiny model and a small chat model on Ollama, both through the OpenAI-compatible connector, transcribing and summarising a spoken clip (crates/drusite-ai/tests/selfhosted.rs). To check yours, record a short meeting in the web app and watch the meeting page’s status bar.

Agents: MCP and agent devices

AI agents such as Claude Code, or any client of the Model Context Protocol, can read people’s notes and, if allowed, edit them. There are three places that serve them:

ServesForWhere it runs
The server’s /mcpStandard workspacesYour server, on by default
An agent deviceEnd-to-end encrypted workspaces (and standard ones)Wherever the agent runs: a container beside it, a home server, a laptop
The desktop app’s local MCPWhatever the app has openThe person’s computer, while the app is open

The tools are the same everywhere: list_workspaces, list_pages, read_page, read_journal, search, create_page, append_to_page, update_page, publish_page, query_database, add_row, update_row and create_database. None of them deletes. Every change an agent makes is recorded, and people undo it from Settings → Agents. How people connect agents is in Agents and MCP.

The server’s /mcp

Agents connect to https://notes.example.com/mcp (MCP over Streamable HTTP). With Claude Code:

claude mcp add --transport http drusite https://notes.example.com/mcp

The agent signs in through the browser as an app does, using a Client ID Metadata Document, so there’s no registration step. A consent page then asks the person:

  • which workspace it can see;
  • read only, or read and edit (never more than their own role);
  • whether it may edit journal entries (off unless allowed);
  • whether it may publish pages to the web (off unless allowed).

Its tokens are good at /mcp only (RFC 8707). An agent that can’t open a browser, such as one on a server, uses a token made on the account page (/account → Agents → Make a token), sent as Authorization: Bearer <token>. Disconnecting an agent ends its access at once.

[agents]
enabled = true                      # false turns /mcp off
max_token_days = 365                # the longest an account-page token can last
# allow_insecure_client_ids = false # development only

When the server fetches a client’s metadata document it refuses addresses on private networks, unless allow_insecure_client_ids is on (only for testing a client on your own machine). Your proxy must pass /mcp, /oauth/… and /.well-known/oauth-protected-resource through to the server.

Agent devices

The server can’t read an end-to-end encrypted workspace, so it can’t serve agents for one. An agent device is a small, headless Drusite that belongs to one person: it’s approved like a new phone, holds keys for only the workspaces that person gives it, keeps an encrypted copy of them, and serves the same MCP tools.

What an agent device can reach:

  • Only the workspaces ticked when it was added. It gets keys for those and nothing else, not even the person’s other workspaces.
  • Private pages and pages shared with the person, in those workspaces, only if that box was ticked.
  • Read only, or edit up to the person’s own role. The server checks again on every push.
  • It never gets the person’s root key, so it can’t approve other devices, and it can’t publish.

Agents sign in to it through your server, with the same consent page, the same list in Settings → Agents and the same revocation. The server’s /mcp points agents at the agent device for the workspaces it serves.

Running one

The person starts in the app: Settings → Agents → Add an agent device, picks what it may read, and gets a one-time enrollment code (good for 15 minutes). Then, wherever it should run:

As a binary (from the release’s drusite-agent-<version>-<target> archives):

drusite agent run \
  --address https://agents.example.com \
  --server https://notes.example.com \
  --code ABCDE-FGHJK

As a container, with its store key made once and kept:

openssl rand -hex 32 > agent-store-key
docker run -d --name drusite-agent --restart unless-stopped -p 8790:8790 \
  -v drusite-agent:/data \
  -e DRUSITE_AGENT_STORE_KEY="$(cat agent-store-key)" \
  -e DRUSITE_AGENT_ADDRESS=https://agents.example.com \
  -e DRUSITE_AGENT_SERVER=https://notes.example.com \
  -e DRUSITE_AGENT_CODE=ABCDE-FGHJK \
  ghcr.io/pranavajk1/drusite-agent:1

The image runs drusite agent run, keeps its data in /data and listens on 0.0.0.0:8790.

On Kubernetes: the chart’s agentDevice values.

On its first start it enrolls, then waits: the app shows “A new device wants your keys” with a six-digit code, and the agent device logs the same code. When they match, Approve. After that the code isn’t needed; the agent device signs in with its own key.

  • --address is where agents reach it, as they’ll name it. Its MCP endpoint is <address>/mcp, so put it behind HTTPS like the server.
  • Its store key (64 hex digits) encrypts its copy. Give it in DRUSITE_AGENT_STORE_KEY, or a file named by --store-key-file; with neither, enroll makes one in its data folder. Keep it with the data folder: without it, the copy can’t be opened and the agent device must be added again.
  • drusite agent status says what it is: its server, its name, how many workspaces it reads, and whether it may edit.

Every flag and variable is in the drusite agent reference.

Who controls it

Whoever controls an agent device’s host can read what it holds: that’s the point of it. Members of a workspace see each agent device that can read it, and whose it is. Owners can turn agent devices off for their workspace (Settings → AI → Allow agent devices), which takes their keys away. You can turn them off for the whole server:

[e2ee]
agent_devices = false

Removing an agent device signs it out and replaces every key it held.

Publish to web

Anyone who can edit a page can share it as a read-only link, from the page’s Share button. The server renders the page as plain HTML, live: readers always see the page as it is now, and unpublishing or making a new link takes the old address down at once. Links are long random tokens, never page IDs. Each page’s options are off until its editor turns them on: its subpages (as a small site), search engines, an expiry date, and a password.

Where published pages live

With no settings, at https://notes.example.com/p/<token>. That works, but readers reach the same host as your app. To keep the app, its API and sign-in private, give published pages a host of their own, which serves nothing but published pages and their files (everything else there is a 404):

[publish]
public_url = "https://pages.example.com"
listen = "0.0.0.0:8443"   # a port of its own: published pages only

Then put only that port, or that host name, on the internet:

  • Behind a reverse proxy: route pages.example.com to port 8443 and nothing else, and keep the app’s host on your private network or VPN. Set client_ip_header = "x-forwarded-for" if the proxy sets it, so the per-reader limits see readers rather than the proxy. Without listen, the main port also serves the public host to requests for its name, but a separate port is easier to expose alone.

  • Docker Compose: uncomment [publish] in drusite.toml and the 8443 port in compose.yaml.

  • Kubernetes: the chart’s publish values add the listener, a public Service port and, optionally, an Ingress for the public host alone:

    publish:
      enabled: true
      host: pages.example.com
      ingress:
        enabled: true
        className: public
        tls:
          - hosts: [pages.example.com]
            secretName: pages-tls
    

TLS without a proxy

The server can serve TLS on the public listener itself, from PEM files. It reads them again when they change, so a renewal by certbot, acme.sh or cert-manager needs no restart:

[publish]
public_url = "https://pages.example.com"
listen = "0.0.0.0:443"
tls_cert = "/etc/drusite/tls/fullchain.pem"
tls_key = "/etc/drusite/tls/privkey.pem"

What readers get

  • Pages rendered by the server, with no JavaScript, in light and dark, on phones too. Every piece of content is escaped, a strict Content Security Policy allows no script at all, Referrer-Policy: no-referrer keeps the link’s token from leaking to sites a page links to, links to pages that aren’t shared become plain text, and no internal ID appears anywhere.
  • A link that doesn’t work (unknown, unpublished, expired, in the trash, a subpage that isn’t shared) gets the same 404 as one that never existed.
  • noindex (in a meta tag and X-Robots-Tag) unless the editor allows search engines, and always while there’s a password. robots.txt never lists links.
  • A password page shows only a form. The password is hashed (argon2id), tries are limited per address and per link, and a reader who knows it gets a signed cookie for that link. A new password or a new link ends those cookies.
  • Cache-Control: private, max-age=15 and an ETag: a reader’s browser may show a page up to cache_secs after it’s unpublished.

Who may publish

A workspace’s editors and owners (viewers and guests can’t). An agent publishes only if its person allowed it when connecting it, and its publishing shows in the agents’ activity. Agent devices can’t publish.

In an end-to-end encrypted workspace, publishing is a choice to make a readable copy: the editor’s device uploads a plaintext copy of the page to the server, and refreshes it after edits while an editor’s device is online. The app says so before it publishes.

Settings

KeyDefault
[publish] enabledtruefalse: no new links, and published pages are 404 (editors can still unpublish)
[publish] public_urlunsetThe public host’s origin; links use it
[publish] listenunsetThe public host’s own port
[publish] tls_cert, tls_keyunsetPEM files for TLS on that port
[publish] cache_secs15How long browsers keep a page
[publish] per_minute300Requests a minute from one address
[publish] client_ip_headerunsetWhere a proxy puts the reader’s address

Views of published pages are counted, as a number per day and nothing else, unless [analytics] count_public_views is off.

The web app

The full app in a browser, for computers where it can’t be installed. The server serves it at public_url, so there’s nothing else to deploy: the image carries the built app and turns it on.

[web]
enabled = true                       # false: no app at /, and no browser sign-in routes
# dir = "/usr/share/drusite/web"     # the image sets this; point it at ui/dist-web when building yourself

With the Helm chart, use web.enabled.

How it works

  • It runs the same core as the apps, compiled to WebAssembly, and keeps an encrypted copy of the person’s workspaces in the browser (the Origin Private File System). It opens and edits offline, and syncs when it’s back.
  • It signs in through the server with every method the server has on, and holds no token: the server keeps the browser’s sign-in, which is listed with the person’s devices, and gives the browser an HttpOnly, SameSite=Strict cookie that works only from the server’s own pages.
  • Signing out, or signing the browser out from the devices list, deletes its copy.
  • Browsers stay signed in for 14 days unused and 90 at most (browser_idle_days, browser_max_days).
  • It updates when the server does. Settings → About says which version it is.

What it leaves out

What a browser can’t do: the Markdown folder, agents on the same computer (local MCP), AI providers kept on the device, converting a workspace to or from end-to-end encryption, and importing through Notion’s API. Ask your notes, importing a Notion export, meetings (while the tab stays open) and encrypted workspaces all work.

Building it yourself

cd ui
npm ci
npm run wasm
npm run build:web

Then set [web] dir to the resulting ui/dist-web. The server refuses to start if dir has no built app in it (index.html and app/).

Behind a proxy

As for the apps: the proxy must pass WebSockets on /api/v1/sync. See Reverse proxies.

End-to-end encryption: the admin’s view

Every workspace is standard or end-to-end encrypted. In an encrypted workspace, only the members’ devices hold its keys: your server stores what it can’t open. This page is what that means for you as the person running the server. What it means for the people using it is in Encrypted workspaces; the design, with its threat model and formats, is in End-to-end encryption design.

Settings

[e2ee]
enabled = true            # false: nobody can make or convert an encrypted workspace
new_workspaces = "ask"    # or "encrypted", or "standard"
server_ai = true          # whether owners may let the server's AI read pages when asked
agent_devices = true      # whether people may add agent devices
KeyDefault
enabledtrueOff, nobody can make an encrypted workspace or convert one. Those that exist keep working.
new_workspaces"ask"What a new workspace is: "ask" lets each person choose, "encrypted" or "standard" decides for everyone
server_aitrueOwners of an encrypted workspace may turn on Let your server’s AI read pages when asked. Off removes the option.
agent_devicestruePeople may add agent devices. Off turns them off for the whole server.

What you can and can’t do

You can see who is in each workspace, how many pages it has, their sizes and when they change; remove people from workspaces; and turn the features above off.

You can’t read an encrypted workspace, and you can’t get one back for someone who lost every device and their recovery key. drusite-server account recover gets them back into their account and their standard workspaces only. People who share a workspace with them can give it back once they start over with new keys.

What the server still knows

The server stores, for an encrypted workspace: who the members are and their roles, how many pages and files there are and how big, when they change and from which device, and (if owners turn analytics on) view counts. It doesn’t store titles, text, properties, file contents, search words or vectors. The design has the full list, and what encryption doesn’t protect against.

What changes for server features

FeatureIn an encrypted workspace
SearchOn the members’ devices. The server builds no index.
Ask, search by meaning, meeting notesOn the devices, with models kept on them; or, if an owner allows it, through the server’s or account models one request at a time, with nothing kept
AgentsThrough an agent device or the desktop app’s local MCP; the server’s /mcp points agents at the agent device
Publish to webThe editor’s device uploads a readable copy of each published page
AnalyticsOff unless an owner turns it on

The server’s AI

When an owner turns on Settings → AI → Let your server’s AI read pages when asked, a device sends the text the server needs for one request (an Ask question’s sources, blocks to embed, a recording to transcribe). The server uses it for that request, records it in the AI audit log without the text, and keeps nothing else. It never gets a key. The app shows that the option is on wherever the workspace’s lock is shown.

Backups

Backups of an encrypted workspace can be restored without the master key, because the members’ devices hold its keys. A workspace converted to encryption stays readable in backups made before the conversion, with the master key of that time, until those backups expire.

Upgrading to 1.0

Encrypted workspaces need a 1.0 server and 1.0 apps. Upgrade the server first, then the apps. Standard workspaces keep working with older apps, on sync protocol 1, until 1.1.

Logs, metrics and health checks

Health checks

PathAnswersUse it for
/healthzok while the process is upLiveness
/readyz200 with {"status":"ok","checks":{"database":"ok","storage":"ok","keys":"ok"}} when it can serve; 503 with "failing" for the check that isn’tReadiness, load balancers, uptime monitors
/api/v1/version{"version":"1.0.0","protocol":2}Checking which release is running

/readyz checks that the database answers with every migration applied, that the object store answers, and, with OpenBao or Vault, that the key source works. Each check has three seconds. It says which check failed, never why: the reason is in the server’s log, as a warning naming the check.

Logs

Logs go to stderr, as JSON by default (one object per line, for log collectors):

[telemetry]
log_format = "pretty"   # for people reading a terminal; "json" is the default

RUST_LOG sets the level, as info (the default), debug, or per module: RUST_LOG=info,drusite_server::sync=debug.

No note text is logged, and AI providers’ errors are logged as a category, never with the provider’s message, which can quote the request. Authorization, Cookie and DPoP headers are marked sensitive and left out of traces. Every request gets an X-Request-Id, echoed in the response and the log, so a person can quote it when something fails.

Traces, metrics and logs over OTLP

Set the standard OpenTelemetry variables and the server sends traces, metrics and logs to any OTLP/HTTP backend (an OpenTelemetry Collector, Grafana Alloy, Jaeger, Tempo, Honeycomb, …):

OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector.example.test:4318
OTEL_EXPORTER_OTLP_HEADERS=authorization=Bearer%20TOKEN
[telemetry]
service_name = "drusite-server"   # service.name in everything it sends
# otlp = false                    # off, whatever the variables say

Incoming W3C traceparent headers are honoured, so a trace can start at your proxy. The server records http.server.request.duration for every request, by route and status.

What to watch

  • /readyz from outside, through your proxy.
  • Warnings in the log: readiness check failed (with the check’s name), and errors from the background jobs (search indexing, meetings, deleting old workspaces).
  • PostgreSQL’s disk and connections, and the bucket’s size.
  • Certificate expiry on your proxy.

Upgrading

The server and the apps share one version, major.minor.patch.

  • Patch releases (1.0.0 → 1.0.1) are fixes. Upgrade any time, in any order.
  • Minor releases (1.0 → 1.1) add features. Upgrade the server first, then the apps. A newer app on an older server says which features need the server updated; an older app on a newer server keeps working.
  • Major releases (1.x → 2.0) can change what’s stored. Their release notes say what to do.

From 1.0, sync protocol 2 and every sealed format are stable: a format changes only through its version bytes, and every 1.x app reads what any 1.x app wrote.

Before you upgrade

  1. Read the release notes on the releases page. The top says what the release brings and anything you must do.

  2. Back up the database and the bucket.

  3. Check the new version accepts your config, without starting it. With Docker Compose:

    DRUSITE_VERSION=1.0.1 docker compose run --rm drusite check-config
    

    Elsewhere, run the new image’s check-config with the same config and secret files the server reads. Unknown keys are errors, so a renamed setting shows here rather than at start-up.

Upgrading

Docker Compose: set the version in .env (DRUSITE_VERSION=1.0.1), or leave it at 1 for the newest 1.x, then:

docker compose pull drusite
docker compose up -d

Helm:

helm upgrade drusite oci://ghcr.io/pranavajk1/charts/drusite --version 1.0.1 -n drusite -f values.yaml

The server applies new database migrations when it starts, before it listens. With several replicas, the first pod to start runs them while the others wait for the lock. To migrate as a separate step, set [database] migrate_on_start = false and run drusite-server migrate with the new image first.

Going back

Migrations only go forward. To go back to an older version, restore the database and bucket backups you made before upgrading, and run the older image. Whatever the server received after those backups is lost from it.

The apps

Desktop apps update themselves from Settings → About → Check for updates; phones and Linux packages are updated as Check for Updates describes. The web app updates with the server.

Upgrading to 1.0 from a 0.x or 1.0 pre-release

Encrypted workspaces need a 1.0 server and 1.0 apps, so upgrade the server first. Standard workspaces keep working with older apps on sync protocol 1 until 1.1, so people can update their apps at their own pace until then.

Releases and update channels

Every release is published on GitHub with the apps for every platform, the agent device, SHA256SUMS, and the server image and Helm chart at the same version.

Stable releases and pre-releases

  • A release is what Check for Updates offers everyone. Its image is tagged with its version and moves 1.2, 1 and latest to it.
  • A pre-release (an alpha, beta or release candidate, such as 1.1.0-beta.1) is offered only to people who turn on Get pre-releases in Settings → About. Its image gets only its own tag, so 1 and latest never move to a pre-release.
To runUse the tag
Every 1.x release as you restart or pull1
Every 1.0.x patch1.0
Exactly one version, upgraded when you choose1.0.0 (or pin a digest)
A pre-releaseits own version, such as 1.1.0-beta.1

latest follows the newest release across major versions; prefer 1.

In the apps

Settings → About shows the app’s version, the channel (Stable or Pre-releases), and the server’s version, with whether they match.

  • Check automatically (on by default): once a day, the app asks GitHub whether there’s a newer version. Nothing about the person or their notes is sent. Off, it never contacts GitHub unless someone presses Check for updates.
  • Get pre-releases: off by default on stable builds, on by default on pre-release builds. It never offers an older version than the one running.

What happens on each platform is in Check for Updates. A fork that ships its own builds points its apps at its own releases with the build-time variable DRUSITE_RELEASES_REPO (default pranavajk1/drusite).

Verifying what you run

Check downloaded files against the release’s SHA256SUMS:

sha256sum --ignore-missing -c SHA256SUMS

The desktop apps check every in-app update’s signature against the key built into them, and refuse anything else.

The images and the chart are signed with cosign by the workflow that built them, and carry an SBOM and build provenance:

cosign verify ghcr.io/pranavajk1/drusite-server:1 \
  --certificate-identity-regexp '^https://github.com/pranavajk1/drusite/\.github/workflows/image\.yml@' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

The same works for ghcr.io/pranavajk1/drusite-agent and ghcr.io/pranavajk1/charts/drusite.

How releases are made

By merging a release pull request that changes the version; nothing is built on anyone’s own machine. Releasing has the details.

Troubleshooting

The server says what’s wrong in plain words, at start-up or in its log. The messages below are the server’s own, quoted; find yours, then the fix. Start with:

drusite-server check-config          # or: docker compose run --rm drusite check-config
curl -s https://notes.example.com/readyz
docker compose logs --tail 100 drusite   # or: kubectl logs deploy/drusite

The server won’t start

Configuration

The server saysFix
no login method is enabled. Turn on at least one of [auth.password], [auth.passkeys], [auth.magic_link] or an [auth.oidc.<id>] provider.Turn one on: Sign-in methods.
public_url … must use https (plain http is allowed only for localhost)Use your HTTPS address. For a test on your own machine, http://localhost:8080 works.
[auth.passkeys] needs public_url to use a domain name, not an IP addressPasskeys belong to a domain. Use a name (localhost for testing), or turn passkeys off.
[auth.magic_link] is enabled but [smtp] isn't configuredAdd [smtp], or turn magic links off.
checking the SMTP serverWith magic links on, the server tries the SMTP server at start-up. Check host, port, tls and the credentials.
unknown field \…``A key the server doesn’t have: a typo, or a setting from another version. The configuration reference has the right names.
… and …_file are both set; use oneA key and its _file form are both set, perhaps one in the file and one in the environment.
environment variable DRUSITE__…: …A DRUSITE__ variable that doesn’t name a setting, or a value of the wrong type.
[ai.defaults] chat = "…" must be "provider/model", naming a provider under [ai.providers]The default names a provider ID you haven’t defined.
[ai.providers] ID "ask" is taken by [ask.chat]; use anotherask is reserved for [ask.chat].
[…] base_url is needed for an openai-compatible providerSelf-hosted providers need their address.
[…] api_key is needed for …Vendors need a key: api_key_file.
[search.embeddings] provider Anthropic doesn't make embeddingsUse another provider for embeddings.
[web] dir … has no web app in itPoint dir at a built ui/dist-web, or leave it to the image.
[publish] tls_cert is for the public listener; set listen tooTLS is served only on [publish] listen.

Database

The server saysFix
connecting to PostgreSQLThe URL, the network or the password. With Compose, is the postgres service healthy?
Drusite needs PostgreSQL 16 or newer; this server is …Upgrade PostgreSQL.
the database role is a superuser or has BYPASSRLS, so row-level security wouldn't separate workspaces.Connect as an ordinary role: PostgreSQL.
pgvector isn't installed on this PostgreSQL serverInstall pgvector 0.8 or newer, or use the pgvector/pgvector image.
pgvector isn't enabled in database "…" and this role can't enable itAs an administrator, in that database: CREATE EXTENSION vector;
Drusite needs pgvector 0.8 or newer; this server has …ALTER EXTENSION vector UPDATE; after upgrading pgvector’s package.
the database has pending migrations and migrate_on_start is off; run \drusite-server migrate``Run it, or turn migrate_on_start back on.
the database isn't migrated; run \drusite-server migrate` first`A server command was run before the server ever started. Start the server once, or run migrate.

Keys

The server saysFix
[keys] source is env, but DRUSITE_MASTER_KEY isn't setSet it, or use source = "file". Make a key with drusite-server keys generate.
can't read /run/secrets/…The key file isn’t mounted where path says.
each entry is id:key / key "…" isn't URL-safe base64 / key "…" is N bytes, not 32The key was changed or cut short. Use what keys generate printed, whole.
checking the key sourceWith OpenBao or Vault: its address, the token (expired?), the mount, the key’s name, and the policy’s encrypt and decrypt paths.

Object store

The server saysFix
checking the object store can be writtenThe bucket doesn’t exist, the credentials are wrong, or they can’t write, read and delete. Object storage.
[storage] set both access_key_id and secret_access_key, or neitherSet the pair, or neither to use the AWS_* variables or a role.

/readyz says failing

The log names the check (readiness check failed, with check set to database, storage or keys) and its error. A storage check that fails only on AWS, while uploads work, usually means the credentials can’t list the bucket: see Object storage.

Reverse proxies

What people seeLikely cause
The app connects, then shows offline every minute or soThe proxy’s WebSocket or read timeout. Raise it to an hour: Reverse proxies.
Sync never connects, but the web app’s pages loadThe proxy doesn’t pass WebSockets on /api/v1/sync (Upgrade and Connection headers).
Attachments fail above a certain size (often 1 MB or 100 MB)The proxy’s body limit (client_max_body_size, Caddy’s max_size, Traefik’s buffering middleware), or [attachments] max_bytes.
Ask’s answers appear all at once at the end, or time outThe proxy buffers responses. Turn buffering off for the server (proxy_buffering off).
Signing in from an app loops back to a login page that isn’t Drusite’sA forward-auth or SSO layer in front of the server. Remove it, and use OIDC inside Drusite instead.
Agents can’t sign in/.well-known/oauth-protected-resource, /oauth/… or /mcp aren’t passed through.

Signing in

The sign-in page saysCause
this server doesn't let anyone create an accountSign-up is off and there’s no invitation for this email. Accounts.
this link has expired or was already used; ask for a new oneRecovery and magic links work once. Make another with account recover.
finish signing in in the browser you started inThe sign-in began in one browser and the link was opened in another.
that email and password don't match an accountWrong password, or the account has no password: it may use a passkey or OIDC.
requests from other sites aren't allowedA request came from another origin: usually public_url doesn’t match the address in the browser.

Single sign-on

The sign-in page saysCause
the sign-in was cancelled or refused at the providerThe provider refused: the person isn’t allowed the application there, or the redirect URI doesn’t match. The provider’s own log says which.
the provider sent no ID token / the provider's ID token didn't verifyThe client isn’t an OIDC client (openid scope missing), or the issuer is wrong.
your account at the provider isn't in a group allowed to use this serverallowed_groups: the person isn’t in one, or the groups aren’t in the ID token (check groups_claim and the provider’s mapper).
your email address isn't one allowed to use this serverallowed_email_domains: the email isn’t in one, or the provider doesn’t say it’s verified.
this server doesn't let anyone create an accountA first sign-in, with auto_create off and no invitation.
The server logs OIDC discovery for … failingThe issuer is wrong. It must match the provider’s exactly, trailing slash included (Authentik has one, Keycloak and Google don’t).

Sync and the apps

The app saysCause
The workspace needs a newer appThe workspace is end-to-end encrypted and the app speaks sync protocol 1. Update the app.
Changes from this device couldn’t be checked. Restart Drusite.The server refused a push it couldn’t attribute to this device. Restarting makes the device write as a new peer.
You can view this workspace but not edit it.The person is a viewer; the edit is rolled back.
A new canvas can’t be madeThe server is older than 1.0.
Search by meaning finds nothing newThe embedding model is down or changed; the server re-embeds in the background, and sweeps for missed pages every ten minutes.
Ask isn’t set upNo chat model: Ask your notes.

Still stuck

Search the issues, or open one with the server’s version (/api/v1/version), what you ran, and the log lines around the error. Remove addresses, emails and tokens from logs first. Security problems go privately, as SECURITY.md says.

Signing in and devices

Signing in

In Settings → Account & sync, give your server’s address, such as https://notes.example.com, and choose Sign in. The app opens your server’s sign-in page in your browser (in the web app, the page itself), where you sign in with whatever your server offers:

  • a passkey, stored by your password manager, phone or computer;
  • an email and password, perhaps with a code from an authenticator app;
  • a link by email (a magic link);
  • single sign-on through your organization’s identity provider.

Then the browser hands you back to the app, which starts syncing. The app never sees your password: the server gives it tokens tied to a key that stays on the device.

If you don’t have an account, the server’s owner can make one, or invite you to a workspace; how accounts are made depends on the server.

Your account page

Your server’s /account page (Settings → Account & sync links to it) is where you:

  • add or remove passkeys, set or change a password, and set up an authenticator app;
  • see the devices signed in to your account, and sign any of them out;
  • see the agents you’ve connected, and make tokens for agents that can’t open a browser.

Devices

Each app you sign in on, and each browser you use the web app in, is a device. A device stays signed in while it’s used, and signs in again after a month unused or a year in any case (your server may set other limits). Signing a device out deletes its copy of your notes the next time it connects.

If you use encrypted workspaces, a new device also needs your keys: you approve it from a device you already have, or use your recovery key. Signing in and your keys are separate: changing your password, adding a passkey or moving to single sign-on never touches your keys.

Locked out

Lost every way to sign in? Ask whoever runs your server for a recovery link (drusite-server account recover). It signs you in once, so you can add a passkey or a password. It gets you back into your account and your standard workspaces; encrypted workspaces also need one of your devices or your recovery key.

Deleting your account

Settings → Account & sync → Delete account shows what will happen before anything goes:

  • Deleted for good: your account, your sign-ins, your keys, your AI providers and Ask chats, your agents and agent devices, and the workspaces only you are in.
  • Kept: workspaces you share with others, and what you wrote in them. Encrypted ones get new keys, as when someone is removed.
  • If you’re the last owner of a workspace that others are in, make someone else an owner first.

Notes already on your devices stay there until you sign out. Export anything you want to keep first.

Workspaces, roles and sharing

Workspaces

A workspace is a set of pages with its own members, trash and settings: say, Personal and Work. Your account can have as many as you like.

  • The switcher at the top of the sidebar lists your workspaces, with your role in each if you aren’t the owner. ⌘⇧1 to ⌘⇧9 (Ctrl+Shift on Windows and Linux) switch to the first nine. It ends with New workspace and Workspace settings.
  • New workspace asks for a name and an icon, and, if your server lets you choose, whether it’s standard or end-to-end encrypted (what that means). New workspaces start empty.
  • Only the open workspace syncs live; another catches up when you open it. Search, Ask and the Markdown folder cover the open workspace.
  • Settings → General → Remove from this device deletes the workspace’s copy on this device only. It’s still in your account, and comes back when you open it again. Unsynced changes stop this, unless you choose to lose them.
  • Delete workspace (owners only) asks you to type its name. It disappears from every member’s switcher, and you can restore it for 30 days from Settings → Account & sync; after that the server deletes it for good.

Roles

Everyone in a workspace is an owner, an editor or a viewer. The server checks the role on every request, from every app and every agent.

OwnerEditorViewer
Read pages, search, Ask✓✓✓
Write, move, share and trash pages✓✓
Version history: see, restore, name versions✓✓
Publish to web✓✓
Connect an agent✓up to editorread only
Invite people✓if owners allow it
Change roles, remove people✓
Change the workspace’s settings, delete it✓
  • A workspace always has an owner: the last one can’t leave or be demoted. Make someone else an owner first.
  • Editors and viewers can leave a workspace (Settings → General → Leave workspace).
  • An agent acts as you: it reaches only what you can, and never more than you allowed.

Roles come only from invitations, invite links and owners’ changes. Groups at your server’s identity provider decide who may sign in, never a role.

Inviting people

Settings → Members → Invite people:

  • By email, with a role. Each person gets a link that works once, for that email, for 7 days. If your server can send email, it sends it; if not, the app shows the link for you to send. Pending invitations can be sent again or revoked.
  • An invite link (off unless an owner turns it on): anyone with it joins as an editor or a viewer until it’s turned off or reset. Owners can limit it to email domains.

An invitation lets someone without an account make one, unless your server doesn’t allow that. Joining opens your server’s “Join” page; once joined, the workspace appears in their switcher.

Private pages and sharing a page

The sidebar has up to three sections:

  • Workspace: pages every member sees.
  • Private: pages only you see.
  • Shared with me: pages someone shared with you alone, in their workspace or yours.

Move a page with a drag, or with its “…” menu (Move to Private, Move to Workspace). Moving to Workspace says first how many pages everyone will see. Pages inside a page go with it.

A page’s Share button, Invite tab, lists who has access: “Everyone in Work”, or “Only people listed”, then each person with Can edit or Can view. Add someone by email: a member gets access at once; someone outside the workspace becomes a guest. A lock after a page’s title marks a page that isn’t for everyone.

Guests

Guests are people outside the workspace who were given some of its pages. They see only those, under Shared with me, and aren’t in the member list.

Guest who can editGuest who can view
Read the page and the pages in it✓✓
Edit it, add pages in it, its version history✓
Share it further, publish it
Search and Askon their own devices, over what’s shared with themthe same

Owners can turn guests off for a workspace (Settings → Members → Allow guests); your server may have them off everywhere. A link to a page a reader can’t see shows as “No access”, without its title.

Removing people

Owners remove people in Settings → Members. It takes effect at once on the server: their open connections lose the workspace, and their agents’ access to it ends. Each of their devices deletes its copy the next time it connects. A device that stays offline keeps what it already had, which no system can reach into. In an encrypted workspace, removing someone also replaces the workspace’s keys, so they can’t read anything written afterwards.

Their past edits stay in history under their name. Pages they published stay published; owners can unpublish them.

Settings: device, account and server

Settings belong to one of four places, and that decides who changes them and where they apply.

ScopeApplies toWho changes it
This deviceThis app on this computer or phone, or this browserYou, on that device
Your accountYou, on every device and the web appYou
The workspaceEveryone in itIts owners
The serverEveryone on itWhoever runs it, in its config file

Where each setting lives

SettingScopeWhere
Theme, page outline on or offThis deviceSettings → Appearance
The Markdown folderThis device, per workspaceSettings → Markdown folder
Agents on this computer (local MCP)This deviceSettings → Agents
AI providers kept on this device, and their keysThis deviceSettings → AI
Check for updates automatically, get pre-releasesThis deviceSettings → About
Your server, signing out, deleting your accountYour accountSettings → Account & sync
Your keys, recovery key and devices for encrypted workspacesYour accountSettings → Security
AI providers you add to your account, and which model each feature starts withYour accountSettings → AI
Agents connected through your server, and agent devicesYour accountSettings → Agents
Journal: where entries go, the template, the week’s first day, whether Ask reads itThe workspace’s journal, syncedSettings → Journal
Name and iconThe workspaceSettings → General
End-to-end encryption, on or offThe workspaceSettings → General
Letting the server’s AI read pages when asked (encrypted workspaces)The workspaceSettings → AI
Allowing agent devices, analyticsThe workspaceSettings → AI
Invite link, whether editors can invite, whether pages can be shared with guestsThe workspaceSettings → Members
AI providers offered to everyone, sign-in methods, who can make accounts, encryption featuresThe serverIts config

Your AI providers are never shared with the other people in a workspace, and their keys never leave your account (or, for a device’s providers, the device).

What the server decides

Whoever runs your server can, in its config:

  • choose the sign-in methods, and who can make an account;
  • offer AI providers and models to everyone, and allow or stop people adding their own;
  • turn features off for everyone: guests, publishing, analytics, agents, encrypted workspaces, the server’s AI in encrypted workspaces, agent devices;
  • decide whether new workspaces are encrypted, standard, or each person’s choice.

The apps show what the server offers. When something is off, the place you’d find it says so.

End-to-end encryption

Each workspace is standard or end-to-end encrypted.

  • In a standard workspace, your server can read your pages. That’s what lets its search, Ask, agents and meeting jobs work there. It still encrypts everything it stores, with its own keys.
  • In an end-to-end encrypted workspace, only your devices and the people you share with can read it. Your server stores what it can’t open. Its operator, a stolen backup or a leaked database shows who is in the workspace, how many pages there are and when they change, but not what they say.

You choose when you make a workspace, unless your server decides for everyone. An owner can convert a workspace either way later. The details, and what encryption doesn’t protect against, are in the security design. For whoever runs the server, there’s the admin’s view.

Setting up

The first time you make or join an encrypted workspace, your device sets up your keys and shows your recovery key: 24 words.

  • Keep the recovery key somewhere safe: a password manager, or printed. It’s the only way into your encrypted workspaces if you lose every device. Nobody can recover it for you, not your server’s admin and not Drusite.
  • Drusite asks for three of the words to check you saved them. You can skip this, and Settings → Security reminds you until you do.
  • You can make a new recovery key any time in Settings → Security. The old words stop working.

Signing in is separate from your keys. Changing your password, adding a passkey or moving to a company login never touches them.

Adding a device

Sign in on the new device as usual. It then shows Open your encrypted workspaces:

  • Approve from another device: your other signed-in devices show “A new device wants your keys”. Check that both screens show the same six-digit code, then approve. If the codes don’t match, deny it: someone else may be trying to get your keys.
  • Use your recovery key: type the 24 words.

Until then, the new device opens your standard workspaces as usual, and shows encrypted ones as waiting for your keys. A browser counts as a device, and signing out of one forgets its keys.

Losing a device

In Settings → Security → Devices, Remove the lost device. Your other device then replaces your keys and the keys of every workspace you’re in. The lost device keeps what it already had, but can’t read anything written afterwards.

Lost every device? Sign in on a new one and use your recovery key. Lost the recovery key too? Your private pages, and encrypted workspaces only you were in, are gone for good. Shared workspaces can be given back: in Settings → Security, choose Lost every device and your recovery key?, then Start over. You get new keys and a new recovery key. The other members see that your safety code changed, and once one of them accepts it (Members → your name), you have the workspace again, history included.

Sharing

Inviting people works as in a standard workspace. A person’s keys come from a member’s device that’s online, usually within seconds of them joining.

Members and the Share panel show each person’s safety code. If you need to be sure nobody, your server included, is listening in, compare codes with the person in person or on a call, then mark them as verified. If someone’s code changes, Drusite tells you before sharing anything with their new key.

Removing someone replaces the workspace’s keys, so they can’t read anything written after. They keep what their devices already had.

Converting a workspace

In Workspace settings → General, an owner can turn end-to-end encryption on or off.

  • The members’ devices do the work, in the background, while they’re open. Nobody has to stop writing.
  • It runs in the desktop and phone apps. The browser shows the progress but can’t convert.
  • Turning it on: the server’s AI, search, agents and meeting jobs stop reading the workspace. Search and Ask move to your devices. An owner can let the server’s AI read pages when asked (Workspace settings → AI). Agents that connected through the server can be moved to an agent device.
  • Turning it off: the server can read the workspace again.

Leaving Drusite

Export (Workspace settings → General) makes a zip on your device of every page you can read, as Markdown and CSV, in the layout Notion’s own export uses. It works the same for encrypted workspaces, because your device does it. Notion, Drusite and many other tools can import it.

For server admins

  • What an admin can do: see who is in each workspace, how many pages there are, and when they change; remove people and accounts; turn encryption features off for the whole server ([e2ee] in the server’s config).
  • What an admin can’t do: read an encrypted workspace, or recover one for someone who lost their devices and recovery key. A sign-in link from drusite-server account recover gets someone back into their account and standard workspaces, not their encrypted ones.
  • Backups: see backups and restore.

Pages, the outline and version history

Pages and blocks

A page is a title, optional properties, and blocks: text, three levels of heading, bulleted and numbered lists, to-dos, toggles, quotes, callouts, code, dividers, files and images, inline databases and task boards, canvases, filters over a database, and meeting notes. Type / for the block menu. Pages nest: a page can hold pages, as deep as you like.

Everything is saved as you type, on the device first, and synced when there’s a connection. Two people typing in the same paragraph both keep what they typed.

  • Search: ⌘K (Ctrl+K). See Search and Ask.
  • Trash: a deleted page goes to the workspace’s trash, from the account menu at the foot of the sidebar, where it can be restored or deleted forever.
  • Files: drop or paste them onto a page. They’re synced through your server, up to its size limit (100 MB unless your server says otherwise).

The outline

A page with three or more headings gets a column of short dashes at its right edge, one per heading. Hover it, or Tab to it, for the outline: click a heading to jump there. On phones and narrow windows it’s in the page’s “…” menu as Outline. A heading inside a folded toggle, or in a meeting tab that isn’t shown, is listed too; jumping there opens it.

Turn it off in Settings → Appearance → Show page outline (per device).

Version history

The page’s “…” menu → Version history shows every version of the page, for owners and editors (viewers don’t see it, because it shows text that was deleted).

  • The list: each version is a run of changes by one person, grouped by 10 minutes unless you pick another window (every change, 1 minute, 1 hour, 1 day). Each row says when, who, and how: “Sam · MacBook, iPhone”, “via Markdown folder”, “Research agent for Sam”, “Imported from Notion”.
  • The selected version is shown as the page looked then, with its changes marked: new text highlighted, deleted text struck through, moved and changed blocks marked in the margin. ⌥↑ and ⌥↓ (Alt) step between changes. Compare with current compares it with the page as it is now.
  • Restore this version makes the page what it was then, as one new change by you. Nothing is removed from history, so you can restore the restore. It doesn’t touch subpages, where the page sits, or whether it’s published.
  • Name this version (up to 80 characters) bookmarks one; Only named versions shows just those. Naming isn’t an edit to the page.

History is kept for the life of the page, on the server and on every device that has it, so it works offline. When a page is deleted forever from the trash, its history goes with it. History isn’t exported.

Updates and analytics

The Updates panel lists who changed what and when, for this page or all pages. Analytics shows a page’s views per day and, to owners and editors, who viewed it (people can choose not to be listed). Owners can turn analytics off; in an encrypted workspace it’s off unless they turn it on.

Databases

Drusite’s databases work as Notion’s do: a database is a page, each row is a page of its own, and views (table, board, calendar, list, gallery) show the rows with their own filter, sorts, grouping and visible properties.

  • Database in a page’s / menu makes one inside the page.
  • New task board in the sidebar, or Task board in the / menu, makes a database from the tasks template: Status, Due, Priority and Assignee, with a board to work from.
  • Open a row to write in it like any page; its properties sit above its text.

Properties

Text, number, select, multi-select, status, date, person, files, checkbox, URL, email, phone, relation, rollup, formula, unique ID, and created and last edited time and person. Properties are named by ID, never by name, so renaming one keeps every value.

  • Two-way relations are a pair of properties: one holds the links, the other shows the rows that link to it. Setting either side changes the other, so they can never disagree.
  • Computed values (formulas, rollups, created and edited time and person, the mirror side of a relation) are never stored. They’re worked out when a view is shown, so they’re the same on every device and never stale.

Formulas

Drusite has Notion’s formula language (Formulas 2.0): the operators, if/ifs, let/lets, map/filter/find/some/every with current and index, and the text, number, date, list and people functions. Empty values behave as Notion’s do (prop("Number") + 1 is 1 when the number is unset; empty(0) is true), and numbers show to 12 decimal places, as Notion shows them. The editor refuses what Notion’s refuses, with the reason.

Checked against Notion itself: the results Notion showed for about 120 formulas, on a filled row and an empty one, are a test. Not supported yet: text colours, links as links, and time zones in formatDate.

Two devices at once

Every fact in a database is kept on its own, so edits from two devices or two people merge fact by fact: a rename on one and a new value on another both stay; two people adding a tag each keep theirs; two changing one view’s filter and its sort keep both. Two changing the very same value keep the later one.

Version history

A row has the same version history as any page. The database itself has a history of its structure: columns added, renamed, retyped or removed, options, views, rows added and moved to the trash, each listed in words (“Added the column Priority”). Restoring puts back the columns, options and views; a removed row is in the trash, with its own history.

In the Markdown folder and for agents

A database is a folder of rows, each a Markdown file with its values in the frontmatter: see The Markdown folder. Agents read a database through one of its views (query_database) and add or change rows by property name (add_row, update_row); see Agents and MCP.

How they’re stored

For the curious: everything lives in the workspace’s document, so a view is computed without loading any page.

  • A database is a page of kind database; its rows are its subpages.
  • Its schema is a set of flat keys in its tree entry: db:p:<property>:name, :kind, :pos and :desc for each property, db:o:<property>:<option> for each option, and db:v:<view>:<field> for each field of each view. Values are JSON.
  • Each row’s values are keys in the row’s tree entry: v:<property> for one value, and v:<property>#<item> for each item of a multi-select, relation, people or files value. Who made and last edited a row, and when, are createdBy, created, editedBy and edited.

Because nothing is a container of its own, two devices can’t each make one and lose the other’s. crates/drusite-crdt/tests/database.rs checks this, with a property test of three devices editing at random. The formula engine is crates/drusite-formula; views are computed by crates/drusite-db.

The journal

The journal is a database with one entry per day.

  • Today in the sidebar opens today’s entry, making it from your template if it isn’t there yet.
  • Journals shows a calendar of your entries, coloured by mood, the entries themselves, and your mood over time.
  • Each entry has a Date and a Mood; pick the mood with the picker at the top of the entry. Every other column is yours to add, like any database’s. Date and Mood can be renamed but not deleted, because Today, the mood picker, Journals and agents read them.

A workspace has a journal once you first write in it. In a workspace shared with others, a new journal starts in Private, so only you see it; move it like any page if you want to share it.

Settings → Journal

These sync, so every device you sign in on has them:

Setting
Journal entries go underThe database (or page) that holds an entry per day
New entries start fromA page to copy as each new entry’s template, or an empty page
Weeks start onFor the journal’s calendar
Ask your notes reads the journalOff by default: Ask leaves journal entries out unless you allow it

Privacy

  • Ask leaves journal entries out unless you turn on Ask your notes reads the journal.
  • Agents can read journal entries but can’t edit them unless you allowed that when connecting them.
  • Journal entries are pages like any other: they sync, have version history, and are exported.

The canvas

A canvas is a page you draw on instead of typing down: an endless board you pan and zoom, with sticky notes, text, shapes, connectors, ink, images, frames and cards of other pages.

  • Make one with New canvas in the sidebar, or Canvas in a page’s / menu, which makes a canvas inside the page and shows it there.
  • A canvas has a title, an icon, properties and history like any page.
  • Making a canvas needs a 1.0 server or newer; on an older one, the app says why.

Tools

ToolKey
SelectVClick, shift-click to add, drag on the board to select an area. Handles resize and rotate. Shapes snap to each other’s edges and centres; hold ⌘ (Ctrl) not to snap.
HandH, or hold SpaceDrag to pan
Sticky noteNClick to place one and start typing. Tab makes the next one beside it.
TextTClick to type; drag to set the width it wraps at
ShapeR rectangle, O ellipse, D diamondDrag to draw; type with a shape selected to label it
ConnectorADrag from one shape to another; the line follows them. Straight or elbow, with arrowheads and a label.
LineLA free line or arrow
PenPFreehand ink, pressure-sensitive with a pen, and a highlighter
EraserEDeletes whole strokes
FrameFA named area; what’s inside moves with it. Double-click to rename.
PageA card showing another page; double-click to open it
ImagePick a file, or drop or paste one onto the board

With something selected, a style bar sets its colour, fill, stroke, font size and alignment, and its “…” menu brings it forward or back, groups, locks, duplicates, copies as PNG or deletes. Copy and paste work between canvases and between devices; pasting plain text makes a note per paragraph.

Zoom from 10% to 800%: ⌘+ and ⌘−, ⌘0 for 100%, ⇧1 to fit everything, ⇧2 to fit the selection. The board’s “…” menu opens the Frames panel, the canvas’s outline.

In pages, and pages in it

  • A canvas in a page shows a live preview of the whole board or one frame. Click it to open the canvas. Scrolling over it scrolls the page.
  • A page card on the board shows the page’s icon, title and its first blocks. A database shows its title and row count.
  • A card or preview of a page the reader can’t see shows “No access”.

Phones, touch and pens

Pinch to zoom and two fingers to pan; the toolbar sits at the bottom. On phones the board fills the space between the top bar and the tab bar.

Sharing, history and publishing

Two people drawing on one canvas see each other’s changes live, and both keep what they did. A canvas’s history shows what was added, changed and removed in each version. A published canvas page shows its board; a canvas inside a published page doesn’t show.

Search and Ask

⌘K (Ctrl+K), or Search in the sidebar. It searches the open workspace, by words, on the device, so it works offline. With an embedding model, it also finds pages that say the same thing in other words (search by meaning):

  • in a standard workspace, if your server has one;
  • in any workspace, with an embedding model you add to Settings → AI on this device. Desktops build the vectors in the background; phones search with the ones they have.

Ask your notes

Ask (⌘J, Ctrl+J) answers a question from your own pages, with a link to each block it used. Follow-ups keep the conversation’s context, and conversations are saved in your account, so every device has them. Nobody else in a workspace sees your conversations.

  • Choose the model in Ask’s model menu: your server’s models, your account’s, or one kept on this device. AI models below says where each runs.
  • Answers draw on up to a dozen blocks, chosen by search. A block you can’t read is never used.
  • Journal entries are left out unless you turn on Settings → Journal → Ask your notes reads the journal.
  • If your server has no chat model and you haven’t added one, Ask says it isn’t set up.

What text goes to which provider is said in the app before you ask, and recorded on the server for owners to check (never the text itself). In an encrypted workspace, Ask finds the blocks on your device and sends them to a model kept on your device, unless an owner lets the server’s AI read pages when asked.

AI models

Settings → AI lists three kinds of provider, each with its models:

Set up byUsed fromIts key
Your server’sWhoever runs the serverEvery device and the web appOn the server
Your account’sYouEvery device you sign in on, and the web appOn the server, sealed with your account’s own key; only the last four characters are ever shown
This device’sYou, on this deviceThis device only (not the web app)On this device only

Each provider is a vendor’s API (Anthropic, OpenAI, Google, Mistral, OpenRouter) or any OpenAI-compatible server (LiteLLM, Ollama, vLLM, LM Studio, llama.cpp, LocalAI). Pick which model each feature starts with: chat, meeting transcription and meeting summaries. Your providers and their keys are never shared with anyone else in a workspace.

Meeting notes

Record a meeting, or upload a recording, and get a page with a summary, decisions, action items and the transcript, plus your own notes.

Starting one

  • Meetings in the sidebar, then New meeting (on phones, the + by Meetings in the drawer);
  • a page’s “…” menu → Record a meeting;
  • Meeting notes in a page’s / menu, which also links to the meeting from there.

The start sheet asks: Record or Upload a file; which model transcribes and which summarises (your defaults first); and the language. One line says where the audio and the transcript will go, by provider, before anything is recorded.

On desktops, Also record the computer’s sound mixes in the other side of a call on headphones (macOS asks for Screen & System Audio Recording the first time).

While it records

The meeting page opens with a recording bar: the time, a level meter, Pause and Stop. Type in the Notes tab as you go; the summary uses your notes as a hint and never changes them.

PlatformWith the screen locked or the app hidden
macOS, Windows, LinuxKeeps recording
iPhone and iPadKeeps recording; a phone call pauses it
AndroidKeeps recording, with a notification you can stop it from
A browserThe tab must stay open; phone browsers stop when you switch apps

If the app stops while recording, the recording is kept: next time it offers to Transcribe it or Delete it.

Uploads can be m4a, mp3, wav, flac or ogg audio, or mp4 or mov video (only its sound is kept).

The page

Meetings live in a Meetings database, made the first time you record, with Date, Attendees, Duration and Status. Each meeting page has three tabs:

  • Summary: a few paragraphs, Decisions, and Action items as to-dos. Add to a task board… turns the action items into rows of a database you pick.
  • Notes: what you typed.
  • Transcript: the audio player, then the transcript with timestamps; click one to play from there. Speakers are labelled when the model gives them.

When it’s done, the title becomes a short one the summary suggests, unless you renamed the page. Summarise again (the “…” menu) can use another model; your notes and the transcript are never replaced. Settings → AI → Extra instructions for summaries adds your own instructions to every summary in the workspace (“Use British spelling”).

Where it runs

With your server’s or your account’s models, transcription runs on the server, so you can close the app. With a model kept on the device, it runs on the device, which must stay open. The status bar shows each step (uploading, transcribing part 3 of 7, writing the summary), and a failed step can be tried again, or with another model. The audio is never thrown away by a failure.

Recordings are attachments, so your server’s size limit applies: about six hours at the default.

Importing from Notion

Settings → Import brings in a Notion workspace in one of two ways. Imported pages go to Private when the workspace has other members, and Drusite asks otherwise. Notion’s own sharing settings aren’t in what it exports, so they don’t come across. Each imported page’s history starts at the import.

From an export

In Notion, Settings → Export, with the format Markdown & CSV (subpages included). Then in Drusite, Settings → Import → Notion, and pick the .zip (or its Part-N.zips), or the folder it unzips to. This works offline, in every app and the web app.

Pages keep their tree, links and images; databases come from their CSVs, each row matched to its page. The export has no property types, views, formulas or rollups, so:

  • types are read off the values and names: a Status column is a status, with groups guessed from the option names; Yes/No is a checkbox; $1,200.50 is a dollar number; PREFIX-12 is an ID;
  • formulas and rollups come in as the values they showed;
  • each database gets a table and, when it has a status or select, a board;
  • a pair of relations that link the same rows both ways becomes one two-way relation.

From Notion’s API

Settings → Import → Notion → Import from Notion’s API, with an internal integration’s token (make one at Notion, then share the pages you want with it). This brings every page shared with the integration and keeps much more: every property’s type and options, status groups, formulas, rollups, two-way relations, unique IDs, and who made and edited each row and when. Notion’s API doesn’t give views, so these get a table and a board too.

The token is kept in the device’s key store (the Keychain on Apple devices), sent only to Notion, and never logged. The web app can’t import through the API; use an export there.

What doesn’t come across

Both ways report what they couldn’t carry over: a formula using a function Drusite lacks, a relation to a database that wasn’t shared, a property type Drusite doesn’t have (buttons, places).

Markdown

Settings → Import → Import a folder brings in a folder of Markdown notes, keeping its folders as pages. On desktops, the Markdown folder keeps a folder and a workspace in step both ways.

Publishing pages

Anyone who can edit a page can publish it as a read-only web page that anyone with the link can open, without an account.

Share → Publish → Publish to web makes the link. Then, each off until you turn it on:

  • Include subpages: the pages inside are published too, as a small site;
  • Search engines: let search engines list it;
  • Link expires: the link stops working after a day you pick;
  • Password: readers need a password to open it.

The published page is live: readers always see it as it is now. Unpublish takes it down at once, and Make a new link replaces the address, so the old one stops working. A link that doesn’t work looks the same as one that never existed.

What readers see is plain HTML, in light and dark, with no scripts. Links to pages that aren’t published become plain text. Your server may serve published pages from a host of their own, such as pages.example.com, so the app itself can stay private.

Viewers and guests can’t publish. An agent can publish only if you allowed it when you connected it. In an encrypted workspace, publishing puts a readable copy of the page on your server, which the app says before it does; the copy is refreshed after edits while an editor’s device is online.

A published page’s views are counted per day, as a number only.

Agents and MCP

Agents such as Claude Code can read your notes and, if you allow it, add to and edit them, through the Model Context Protocol (MCP). They can never delete pages, journal entries stay read-only to them unless you allow more, and everything they change is listed in Settings → Agents → What agents changed, where you can undo it.

An agent acts as you: it reaches only what you can, and never more than you allowed.

Three ways to connect one

WayForWorks while
Through your serverStandard workspaces, from any computerAlways
On this computerWhatever the desktop app has open, for agents on the same computerThe app is open
An agent deviceEncrypted workspaces (and standard ones), from wherever your agents runThe agent device runs

Through your server

Settings → Agents → Through your server shows the command. For Claude Code:

claude mcp add --transport http drusite https://notes.example.com/mcp

The first time the agent connects, your browser opens your server’s sign-in, then asks what the agent may do:

  • which workspace it can see;
  • read only, or read and edit (never more than your role);
  • whether it may edit journal entries;
  • whether it may publish pages to the web.

For an agent that can’t open a browser, such as one on a server, make a token on your account page (/account → Agents → Make a token) and give it as Authorization: Bearer <token>.

On this computer

Settings → Agents → On this computer → Let agents on this computer connect. Drusite then serves MCP at a local address while it’s open, with a token made there, and shows the command to connect with. The browser can’t do this.

Agent devices

Your server can’t read an encrypted workspace, so it can’t serve agents for one. An agent device is a small Drusite of yours that runs where your agents do, holds keys for what you give it, and serves them MCP.

In Settings → Agents → Add an agent device, you choose:

  • Which workspaces it may read. It gets keys for those only, not even your other workspaces.
  • Also your private pages, and pages shared with you, in those workspaces. Off unless ticked.
  • Can edit, or read only. Never more than your own role allows.

You get a one-time code, good for 15 minutes, to start it with:

drusite agent run --address https://agents.example.com --server https://notes.example.com --code <the code>

or with the ghcr.io/pranavajk1/drusite-agent image, or the Helm chart (running one). Then approve it in the app, checking the six-digit code matches, as with a new device. Agents connect to it at <address>/mcp and sign in through your server, as above.

Members see each agent device that can read their workspace, and whose it is. Owners can turn agent devices off for a workspace (Settings → AI → Allow agent devices), which takes their keys away. Removing an agent device signs it out and replaces the keys it held. Agent devices can’t publish.

What agents can do

Tool
list_workspaces, list_pagesSee your workspaces and their page tree
read_page, read_journalRead a page, or a day’s journal entry, as Markdown
searchSearch by words (and by meaning, where there’s an embedding model)
create_page, append_to_page, update_pageMake, add to and edit pages
query_database, add_row, update_row, create_databaseRead databases through their views, and add or change rows by property name
publish_pagePublish a page, only if you allowed it

Seeing and undoing what they did

Settings → Agents → What agents changed lists each change with its agent, and an Undo for each. Version history shows agents’ edits as “(agent) for (you)”. Disconnecting an agent ends its access at once.

The Markdown folder

On desktops, Drusite can keep every page of a workspace as a Markdown file in a folder you pick, both ways: edit a file in any editor (or let a tool or an agent edit it) and the page changes; edit the page in Drusite and the file changes.

Settings → Markdown folder → Choose a folder…. It’s set per workspace and per computer: Work can go to ~/Notes/Work and Personal to ~/Notes/Personal, or not at all. Two workspaces can’t share a folder. The web app and phones don’t have it.

The folder holds plain text, outside Drusite’s encrypted store. That’s its point, but it means anything that can read your files can read those notes, encrypted workspace or not.

How it’s laid out

The page tree becomes folders. A page with subpages is a file, Parent.md, beside a folder, Parent/, holding them. Names are made safe for every file system.

  • Editing a file merges the change into its page. Two edits to different parts of a page, one in the file and one in the app, both stay.
  • A new .md file becomes a new page.
  • Deleting a file moves its page to the trash.
  • Drusite checks the folder when it changes and every half minute in case it missed something.

History shows edits that came from the folder as “via Markdown folder”.

Databases

A database is a folder of rows:

Tasks.md                       the database: drusite-kind: database, and its schema
Tasks/Water the seedlings.md   a row: its values in frontmatter, its content below
Tasks/Buy compost.md

A row’s file:

---
drusite-id: 01934f6e-…
Status: In progress
Due: 2026-11-28
Priority: High
Tags: web, design
Project: "[[Garden app]]"
Estimate: 10
---
Twice a day while it is warm.

Values are written as a person would type them: an option’s name, several joined with , , a date as 2026-11-28, 2026-11-28T14:30 or 2026-12-03 → 2026-12-05, true or false, a number, and [[Row title]] for a related row. Editing one sets it in the app; a value that can’t be read (an option the property doesn’t have) is left as it was. A new .md file in the folder is a new row. Computed values are written too, so search tools and agents can read them, and are ignored when read back.

The database’s own file carries its schema and views as a drusite-schema block, for reading. Change the schema in the app or through an agent.

Check for Updates

Settings → About shows this app’s version, its channel (Stable or Pre-releases), and your server’s version, with whether they match. Check for updates asks GitHub for the newest release.

PlatformWhat happens
macOS, Windows, Linux AppImageInstall and restart: the app downloads the update, checks its signature against the key built into it, installs it and restarts
Debian and Ubuntu (.deb), Fedora and openSUSE (.rpm)The same, asking for your password to install
ArchThe app links to the new package; install it with sudo pacman -U
AndroidDownload opens the new APK; Android installs it. Obtainium can do this for you.
iPhone and iPadUpdates come through TestFlight
The web appIt updates when your server does

An update that isn’t signed with Drusite’s release key is refused.

Settings

  • Check automatically (on by default): once a day, Drusite asks GitHub whether there’s a newer version. Nothing about you or your notes is sent. When there is one, a notice says so; nothing is downloaded or installed until you choose to.
  • Get pre-releases: alphas, betas and release candidates as well as stable releases. Off by default on stable builds. Nothing ever goes back to an older version.

Your server’s version

The app and the server share a version number. If your server is older than the app, some features say they need the server updated; if it’s newer, About suggests updating the app. Ask whoever runs your server to upgrade it first when a minor version comes out.

Exporting and leaving

Settings → General → Export makes a zip, on your device, of every page you can read in the workspace:

  • pages as Markdown;
  • databases as CSV, each row also a page;
  • files beside the pages that hold them;

laid out as Notion’s own Markdown & CSV export, so Notion, Drusite and many other tools import it. It works the same for an encrypted workspace, since your device makes it.

What isn’t exported: version history, and a database’s views (Notion’s CSV layout has no place for them either).

Other ways out

  • The Markdown folder keeps a plain-text copy of a workspace on your computer all the time.
  • Agents can read everything you can, as Markdown.
  • Whoever runs your server can back up and restore everything; see backups.

To leave a workspace, Settings → General → Leave workspace. To delete your account, see Signing in and devices.

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]

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.

Command line

Drusite has two command-line programs. Their reference pages are generated from the programs’ own definitions, so every flag, default and environment variable there is the code’s.

ProgramWhat it doesReference
drusite-serverThe server: serve, migrate, check a config, make and recover accounts, make master keysdrusite-server
drusite agentThe agent device: enroll, run, statusdrusite agent

Common tasks

ToRun
Check a config without starting anythingdrusite-server check-config
Make the first accountdrusite-server account create you@example.com
Let someone back indrusite-server account recover them@example.com
Make a master keydrusite-server keys generate
Migrate the database as its own stepdrusite-server migrate
Start an agent device the first timedrusite agent run --address … --server … --code …

In the server’s image the program is the entry point, so pass the command to docker run or docker compose run:

docker compose run --rm drusite account create you@example.com
kubectl -n drusite exec deploy/drusite -- drusite-server account recover them@example.com

Every command reads the same config as the server: --config, or DRUSITE_CONFIG, plus any DRUSITE__… variables. See the configuration reference.

Helm chart values

Every value of the chart at oci://ghcr.io/pranavajk1/charts/drusite, from deploy/helm/drusite/values.yaml. CI checks this page against that file: a value added to the chart and not explained here fails the build. Kubernetes with Helm shows them in use.

The server

ValueDefaultWhat it does
image.repositoryghcr.io/pranavajk1/drusite-serverThe server’s image.
image.tag""The image tag. Empty means the chart’s appVersion, which is the release the chart came with.
image.digest""A digest (sha256:…) to pin the image to, added after the tag. Recommended in production.
image.pullPolicyIfNotPresentThe pod’s image pull policy.
replicaCount1How many server pods. The server keeps no state of its own, so more than one can run; each opens up to [database] max_connections to PostgreSQL.
configa minimal configThe server’s config file, TOML, mounted at /etc/drusite/drusite.toml. Any key from the configuration reference. Keep secrets out of it: use *_file keys that read from secret. Changing it rolls the pods.
secret.name""A Secret you create outside the chart, whose keys are mounted as files under /run/secrets/drusite/. The default config reads database-url, s3-secret-access-key and master-key from it.
env[]More environment variables for the server container, as a list of {name, value} or valueFrom. DRUSITE__SECTION__KEY overrides the config; OTEL_* configures telemetry.
envFrom[]Whole ConfigMaps or Secrets as environment variables.
resources.requests.cpu50mThe server’s CPU request.
resources.requests.memory64MiThe server’s memory request.
resources.limits.memory512MiThe server’s memory limit.
podAnnotations{}Annotations on the server’s pods.
podLabels{}Labels on the server’s pods.
nodeSelector{}The server pods’ node selector.
tolerations[]The server pods’ tolerations.
affinity{}The server pods’ affinity.

The chart always sets these on the server container, so don’t set them in config: DRUSITE_CONFIG, DRUSITE__SERVER__LISTEN (0.0.0.0:8080), DRUSITE__WEB__ENABLED (from web.enabled) and, with publish.enabled, DRUSITE__PUBLISH__LISTEN and DRUSITE__PUBLISH__PUBLIC_URL. Its probes are /healthz (startup and liveness) and /readyz (readiness). The pod runs as user 65532 with a read-only root filesystem and no capabilities.

Reaching it

ValueDefaultWhat it does
service.typeClusterIPThe Service’s type.
service.port8080The Service’s port for the app, the API and sync.
ingress.enabledfalseMake an Ingress for the server.
ingress.className""Its ingress class.
ingress.annotations{}Its annotations: a body size limit for attachments, WebSocket timeouts, a cert-manager issuer. Reverse proxies says what the server needs.
ingress.hostnotes.example.comThe host it routes. It should be public_url’s.
ingress.tls[]Its TLS section, as in any Ingress: [{hosts: [notes.example.com], secretName: notes-tls}].
web.enabledtrueServe the web app at public_url. Off, the server serves no app at /.

Publish to web on a host of its own

ValueDefaultWhat it does
publish.enabledfalseServe published pages on a listener of their own, which serves nothing else. Adds a public port to the pod and the Service.
publish.hostpages.example.comThe published pages’ host. The chart sets [publish] public_url to https:// and this.
publish.port8443The port that listener uses, in the pod and on the Service.
publish.ingress.enabledfalseMake a second Ingress, for publish.host alone, to the public port.
publish.ingress.className""Its ingress class: say, an internet-facing one while the app’s Ingress stays internal.
publish.ingress.annotations{}Its annotations.
publish.ingress.tls[]Its TLS section.

An agent device

The chart can also run an agent device, which serves MCP for end-to-end encrypted workspaces. It’s one person’s: they add it in the app first.

ValueDefaultWhat it does
agentDevice.enabledfalseRun an agent device beside the server: a Deployment, a PersistentVolumeClaim and a Service.
agentDevice.image.repositoryghcr.io/pranavajk1/drusite-agentIts image.
agentDevice.image.tag""Its tag; empty means the chart’s appVersion.
agentDevice.image.digest""A digest to pin it to.
agentDevice.image.pullPolicyIfNotPresentIts pull policy.
agentDevice.addresshttps://agents.example.comWhere agents reach it (DRUSITE_AGENT_ADDRESS). Its MCP endpoint is <address>/mcp.
agentDevice.serverhttps://notes.example.comThe Drusite server it belongs to, usually public_url (DRUSITE_AGENT_SERVER).
agentDevice.secret.name""A Secret you create, with store-key (64 hex digits, the key of its encrypted stores) and, for the first start only, enrollment-code (from Settings → Agents).
agentDevice.persistence.size1GiIts volume: an encrypted copy of what it was given.
agentDevice.persistence.storageClass""The volume’s storage class; empty means the cluster’s default.
agentDevice.port8790The port it listens on, and its Service’s.
agentDevice.ingress.enabledfalseMake an Ingress for agentDevice.address’s host.
agentDevice.ingress.className""Its ingress class.
agentDevice.ingress.annotations{}Its annotations.
agentDevice.ingress.tls[]Its TLS section.
agentDevice.resources.requests.cpu20mIts CPU request.
agentDevice.resources.requests.memory64MiIts memory request.
agentDevice.resources.limits.memory256MiIts memory limit.

HTTP API

The apps, the web app and agents all talk to the server over HTTP. This is an overview of what’s there, for people running a server (what to route, what to monitor) and for anyone curious. The API is the apps’ own: it isn’t promised stable between minor versions, except where it says so. Agents should use MCP.

All of it is under public_url. Everything except the health checks, the version, sign-in and published pages needs a signed-in device: an access token bound to the device’s key (DPoP), or the web app’s cookie.

Open to anyone

Path
GET /healthz, GET /readyzHealth checks
GET /api/v1/version{"version": "1.0.0", "protocol": 2}; stable
GET /api/v1/auth/methodsThe sign-in methods that are on
/p/<token>A published page, when published pages have no host of their own
/robots.txtFor crawlers
/.well-known/oauth-protected-resourceMCP’s protected-resource metadata, for agents

Signing in

Path
/auth/…, /accountThe server’s sign-in and account pages, in the browser
/api/v1/auth/password/…, /api/v1/auth/passkeys/…, /api/v1/auth/magic-link/…The methods that are on (a method that’s off has no routes)
/api/v1/auth/oidc/<id>/start, /api/v1/auth/oidc/<id>/callbackSingle sign-on; the callback is the redirect URI to give your provider
/api/v1/auth/recoverRecovery and first sign-in links
/oauth/authorize, /oauth/token, /oauth/revoke, /oauth/consentOAuth 2.1 for the apps and agents, with PKCE, DPoP and resource indicators
/api/v1/account/…, /api/v1/meThe account: sign-ins, devices, keys for encrypted workspaces, agents, deleting it

Sync

GET /api/v1/sync upgrades to a WebSocket that carries every workspace a device syncs: subscriptions, pushes and updates of Loro documents, sealed entries for encrypted workspaces, and the key work devices do for each other. The protocol is versioned (protocol in /api/v1/version); protocol 2 is stable for 1.x. Its messages are defined in crates/drusite-proto.

Attachments go over plain HTTP beside it, under /api/v1/workspaces/<id>/…, bounded by [attachments] max_bytes rather than the request timeout.

Workspaces and features

Path
/api/v1/workspaces, /api/v1/workspaces/<id>/members, …/invites, …/invite-link, …/settings, /api/v1/join/<token>Workspaces, members and invitations
/api/v1/searchServer search
/api/v1/ask, /api/v1/workspaces/<id>/askAsk your notes; answers stream as server-sent events
/api/v1/ai, /api/v1/ai/providersAI providers and models: the server’s and the account’s
/api/v1/workspaces/<id>/ai-auditWhat was sent to which AI provider, for owners
/api/v1/workspaces/<id>/meetings…Meeting jobs
/api/v1/workspaces/<id>/sharesPublished pages
/api/v1/workspaces/<id>/views, …/updatesAnalytics and the Updates feed
/api/v1/workspaces/<id>/agent-activityWhat agents changed, for undo
/api/v1/account/agent-devices, /api/v1/agent-devices/…Agent devices: adding, enrolling, checking tokens
/mcpMCP over Streamable HTTP, for agents

Every request

  • An X-Request-Id comes back on every response, and is in the server’s log.
  • Ordinary requests have [server] request_timeout_secs (30 s); the sync WebSocket, Ask’s streams and attachments don’t.
  • Who may do what is decided by a Cedar policy, and repeated by PostgreSQL’s row-level security. See the security model.

Architecture

Drusite is local-first: every device holds a full, encrypted copy of the workspaces it syncs, and edits there first. The server is where devices meet, and where the work that needs every page (server search, Ask, meeting jobs, publishing, agents) happens for standard workspaces.

 ┌──────────── Device (desktop, phone, browser, agent device) ────────────┐
 │  UI (Svelte 5)                                                          │
 │    │  Core API (generated TypeScript types)                             │
 │  drusite-core ── Loro documents ── SQLCipher store (key in the OS)      │
 │    │  search (words, and meaning with a model), Markdown folder, MCP    │
 └────┼────────────────────────────────────────────────────────────────────┘
      │ WebSocket: sync protocol 2 (drusite-proto), DPoP-bound tokens
 ┌────┼──────────────────────── drusite-server ────────────────────────────┐
 │  axum: sign-in, sync hub, search, Ask, AI, meetings, publish, MCP       │
 │  Cedar policy ─ row-level security                                      │
 └──┬───────────────────────┬──────────────────────┬───────────────────────┘
    │                       │                      │
 PostgreSQL 16+        S3-compatible store     Key source
 + pgvector            (attachments,           (env, file, or
 (accounts, documents,  recordings)             OpenBao/Vault Transit)
  history, search)

The documents

  • One Loro document per page, holding its blocks, plus one document per workspace holding the page tree, titles, properties, database schemas and row values. Loro is a CRDT: edits from any number of devices merge without a central lock, and every change is kept, which is where version history comes from.
  • Restricted pages (private, or shared with some people) are listed in tree documents of their own, which only the people they’re shared with can sync.
  • The block model follows Notion’s: pages of blocks, databases whose rows are pages, with Notion’s property types and formula language.

The crates

CrateJob
drusite-modelIDs, the page and block schema, schema versioning
drusite-crdtThe block model on Loro: one document per page, plus the workspace document
drusite-protoThe sync protocol
drusite-formulaNotion’s formula language: parser, type checker, evaluator
drusite-dbDatabases: views computed (formulas, rollups, relations, filters, groups), rows as Markdown
drusite-markdownMarkdown in and out
drusite-coreThe client engine and the Core API the UI talks to: the store, sync, search, Ask, import and export, the Markdown folder
drusite-e2eeEnd-to-end encryption’s keys and formats, with golden test vectors; no I/O
drusite-aiThe AI provider interface and its adapters: chat, embeddings, transcription
drusite-audioAudio decoding and cutting for meeting transcription
drusite-mcpThe MCP tools, shared by the server, the desktop app and the agent device
drusite-dpopProof-of-possession tokens (DPoP) for devices
drusite-serverThe server binary
drusite-agentThe agent device (drusite agent)
drusite-appThe Tauri 2 shell: the Core API over Tauri
tauri-plugin-drusitePlatform code: keys in the Keychain or Android’s keystore, signing in through the system browser, recording
drusite-wasmThe browser adapter: the core as WebAssembly
xtaskRepository tooling: performance budgets, bindings, version bumps, the docs
ui/The frontend (TypeScript and Svelte 5), which reaches the core only through ui/src/core/client.ts

The server

One binary with its modules inside:

  • Sign-in (auth): passkeys, passwords with TOTP, magic links and OIDC, all ending in an OAuth 2.1 authorization for the app, with DPoP-bound tokens.
  • Sync (sync): a hub per workspace that takes pushes, checks them against the policy, stores them, and fans them out; it compacts each document’s log into snapshots.
  • Keys (keys, crypto): each standard workspace has its own key, wrapped by the master key; everything stored is sealed with it.
  • Policy (policy): who may do what is a Cedar policy, checked on every request, and repeated in PostgreSQL by row-level security, so a bug in one is caught by the other.
  • Search (search): a background indexer writing words (tsvector) and vectors (pgvector) for standard workspaces.
  • Ask, AI and meetings (ask, ai, meetings): retrieval, prompts and streaming answers; the model catalog; meeting jobs that resume after a restart.
  • Publish (publish): server-rendered HTML for published pages, optionally on a listener of its own.
  • MCP (mcp): the agents’ endpoint, with OAuth consent and an activity log for undo.
  • The web app (web): the built UI, served at /.

It keeps no state of its own between requests, so it scales out behind a load balancer.

End-to-end encrypted workspaces

For an encrypted workspace, devices seal every document entry and file before it leaves them, and the server stores and relays what it can’t open, checking signatures and membership but never contents. Search, Ask, meetings and agents move to the devices (or to an agent device). The design is in End-to-end encryption.

Security model

What protects your notes, layer by layer, and where the details are. To report a vulnerability, see SECURITY.md.

On devices

  • Every device keeps its copy in a SQLCipher database, encrypted with a random key kept by the operating system: the login Keychain on macOS and iOS, Android’s keystore. The web app keeps an encrypted copy in the browser’s private file system, with its key wrapped by the browser.
  • A device signs in with tokens bound to a key that never leaves it (DPoP), so a stolen token is useless elsewhere. Access tokens last minutes; devices unused for a month are signed out.
  • Signing out, or being signed out from another device, deletes the device’s copy.

In transit

Everything goes over HTTPS and a WebSocket under it, through your reverse proxy. Plain HTTP is refused except for localhost.

On the server

  • Standard workspaces are sealed at rest with a key per workspace, which the master key wraps. The database and the bucket alone open nothing; with the master key, the server (and so its operator) can read them. That’s what lets it search, answer Ask and serve agents.
  • End-to-end encrypted workspaces are sealed on the members’ devices. The server can’t read them, and neither can its operator, a stolen backup or a leaked database. It still learns who is in a workspace, how many pages there are, their sizes, and when they change.
  • Who may do what is a Cedar policy checked on every request, repeated by PostgreSQL’s row-level security. The server refuses to run as a database role that row-level security doesn’t apply to.
  • Search data: for standard workspaces the database holds each block’s words and vectors, derived from the text, but never the text itself. Turn server search off to keep them out.
  • AI: what’s sent to which provider is recorded without the text, and page text is treated as data, never instructions. People’s own provider keys are sealed with a key of their account’s. See AI providers.
  • Agents have no tool that deletes; every change they make is recorded and can be undone.
  • Published pages carry no JavaScript and a strict Content Security Policy, and links are long random tokens.

Supply chain

Releases are built only on GitHub, from a merged pull request. Images and the Helm chart are signed with cosign and carry an SBOM and build provenance; desktop updates are signed with the release key and checked by the app before installing. Third-party actions are pinned to commits, and dependencies are checked with cargo deny and cargo vet.

The details

End-to-end encryption in Drusite

This is the design as built: who it defends against, what your server can and can’t see, every key and format, and what it doesn’t promise. The code is in crates/drusite-e2ee (formats, no I/O), crates/drusite-core (devices) and crates/drusite-server (the server’s checks). The plan it was built from, with the reasons for each choice, is docs/phase11.md.

To report a vulnerability, see SECURITY.md. For reviewers: review.md.

Status

  • Format 1, suite 1. This is the format 1.0 ships with. From 1.0 a format changes only through its format and suite bytes, and every 1.x app reads every format any 1.x app wrote.
  • No independent review yet. The design and drusite-e2ee are waiting for one. Until then, treat this as a careful design that nobody outside the project has checked.
  • Dependencies. The newer cryptography crates (hpke, x-wing, ml-kem and the crates they need) are cargo vet exemptions, not audits.

1. Encrypted or standard, per workspace

Each workspace is one or the other, and its owners can convert it either way.

  • Standard: the server can read the workspace, so its search, Ask, agents over /mcp, meeting jobs and analytics work there. It’s encrypted at rest with the server’s own keys.
  • End-to-end encrypted: the server stores ciphertext it can’t open. Only the members’ devices, and agent devices they add, hold keys.

2. Threat model

Defended against:

  • The server’s operator, and anyone who gets what the server has: the database, its backups, the S3 bucket, the key source, the server’s memory and logs.
  • Someone removed from a workspace or a page. They can’t read anything written after their removal, even with a copy of the database.
  • A member forging edits. Every entry is signed by the device that wrote it, and each device is certified by its person’s account key, so history’s “who changed this” holds even against a member who has the workspace’s key.
  • The network: TLS, and DPoP-bound tokens.

Not defended against:

  • A compromised, unlocked device. It holds the keys and the notes.
  • The host of an agent device you add. It holds keys for what you gave it, by design.
  • A server that changes the code it serves to the browser. The web app comes from the server, and an operator who changes it can take keys from that browser. The desktop and phone apps are signed builds from GitHub releases and run no code from the server.
  • A server that lies about someone’s public key, unless you compare safety codes (§6.4).
  • Availability. A server can refuse, delay or withhold updates. Devices notice some of this (§8) but can’t prevent it.

3. What the operator can and can’t see

Encrypted workspaceStandard workspace
Page text, titles, icons, properties, database columns, views and valuesNoYes
The page tree, the sidebar’s order, the trashNoYes
The workspace’s name and iconNoYes
Canvas content, journal entries, meeting audio, transcripts and summariesNoYes
Attachment contents and file namesNoYes
Version history’s content, and named versions’ namesNoYes
Ask questions and answers, search queriesNo, unless an owner lets the server’s AI read pages when askedYes
Who is a member and their role; guests; who has which private or shared treeYes: the server enforces accessYes
How many documents there are, and which tree each page belongs toYes, as opaque IDsYes
Each document’s and file’s size, to within padding (§5.7)YesYes
When each device pushes to which document, and from which addressYesYes
Loro peer IDs (random 64-bit numbers), and which device each belongs toYesYes
Page views, if an owner turns Analytics on (off by default when encrypted)By document ID onlyYes
Published pagesYes: publishing uploads a readable copyYes
What an agent readsNo, through the server. An agent device reads what you gave it, on a host you choose.Yes, through /mcp

So an operator learns a workspace’s shape: who works with whom, how many pages there are, how big they are and when they change. Not what they say.

4. Keys

Recovery key (24 words; only you hold it)
  └─ opens → Account root key (ARK), versioned
Device key pairs (one per device; the private half never leaves it)
  └─ receive the ARK when another of your devices approves them
ARK
  └─ seals → the account's identity keys:
       • signing key pair (Ed25519): certifies devices, signs key changes
       • encryption key pair (X-Wing: X25519 + ML-KEM-768): receives container keys
       • the account container seed: your own sealed document (Ask chats)
Container keys (32 bytes, one per epoch), one per:
  • encrypted workspace (its workspace document and its pages)
  • private or shared tree (private pages, pages shared with some people, guests' pages)
  └─ wrapped to each member's account encryption key (HPKE)
  └─ each epoch seals the epoch before it, so history stays readable
Document keys = HKDF(container key at epoch e, container ‖ e ‖ document): derived, never stored
Attachment keys: random per file, kept in the block that shows the file
  • The root key is the one thing a device needs. A new device gets it once, from another of your devices or from the recovery key, and unwraps everything else from the server.
  • The recovery key is a key pair. The 24 words are the private half. The public half is stored with the account, so a device can wrap a new root key to it without knowing the words.
  • Container keys are wrapped per person, not per device. Adding a device touches no workspace.
  • Document keys are derived. Rotating a container’s key changes every page’s key at once.
  • Agent devices never get the root key. They get only the container keys of what they were given, wrapped to their own device key.

Where keys live: inside each device’s SQLCipher store, whose own key is in the platform’s key store (Keychain, Credential Manager, Secret Service, Keystore), or for the browser wrapped by a non-extractable WebCrypto key in its OPFS store. Keys in memory are zeroed when dropped. Signing in with any method (password, passkey, OIDC, magic link, an operator’s recovery link) never gives keys: they come only from an approved device or the recovery key.

5. Formats

Every format starts with a format byte (1) and a suite byte (1). Suite 1 is XChaCha20-Poly1305, Ed25519 and HKDF-SHA256, with HPKE (RFC 9180, base mode) using X-Wing, HKDF-SHA256 and ChaCha20-Poly1305 for wraps. IDs are 16-byte UUIDs. Integers are big-endian. Every key derivation and signature uses a label of its own (drusite … v1), so no key or signature made for one purpose is valid for another.

5.1 Sealed entry (entry.rs)

One Loro update or snapshot of an encrypted document, as the server stores it.

format u8 ‖ suite u8 ‖ kind u8 (update | snapshot) ‖ workspace [16] ‖ document [16]
  ‖ document kind u8 ‖ container [16] ‖ epoch u32 ‖ device [16] ‖ through_seq u64
  ‖ peers: u16 count, u64 each
  ‖ sealed Loro bytes: u32 length, nonce [24] ‖ ciphertext ‖ tag [16]
  ‖ sealed version vector (snapshots only): u32 length, nonce ‖ ciphertext ‖ tag
  ‖ signature [64]
  • The header (everything before the sealed parts) is in clear, so the server checks it without a key. It’s the associated data of both sealed parts (labels drusite entry data v1 and drusite entry version v1), so an entry moved to another document, container, epoch, device or peer set doesn’t open.
  • Sealed with the document key, under a random 192-bit nonce. The Loro bytes are padded first.
  • The signature is the device’s Ed25519 signature over every byte before it, framed as drusite signature v1\0 ‖ purpose (1: entry) ‖ bytes.

5.2 Wraps (wrap.rs)

A key, or a small message, sealed to someone’s X-Wing public key with HPKE:

format u8 ‖ suite u8 ‖ encapsulated key [1120] ‖ ciphertext

HPKE’s info is drusite wrap v1\0 ‖ purpose u8 ‖ context, so a wrap can’t be replayed for another purpose or place:

PurposeValueContext
Root key to a device (approval)1user, root key version, device
Root key to the recovery key2user, root key version
Container key to a member3container, epoch, user, their key version
Container key to an agent device4container, epoch, device, 0
A server-made result to an account (opt-in meeting notes)5job, user, their key version

The epoch chain: each epoch’s key seals the previous epoch’s key (associated data drusite epoch chain v1, the container and the epoch), so whoever holds the current key can read the whole history and nobody needs a wrap per epoch.

5.3 Identity (identity.rs)

  • Account keys sealed by the root key: the signing seed, the encryption seed and the container seed, sealed with XChaCha20-Poly1305 under the root key (associated data drusite account keys v1, the user and version).
  • Device certificate: the account’s signature over the user, the account key version that signs it, the device ID, the device’s signing and encryption public keys, when it was made, and whether it’s an agent device. Devices check every entry’s signer against a certificate from that person’s current or a previous key version.
  • Key change: a new key version, signed by the previous signing key, so the people you share with accept it without a warning.

5.4 Safety codes

30 digits in six groups of five, from 5,200 rounds of SHA-512 over drusite safety code v1\0, the signing key and the user’s ID, as Signal makes its half of a safety number. Devices pin each person’s signing key the first time they see it. A later key must be signed by the previous one. One that isn’t shows “safety code changed”, and nothing is shared with it until someone accepts it.

5.5 Approving a new device (sas.rs)

Numeric comparison with a commitment, the pattern of Bluetooth pairing and ZRTP:

  1. The new device makes its keys and a random nonce, and sends its public keys with a commitment, a hash (drusite approval commitment v1\0) of its nonce and keys.
  2. The approving device sends a random nonce of its own.
  3. The new device reveals its nonce, and the approving device checks it against the commitment.
  4. Both show a six-digit code from HKDF-SHA256 (drusite approval code v1) over both keys and both nonces. The person compares the codes and approves. The approving device then wraps the root key to the new device (purpose 1) and certifies it.

The new device is bound to its nonce before it sees the approver’s, so a server in the middle gets one guess at a six-digit code, one in a million, rather than a search. A request lasts 10 minutes.

5.6 The recovery key (recovery.rs)

32 random bytes written as 24 words from the BIP-39 English list (the last word carries a checksum). They’re the seed (HKDF, drusite recovery key v1) of an X-Wing key pair. The server keeps the public half and the root key wrapped to it (purpose 2). A passphrase was ruled out: a passphrase-wrapped key on the server could be guessed offline by its operator.

5.7 Padding (pad.rs)

Everything sealed is padded to at least 512 bytes, then with Padmé, which reveals O(log log L) bits of a length L at a cost of at most 12%.

5.8 Attachments (file.rs)

STREAM over XChaCha20-Poly1305 in 64 KiB chunks, each authenticated and the last marked as last, so a file can’t be cut short, reordered or spliced. Each file has its own random key, kept in the block that shows it, inside the sealed page.

format u8 ‖ suite u8 ‖ nonce prefix [19]
  ‖ chunk 0: length and padded length, u64 each (+ tag)
  ‖ chunks 1…n: the padded content, 64 KiB each (+ tag), the last marked last

The file’s ID is the BLAKE3 hash of the sealed bytes, so the server can still check a file is stored under its own name. Chunk 0 comes first so audio and video can seek.

6. Protocols

6.1 Sync (protocol 2)

Encrypted documents sync over drusite.sync.v2. Devices push sealed entries; the server stores them as they are. Before storing one, the server checks, without keys:

  • the header’s workspace, document and container are where the push says;
  • the epoch is the container’s current one;
  • the device is a certified, signed-in device of a member who may edit there;
  • the signature verifies;
  • the declared Loro peers belong to that device (a peer ID can’t be claimed by two devices).

Devices check the same things and also open the entry: one that doesn’t open, or whose signer isn’t certified, is quarantined, never imported.

Keys travel in sync too: the container keys a connection needs (wrapped to the member), and the certificates of the devices whose entries it gets.

6.2 Compaction and history

The server can’t merge ciphertext, so devices compact: a device writes a sealed snapshot of a document and the server replaces the log it covers. A device checks afterwards that the server still has everything it pushed. Replaced entries are kept 14 days, so a bad snapshot can be healed. Version history survives: it’s in the Loro document.

A snapshot declares no peers, and is trusted as written by a member who may edit. A member with the key could hide forged changes in one. This is listed for the independent review.

6.3 Sharing, removal and rotation

The server can’t make a wrap, so devices do the key work. When a device that may share connects, the server sends it KeyWork: people waiting for a container’s key, or a key due to rotate. It answers with ShareKeys (wraps of the current key to the people waiting) or Rotate (a new epoch, sealing the previous one, wrapped to exactly the people with access). The server checks both: wraps only to people with access, and a new epoch to exactly them.

A key is due to rotate when someone loses access: removed from the workspace (every container in it rotates), taken off a page (that page’s tree), a device removed, an agent device removed, or an account deleted. The first member’s device online does it.

Moving a page between the workspace and a private or shared tree is done by a device: it re-seals the page under the destination’s key, and the server deletes the old log, which people who are losing access could read.

6.4 Knowing whose key it is

See §5.4. Comparing safety codes is optional. Without it, a server that lies about a public key when someone is invited could receive the wrap meant for them.

6.5 Agent devices

An agent device is a headless Drusite (drusite agent run) that serves MCP for encrypted workspaces from a host you choose. You make an enrollment code in Settings → Agents, choosing the workspaces it may read, whether it may also read your private and shared pages, and whether it may edit. It enrolls with the code (one use, 15 minutes), you approve it with the six-digit code, and your device wraps only those workspaces’ container keys to its device key (purpose 4). It never gets the root key. Agents reach it with tokens from your Drusite server, which the agent device checks with the server. Removing it revokes its sign-in and rotates every key it held.

6.6 Converting a workspace

An owner turns encryption on or off in Workspace settings. The server can’t seal or open anything, so the members’ devices convert it: each converts the documents it has whole and may edit, sending a sealed (or readable) snapshot that the server switches one document at a time. Files are converted with their pages. Editing never stops. Turning it off sends readable snapshots back, and the server’s own at-rest encryption takes over.

6.7 Deleting an account

Deleting an account deletes its keys, the wraps made to it, its sign-ins, its agent devices, and the workspaces only it was in. It’s refused while it’s the last owner of a workspace others are in. The workspaces it leaves rotate their keys, as when someone is removed, and so do pages shared with it as a guest.

6.8 The server’s AI, by choice

In an encrypted workspace, search by meaning and Ask run on the device. An owner can let the server’s AI read pages when asked: the device then sends only what that request needs. The server keeps nothing it read. Meeting notes made that way come back sealed to the person (purpose 5).

7. What the browser can and can’t promise

The browser is a device like any other, with keys in its OPFS store that are wiped on sign-out. Against a curious operator or a stolen database or backup, it’s as safe as the apps. Against an operator who serves modified JavaScript, it isn’t, and Settings → Security says so the first time an encrypted workspace opens in a browser.

8. Limits

  • Withheld updates. A server can hide one device’s edits from another. A document whose updates never arrive shows that some changes haven’t arrived, and devices check after a snapshot that the server still has what they pushed.
  • Removed people keep what they had. Rotation protects what’s written after the removal. It can’t reach into a copy they already have.
  • Viewers hold the history. A viewer’s device has the whole document, history included.
  • Metadata (§3) is visible to the server, by design: it enforces access.
  • Losing every device and the recovery key loses your private pages and the encrypted workspaces only you are in, for good. Shared ones can be given back by their other members.

9. Test vectors and tests

  • Golden vectors: crates/drusite-e2ee/vectors/v1.txt, made by crates/drusite-e2ee/tests/vectors.rs from a deterministic random source (drusite-e2ee test vectors v1), for every format above: wraps, the epoch chain, account keys, device certificates, key changes, safety codes, approval codes, recovery words, sealed entries, sealed files and padding. CI checks them natively on Linux, macOS and Windows and as wasm, so every platform agrees byte for byte. Run cargo test -p drusite-e2ee.
  • Properties (tests/props.rs): seal then open round-trips; any changed byte, associated data, epoch or signer fails; padding round-trips; derived keys differ per document and epoch.
  • Fuzz targets (crates/drusite-e2ee/fuzz): every parser (sealed entry, file, identity, recovery words, wraps). They need nightly Rust and cargo-fuzz, and haven’t been run for long yet.
  • End to end: crates/drusite-server/tests/e2ee.rs runs real devices against a real server and PostgreSQL: setup, approval, sync, rotation, private pages and guests, agent devices, and conversion.

For the independent review

What to look at, in order, and the questions already known. The design is e2ee.md; the reasons for each choice are in ../phase11.md.

Scope

  1. crates/drusite-e2ee (formats, no I/O): every layout, label and length check; that every ciphertext’s associated data binds it to where it belongs; the epoch chain; the approval code’s commitment; padding. About 2,150 lines, with golden vectors (vectors/v1.txt), property tests and fuzz targets.
  2. The devices’ use of it in crates/drusite-core/src/e2ee.rs: trust on first use and key changes (pin), what a device accepts from the server in KeyWork, rotation, approving devices and agent devices, and opening entries (sync/).
  3. The server’s checks in crates/drusite-server/src/sync/sealed.rs, sync/keywork.rs and e2ee.rs: what it refuses without keys, and that no route hands one person’s wraps to another.

Known questions

  • Snapshots are trusted as written by a member who may edit. A snapshot declares no peers (it carries everyone’s changes), so a member with the key could hide forged changes from other people’s peers in one. Is a per-peer check on snapshots worth its cost?
  • Key substitution without safety codes. On first use a device trusts the key the server hands it. Is the “safety code changed” flow, and the UI around it, enough for people who never compare codes?
  • Starting over (reset) makes keys not signed by the old ones, by design. Members must accept the change before sharing. Check nothing shares with an unaccepted key.
  • The browser runs code the server serves. That’s stated as out of scope; is the warning enough?
  • Dependencies: hpke, x-wing, ml-kem and the crates they need are cargo vet exemptions, not audits.
  • Fuzzing: the targets (crates/drusite-e2ee/fuzz) compile, but haven’t had long runs.

Running things

cargo test -p drusite-e2ee
cargo +nightly fuzz run entry -- -max_total_time=600   # from crates/drusite-e2ee
DRUSITE_TEST_DATABASE_URL=postgres://… cargo test -p drusite-server --test e2ee

Contributing

Drusite is licensed under the AGPL-3.0-or-later, with an additional permission for app stores. There’s no CLA; commits must be signed.

CONTRIBUTING.md in the repository has everything: the licence terms for contributions, every check CI runs and how to run them, the server’s tests with PostgreSQL and S3, the sync simulation, and building for phones.

Building it

The Rust toolchain is pinned in rust-toolchain.toml; rustup installs it on first use. The app embeds the built UI, so build the UI first:

(cd ui && npm ci && npm run build)
cargo test --workspace
cargo xtask budgets

Run the desktop app with the UI reloading as you edit:

(cd ui && npm run tauri dev)

cd ui && npm run dev runs the UI alone in a browser, against an in-memory core.

Changing the docs

These pages live in docs/. Every page has an edit button. Keeping these docs current says how they’re checked against the code, and what to run when you change a setting or a command.

Keeping these docs current

Docs that drift from the code are worse than none: they send people down paths that no longer exist. So the parts of these docs that describe the code are made from it or checked against it, and CI fails when they disagree.

What’s generated

PageMade from
ConfigurationThe server’s config types and their doc comments, in crates/drusite-server/src/config.rs, through a JSON Schema
drusite-serverThe server’s command line, crates/drusite-server/src/cli.rs
drusite agentThe agent device’s command line, crates/drusite-agent/src/cli.rs

Don’t edit these pages: change the doc comments in the code, then run

cargo xtask docs

which writes them again and runs every check below. Commit the result with the code change.

What’s checked

cargo xtask docs --check runs crates/drusite-server/tests/docs.rs, which CI’s Docs workflow runs on every pull request too. It fails when:

  • a generated page differs from what the code makes now;
  • a config key or a command-line argument has no doc comment, so its reference row would say nothing;
  • any page (these docs, the README, CONTRIBUTING.md, SECURITY.md) names a setting the server doesn’t have: a DRUSITE__… variable, a table and key in backticks (such as [auth.password] enabled), or a key in a TOML example (which must also parse);
  • a page names a DRUSITE_… variable that nothing in the code, the images, the deployment files or the workflows reads;
  • the Helm values reference and the chart’s values.yaml don’t list the same values;
  • the README’s download links aren’t for the workspace’s version (on a stable version);
  • a relative link points at a file that isn’t there.

The phase plans under History aren’t checked: they record what was planned at the time.

The site

The site is built with mdBook from docs/, with the table of contents in docs/SUMMARY.md, and published to GitHub Pages by .github/workflows/docs.yml on every push to main. To preview it:

mdbook serve --open

mdBook is a single Rust binary (cargo install mdbook, or your package manager’s), its pages are plain Markdown that also read well on GitHub, and it has search built in.

Writing for these docs

  • Say what something does and why before how; then the steps, then how to check it worked.
  • Use example.com and example.test for every host and address. Every provider in an example is one choice among many: say so, and show more than one where it matters.
  • Quote messages exactly as the code writes them, so people can search for what they see.
  • When a feature changes, change its page in the same pull request.

Releasing Drusite

Everything is built on GitHub, by merging a release pull request: one that changes the version. Nobody builds a release on their own machine.

git switch -c release-1.0.0
cargo xtask bump 1.0.0     # one version everywhere: Cargo.toml, tauri.conf.json, the Helm chart, the README's downloads
git commit -sS -am "Release 1.0.0" && git push -u origin release-1.0.0   # then open the PR

When it’s merged, release.yml sees a version with no tag yet and releases it:

  • The apps: it builds every app, in the table below.
  • The server image: published as ghcr.io/pranavajk1/drusite-server:1.0.0, with 1.0, 1 and latest moved to it, and signed.
  • The Helm chart: published to oci://ghcr.io/pranavajk1/charts/drusite at 1.0.0, signed.
  • The GitHub release: it makes the release, and with it the tag v1.0.0 on the merged commit.

Other details:

  • Every release is a full release, the one Check for Updates offers everyone, whatever its version looks like: 1.0.0-beta.1 included. To make a pre-release instead, offered only to people who turned pre-releases on, add the pre-release label to the release pull request before merging. Its image then gets only its own tag, not 1.0, 1 or latest.
  • Any other push to main runs one small job that finds the version already tagged, and builds nothing. No build runs on pull requests.
  • If a build fails, re-run the workflow, or merge the fix: that push releases the same version again. The tag is made last, so nothing is half-released.

What a release has

PlatformFileUpdates
macOS (Apple silicon and Intel)Drusite-<v>-macos-universal.dmgin the app (.app.tar.gz and .sig)
WindowsDrusite-<v>-windows-x64-setup.exein the app (the same file and its .sig)
Linux, anyDrusite-<v>-linux-x86_64.AppImagein the app
Debian, Ubuntudrusite_<v>_amd64.debin the app, which asks for the admin password (pkexec)
Fedora, openSUSEdrusite-<v>.x86_64.rpmin the app, the same way
Archdrusite-<v>-x86_64.pkg.tar.zst, installed with sudo pacman -Uthe app links to the new package
Androiddrusite-<v>-arm64.apkthe app links to the new APK
Google Playdrusite-<v>.aabuploaded to Play by hand, if you publish there
iOS and iPadOSnot attached: it goes to App Store ConnectTestFlight, then the App Store
The agent devicedrusite-agent-<v>-<target>.tar.gz (Linux x86_64 and arm64, macOS Apple silicon) and .zip (Windows), and the image ghcr.io/pranavajk1/drusite-agent:<v>, signed like the server’sby hand, or a new image

The release also has latest.json, which the desktop updater reads, and SHA256SUMS.

Its notes are .github/release-notes.md, followed by the pull requests GitHub lists since the last release. Change the top of that file in each release pull request to say what the release brings, and anything people must do to upgrade.

Upgrading across 1.0. The server goes first, then the apps: encrypted workspaces need a 1.0 server and 1.0 apps. Standard workspaces keep working with older apps, on sync protocol 1, until 1.1. From 1.0, sync protocol 2 and the sealed formats (docs/security/e2ee.md) are stable: a format changes only through its format and suite bytes, and every 1.x app reads every format any 1.x app wrote.

The iOS build runs beside the others. The release doesn’t wait for it, and if its keys aren’t in Doppler it builds nothing and says so in the run’s summary.

The secrets

They all live in Doppler, in the config the one repository secret (DOPPLER_TOKEN) reads. You make each one on your own machine. An agent never makes, sees or holds them.

SecretWhat it isNeeded for
TAURI_SIGNING_PRIVATE_KEY, TAURI_SIGNING_PRIVATE_KEY_PASSWORDthe updater key (npx tauri signer generate). Its public half goes in crates/drusite-app/updater-key.pubevery release
ANDROID_KEYSTORE (base64), ANDROID_KEYSTORE_PASSWORD, ANDROID_KEY_ALIAS, ANDROID_KEY_PASSWORDthe Android signing key, already thereevery release
APPLE_CERTIFICATE (base64 .p12), APPLE_CERTIFICATE_PASSWORD, APPLE_SIGNING_IDENTITYthe Developer ID Application certificatethe Mac app, on a stable release
APPLE_API_KEY (base64 .p8), APPLE_API_KEY_ID, APPLE_API_ISSUERthe App Store Connect API keyMac notarization and iOS uploads
IOS_CERTIFICATE (base64 .p12), IOS_CERTIFICATE_PASSWORDthe Apple Distribution certificateiOS
IOS_MOBILE_PROVISION (base64)the App Store provisioning profile for app.drusiteiOS
APPLE_DEVELOPMENT_TEAMyour team IDiOS

A pre-release without the Apple secrets is signed ad hoc on macOS. A stable release without them fails.

To turn a file into base64 for Doppler: base64 -i file | pbcopy.

Apple: what to make with the developer account

Do these at developer.apple.com and appstoreconnect.apple.com, signed in as the account holder.

1. Your team ID. It’s under Account → Membership details: ten letters and digits. It goes in APPLE_DEVELOPMENT_TEAM, and it’s the part in brackets of the signing identity.

2. The Developer ID Application certificate, which signs the Mac app for use outside the App Store.

  • In Xcode, go to Settings → Accounts, pick the team, then Manage Certificates. Choose + → Developer ID Application. Only the account holder can make one. It lasts five years.
  • In Keychain Access, under My Certificates, right-click “Developer ID Application: …” and choose Export as .p12, with a new password.
  • In Doppler: APPLE_CERTIFICATE (the .p12, base64) and APPLE_CERTIFICATE_PASSWORD.
  • APPLE_SIGNING_IDENTITY is the certificate’s full name as security find-identity -v -p codesigning prints it: Developer ID Application: Your Name (TEAMID).

3. An App Store Connect API key. One key both notarizes the Mac app and uploads the iOS app.

  • In App Store Connect, go to Users and Access → Integrations → App Store Connect API → Team Keys, and choose +. Give it the role App Manager: notarizing needs Developer, and uploading builds needs App Manager.
  • Download the .p8. Apple lets you download it only once.
  • In Doppler: APPLE_API_KEY (the .p8, base64), APPLE_API_KEY_ID (the Key ID beside it) and APPLE_API_ISSUER (the Issuer ID above the list).

That covers the Mac. The rest is for iOS.

4. The App ID. In Certificates, IDs & Profiles → Identifiers, choose + → App IDs → App, with the explicit Bundle ID app.drusite. It needs no extra capabilities: recording in the background is set in the app’s Info.plist.

5. The Apple Distribution certificate. Make it the same way as step 2, but choose Apple Distribution. It lasts one year. Export it as a .p12, then put it in IOS_CERTIFICATE and IOS_CERTIFICATE_PASSWORD.

6. The provisioning profile. In Profiles, choose + → Distribution → App Store Connect. Pick app.drusite and the Apple Distribution certificate, and name it “Drusite App Store”. Download the .mobileprovision and put it in IOS_MOBILE_PROVISION (base64). It also lasts a year. When you renew it or the certificate, replace both in Doppler.

7. The app in App Store Connect. In Apps, choose + → New App. The platform is iOS, the name is Drusite (or whatever’s free; names are unique across the store), the bundle ID is app.drusite and the SKU is drusite. Each release’s build then shows up under TestFlight once Apple has processed it, usually in 10–30 minutes. App Store Connect asks two things about each build:

  • Export compliance. Drusite uses encryption: HTTPS, SQLCipher for the database, and, from 1.0, end-to-end encryption built from standard algorithms (XChaCha20-Poly1305, Ed25519, HPKE with X25519 and ML-KEM-768; see docs/security/e2ee.md), not only the operating system’s. So the answer to “does it use encryption” is yes, and to “proprietary or non-standard algorithms” no. Before the first App Store or Play upload of 1.0, check whether the US mass-market self-classification report (EAR §740.17(b)(1)) applies to an open-source app published this way, and keep the answer in App Store Connect’s export compliance documentation.
  • Store listing. Before you send a build for review: screenshots, a privacy policy URL, and the privacy answers.

A licence point to settle before the App Store, not TestFlight. Apple’s App Store terms add restrictions that the AGPL forbids for code you don’t own; this is the VLC case. Drusite’s own code is yours to license as you like. Code contributed under the AGPL is not. Decide this, for example with a contributor licence agreement or a licence exception for app stores, before contributions land that you’d need to ship there.

Google Play

The .aab is signed with the same key as the APK. Play takes it as the upload key. When you create the app in the Play Console:

  • Recommended: under Play App Signing, choose to use your own key. Upload the existing Android key with the Console’s PEPK tool. Then the Play build and the GitHub APK carry the same signature, and someone can move from one to the other without uninstalling.
  • If Google makes a new signing key instead, the two can’t replace each other on a phone.
  • Play needs each upload’s versionCode to be higher than the last. CI sets it to 1000 plus the run number, so every release is higher than the one before.

History: the phase plans

Drusite was built in phases, each planned in writing before it was built. The plans are kept as they were, as a record of what was decided and why, with each one’s “Changed from the plan” section saying where the build differed. They describe what was planned at the time, not necessarily how Drusite works now: for that, read the rest of these docs.

PhaseWhat it brought
Phase 7The browser version: the core as WebAssembly, served by the server
Phase 8Choosing AI models from any provider, and meeting notes
Phase 9The page outline, version history, several workspaces, sharing, guests and private pages, updates and analytics
Phase 10The canvas, Check for Updates, and the road to 1.0
Phase 11End-to-end encrypted workspaces, agent devices, and 1.0.0

Phases 1 to 6 (the editor, sync, the server, search and Ask, publishing, databases) were planned before plans were kept in the repository.

Phase 7: the browser version

The roadmap’s entry: the core as WebAssembly with browser storage, login through a backend-for-frontend. Done when the full app works from a browser on a machine where I can’t install it.

The UI already reaches the core only through CoreClient and a Transport (ui/src/core/), so the browser version is a new transport plus the pieces of the core that were native-only. Everything below is built for any deployment: the web app is served by the Drusite server itself, at the same origin, with no extra service and nothing assuming one setup.

1. What compiles to wasm32, and what’s split out

drusite-model, -crdt, -db, -formula, -markdown and -proto (without its C zstd) already build for wasm32-unknown-unknown, as CI checks. drusite-core with its sqlite feature does too, unchanged in the parts that matter:

piecenativebrowser
Encrypted local storerusqlite + SQLCipherthe same code: rusqlite builds on wasm32 through sqlite-wasm-rs, which compiles SQLCipher (libtomcrypt) to wasm. Same schema, same migrations, same cipher. Stored in OPFS by sqlite-wasm-vfs’s sahpool VFS (sync access handles, so it runs in a dedicated worker). journal_mode = DELETE there: the VFS has no WAL
Full-text searchtantivy, in memorytantivy’s writer needs threads. On wasm a small in-memory inverted index with the same tokenising (lower case, accents folded), the same rules (every word, the last as a prefix) and the same hits; behind the same Core::search
ClockSystemTimeDate.now() (SystemTime panics on wasm32). time and uuid get their wasm features
Sync driver (net)tokio + tungstenite + ureq, DPoPnot compiled. The sync session is already sans-I/O (sync_start, sync_receive, sync_outgoing, sync_retry); the worker owns a WebSocket and pumps frames through it. Frames over 1 KiB come zstd-compressed from the server: decoded with ruzstd (pure Rust); the browser sends plain frames, which the server already takes
Attachments up/downureq beside the socketfetch beside the socket, same queue in the core
Account (sign-in, refresh, workspace to join)account::Supervisorthe worker: the session cookie replaces tokens; “which workspace to join” uses the core’s same choose rule, now public
Store keyKeychain / Keystore / filesee §2
DPoP device keySecure Enclave, Keystore, Keychainnone: the browser holds no token (§4)
Markdown bridge, folder watcherwatchnot compiled (no folders in a browser)
Local MCPmcp (axum, rmcp)not compiled (a browser can’t listen on a port)
Device AI providersai (reqwest)not compiled: vendors’ APIs refuse browser origins (CORS), and a key in the browser is a key in JavaScript. Ask your notes runs on the server and works
Notion importzip (bytes) and API (ureq)zip from bytes works as on phones; the API import needs a server-side proxy, so it’s left out in the browser for now

drusite-wasm is the adapter: wasm-bindgen exports a WasmCore with handle(command) → response (the same JSON the Tauri adapter passes), the event queue, and the sync and attachment hooks. Events and the change listener go through a queue the worker drains after every call, so nothing JavaScript is held across Rust’s Send bounds.

2. Browser storage and the store key

  • OPFS, through the sahpool VFS: one SQLCipher database (/drusite/store.db), the same format as on devices. IndexedDB holds only the wrapped store key. navigator.storage.persist() is asked for so the browser doesn’t evict the store under pressure.
  • The key: 32 random bytes, as everywhere. It’s kept in IndexedDB wrapped (AES-GCM) by a non-extractable WebCrypto key also kept there: script on the page can use it but never read it out, the nearest a browser has to a keychain. Copying the profile’s files copies the ciphertext, not a key anyone can export.
  • Signing out wipes: the OPFS store, the wrapped key and the app’s caches. So does the server answering that this browser was signed out elsewhere (Account → Devices, or an expired session) the next time it’s online.

3. Sync from the browser

The existing protocol, unchanged: GET /api/v1/sync upgraded to a WebSocket with the drusite.sync subprotocol, the server speaks first, one subscription per document. The worker runs the same loop as sync/net.rs: ping every 30 s, drop a connection silent for 75 s, reconnect with the same backoff (1 s doubling to 5 min, with jitter), and reconnect at once on the browser’s online event or when the tab becomes visible.

4. Login: a backend-for-frontend

The browser never holds an OAuth token. The server is the OAuth client for it:

  1. The app, signed out, sends the browser to GET /web/login. The server makes a PKCE verifier and state (kept in auth_challenges, bound to a nonce cookie) and redirects to its own /oauth/authorize as the built-in client drusite-web, whose only redirect is the server’s own /web/callback.
  2. The usual sign-in page runs: every login method the server has switched on (OIDC, passkeys, password with TOTP, magic links), with the same rules for self-signup and who may sign in.
  3. /web/callback checks the state, spends the code in-process and makes a grant, like a device’s: listed under Account → Devices (“Firefox on macOS”), revocable there, with idle and absolute expiry. Instead of tokens it sets one cookie: __Host-drusite_web (plain drusite_web on http): HttpOnly, SameSite=Strict, Secure, Path=/, an opaque random value whose hash maps to the grant.

What replaces DPoP. DPoP binds a token to a key so a stolen token is useless elsewhere; here there’s no token for script to steal. The cookie is HttpOnly (no script reads it), SameSite=Strict (no cross-site request carries it) and __Host- (no other host or path can set or shadow it). Sibling subdomains are “same site”, so every cookie-authenticated request is also checked for Origin equal to the server’s own (WebSocket upgrades included) and Fetch Metadata that isn’t cross-site or same-site; and the server never sends CORS headers. The cookie is accepted by the same Authenticated extractor every API route uses, so the browser reaches exactly what a device can (sync, attachments, Ask, publish, agent activity) under the same Cedar policy. Device Bound Session Credentials would bind the cookie to a key, but only Chrome has them; a later step if they spread.

Sign-out (POST /api/v1/web/logout) revokes the grant, clears the cookie, and ends the sign-in pages’ own session too, so a shared machine is left signed out everywhere.

5. How it’s served

  • The server serves the web app from [web] dir (a built ui/dist-web): index.html at /, hashed files under /app/ with immutable caching, the service worker at /sw.js. With dir unset there are no web routes, as with any switched-off feature. The page gets a strict CSP: script-src 'self' 'wasm-unsafe-eval', connect-src 'self', worker-src 'self', frame-ancestors 'none', no inline anything.
  • The image builds the web app (a Node stage for the UI, the wasm crate with wasm-bindgen) and ships it at /usr/share/drusite/web with DRUSITE__WEB__DIR set, so every deployment of the image has it.
  • The Helm chart keeps it on (web.enabled: true), on the same host the ingress already routes. A sigma-lab deployment gets it with the chart bump that follows the release.
  • Published pages on their own public host are untouched: that host serves only them.

6. Offline, tabs, budgets

  • Offline: a service worker keeps the app shell (HTML, JS, CSS, wasm) so a reload works without the network; the notes are in OPFS. Edits save locally and sync on reconnect, as on devices. Signing in, Ask and publishing need the server and say so.
  • Several tabs: every tab works. The tabs’ workers elect one owner of the store with the Web Locks API (the sahpool VFS allows one connection); the others send their commands to it over a BroadcastChannel. Events go to every tab, and an edit made in one tab reaches the others as a page patch, as edits from another device do. When the owning tab closes, the next takes the lock, opens the store and the other tabs re-open their pages.
  • Budgets, checked in CI:
    • download: the wasm module and the app’s JS, brotli-compressed, each under a fixed ceiling (set from the first build, about 25% above it);
    • memory: a Chromium tab (page + worker heaps + wasm memory) with the 1,000-page workspace and one page open, under 250 MB, the desktop’s budget.

7. What stays desktop- or device-only, and how it’s hidden

The core answers unsupported or available: false for features it isn’t built with, and the UI already hides on that (as on phones): the Markdown folder, local agents (local MCP), device AI providers, folder pickers. In the browser also: the Notion API import, and the server address field (the server is where the page came from). Settings → Account shows the account, the server, sync state and Sign out.

8. Tests and the exit test

  • CI: cargo build of the core and drusite-wasm for wasm32; a web job that builds the wasm with wasm-bindgen, builds ui/dist-web, checks the download budget, and runs Playwright against the real wasm core in Chromium, WebKit and Firefox (the existing e2e specs that don’t need a desktop, plus browser-only ones: reload keeps notes, two tabs, offline then online); the RAM budget in Chromium. Server tests for the web login and cookie rules.
  • Exit test, by hand: the server locally with Postgres and S3 in containers and the built web app; sign in from a browser; create and edit pages, a journal entry, a database (board and table), Ask; sync both ways with the Mac app built from this branch (its own bundle ID and data directory); go offline, edit, come back; two tabs at once. The PR lists what was done by hand and what only in CI.

Decisions

The first two were Pranava’s to make; no answer had come by the end of the build, so they are the recommendations, each a config default or a few lines to change.

decisionchoicewhy
Local copy on a machine I can’t install onAn encrypted copy that opens offline, wiped on sign-out and when the server says the browser was signed outThe point is a full app on that machine, offline included; the wipe covers leaving it behind
How long a browser stays signed inIts own limits, 14 days idle and 90 at most ([auth] browser_idle_days, browser_max_days)A browser on someone else’s machine is likelier to be left behind than a phone
Where the web app livesThe server’s own address, at /Same origin is what makes an HttpOnly, SameSite=Strict cookie work with no CORS at all; nothing else to deploy
Several tabsAll live, one owns the storeA second tab that only says “open elsewhere” isn’t the full app
Device AI providers, Notion API importNot in the browserVendors’ APIs refuse browser origins, and keys would sit in JavaScript; Ask runs on the server either way

Results

Built as planned, with these differences:

  • Search in the browser is the small in-memory index (tantivy needs threads); same rules, BM25 ranking, and the core’s search tests run against both.
  • Commands cross to the worker as JSON: the UI builds some from Svelte’s reactive state, whose proxies can’t be cloned into a message.
  • A store whose key is gone (site data partly cleared, so IndexedDB lost the key and OPFS kept the store) is replaced at start, not left unopenable. Signed in, the notes come back from the server.
  • Offline from the start the browser remembers who it was signed in as (beside the wrapped key, and gone with it), so it says it’s offline for that account rather than signed out.
  • Two tabs, one closing mid-command: a command in flight to the tab that held the store is refused, and the editor shows what was saved; the other tabs reopen their pages under the new owner.

Budgets on the first build: the core’s WebAssembly 1,667 KiB brotli (budget 2,100), the app’s JavaScript 147 KiB (181). Memory, a Chromium tab with 1,000 pages and one open: 36 MB, of which 5 MB is the core’s WebAssembly memory (budget 48).

The exit test

whathowresult
Server tests: web app served, BFF sign-in, cookie only from the server’s own origin (sibling subdomain and Sec-Fetch-Site: same-site refused), token endpoint refuses web codes, a sign-in can’t be finished or spent from another browser, Devices revoke → signed_out, sign-out ends grant + cookie + sign-in session, no tokens kept for browsers; no web routes without [web] dircargo test -p drusite-server (PostgreSQL 16 + versitygw in containers)all 115 pass
The UI’s specs on the WebAssembly corePlaywright, local: Chromium and WebKit; CI also Firefox59 + 4 browser-only, each engine; 1 skipped (publishing needs a server)
The UI’s specs on the in-memory corePlaywright, Chromium and WebKit144 pass
Memory budgetPlaywright, full Chromium36 MB of 48
By hand, in the built-in browser against the local server (debug build, own Postgres and S3 containers, [web] dir = the built app)
First visitblank browser at /straight to the server’s sign-in page (“continue to Drusite in a browser”)
Sign innew password account (synthetic)back in the app, signed in, Synced
Pages, journal, databasestyped a page, picked a mood and wrote today’s entry, made a task board and a card (opens in its title)all saved and synced
Askthe right-hand panela CPU-bound local model (qwen3 1.7B in Ollama) ran past the server’s 5-minute limit, and the panel showed the server’s “took too long” error; with a local stub that streams a fixed cited answer: answer streamed, citation to the page, clicking it put the cursor in the cited block
Sync with the Mac app built from this branchdebug bundle with its own identifier and data folder and a file key (no Keychain), signed in to the same account (its sign-in URL taken from a stand-in open and finished in the built-in browser)it took the account’s notes; an edit on the Mac appeared in the browser; a live edit in the browser appeared on the open page on the Mac
Offline, then reconnectPlaywright Chromium against the same server (the built-in browser doesn’t allow service workers)signed in through the BFF, notes arrived; offline: edit, reload (app from the service worker, notes from OPFS, status “Offline; changes wait on this device”), edit again; online: Synced with no reload, and both offline edits reached the Mac
Two tabs at oncesamethe second tab opened the page through the first and its edit showed in the first; both reached the Mac
Sign outSettings → Sign outback at the sign-in page; the store’s files, the wrapped key and the remembered session gone; the server session ended

Not covered by hand: Firefox (Playwright’s Firefox doesn’t start on this Mac’s macOS; CI runs it on Linux), Safari itself (Playwright’s WebKit stands in), passkeys and OIDC through the web sign-in (the same sign-in pages as the apps; the server tests use passwords), and a phone’s browser.

Phase 8: choosing AI models, and meeting notes

Status: built, from this plan as approved (with your answers: account providers yes, the computer’s sound in a follow-up, audio kept, a Meetings database, reach = "public" by default). Where the build differs from the plan, it says so in “Changed from the plan” just below.

Changed from the plan

  • Each app records natively, as planned, but in a follow-up PR (the first PR used the webview’s recorder everywhere). iOS records with AVAudioRecorder and the audio background mode, Android with a foreground service of the microphone type, and desktops with cpal. All of them write the file as they go, so a recording goes on with the screen locked or the window hidden, and a crash keeps what was recorded. The browser keeps the browser’s recorder. Details in §7.2.
  • Phones record AAC in an ADTS stream (.aac), not M4A. An M4A file’s index is only written when recording stops, so a phone that ends the app partway would leave a file nothing can read. An ADTS file is a stream of frames: cut anywhere, it plays up to the cut. Same codec, 16 kHz mono at 32 kbit/s, about 15 MB an hour.
  • Desktops record Ogg Opus, not AAC: 16 kHz mono at 24 kbit/s, about 11 MB an hour, the same size as the phones’ and the browser’s. Desktops have no AAC encoder that works the same on macOS, Windows and Linux. The encoder is libopus 1.3.1 translated to Rust (unsafe-libopus), so building the app needs no C toolchain. Each Ogg page (a second) is written as soon as it’s full, so a crash keeps everything up to the last second. (FLAC was tried first: lossless, but about 70 MB an hour, which would have filled the server’s default 100 MB in 80 minutes. Lossless buys nothing here: every recording is resampled to 16 kHz before transcribing.)
  • The computer’s sound is recorded on desktops (question 2), in the same follow-up PR. The start sheet has a switch, “Also record the computer’s sound”, remembered on each device. It’s mixed with the microphone into one track.
  • The size warning (“10 minutes left before the recording is too big for your server”) isn’t built yet. The apps don’t know the server’s limit. A recording over it fails to sync, and stays on the device with Try again.
  • The macOS app needs macOS 12.3 or later, the first with ScreenCaptureKit.
  • Parts are transcribed one at a time, not three at once, so each gets the end of the one before as context, which is what keeps names right. An hour is about six parts.
  • Gemini gets each part inline, cut small enough (7 minutes) to fit its 20 MB request, rather than through its Files API.
  • Attendees is a text column (names, comma-separated), not a multi-select.
  • The phone’s New page tab still makes a page. A meeting starts from the drawer’s Meetings row (its +), a page’s “…” › Record a meeting, or the slash menu. One tap fewer for the common case.

Two pieces of work, on one branch and one PR:

  1. Models and providers. Ask your notes lets you pick a model in the chat box, as Notion does, from every model you can use: your server’s and your own. A provider can offer many models.
  2. Meeting notes (the roadmap’s Phase 8): record a meeting or upload a file, transcribe it with a model you choose, and get a page with a summary, action items and the transcript. Done when a meeting becomes a page.

Everything here behaves the same on macOS, Windows, Linux, iOS, Android and the browser. Where a platform can’t do something, the app says so where you’d look for it. Nothing assumes a particular vendor, gateway or model. Examples use made-up names (“Home lab”, “OpenAI”).


1. What’s wrong today

What you sawWhy it happens
Ask shows one fixed model with a tooltip. You can’t change it.Ask runs only on the server’s single [ask.chat] model. Providers you add in Settings never reach Ask: Settings even says “Ask your notes doesn’t use these”.
One provider gets one model id, typed by hand, for “Chat”.The device keeps one (provider, model) pair per feature. LiteLLM, OpenRouter and OpenAI each serve dozens of models under one key, and there’s nowhere to list or choose them. The app can already fetch a provider’s model list; it only uses it for suggestions.
"https//ai…" isn't an address (http://…)It reads as though https isn’t allowed. It is. The real problem was a missing colon, and the message didn’t say so.
Models: can’t reach the provider: error sending request for url (gateway.ai.svc.cluster.local)A provider added in Settings today is a device provider: the app on the Mac calls it, not the server. Only Ask goes through the server, and only with the server’s config model. The Mac can’t resolve a name that exists only inside the cluster, and the error doesn’t say so. An account provider (§2) would be called by the server, so this address would work.
Settings → AI → Embeddings, “for finding notes by meaning on this device”.Nothing on the device uses it. Search by meaning runs only on the server.
A server can offer only one chat model.The config has room for one.

2. Where a model runs: three kinds of provider

The menu and Settings both group models by provider. Each provider shows where it runs, because that decides where your notes and your key go.

Your server’sYour account’s (new)This device’s
Who adds itThe server’s owner, in the server configYou, in Settings → AIYou, in Settings → AI
Where the key is keptServer config or secret fileOn the server, encrypted with the server’s master key, like your notes. Never sent back to any app.In this device’s encrypted store. Never synced, never sent to the server.
Which devices can use itEvery device signed in to the serverEvery device signed in to your account, the browser includedOnly this device
What it can reachWhat the server can reach (e.g. http://llm.internal:4000)What the server can reach, within the owner’s rule (§10)What this device can reach (e.g. http://localhost:11434)
Keeps working when the app closesYes (server jobs)Yes (server jobs)No: the app has to stay open
In the browserYesYesNo. A browser can’t safely keep a key or call most vendors directly (CORS), as Phase 7 found. The browser says: “A browser can’t keep providers of its own. Add one to your account instead.”
Shown as“Home lab · Server”“OpenAI · Account”“Ollama · This device”

Why add account providers: today a provider has to be added again on every device, and none of them works in the browser. Long jobs, such as transcribing an hour of audio, can’t survive a phone locking. And the address in your screenshot, which only the cluster can reach, would just work from the server. The cost is that the key sits on the server, which already holds your notes. Device providers stay for models only your device can reach, such as Ollama on a laptop, and for anyone who doesn’t want a key on the server. This is open question 1 (§13).


3. Settings → AI

One page, the same on every platform (phones get the usual inset-group version).

Default models: synced with your account.

RowControlNotes
ChatModel menu (§4)What a new Ask chat starts with.
Summaries“Same as chat” or a modelUsed for meeting summaries.
TranscriptionA model that takes audioOnly models marked for transcription are listed. If there are none: “No provider here transcribes audio. OpenAI, Mistral, Google and most self-hosted Whisper servers do.”
Search by meaningRead-only: the server’s embedding model, or “Off”“Set by your server’s owner. Changing it re-indexes every page.”

The old device-only Embeddings row goes, because nothing used it. Its saved value is kept in the store, untouched.

Your server: its providers and models, read-only, under the names the owner gave them. If the server has none: “Your server has no AI models set up. You can still add your own below.”

Providers: one row per provider: the name, “Account” or “This device”, the address, the key’s last four characters, and “12 models · 3 shown”. Its buttons are Test connection, Edit and Remove. Add a provider… opens the form:

  1. Type: Anthropic, OpenAI, Google Gemini, Mistral, OpenRouter, or OpenAI-compatible (LiteLLM, Ollama, vLLM, SGLang, LM Studio, llama.cpp and others).
  2. Name: defaults to the type.
  3. Address: filled in for vendors, empty and required for OpenAI-compatible, with the placeholder https://example.com/v1. It’s checked as you type (§9).
  4. API key: optional for OpenAI-compatible. Once saved it shows as “Saved (…VrVw); type to replace”.
  5. Keep it: “In your account: every device, key kept on your server” or “On this device only”. Signed out: device only. In the browser: account only.
  6. Save saves, tests the connection, then lists the provider’s models.

The provider’s models (under the row, opened by “12 models”):

  • Fetched from the provider:
    • OpenAI, Mistral, OpenRouter and OpenAI-compatible: GET /models;
    • Anthropic: GET /v1/models;
    • Google: GET /v1beta/models, paged.
  • Each model has a Show in Ask checkbox, and a Use for tag: Chat, Embeddings or Transcription. The tag comes from what the vendor says (Google’s supportedGenerationMethods, OpenRouter’s input types) or, failing that, from the name (“whisper”, “transcribe” or “stt” means transcription; “embed” means embeddings). It can be changed from the row’s “…” menu, because names guess wrong.
  • A search box once there are more than 10. Refresh list fetches the list again.
  • Add a model by ID, for endpoints that don’t list models or list only some: an id, an optional display name, and Use for. A hand-added model is marked “added by hand”, and Refresh never removes it.
  • What’s ticked at first: when the list has 12 or fewer chat models, all of them; when it has more (OpenRouter lists hundreds), none, with “Choose which models appear in Ask”.
  • If listing fails, the list says why (§9) and offers Add a model by ID. The provider still saves.

Test connection keeps its steps (reach the address → key accepted → list models → a tiny request to each model used by default), in plain words and with timings.


4. The model menu in Ask

Where: the small model label in the question box (today a grey label with a tooltip) becomes a quiet button: the model’s display name and a chevron. It sits in the same place in the floating panel, the side panel and full screen on phones.

Opening it (click, or Enter with focus on it): on desktops and in the browser, a menu above the button, 320 px wide; on phones, a bottom sheet.

  • A search box at the top when there are more than 8 models.
  • Groups, in this order: the server’s providers, then your account’s, then this device’s. Each group has the provider’s name with “Server”, “Account” or “This device” after it.
  • Rows: the model’s display name, with a check on the one in use. “Default” in grey on your default.
  • A row that can’t be used right now is greyed out, with the reason on a second line: “Set up on another device”, “Your server is too old for this (needs 0.1.0-alpha.8)”, “Last test failed: key not accepted”.
  • At the foot: Make default (for the highlighted model) and Manage models…, which opens Settings → AI.
  • Keyboard: arrows, type to filter, Enter picks, Esc closes, as the design doc’s menus do.

What’s remembered:

  • Per chat: the chat keeps the model you last picked in it, saved with the chat on the server, so it follows you to other devices. Reopening a chat picks that model again.
  • New chats start with your default model. The default is synced with your account; a server with models has its owner’s default until you pick your own.
  • Each answer names the model that wrote it, in small grey text under the answer (shown on hover on desktops and always on touch screens). Changing the model partway through a chat is fine: earlier answers keep their label.

When a model goes away (its provider was removed, its box unticked, the server’s config changed, or the provider no longer lists it):

  • the next question uses your default, and a line in the chat says so: “Model X isn’t available any more, so this answer uses Y.” Nothing switches without telling you;
  • the button shows the model actually in use;
  • if your default itself goes away, the server’s default takes over. If there is none, the first model in the menu does. Settings → AI shows “Your default, X, isn’t available. Using Y.”

A model set up on another device (a device provider on the Mac, with the chat opened on the phone): the chat’s model shows as “X (on another device)”, greyed, and the phone answers with your default, with the same one-line note.

No models at all: the empty state says “No AI models yet. Your server has none set up, and you haven’t added a provider.” with a button, Add a provider.


5. How Ask answers, and what goes where

Finding the notes doesn’t change. The server searches your pages, words plus meaning when it has an embedding model, with the same permission checks, the journal switch and the page chip. Only the last step changes: which model writes the answer, and who calls it.

Server or account model: everything happens on the server, as today. App → server: question, chosen model. Server → provider: the found blocks + the question. The answer streams back. The key never leaves the server. The audit log (ai_audit) records the provider’s host and model, without any text.

This device’s model:

  1. App → server: the question and the page scope. The server finds the blocks, builds the same prompt it would send itself, saves the question in the chat, and returns the prompt and the sources. It records in the audit log that the device asked for the context.
  2. App → provider, directly from the device: the prompt (the found blocks and the question). The answer streams into the panel.
  3. App → server: the finished answer, to save in the chat with its model’s name and sources.

What leaves the device: the question goes to your server; the found blocks and the question go to the provider you picked. The key never leaves the device, and the server never sees it. If the answer fails partway, the chat keeps the question and shows the error, as a server answer does.

Offline or signed out: Ask needs the server to find the notes, so it says “Ask needs your server to find your notes. You’re offline.” This is unchanged. Asking from the device’s own copy while offline is listed under Not in this PR (§12).


6. One choice per feature

The design note’s rule: chat, embeddings, transcription and agents each pick their own provider and model.

FeatureChosen whereRuns whereRemembered
Chat (Ask)The model menu, per chat; default in SettingsWhere its provider is (§2)Per chat (server) and default (account)
SummariesOn the meeting’s start screen; default in Settings (“Same as chat”)Where its provider isPer meeting and default
TranscriptionOn the meeting’s start screen; default in SettingsWhere its provider isPer meeting and default
EmbeddingsServer config onlyServerThe model’s id is kept with every vector. Changing it re-indexes everything, and the server already does this when the id changes. Settings says so.

Agents use MCP and their own models, so nothing changes for them here.


7. Meeting notes

7.1 Where meetings live

Meetings live in a Meetings database, made the first time you record. It works the way the journal now does: it’s in the sidebar’s top section as “Meetings” (mic icon), its entries are listed in the tree, and it has these properties: Date, Attendees (names, as a multi-select), Duration and Status (Recording, Uploading, Transcribing, Summarising, Done, Failed). You can rename it, move it, or give it other views like any database. Notion’s “My meetings” is the model: one table of meetings, with name, date and attendees.

Starting one:

  • Sidebar: “Meetings”, then New meeting.
  • The page’s top bar: “…”, then Record a meeting.
  • Slash menu in any page: Meeting notes starts a meeting and puts a link to its page at that spot.
  • Phones: the drawer’s Meetings row (its +), or a page’s “…” menu.

The start screen is a small sheet, a bottom sheet on phones:

  • Record or Upload a file;
  • Transcribe with [model] and Summarise with [model], from your defaults;
  • Language: Detect, or one you pick;
  • one line saying where things go, e.g. “Audio is saved with the page and synced to your server. It’s sent to Home lab (your server) to transcribe, and the transcript to OpenAI (your account) to summarise.” It changes as you change the models.

7.2 Recording

As soon as you press Record, the meeting page opens, titled with the date and time (“Meeting, 28 Nov 2026, 14:05”). A recording bar is pinned to the top of the page: a red dot, the time (12:04), a level meter, Pause and Stop. You can type in the Notes tab while it records, and the summary uses what you write as a hint, as Notion does. If the level meter shows nothing for 30 seconds, the bar says “No sound from (microphone name). Check it isn’t muted.” If you leave the page, a small red “Recording 12:04” pill stays in the sidebar or top bar and takes you back.

PlatformHow it recordsPermissionScreen locked / app hidden
macOSNatively (Core Audio through cpal), OpusmacOS asks the first time (“Drusite records meetings you start, to turn them into a page.”)Keeps recording
WindowsNatively (WASAPI through cpal), OpusIf Windows has the microphone off for desktop apps, the app says so and opens Settings › Privacy & security › MicrophoneKeeps recording
LinuxNatively (PulseAudio or PipeWire, ALSA if neither runs), OpusNoneKeeps recording
iOS / iPadOSNatively (AVAudioRecorder, background audio on), AACiOS asks the first time; the orange dot shows while recordingKeeps recording when locked. A phone call pauses it: “Paused for a call. Resume”
AndroidNatively, as a foreground service (microphone type), AACAndroid asks the first time, and from Android 13 for the notificationKeeps recording, with a notification: “Recording meeting · 12:04 · Stop”
BrowserThe browser’s recorderThe browser asks the first timeThe tab has to stay open. Leaving asks “Stop recording and leave?”. Phone browsers stop when you switch apps, and the start sheet says so there.

The apps write the recording to a recordings folder in their data as it’s made: every couple of seconds on desktops, frame by frame on phones. When it stops, the file goes to the core by its path, not through the webview as base64, and is deleted once it’s kept with the page. A note beside each file holds the meeting’s page and the models chosen.

If the app stops while recording (closed, crashed, or ended by the phone), the file and its note are still there. The next time the app opens, it says: “A recording from 14:05 (32 min) wasn’t finished. Transcribe it · Delete”. Transcribe it goes on as Stop would have, into the same meeting’s page (or a new one if that page is gone), with the same models.

Pressing Stop in Android’s notification stops and keeps the recording. The app transcribes it the moment it’s next looked at, or offers it back as above if it was closed.

If permission is denied: “Drusite can’t use the microphone. Allow it in System Settings › Privacy & Security › Microphone.” (the equivalent on each platform).

The computer’s sound (desktops: the other side of a call on headphones). The start sheet’s switch, “Also record the computer’s sound”, mixes it with the microphone:

PlatformHowPermission
macOS 13+ScreenCaptureKit, audio only (the app’s own sound left out)Screen & System Audio Recording, asked the first time. Until it’s allowed, the bar says: “Drusite can’t record the computer’s sound, so only the microphone is recorded. Allow it in System Settings › Privacy & Security › Screen & System Audio Recording, then record again.”
WindowsWASAPI loopback of the default outputNone
LinuxThe default output’s monitor source (PulseAudio, or PipeWire’s PulseAudio server)None. Without PulseAudio or PipeWire, only the microphone is recorded, and the bar says why.

Phones can’t record other apps’ sound, so the switch isn’t there.

Screenshots (the browser tests’ stand-in recorder): the start sheet with the switch, paused for a call, and a recording left unfinished.

7.3 Uploading a file

You can upload m4a, mp3, wav, flac and ogg audio, and mp4 or mov video. From a video, only the sound is kept. Files can be picked or dropped onto the page. On phones, the system file picker includes voice memos. The page is made at once, with the status bar showing “Uploading 40%”.

7.4 Where the audio goes, and size limits

  • The audio is an attachment of the meeting page: an audio block with a player, placed above the transcript. Like every attachment, it syncs through the server to S3, encrypted at rest.
  • Recordings are mono speech audio, about 11–15 MB an hour everywhere: AAC on phones, Opus on desktops and in the browser.
  • The limit is the server’s attachment size ([attachments] max_bytes, 100 MB by default), so about 6 hours or more on every platform. Planned, not built yet: ten minutes before the limit the bar warns: “10 minutes left before the recording is too big for your server.” At the limit it stops and keeps what it has.
  • An upload over the limit: “This file is 240 MB. Your server takes files up to 100 MB. The server’s owner can raise [attachments] max_bytes.” A video is checked after its sound is taken out, so most videos fit.
  • Signed out (no server), the audio stays on the device and transcription needs a device model.
  • Delete audio (in the page’s “…” menu) removes it from the page and the server, and keeps the transcript. Whether audio is kept by default is open question 3.

7.5 Transcription

Provider typeHowNotes
OpenAI, Mistral, OpenAI-compatiblePOST /audio/transcriptions (multipart: file, model, language, prompt)Timestamps where the model gives them (verbose_json); otherwise plain text with each part’s start time. Self-hosted: any server with this endpoint, e.g. Speaches/faster-whisper, vLLM, LocalAI, or a gateway in front of them.
Google GeminigenerateContent with the audio attached and a transcription instructionEach part goes inline, cut to 7 minutes to fit. Speaker labels come from the prompt.
Anthropic, OpenRouterNot offered for transcriptionThey take no audio here. The picker says: “Anthropic can’t transcribe audio.”
  • Speakers: labelled “Speaker 1”, “Speaker 2” when the model gives speakers (diarizing models, Gemini). Otherwise the transcript has no speaker labels.
  • Where it runs: a server or account model runs it as a server job, so you can close the app or lock the phone. A device model runs it on the device. Its start screen says: “Runs on this device: keep Drusite open until it’s done.”

7.6 Long recordings

  • Audio longer than 10 minutes is cut into parts of about 10 minutes, each cut at a pause near the mark, so no word is split. Each part is under every provider’s upload limit (OpenAI’s is 25 MB).
  • Parts are sent one at a time, each with the end of the previous part’s text as context, so names and spellings carry over. Timestamps continue across parts.
  • Progress shows by part: “Transcribing: part 3 of 7”.
  • A part that fails is retried three times, waiting longer each time. If it still fails, the meeting shows “Part 4 of 7 failed: (reason). Try again”, and only that part is sent again. The parts that worked are kept.
  • A transcript too long for the summary model is summarised in pieces, and then the pieces’ summaries are combined.

7.7 The page

The page is laid out like Notion’s meeting notes:

  • Title: “Meeting, 28 Nov 2026” at first. When it’s done, it becomes a short title the summary model suggests (“Budget review: Q1 hiring”), unless you renamed the page yourself.
  • Properties: Date, Attendees and Duration. Attendees is filled with the names the summary model heard. You can edit it.
  • A meeting block with three tabs, Summary · Notes · Transcript, a quiet tab bar like the database view tabs. The status bar (§7.8) sits just above the tabs. The tab you last chose is remembered on this device.
    • Notes is where you type during the meeting, and it opens first while recording. The summary uses it as a hint and never changes it.

    • Summary opens first once it’s done:

      • a few short paragraphs;
      • Decisions, a bulleted list, left out when there are none;
      • Action items, as to-dos with the person’s name in the text when it was said (“Sam: send the draft by Friday”). Under them, Add to a task board…: you pick a database, and each item becomes a row there, titled with the item and linking back to the meeting.

      At the foot, in grey: “Transcribed by X · Summarised by Y”.

    • Transcript has the audio player, then paragraphs like “00:03:12 Speaker 1: …”. Clicking a timestamp plays the audio from there.

  • Each tab holds ordinary blocks: editable, searchable, and readable by Ask. Below the meeting block the page is an ordinary page.
  • If nothing was heard (silence, or a muted mic), the Summary tab says: “No speech was heard in the recording. Check that the right microphone is chosen and not muted, then record again.” The audio is kept, so you can check it. Notion shows the same case in your screenshot.
  • Markdown copy and export: a meeting block becomes three headings: ## Summary, ## Notes and ## Transcript.

Summarise again (the page’s “…” menu) can use another model. If you’ve edited the summary sections it asks first: “Replace the summary, decisions and action items you edited?” Your notes and the transcript are never replaced.

The summary prompt is built in. It asks for the sections above, in the meeting’s language, from the transcript and your notes only, with no made-up names or dates. Settings → Meetings has one text box, “Extra instructions for summaries”, added to the prompt (e.g. “Use British spelling”).

Journal entries aren’t touched. A meeting has a Date, so a journal query or view can show the day’s meetings, but nothing is written into your journal.

7.8 Progress and failure

The status bar at the top of the meeting page and the database’s Status property always agree:

StateThe bar saysYou can
Recording● 12:04, level meterPause, Stop
Uploading“Uploading audio: 40%”Cancel (keeps the audio on this device)
Transcribing“Transcribing: part 3 of 7”Cancel
Summarising“Writing the summary…”Cancel (keeps the transcript)
Done(bar disappears)
Failed“Transcription failed: (reason).”Try again, Choose another model

The audio is never thrown away by a failure. It’s kept on the device until the server has it, and kept with the page after that. A server job that was interrupted by a restart picks up where it stopped.

  • Before the first recording on each device, a sheet: “Before you record. Tell everyone in the meeting that you’re recording. In many places the law requires their consent. The audio is saved with the meeting page and synced to your server. To make the transcript and summary it’s sent to the models you choose, which are named before you start.” Got it.
  • The start screen always names where audio and transcript go (§7.1).
  • While recording, the red dot and time are always visible in the app, and the OS shows its microphone indicator.
  • Meeting pages are ordinary pages: Ask can read them and agents can see them, under the same rules as other pages. The transcript isn’t logged anywhere. The audit log records only the provider’s host, the model, the feature (“transcription”) and the size.

8. Server config

The server can offer several models, and [ask.chat] keeps working:

[[ai.providers]]
id = "lab"                      # stable: saved choices refer to it
name = "Home lab"               # what the apps show
kind = "openai-compatible"
base_url = "http://llm.internal:4000/v1"
api_key_file = "/run/secrets/llm"
# Which models to offer. "listed" offers everything the endpoint lists; or name them:
models = [
  { id = "big-model", name = "Big model" },
  { id = "whisper-large-v3", use = "transcription" },
]

[ai.defaults]
chat = "lab/big-model"
transcription = "lab/whisper-large-v3"

[ai.accounts]
enabled = true                  # people may add their own providers (§2)
reach = "public"                # "public": public internet addresses only; "any": private ones too
  • The config and the UI work side by side. Providers in the config (or in a Kubernetes manifest, through the config file, DRUSITE__AI__… environment variables, and *_file secrets) show in the app as “Server”, read-only, marked “Set in the server’s config”. Providers you add in the UI show as “Account”. The menu lists both together. Nothing in the config is required, and a server with no AI config still lets people add their own, if [ai.accounts] allows it. Server providers are managed only in the config, so a GitOps deployment stays the one source of truth, and the UI can’t change them.
  • [ask.chat], if set, becomes one more server provider with one model, and it’s the default chat model unless [ai.defaults] says otherwise. Existing deployments work unchanged; moving to [[ai.providers]] is optional.
  • reach = "public" stops people on a shared server from pointing it at addresses inside its own network. A home lab where the owner is the only user sets "any".
  • [search.embeddings] is unchanged.

8.1 How keys entered in the UI are kept on the server

The server protects account provider keys with the same envelope encryption it uses for workspaces:

  • Encrypted at rest. Each account gets its own 32-byte data key, and every API key is sealed with it (XChaCha20-Poly1305). That data key is stored only wrapped by the server’s master key source: the env or file key, or a KMS (OpenBao/Vault Transit), where the master key never leaves the KMS. A database dump or backup on its own holds only ciphertext.
  • Tied to its row. The sealed key is bound to the account, the provider and the provider’s address. A ciphertext copied into another row, or onto another address, fails to open.
  • Write-only. No API ever returns a key, to any app or to the server’s owner through the app. Apps see only the last four characters.
  • The key goes only to the address it was saved with. Changing a provider’s address clears its key, and you have to enter it again. Otherwise a stolen session could point the provider at another host and collect the key.
  • Opened only at the moment of a call. The key is decrypted in memory for that one request and wiped afterwards (zeroized). It’s never logged, never put in traces or error messages, and never stored in plain text in Postgres or S3.
  • Gone when you’re done. Removing a provider deletes its key. Deleting the account deletes its data key, so anything left behind can’t be opened. Rotating the master key works as it does for workspace keys: the new one, put first, wraps new account keys, and the old ones still open what they wrapped.
  • Who can still read it: someone holding both the database and the master key (or access to the KMS) can, as with your notes. That’s the trade-off of keeping it on the server. A key you don’t want on the server stays a “This device” provider. On the device it’s kept in the store encrypted by SQLCipher, with that store’s key in the OS keychain or keystore.

9. Error messages

They’re written for the person reading them, and each says what to do next.

WhenMessage
https//host/v1“The address is missing a colon after https. Did you mean https://host/v1?” (clicking fixes it)
host/v1“Addresses start with https:// or http://. Did you mean https://host/v1?”
ftp://… or another scheme“Addresses start with https:// or http://.”
A space in the address“The address has a space in it.”
http:// to a public addressWarning, not an error: “Your key will be sent unencrypted. Use https:// unless this is on your own network.”
/models is 404, but works under /v1“Found it at https://host/v1. Use that?”
The name can’t be found from this device, ending in .cluster.local, .svc, .internal or .lan“This device can’t find gateway.ai.svc.cluster.local. Names like this only work inside their own network. Use an address this device can reach, or keep the provider in your account so your server calls it.”
The name can’t be found (other)“Couldn’t find host. Check the address and your connection.”
Connection refused“Nothing answered at host:port. Is the server running?”
Timeout“host didn’t answer within 10 seconds.”
Untrusted certificate“host’s certificate isn’t trusted by this device. If it’s your own certificate authority, install it on this device first.”
401“The provider didn’t accept the key. Check it, or make a new one.”
403“The key works, but isn’t allowed to use model.”
404 for a model“The provider has no model called model. Refresh the list or check the id.”
413“The audio part was too big for provider.” (parts are cut small enough, so this means a provider limit lower than usual. Retrying cuts the parts smaller.)
429“provider is limiting requests. Trying again in 30 seconds…”, then “…still limited. Try again later.”
5xx“provider had a problem (error 502). Try again, or choose another model.”
Account provider blocked by reach“Your server only calls public addresses for your own providers. Keep this one on this device, or ask the server’s owner to allow private addresses.”
A model that can’t transcribe“model doesn’t take audio. Choose a transcription model.”
Microphone denied§7.2

10. Migration

  • Device providers stay as “This device” providers, with their keys untouched.
  • The device’s old Chat choice (provider plus a typed model id) becomes that provider’s first ticked model, so it shows in the menu. It does not become your default. Ask used the server’s model before, and it still starts with that.
  • The old Embeddings choice stays in the store, and the row is gone (§3).
  • [ask.chat] becomes a server provider with one model and the default (§8). Saved chats and their answers keep their model labels, and their model is the server’s default.
  • Older servers with a new app: the menu shows the old server’s one model and your device models. Device models are greyed with “Your server is too old for this (needs 0.1.0-alpha.8)”, because they need the new context step. Account providers and meetings need the new server too, and say so.
  • Older apps with a new server: they keep showing the default model and answering with it, as today.
  • Database migrations add: account providers (key sealed with the master key), each provider’s ticked models, the model per chat, defaults per account, and meeting jobs and their parts.

11. Tests

WhatHow
Model listing per vendordrusite-ai against fakes of each API (the existing adapters.rs style): Anthropic, OpenAI, Google (paged), Mistral, OpenRouter, and OpenAI-compatible as LiteLLM, Ollama, vLLM and llama.cpp each answer, quirks included.
Use-for guessingUnit tests over real-world model ids.
Address checksUnit tests for every row of §9, in Rust and in the UI’s in-memory core, which must give the same messages.
Transcription/audio/transcriptions (multipart, verbose_json and plain), Gemini with inline audio, a server without timestamps asked again for plain text, providers without audio.
ChunkingMade-up audio (tones with silences at known places): cuts land in silences, parts stay under the size, timestamps line up, a failed part retries alone.
ServerOn Postgres in CI: several server models, account providers (key sealed, never returned), the reach rule (private addresses refused), Ask with a chosen model, the device-model flow (context, then saving the answer), model-gone fallbacks, meeting jobs that survive a restart, permission checks on everything.
Self-hosted, for realA Linux CI job runs real self-hosted servers, not fakes: Ollama with a small chat model, and Speaches (faster-whisper) with its tiny model. Ask answers through it; a synthetic spoken clip (made with a TTS tool at build time, never real recordings) is transcribed and summarised into a meeting page.
UIPlaywright on the in-memory core: the menu (groups, search, keyboard, greyed rows, the “isn’t available any more” note), Settings → AI (add, list, tick, add by hand, errors), the meeting states from §7.8. The same tests run against the web app in Chromium and WebKit. Browser recording uses Chromium’s fake microphone.
Desktop appsThe existing CI matrix (macOS, Windows, Linux) builds and runs the core tests. The native recorder is tested with a file standing in for the microphone.
PhonesThe Android build in CI. The iOS build checked locally.
By hand, on real devicesThe microphone prompts, recording with the screen locked, a call interrupting on iOS, and the Android notification. You’d run these, since I don’t approve permission prompts on your Mac. I’ll write the checklist into the PR.

No real notes or recordings go in the repo. Test pages and audio are synthetic.


12. Not in this PR

  • Asking from the device’s own copy while offline.
  • On-device models (still “Later” on the roadmap).
  • Renaming speakers, and live transcription while recording.
  • Calendar integration: Notion’s “Event” property, naming a meeting after its calendar event.
  • The size warning before a recording reaches the server’s limit (§7.4).

13. Open questions

  1. Account providers, with keys kept on your server. Recommend yes. You add a provider once and get it on every device and in the browser. Meeting jobs keep going with the app closed, and the server can reach cluster-only addresses. The cost is that the key lives on the server (encrypted, never sent back to apps), alongside notes it already holds. Without them, the browser gets only the server’s models, and a provider has to be added on each device.
  2. Recording the computer’s sound on desktops (the other side of a call): ScreenCaptureKit on macOS (a second permission, “Screen & System Audio Recording”), WASAPI loopback on Windows, the monitor source on Linux. Phones can’t do it at all. Decided: built in the follow-up PR with the native recorders (§7.2), behind a switch on the start sheet.
  3. Keep the audio after transcribing? Recommend keep by default, with Delete audio on each meeting and a Settings › Meetings switch “Delete audio after transcribing”. Keeping it lets you re-transcribe with a better model, or check what was said. It costs about 15–30 MB an hour of storage.
  4. Where meetings live: recommend the Meetings database in the sidebar (§7.1), plus the slash command that links one in from any page. The alternative is Notion’s way: a meeting block inside whatever page you’re on, with no central list.
  5. reach default for account providers on a fresh server: recommend "public", so a shared server can’t be pointed at its own network. Your own deployment would set "any" so it can reach your cluster’s gateway. That’s a one-line change in your deploy config, not in this repo.

Phase 9: page outline, version history, workspaces, and updates & analytics

Status: built, from this plan as approved (with every recommendation: guests on, history for owners and editors, history kept forever, view history Allow by default, invitations make accounts, and this is Phase 9 with the whiteboard moving to Phase 10), on one branch and one PR. Where the build differs from the plan, it says so just below.

Changed from the plan

  • Several workspaces live in one encrypted store per device, each document tagged with its workspace, not one SQLCipher file and key per workspace. Sign-in, AI providers and agents are the device’s and the account’s, and would otherwise be copied into every file. Removing a workspace from a device deletes its rows, with SQLite’s secure_delete on so they’re overwritten.
  • Only the open workspace syncs. Another one catches up when it’s opened, rather than every 5 minutes in the background (§3.1.3). Search, Ask and the Markdown folder cover the open workspace; “Search all workspaces” isn’t built.
  • A device with notes of its own adds them as another workspace without asking (§3.3), and there’s no “Replace” choice: removing a workspace from the device, or deleting it, does that. New workspaces start empty (no getting-started page).
  • Restricted pages live in tree documents the server moves pages into, not in per-person view documents the server keeps in step (§3.4.2). A page that isn’t for everyone is listed in a tree document of its own, which only the people it’s shared with can sync; the server moves pages between the workspace and a tree (Move to Private, Move to Workspace, sharing a workspace page with a guest) in one transaction, and devices keep exactly the trees it lists on every connection. It’s simpler and leaks nothing, with three costs: moving needs a connection; a page’s title and property history starts again in the tree it moves to (its text’s history doesn’t); and a page shared with a guest is always a tree of its own, which every member still has (“Everyone in Work · Can edit”).
  • Who has a restricted page isn’t limited per subpage. Subpages go with their page; giving a subpage more people than its parent isn’t built.
  • Agents, publishing and the server’s search see restricted pages only through their own rules: agents (MCP) and publish to web reach the workspace’s own pages only, and the server’s search never returns a restricted page to someone who can’t reach it (row-level security now also covers the update log, snapshots and the search index). A guest has no server search or Ask; their devices search their pages locally. The Markdown folder writes restricted pages among the others, not under Private/ and Shared with me/.
  • Invitation links are shown once, when they’re made (and sent, when the server can send email). A pending invitation has New link, which replaces it, rather than Copy link: only a hash of each token is kept. The workspace’s invite link works the same way.
  • The server’s clock doesn’t correct a device’s (§2.9): history shows the time the device recorded. Device names come from the sign-in (“test”, “Firefox on macOS”).
  • Updates for all pages list who last edited which page and when, without excerpts; This page’s updates have them. Comments don’t exist yet, so neither do their updates.
  • Analytics’ “Created by” is whoever made the page’s document on the server (for an import, the person who imported it), not Notion’s creator.
  • A viewer’s page menu has no Version history (rather than a greyed item with the reason).
  • History’s size was measured by the new budget test: a page typed a word at a time and then a quarter rewritten keeps every change in 13 KB for 21 KB of text. The test fails past 3× the text.

The plan as approved

Four pieces of work:

  1. Page outline: a strip of dashes at the page’s right edge, one per heading, that opens into a list of headings you can jump to.
  2. Version history for every page, database row and database: who changed what and when, the changes highlighted, named versions, and restore as a new edit.
  3. Workspaces: several per account (Personal, Work), sharing a workspace with other people, private pages inside it, and sharing a single page with anyone, guests included.
  4. Updates & analytics: a side panel with a feed of changes, a views chart, and who viewed and edited the page.

Notion is the reference for how these behave, not for how they look. Everything follows design/DESIGN.md, and everything behaves the same on macOS, Windows, Linux, iOS, Android and the browser. Where a platform can’t do something, the app says so in the place you’d look for it. Nothing assumes a particular deployment, identity provider or number of users. Examples use made-up names (“Sam”, “Work”, “sam@example.com”).


0. What the code says today

These facts decide most of the plan.

FactWhereWhat it means here
Every device and the server already keep a page’s full history. Compaction writes ExportMode::Snapshot, which includes Loro’s whole oplog. Nothing uses shallow snapshots.drusite-core/src/store.rs, drusite-server/src/sync/store.rsHistory costs nothing new to keep. It’s already being paid for. What’s missing is when and who.
Loro isn’t told to record timestamps (set_record_timestamp is never called), so every change’s time is 0.drusite-crdtBefore history can say “19 Sep at 12:02”, every document has to start recording time. Edits made before that have no time.
Each loaded document gets a random Loro peer ID. A peer is a load of a document, not a device or a person.page.rs, workspace.rs“Who” needs a record of which person and device each peer belongs to. Nothing keeps that today.
The server logs who pushed each update (document_updates.created_by) and over which connection, but compaction deletes those rows after 500 updates.0003_sync.sql, sync/store.rsThe server knows who for a while, then forgets. The record of who has to outlive compaction.
A page’s title and properties live in the workspace document, not the page’s. A database’s columns, options and views, and each row’s values, are also keys in the workspace document’s tree entries.workspace.rs, workspace/database.rsA page’s history is its page document’s history plus its entry in the workspace document. Restoring a page can’t simply rewind the workspace document, because that would rewind every other page too.
Rows already store created, createdBy, edited and editedBy, and Notion import fills them.workspace/database.rs, database/notion*.rs“Created by” and “last edited by” exist for rows, and the Notion import’s values are kept.
fork_at and revert_change already undo an agent’s change as a new edit.page.rs, workspace.rsRestore is the same operation over a longer span.
The server has workspaces, workspace_members (owner, editor, viewer) and workspace_keys, with Cedar roles and row-level security on every table. Every route is already /api/v1/workspaces/{ws}/….0001_core.sql, policy.rsWorkspaces are mostly built on the server. The apps assume one.
A device holds one store (workspace.drusite) and chooses one workspace with choose(). A device with its own notes, signed in to an account that already has a workspace, stops at Join::Conflict.engine.rs, sync/mod.rsSeveral workspaces per account also fixes that dead end: the device’s notes can become a second workspace.
The workspace document holds a few settings (journal and meeting settings).journal.rs, meetings.rsThose are already per workspace.
Folded toggles are view state only, never saved. Headings are H1 to H3. There are no toggle headings and no comments.editor/blocks.ts, drusite-modelThe outline deals with folded toggles and meeting tabs, not toggle headings. The Updates feed has no comments to show yet.

1. Page outline

1.1 What it is

A page with headings gets a column of short dashes at the right edge of the page area, level with the top of the text, as in Notion. There’s one dash per heading: H1 dashes are 16 px wide, H2 12 px, H3 8 px, all right-aligned, 2 px tall, 8 px apart, in --text-3. The dash for where you are is --text and 2 px longer.

Hovering the dashes (or focusing them with Tab) opens the outline: a 240 px card on --bg-elevated with --shadow-md, radius 12, at most 70 vh tall, scrolling inside if it’s longer. Each heading is one row of --text-sm, indented 12 px per level below H1, cut with “…” after two lines. The row for where you are is --accent-text. Clicking a row scrolls the page so that heading sits 24 px under the top bar, and flashes it the way a search hit does. The card closes when the pointer leaves it for 300 ms, on Esc, or after a click.

The outline lists only headings: H1, H2 and H3. It doesn’t list the page title, toggles, or bold lines, and it skips empty headings.

1.2 When it shows

  • At least 3 headings. Fewer than that, and the page is short enough to see at once.
  • The window has room. The strip needs 48 px clear to the right of the 720 px column. On a window narrower than that, but wider than 700 px, the strip doesn’t show and the outline is in the page’s “…” menu instead (below).
  • Not on full-page databases, Journals, the Ask panel or Settings. It does show on a database row’s page, a journal entry and a meeting page when they have the headings.
  • With the Ask or Updates panel open beside the page, the strip moves to the left edge of the panel, as long as the page area still has the room.

1.3 Phones and narrow windows (≤ 700 px)

No strip: there’s no spare edge, and a thin target by the screen’s edge fights the system’s back gesture. Instead, the page’s “…” menu has Outline, with the table-of-contents icon, when the page has at least 3 headings. It opens a bottom sheet with the same list, the current heading marked. Tapping a heading closes the sheet and scrolls there. This is the same on iOS, Android and a phone’s browser.

1.4 Where you are

The current heading is the last heading above a line one third of the way down the page area. It’s worked out as you scroll, at most once per animation frame, from the headings’ positions. While you’re above the first heading, nothing is current. At the bottom of the page, the last heading is current even if it never reaches the line, so short final sections can still be marked.

1.5 Folded toggles and meeting tabs

  • A heading inside a folded toggle is listed in --text-3, with a small chevron-right before it. Clicking it unfolds the toggle (and any folded toggles around it) and scrolls there. Unfolding is view state, as it is today, so it isn’t saved or synced.
  • A heading in a meeting tab that isn’t shown is listed under the tab’s name (Summary, Notes, Transcript) as a group label. Clicking it switches to that tab and scrolls there.
  • Its dash is drawn at half opacity in both cases.

1.6 Turning it off

Settings → Appearance → Show page outline, a switch, on by default. It’s kept per device, like the theme, because it’s about screen size. It turns off both the strip and the “…” menu’s Outline.

1.7 Keyboard and screen readers

The strip is a nav landmark labelled “Outline”. Tab reaches it after the page, and focusing it opens the card. ↑ and ↓ move between headings, Enter jumps there, and Esc closes the card and returns the focus. Each row is a link whose name is the heading’s text. With reduced motion on, the jump doesn’t animate.

1.8 Published pages and export

Published pages (Phase 5) don’t get the outline in this plan: they carry no JavaScript, and a plain list of links at the top would change their layout. Markdown export and Notion import are unaffected, since the outline only reads headings.


2. Version history

2.1 Opening it

  • The page’s “…” menu, Version history (file-clock). This works for any page, database row, journal entry, meeting page or full-page database.
  • On desktops and in the browser it opens as a large modal (the lg size, 1040×760, or the whole window if that’s smaller). On phones it’s full screen.
  • Two parts: the version list on the left (280 px), and the selected version on the right, shown read-only as the page looked then, with its changes highlighted. On phones the list comes first, and tapping a version opens it full screen with a back chevron.

2.2 The list

  • Header: “Version history”, the page’s title, and a Group by select: Every change, 1 minute, 10 minutes, 1 hour or 1 day. The default is 10 minutes, and your choice is kept per device.
  • What a version is: a run of changes by one person, where no gap between two changes is longer than the window. A version never mixes two people, and never mixes a person with an agent acting for them. “Every change” shows each Loro change as it was saved (a few seconds of typing).
  • Each row: the time (“19 Sep at 12:02”, or “Today at 09:14”), and under it who made the version, as an avatar and name. If more than one device or way of editing was involved, the line also names them: “Sam · MacBook, iPhone”, “Sam · via Markdown folder”, “Research agent for Sam”, “Imported from Notion by Sam”.
  • The newest row is “Current version”. Rows load as you scroll, 50 at a time.
  • Named versions have a bookmark icon filled in, and their name in 500 weight above the time (“Before the rewrite”). A switch at the top, Only named versions, hides the rest.
  • Hovering a row (always visible on touch screens) shows Name this version (bookmark).
  • The list ends with the page’s first version: “Created” (or “Imported from Notion”, §2.10).

2.3 The selected version and its changes

  • The page as it was at the end of that version: title, properties, then blocks, read-only, drawn by the same editor.
  • Highlighted changes, comparing it with the version before it in the list:
    • inserted text has an --accent-soft background;
    • deleted text is shown where it was, struck through, in --text-2 on --danger-soft;
    • a block whose type, heading level, checked state or indent changed gets a 2 px --accent bar in the left margin, with “Was a paragraph” (or similar) in --text-sm on hover;
    • a property that changed shows its old value struck through before the new one;
    • a block that moved gets the margin bar and “Moved”.
  • Next and previous change: a pill at the bottom centre, “3 / 14 changes”, with ↑ and ↓ buttons, which scroll to the change and outline it. The shortcuts are ⌥↑ and ⌥↓ (Alt on Windows and Linux). With no changes (a version that only renamed a property, say), the pill says “No changes to the text” and lists what changed instead.
  • Compare with current (a switch in the header): compares this version with the current page, not with the one before it. This is what you want before restoring.
  • Subpages and inline databases show as their title only. Their own history is separate. Attachments show as they did then. If a file has since been removed from the server, it shows “This file was deleted” instead.

2.4 Restore

  • Restore this version is a primary button in the header. It’s greyed with the reason when you can’t use it (a viewer, or offline with a version this device doesn’t have).
  • It asks first: “Restore the version from 13 Sep at 14:45? The page goes back to how it was then. This is saved as a new change, so the current version stays in history and you can go back to it.” The buttons are Restore and Cancel.
  • What it does: the page’s content, title and properties become what they were in that version, as one new edit by you, labelled in history as “Restored the version from 13 Sep at 14:45”. Nothing is deleted from history. Restoring the restore is just as possible.
  • Under the hood: it’s revert_change from the current version back to the chosen one, on the page document, merged in as a new change. For the workspace document, only that page’s entry is written: its title and property keys are set to their old values, never a rewind of the whole document.
  • Edits arriving at the same moment from another device or person merge as they always do. The restore is one more concurrent edit, so text someone types while you restore isn’t lost.
  • What it doesn’t touch: subpages, the page’s place in the tree, whether it’s in the trash, and whether it’s published. Restoring a database row doesn’t touch the database’s columns.
  • Afterwards, the modal closes and a toast says “Restored the version from 13 Sep at 14:45”, with Undo. Undo is another new edit.

2.5 Named versions

  • Name this version opens a small field in the row: a name of up to 80 characters, then Save or Esc. Named versions can be renamed or unnamed from the row’s “…” menu.
  • They’re kept in the workspace document, in the page’s tree entry (ver:<id> keys holding the name, the version vector, who named it and when). That way they sync, work offline, and merge if two devices name versions at once. Naming a version isn’t an edit to the page: it doesn’t appear as a change, in Updates, or as “last edited”.
  • Who can name versions: anyone who can edit the page.

2.6 Databases and their rows

  • A database row is a page: its history is its page document plus its row values, so it works exactly like a page’s.
  • A database (the full-page database itself) has a history of its structure: columns added, renamed, retyped or removed, options added and removed, views added and changed, rows added and moved to the trash. Each version lists its changes in words (“Added the column Priority”, “Renamed the view Board to Sprint”, “Added 3 rows”), because a table of every cell at every moment isn’t readable. Restore puts back the columns, options and views. It doesn’t change rows: a row that was removed is in the trash, and its own history restores its content.
  • The journal and meetings are databases, so the same applies to them.

2.7 How long history is kept

Every change is kept for the life of the page, on the server and on every device that has the page. This is how it works today, without the times and names. When a page is deleted forever from the trash, its history goes with it.

Loro shallow snapshots would trim history: a shallow snapshot keeps the current state and only the changes after a chosen point, and a document loaded from one can’t go back further. They also have a cost for sync: a device holding edits that depend on changes from before the point can’t merge them into a trimmed document. That edge case is exactly a device that’s been offline for a long time, and losing its edits is worse than the storage. So this plan doesn’t trim. If trimming is ever needed, it would be a server setting ([history] keep_days) that trims only up to a point that every device of every member has synced past, and keeps each named version as a stored copy. That’s open question 4.

2.8 Where history lives, and its size

  • On every device, as today: a page’s stored snapshot includes its history. So the list, the changes and restore all work offline, for every version this device has. Versions from other devices arrive as part of normal sync.
  • On the server, as today: the document’s snapshot and log, sealed with the workspace’s key.
  • The new costs are small: a timestamp on each Loro change (a few bytes, and Loro merges changes a peer makes within its merge interval, which is set to 10 seconds so “Every change” stays useful); the peer register (§2.9), one row per peer; and named versions. The real size of history is what it already is today. Part of this work is a size test (§7) that measures, for a page typed and edited heavily, a long meeting transcript and a large database, the size of the snapshot with history against the same content without it, and fails if that grows past a budget agreed in the PR. If phones ever need a smaller copy, the fallback is for phones to keep a shallow copy and fetch older versions from the server, which would make old versions need a connection on phones. That isn’t part of this plan.

2.9 Who and which device made each change

  • Time: every document records time on every change (set_record_timestamp(true)), from the device’s clock. A clock that’s wrong shows wrong times, which the server corrects where it can (below).
  • The peer register: each time a device loads a document to write to it, it writes as a new Loro peer, as today. The device records the peer in its store as this device, this person, this way of editing (the editor, the Markdown folder, the local MCP, an import, a meeting job). When it pushes changes, the server records the peer against the signed-in person and the device’s grant (the same grant that’s listed in Account → Devices). The server’s record is what counts:
    • it’s kept in a new table, document_peers (document, peer, user, grant, kind, first and last seen), which compaction never deletes;
    • if a push carries a peer the server already holds for someone else, the push is refused (“Changes from this device couldn’t be checked. Restart Drusite.”), so nobody can make their edits look like someone else’s;
    • when the device’s clock and the server’s receive time differ by more than 5 minutes for an edit pushed live, the list uses the server’s time. Edits made offline keep the device’s time, which is when they were made.
  • The kind of edit goes in Loro’s commit message on the change itself: restore:<version>, import:notion, import:markdown, folder, agent:<grant>, meeting. So it travels with the document and the list can say “Restored…” or “via Markdown folder” even offline.
  • Agents: server-side MCP writes are made on the server as the agent’s grant, and are shown as “(agent name) for (person)”. The desktop’s local MCP writes as its own kind on that device. The existing agent activity log, with its Undo, stays as it is, and history links to it.
  • What a device shows before it knows a peer: the list asks the server for the names of the peers it doesn’t know and keeps them. Offline, your own devices’ peers are named (“Sam · MacBook”), and anyone else’s show as “Someone on another device” until the device is online.
  • Changes from before this ships have no time and no person. They show as one version at the bottom of the list: “Earlier changes, before history was recorded”, with no time. Restoring it is allowed. Drusite is in alpha, so this only affects test data.

2.10 Imported pages

  • From Notion: the page’s history starts at the import, as one version “Imported from Notion by Sam” at the time of the import. Notion’s own page history isn’t in its export, and its API doesn’t offer it, so it can’t come across. The row values created, createdBy, edited and editedBy from Notion are kept, as today, and Analytics uses them for “Created by” (§4.3).
  • From Markdown (the import and the Markdown folder): the same, “Imported from Markdown”. Later edits made in the folder show as “via Markdown folder”.
  • Export: Markdown and Notion-style export carry the current version only. History isn’t exported. That’s listed under §8.

2.11 Who can see and restore history

OwnerEditorViewer
Open Version historyYesYesNo
Restore a versionYesYesNo
Name a versionYesYesNo

Viewers don’t get history because it shows text that was deleted, which they never saw. In their “…” menu the item is greyed out: “Only people who can edit see version history.” The server enforces this too: the peer names and the history endpoints refuse viewers. Since a viewer’s device has the document, a determined viewer could read old text from their own copy, so the plan says so plainly in §5 instead of pretending otherwise.

2.12 Errors and empty states

WhenIt says
A page that has only its first version“No changes yet. Versions appear here as the page is edited.”
Offline, and a version’s peer is unknownThe version shows “Someone on another device”. Nothing is blocked.
A restore that fails“Couldn’t restore that version: (reason). Nothing was changed.”
A version this device doesn’t have yet (still syncing)“This version is still syncing to this device.” Restore is greyed out until it arrives.
The page was deleted forever while the modal was open“This page was deleted, so its history is gone.”

3. Workspaces

All of it is in this plan: (a) several workspaces per account, (b) sharing a workspace with other people, and private pages and single-page sharing inside a workspace (§3.4).

3.1 (a) Several workspaces per account

3.1.1 What you see

  • The switcher replaces the Drusite mark and name at the top of the sidebar: the workspace’s icon (its initial on --accent-soft-2, or an emoji you pick) and name, with chevrons-up-down. It opens a menu listing your workspaces, each with its role if you aren’t the owner (“Editor”), ticks the open one, and ends with New workspace and Workspace settings. ⌘⇧1…9 (Ctrl+Shift on Windows and Linux) switch to the first nine. On phones it’s at the top of the drawer and opens a bottom sheet.
  • The account menu at the foot stays as it is: who you are, the server, Settings, Trash and signing out. Trash is per workspace.
  • The window title and the browser tab say “Page title · Work”.
  • Switching keeps your place in each workspace: the page you had open in Work is open again when you come back to Work.
  • design/DESIGN.md’s “Workspace switcher” row changes from “one workspace” to this.

3.1.2 New workspace

A small form: name, icon, and Start with: Empty, or a copy of the getting-started page. It’s created on the server at once, and offline it’s created on the device and on the server when the device is next online. A new workspace has no journal and no Meetings database until you use them.

3.1.3 What belongs to a workspace, and what to the account

ThingScopeHow
Pages, databases, trashWorkspaceEach workspace document is its own tree, as now.
The local storeWorkspaceOne SQLCipher file per workspace: workspaces/<id>/workspace.drusite in the app’s data. Each has its own store key in the keychain or keystore (in the browser, its own wrapped key in IndexedDB), so removing a workspace from a device deletes its key, and what’s left can’t be opened.
SyncWorkspaceOne connection carries every workspace you belong to. Subscriptions already name their workspace. The open workspace syncs live; the others sync when the app starts, then every 5 minutes while it’s open, and live once you switch to them. This is the same on every platform. Phones and the browser don’t sync while closed, as today.
Server encryptionWorkspaceEach workspace already has its own data key, wrapped by the master key. Nothing changes.
Search (⌘K)WorkspaceSearches the open workspace. A line at the foot, “Search all workspaces”, runs it over all of them, with each result naming its workspace.
Ask your notesWorkspaceAnswers from the open workspace’s pages. Saved chats are listed per workspace. The chosen model and AI providers are the account’s, so they’re the same in every workspace.
AI providers, default modelsAccountAs in Phase 8. In a shared workspace, Ask and meetings use the asking person’s providers and keys.
Agents and MCPWorkspaceAn agent’s sign-in asks which workspace it gets, one per grant, in the consent screen. An agent that needs two gets two grants. The desktop’s local MCP serves the open workspace, and its tokens name a workspace too.
Meeting notesWorkspaceEach workspace makes its own Meetings database the first time you record there. A recording belongs to the workspace it was started in, even if you switch while it records.
Markdown folder syncWorkspaceSet per workspace, on each desktop: Work can sync to ~/Notes/Work and Personal to ~/Notes/Personal, or not at all. Two workspaces can’t share a folder.
JournalWorkspaceA workspace has a journal once you write in it. Today opens the open workspace’s journal. Settings → Journal says which workspace it’s showing.
SettingsSplitAccount: Account & sync, AI, Agents (the list of grants, across workspaces). This device: Appearance (theme, page outline). Workspace: General (name, icon, delete), Members (§3.2), Journal, Meetings, Markdown folder, Import. Settings’ nav gets a fourth group, the workspace’s name, for these.
Publish to webWorkspacePublished pages stay published. Their links don’t contain the workspace, so nothing changes for readers.
Agent activity, AI auditWorkspaceAlready per workspace on the server.

3.1.4 Leaving and deleting

  • Remove from this device (Workspace settings → General): deletes the local copy and its key on this device only. The workspace stays on the server and comes back if you open it again. Unsynced edits block this, with the reason: “3 changes haven’t synced yet. Connect to your server first, or remove anyway and lose them.” The second choice is a separate, danger-styled button.
  • Delete workspace (owners only): asks you to type the workspace’s name. It’s then scheduled for deletion in 30 days: it disappears from every member’s switcher, the owner sees it under Settings → Account → “Deleted workspaces” with Restore, and after 30 days the server deletes its documents, attachments, search index, history and key. The last workspace you own can’t be deleted while it’s your only one.

3.2 (b) Sharing a workspace with other people

3.2.1 Roles

The three roles already in the server, unchanged:

OwnerEditorViewer
Read pages, search, AskYesYesYes
Edit, create, move, trashYesYesNo
Delete forever from trashYesYesNo
Version history, restore, name versionsYesYesNo
Updates panelYesYesYes, without deleted text (§4.2)
Analytics: views chart, created and edited byYesYesYes
Analytics: the list of viewersYesYesNo
Publish to webYesYesNo
Connect an agentYes, at their roleYes, up to editorYes, read-only
Invite peopleYesOption (Settings → Members, “Editors can invite”, off by default)No
Change roles, remove peopleYesNoNo
Rename the workspace, delete itYesNoNo

A workspace can have several owners. The last owner can’t leave or become an editor until someone else is an owner.

3.2.2 Inviting

Workspace settings → Members lists everyone: avatar, name, email, role (a Select for owners), and when they joined. Its button is Invite people:

  • By email: one or more addresses and a role. Each person gets a link that works once, for that email, for 7 days. If the server can send email (the setting magic links already use), it sends it: “Sam invited you to Work on (server)”. If it can’t, the form shows the links to copy and send yourself. Pending invites are listed, with Copy link, Resend and Revoke.
  • Invite link (off by default): a link anyone can use to join with the chosen role (editor or viewer, never owner) until it’s turned off or reset. Owners can limit it to email domains (“@example.com”).
  • What joining looks like: the link opens the server’s page, “Join Work”, with the workspace’s name, who invited you and the role. Signed in, it’s Join. Signed out, it’s the server’s sign-in page, with every login method the server has switched on. After joining, the apps pick up the new workspace at the next sync, and the switcher shows it with a dot until it’s opened.

3.2.3 How logins join

  • An invite doesn’t open self-signup in general. It lets that one email make an account, with any login method the server allows, even when self_signup is off. Owners of a server that doesn’t want even that set [workspaces] invites_create_accounts = false, and then only existing accounts can join.
  • OIDC: the provider’s email must be verified and match the invited email (not case sensitive). OIDC’s existing rules (allowed domains, groups) still apply: an invite can’t let in someone the provider rules keep out. The page says which: “Your sign-in is for sam@other.example, but the invite is for sam@example.com.”
  • Passkeys, password, magic links: as for any new account, with the email checked by the invite link itself.
  • An invite link (not an email invite) asks for an existing account or the normal sign-up rules.

3.2.4 Leaving and removal

  • Leave workspace (Workspace settings → General) asks first, then removes you. Your devices delete their copy of it at their next sync, after pushing anything unsynced first.
  • Removing someone (owners, from Members): it takes effect at once on the server. Their open sync connections lose that workspace’s subscriptions, every later request is refused, and their agent grants for it are revoked. Each of their devices, at its next connection, is told “You were removed from Work” and deletes its copy and that copy’s store key.
  • What can’t be taken back: a removed person’s device that never connects again keeps the copy it had, encrypted with a key only that device holds. No system can reach into an offline device. The Members screen says so when removing: “Their devices delete their copy the next time they connect. A device that stays offline keeps what it already had.”
  • Their past edits stay in history under their name. If their account is deleted, the name becomes “Deleted user”.
  • Pages they published stay published, and owners see them under Settings → Members → “Pages published by former members” to unpublish if they want.

3.2.5 What changes in sync and the security model

  • Protocol (fields added, so old and new keep talking): Welcome lists your workspaces with your role in each. A new frame, Membership, tells a connected device when it’s added to, changed in or removed from a workspace. A subscription to a workspace you’ve left is refused with a new reason, NotAMember. A viewer’s Push is refused with ReadOnly, and the device rolls its local edit back with “You can view this workspace but not edit it.” (The app also stops viewers from typing, so this is a backstop.)
  • Keys per workspace: the server’s per-workspace data key and the device’s per-workspace store key (§3.1.3). Members never hold the server’s key: the server decrypts on their behalf after checking their membership. That’s why removal doesn’t require rotating the workspace key. Rotation stays as it is today, a server job you can run any time.
  • What the server checks: Cedar decides each request from the person’s role in the workspace, and row-level security repeats it in Postgres, as today. New tables (invites, peer register, views) get the same row-level security.
  • End-to-end encrypted spaces (on the roadmap as “Later”) would change this: members would hold the key, and removal would need rotation. Nothing here blocks that.

3.2.6 Whole workspaces, single pages, and publish to web

  • A page is either shared with the workspace (every member sees it, as above) or restricted: private to you, or shared with chosen people, who can be members or guests from outside the workspace. §3.4 covers how.
  • The invite screen says: “Everyone in Work sees every page in the Workspace section. Pages in Private, and pages shared only with some people, stay with them.” The first time you invite someone to a workspace whose journal is shared, it asks: “Work’s journal is shared with the workspace. Make it private first?” with Make private and Keep shared.
  • Publish to web (Phase 5) is unchanged: a read-only link for anyone, with no account.

3.4 Private pages and sharing a single page

3.4.1 What you see

  • The sidebar gets three sections, as in Notion: Workspace (pages every member sees), Private (pages only you see) and Shared with me (pages someone gave you, in a workspace you aren’t a member of, or restricted pages of one you are). Sections with nothing in them are hidden. In a workspace with only you, Workspace and Private both show, so private pages stay private if you invite people later.
  • Share in the top bar (today it’s only Publish to web) gets two tabs: Invite and Publish. Invite lists who has access to this page:
    • “Everyone in Work · Can edit” (or “Only people listed”, for a restricted page);
    • each person added, with Can edit or Can view, and Remove;
    • an email field and Invite. A member is added at once. Someone outside the workspace becomes a guest: they get a link like a workspace invite (§3.2.2), valid 7 days, for that email.
  • Moving a page between Workspace and Private is a drag in the sidebar, or “…” › Move to Private / Move to Workspace. Moving to Workspace asks first: “Everyone in Work will see this page and the 4 pages inside it.”
  • Subpages inherit their parent’s access. A subpage can have more people than its parent, never fewer, as in Notion. Removing someone from a page removes them from the pages inside it.
  • A lock in --text-3 after a restricted page’s title in the tree, and a line under the breadcrumb: “Only you can see this page” or “Shared with Sam and 2 others”.

3.4.2 How it works

The workspace document can’t carry these pages, because every member syncs all of it (§3.2.6). So:

  • The workspace document keeps only Workspace pages, as today.
  • A restricted tree, one per workspace, a new document kind kept only on the server. It holds the entries (title, properties, children, database columns and values, named versions) of every restricted page, with the same layout as the workspace document.
  • A view document per person per workspace, also a new kind. The server builds it for each person from the restricted tree: just the entries they may see, with their place under “Private” or “Shared with me”. A person’s devices sync their own view document like any other.
  • Edits go both ways through the server. When the restricted tree changes, the server writes the change into each affected view document. When a person edits their view document (renames a shared page, sets a property), the server checks they may, writes it into the restricted tree under their name, and from there into everyone else’s view. This is the same kind of mirroring the server already does for publish state. Each fact is a separate key, as in the workspace document, so two people changing different things both keep theirs, and the same thing keeps the last writer’s. Offline edits to a view merge when the device next syncs.
  • Page documents (the text) don’t change. The server keeps a page_access table (page, person or “workspace”, role) and checks it on every subscription, push, search and Ask. A device only ever receives the pages it may see.
  • Moving a page between Workspace and Private moves its entry from one tree to the other: the server deletes it in one and writes it in the other, in one transaction, keeping its ID, so links, history and page documents stay as they are. The page’s history (§2) joins both trees’ entries, so it continues across the move.

3.4.3 Guests

  • A guest needs an account on the server, made from the invite as in §3.2.3. They see only what’s shared with them, under Shared with me, grouped by workspace. A guest isn’t in the workspace’s member list or switcher; their switcher shows “Shared with me” as an entry of its own.
  • What a guest can do follows Can edit or Can view on that page:
Guest, can editGuest, can view
Read the page and pages inside itYesYes
Edit, add pages insideYesNo
Version history of that page, restoreYesNo
Share it furtherNoNo
Publish to webNoNo
Search and AskOnly over pages shared with themSame
AnalyticsViews chart onlyViews chart only
Connect an agentOnly to what’s shared with them, at their accessRead-only
  • Links and blocks pointing elsewhere: a link to a page the reader can’t see shows as a grey chip, “No access”, without its title. A query block or inline database lists only the rows the reader can see. A backlink from a page they can’t see isn’t shown.
  • Owners can turn guests off for a workspace (Settings → Members, Allow guests, on by default), and the server’s owner for the whole server ([workspaces] guests = false). Members gets a Guests list with what each guest can reach, and Remove.

3.4.4 Losing access

The same as removal (§3.2.4), page by page: the server deletes the entries from the person’s view document at once and refuses the page documents. Their devices delete those pages’ local copies at their next sync. A device that stays offline keeps what it had.

3.4.5 Members with restricted pages, and the other features

  • Search, Ask, agents, Markdown folder: each covers what that person can see. A Markdown folder writes private pages under Private/ and pages shared with you under Shared with me/.
  • History of a restricted page is visible to those who can edit it.
  • Updates, “All pages” lists only pages the reader can see.
  • Analytics viewers lists only people who can see the page.
  • Journal and Meetings: each can be moved to Private like any page. A new journal or Meetings database starts in Private in a workspace with other members, and in Workspace when you’re alone.
  • Notion import puts imported pages in Private when the workspace has other members, and asks otherwise. Notion’s own sharing settings aren’t in its export, so they don’t come across.

3.4.6 Sync and security changes

  • documents.kind gains restricted and view. A restricted document is never sent to any device. A view document is sent only to its own person.
  • page_access gets row-level security: a page is readable by a person only if the workspace shares it, or a row names them. Cedar checks the same rule first.
  • New protocol reason NoAccess for a page subscription the person may no longer have.
  • A guest’s grants and agent tokens are limited to their view document and the pages in it.

3.3 Migrating what exists

  • Server: workspaces gets name, icon and deleting_at. Each existing workspace is named “Personal”. Members, keys and documents are already per workspace, so nothing else moves.
  • Devices: on first start, the store moves from workspace.drusite to workspaces/<id>/workspace.drusite, and its key is filed under that workspace. The move is a rename in the same folder, done before the store is opened, so a crash leaves either the old layout or the new one. The browser does the same in OPFS.
  • The dead end goes away: a device with notes of its own that signs in to an account with a workspace from elsewhere (Join::Conflict today) is now asked: “This device has notes that aren’t in your account. Add them as a new workspace, or replace them with your account’s?” The choices are Add as a workspace (“Notes from MacBook”) and Replace (which needs a second confirmation and deletes the device’s own notes).
  • Settings: the journal and meeting settings already in the workspace document stay there. Device settings stay on the device. The Markdown folder setting, which is per device today, becomes this device’s folder for the “Personal” workspace.
  • Agents: existing grants are scoped to the one workspace they could already reach.
  • Old apps against a new server see only the workspace they already sync, as today. New apps against an old server show the one workspace, without the switcher’s New workspace: “Your server is too old for more than one workspace (needs 0.1.0-alpha.9).”

4. Updates & analytics

4.1 Opening it

The page’s “…” menu, Updates & analytics (activity). It opens in the right panel beside the page (the same container as Ask, 400 px, resizable), replacing Ask if that’s open. On phones it’s full screen. Two tabs: Updates and Analytics. The panel remembers the last tab per device.

4.2 Updates

A feed of what happened to this page, newest first, built from version history (§2) at the 10-minute window:

  • Each entry: avatar, “Sam edited Page title”, the time, and a short excerpt of the change: up to 3 changed blocks with insertions highlighted as in history, then “View 6 more”, which opens Version history at that version. A file-clock button on the right opens it too.
  • Other kinds of entry: created, renamed (“Renamed from Draft”), moved (“Moved into Projects”), moved to the trash and restored, published and unpublished, a version restored, a version named, properties changed (“Status: To do → Done”), a meeting transcribed or summarised, and an agent’s edit (“Research agent edited this for Sam”, with Undo from the agent activity log).
  • Comments: Drusite has none yet. When it does, they appear here.
  • Viewers see the feed without deleted text: an entry that only removed text says “Removed some text”.
  • All pages: a select at the top, This page or All pages, shows the same feed for the whole workspace, each entry naming its page. It’s useful with one person too, to see what your other devices, agents and meeting jobs changed. It isn’t a notification inbox: nothing is marked read, and nothing is pushed to you.
  • Where it comes from: the page’s own feed is built from the page’s history on the device, so it works offline for what the device has. “All pages” is built on the server from the peer register and the update log (without opening every document), so it needs a connection.
  • Empty: “No updates yet.” Offline for All pages: “Updates for all pages come from your server. You’re offline.”

4.3 Analytics

Three sections, as in Notion:

Views

  • “Views (12 total)”, and a range select: Last 7 days, Last 28 days (the default), Last 90 days, Last 12 months.
  • A bar chart of views per day (per week for 12 months), in --accent, with the axis in --text-3, following design/DESIGN.md. Hovering or tapping a bar shows the day and count.
  • If the page is published, views from the public link are a second series in --text-3, labelled “Public link”, counted without any identity (§4.4).

Viewers (owners and editors)

  • First, your own setting, Show your view history, a Select: Allow or Don’t allow, with one line: “People who can edit this workspace see when you last viewed a page.” It’s per person, per workspace, and also in Settings → Account.
  • Then the people who viewed the page and allow it, with “Last viewed 5 minutes ago”. People who don’t allow it aren’t listed, and their views still count in the chart.

Editors

  • Created by: the person and when. For a page imported from Notion, Notion’s creator and time are kept, and the line says “(in Notion)”.
  • Recently edited by: up to 5 people, from the peer register, with when each last edited. Agents appear as “(agent) for (person)”.

For one person, which is what most installs are today, the panel says so instead of looking empty: “Only you are in Work, so these are your own views.” The viewers list is hidden, and “Created by” and “Recently edited by” show you and your devices. It’s still honest data, just not very interesting until someone else joins.

4.4 What is recorded, and privacy

What counts as a view: the page shown in the foreground for at least 5 seconds. A person counts once per page per 30 minutes, so scrolling and switching tabs don’t inflate it. Agents reading a page don’t count. Your own views count.

What the server keeps, and nothing more:

RecordContentsKept
page_view_dayspage, day, count (from members), count (from the public link)[analytics] keep_days, 365 by default
page_viewerspage, person, last viewed, count. Only for people who allow it.Until they turn it off, leave the workspace or delete their account, which deletes their rows at once

There’s no per-view log, no IP address, no device and no user agent. A public view of a published page adds 1 to the day’s count and stores nothing about the reader: no cookie and no address.

Defaults (open question 5): Show your view history is Allow in workspaces you share, as in Notion. In a workspace with only you in it, it makes no difference.

The server’s owner can turn it all off: [analytics] enabled = false stops recording, hides the Analytics tab, and deletes the stored rows. count_public_views = false stops counting public links.

What each app reports:

AppHowOffline
Desktop apps, phone appsThe app sends “viewed page P at time T” to /api/v1/workspaces/{ws}/viewsKept in a small queue in the encrypted store and sent later with their original times. Views older than 7 days are dropped instead of being sent.
BrowserThe same, from the workerSame queue, in its OPFS store
Published pagesThe server counts the page it servesNot applicable
Agents, the Markdown folder, importsNothingNot applicable

4.5 Errors and empty states

WhenIt says
No views in the range“No views in the last 28 days.”
OfflineThe panel shows the last numbers it had: “Last updated at 14:05. You’re offline.”
Not signed in to a server“Analytics need your server: views are counted there.” Updates for this page still work.
Analytics turned off on the serverThe Analytics tab isn’t shown.
A viewer opens the panelUpdates and Analytics show, without the viewers list or deleted text.

5. The same on every platform

macOS, Windows, LinuxiOS, AndroidBrowser
OutlineStrip and hover card; in “…” when the window is narrow“…” › Outline, bottom sheetAs desktop (as phone in a phone’s browser)
Version historyModalFull screen, list then versionAs desktop
History offlineYes, from the device’s copyYesYes (OPFS copy)
Restore offlineYes, synced laterYesYes
Updates for this pageRight panelFull screenRight panel
Updates for all pages, AnalyticsOnlineOnlineOnline
Workspace switcherTop of the sidebar, ⌘⇧1–9Top of the drawer, bottom sheetTop of the sidebar
Markdown folder per workspaceYesNo folders on phones, as todayNo folders, as today
Invites, MembersSettings → MembersSame, full screenSame
Private, Shared with me, page InviteSidebar sections; Share › Invite popoverDrawer sections; Share sheet from “…”As desktop
Views reportedYes, queued offlineYes, queued offlineYes, queued offline

What a viewer can technically read. A viewer’s device holds the documents, with their history. The app doesn’t show viewers the history, and the server doesn’t give them peer names, but someone with a viewer’s unlocked device and a debugger could read deleted text from the copy. That’s true of any local-first app that keeps history. If that matters, the answer is not to share that workspace with them.


6. Order and dependencies

One branch, one PR. Inside it, the work is built in this order, because each step uses the one before:

  1. Outline. Only the UI; depends on nothing.
  2. Version history. It starts recording time and authors (§2.9). Every edit made before it has no time or name, permanently, so it goes first among the data changes. The roles it checks already exist on the server.
  3. Several workspaces (a). Moves the device’s store and puts several workspaces on one connection.
  4. Sharing a workspace (b). Invites, roles, removal.
  5. Private pages and single-page sharing (§3.4). The restricted tree, view documents, page_access and guests. It needs (b)’s invites and removal.
  6. Updates & analytics. Updates reads history; analytics’ viewers need members and page access.

The PR description will list these as sections, each with its own tests, so it can be reviewed a part at a time even though it lands at once.


7. Tests

WhatHow
OutlinePlaywright on the in-memory core: when it shows (2 headings no, 3 yes), the current heading as the page scrolls, jumping, folded toggles unfolding, meeting tabs switching, the narrow-window and phone versions, keyboard, and the Settings switch. In Chromium and WebKit, like the other UI tests.
History in the CRDTUnit and property tests in drusite-crdt: versions grouped by window and person, the diff between two versions (inserted, deleted, retyped, moved blocks), restore as a new edit with a concurrent edit kept, restore of title and properties only touching that page’s entry, database structure history in words.
Peer registerServer tests on Postgres: pushes record user and grant, compaction keeps the register, a peer already held by someone else is refused, the server’s time wins for a live push with a wrong clock and the device’s for an offline one, viewers are refused peer names.
Sync simulation (drusite-core/tests/simulation.rs, turmoil)Added cases: two people editing offline, then syncing, each change attributed correctly; a restore made while another device edits the same block, with nothing typed lost; a member removed while their device is partitioned, which deletes its copy on reconnect and has its later pushes refused; a viewer’s pushes refused; views queued offline and sent with their original times; several workspaces on one connection, with only the open one live.
SizeA test that builds pages from synthetic text (heavy editing, a long transcript, a large database) and checks history’s size against a budget set in the PR (§2.8).
Private pages and guestsServer and simulation tests: a restricted page never reaches a device that may not see it (by sync, search, Ask, agents or a link’s title); edits to a view document reach the restricted tree and every other view, attributed right, including from offline devices; a page moved between Workspace and Private keeps its ID, links and history; access removed while a device is offline deletes the copy on reconnect; a guest’s search and Ask see only their pages; subpages can add people but not remove them.
Workspaces on the serverInvites (once only, expiry, email must match, OIDC verified-email check, invites_create_accounts off), roles against every route, the last-owner rule, scheduled deletion and Restore, row-level security on the new tables.
Device migrationThe store moves to workspaces/<id>/, with a crash injected between steps; Join::Conflict becomes “Add as a workspace”. In the browser, the same in OPFS.
AnalyticsThe 5-second and 30-minute rules, opt-out deleting rows at once, public views storing nothing but a count, keep_days pruning, enabled = false deleting the stored rows.
PlatformsThe existing CI matrix builds and runs core tests on macOS, Windows and Linux, plus the Android build. iOS is checked locally. Phones and touch are covered by the UI tests at phone size with pointer: coarse.
By handThe switcher’s shortcuts on each desktop, the outline on an iPad in both orientations, and inviting a second account through an OIDC provider. You’d run these; I’ll write the checklist into each PR.

No real notes, Notion data or real people’s addresses go into the repository. Test people are sam@example.com and the like.


8. Not in this plan

  • Live presence: others’ cursors and who’s on the page now.
  • Comments and suggested edits, and with them comments in Updates.
  • Notifications, an inbox, and “Notify me”.
  • Trimming history (§2.7), unless you choose it in question 4.
  • Exporting history.
  • The outline on published pages.

9. Open questions

  1. Order inside the PR: recommend outline, history, workspaces (a), (b), private pages and guests, then updates & analytics (§6), so that times and names start being recorded first.
  2. Guests on by default: recommend on (Settings → Members, Allow guests), with the server setting [workspaces] guests to turn them off for a whole server.
  3. Who can see history: recommend owners and editors only (§2.11). Notion does the same. The alternative is to let viewers see history without restore, which shows them text that was deleted before they were invited.
  4. How long to keep history: recommend forever, with no trimming, as today (§2.7). Trimming with shallow snapshots saves space but can lose the edits of a device that was offline for a long time. If you want a limit anyway, it would be a server setting that trims only past what every device has synced, with named versions kept.
  5. The default for “Show your view history”: recommend Allow, as Notion does, since members of a workspace already see each other’s edits. The alternative is Don’t allow by default, which leaves the viewers list empty unless people opt in.
  6. Invites creating accounts when self-signup is off: recommend yes by default (invites_create_accounts = true), since otherwise inviting someone new means the server’s owner has to make their account first. A server that wants only existing accounts sets it to false.
  7. The phase number: this plan is “Phase 9”, so the roadmap’s whiteboard would become Phase 10. Recommend renumbering, since this work comes first.

Phase 10: canvas (edgeless whiteboard), Check for Updates, and the road to 1.0.0

Status: built, from this plan as approved (with every recommendation: a Developer ID and notarization for 1.0, no Windows signing yet, the updater key in Doppler, pre-releases off on stable builds and a daily check that only notifies, and the name “Canvas”), on one branch and one PR, merged after #37. Where the build differs from the plan, it says so just below.

Changed from the plan

  • A shape’s text is one block, not a section of blocks (§1.2). A note’s text is plain text with line breaks, kept in its CanvasText block, typed and merged as page text is (two devices typing in one note both keep what they typed). There’s no bold or links inside notes yet.
  • Undo is the canvas’s own, a step per gesture kept by the UI (as the page editor’s history is), not Loro’s UndoManager.
  • 1,000 notes are about 260 KB, not 200: each is a shape, a block and its text (a page of 1,000 such paragraphs is about 120 KB). The test fails past 300 KB.
  • Not built: Present (stepping through frames), the minimap, Pencil hover, pasting a PNG beside the JSON on copy, the “Loose text” frame for text whose shape is gone (it isn’t shown), the counts in a version’s row and in the Updates feed (a version shows “2 added · 1 changed · 0 removed” above the board instead), the 5,000-shape frame test, and canvases inside published pages (a published canvas page shows its board; a canvas block in a published page shows nothing, as an inline database doesn’t). A page card on a published canvas says “Open page” and links to the page when it’s published too, rather than showing its title.
  • The frame list is a panel from the board’s “…” menu, not a strip at the right edge.
  • A frame is renamed by double-clicking it (a name prompt).
  • On phones the canvas’s title isn’t shown (the top bar has it), and the app’s tab bar stays under the canvas’s toolbar rather than stepping aside, so the board fills what’s between them.
  • Making a canvas needs a server at the app’s major.minor or newer: an older one refuses canvas documents, so New canvas says why instead of making one that can’t sync.
  • The updater’s public key is a file, crates/drusite-app/updater-key.pub, which build.rs builds into the app, not tauri.conf.json. A build without it offers the download instead of installing. Update bundles are made only in CI (--config turns createUpdaterArtifacts on), so a local build never needs the private key.
  • Links to the release page and the APK open through Drusite’s own plugin (the system browser on desktops, an ACTION_VIEW intent on Android, Safari on iOS), and only for https://github.com/pranavajk1/drusite/…. Tauri’s opener plugin pulls in crates cargo deny refuses as unmaintained.
  • The web app’s main bundle keeps its budget because the app is built as one chunk again (manualChunks): split up for the canvas, the pieces compressed 10 KB worse.
  • Linux’s idle RAM is close to its limit: 446–451 MiB measured on CI’s software-rendered runners against 450 (Phase 9 measured 443). The Mac and Windows figures are about 116 and 103 of 250.
  • The app builds run only for a release (a version tag) or when started by hand, never on pull requests; CI on a pull request is the Rust, UI, server and web-app checks.
  • The updater’s own test is partial: a desktop run started by hand builds and signs every update bundle with a throwaway key; installing one over an older app and relaunching is on the list of things only Pranava can check, on his own Mac, Windows and Linux machines.
  • More in each release (asked for after the plan): Linux gets an .rpm and an Arch package (.pkg.tar.zst, made from the .deb) beside the AppImage and .deb, and the .deb and .rpm update in the app too. Android gets an .aab for Google Play. iOS is built and uploaded to App Store Connect (TestFlight) once its keys are in Doppler (ios.yml). Releasing is merging a pull request that bumps the version: release.yml then builds everything, publishes the server image and Helm chart at that version, and makes the release and its tag. Nothing builds on other pushes to main or on pull requests. docs/releasing.md has what each release holds, every secret, and the Apple and Google Play setup.

The plan as approved

Two pieces of work, then a release checklist:

  1. Canvas: an infinite, zoomable board of sticky notes, text, shapes, connectors, freehand ink and frames, with pages on it and it inside pages. It’s a kind of page, so it syncs, merges, shares, keeps history and is searched like any other page.
  2. Check for Updates: Settings → About shows this app’s version and the server’s, and checks GitHub’s releases of pranavajk1/drusite. Desktops download, install and restart in the app; phones say there’s a new version and link to it.
  3. 1.0.0: what changes when the next tag is a stable release instead of an alpha.

As in every phase: design/DESIGN.md decides how it looks; everything behaves the same on macOS, Windows, Linux, iOS, Android and the browser, and where a platform can’t do something the app says so where you’d look for it. Nothing assumes a particular deployment or provider. Examples use made-up names (“Sam”, “Work”, “sam@example.com”).


0. What the code says today

FactWhereWhat it means here
A page document is four root containers: body (one LoroText of every block’s text, each block starting with a marker), blocks, order, meta. Loro keeps containers a version doesn’t know about.drusite-crdt/src/lib.rs, page.rsA canvas can be a page document with extra root containers. Everything that reads a page’s text (search, Ask, MCP, Markdown, publish, history) keeps working.
A block can hold other blocks: a MeetingSection or Toggle’s children are the blocks after it, indented one deeper.drusite-model, meeting.rsEach shape’s text can be one section block with its paragraphs under it: rich text, split, join and merge exactly as in a page.
BlockKind::Database { database, view } shows a subpage of kind Database inside a page.drusite-model/src/lib.rsA canvas inside a page is the same shape: a Canvas block naming a subpage of kind Canvas.
PageKind is Page, Journal, Database; unknown kinds read as Page. meta.schema above SCHEMA_VERSION refuses to load with NewerSchema.drusite-model/src/journal.rs, page.rsAn older app would show a canvas as a page of loose text. Canvas documents get a higher meta.schema, so older apps (and older servers) refuse them cleanly, and the refusal can point at Check for Updates.
The sync protocol has DocKind::{Workspace, Page, Tree}, row-level security, restricted trees and compaction, all keyed on page documents.drusite-proto, drusite-server/src/syncA canvas rides as DocKind::Page. No protocol change, no new table.
There is no presence (live cursors) in sync.drusite-protoEdits on a canvas appear live, as on a page. Other people’s cursors don’t (§1.12).
The server already tells the app its version: Welcome.server_version is CARGO_PKG_VERSION.sync/connection.rs, messages.rs“Server is older/newer” needs no server change, only UI. A small unauthenticated GET /api/v1/version is added for the sign-in screen.
The app’s CSP allows connect-src ipc: only; all networking is Rust (reqwest behind net).tauri.conf.json, drusite-coreThe release check runs in Rust, not fetch.
One version everywhere: .github/scripts/version.sh fails CI unless Cargo.toml and tauri.conf.json agree, and the tag must match..github/scripts/version.sh“Bump app and server together” is already enforced; a cargo xtask bump makes it one command.
A v* tag runs image.yml (server image, Helm chart, cosign keyless) and android.yml, which creates the GitHub release (--prerelease when the tag has a -) with the APK and SHA256SUMS. No desktop builds in CI; Mac builds are local and ad-hoc signed..github/workflows/Desktop builds move into CI, and one job creates the release with every platform’s files and the updater manifest.
The web app is built into the server image.DockerfileThe web app’s version is always the server’s. It has nothing to update itself.
Main JS bundle budget: 185 KB brotli; wasm 2.15 MB. Core keystroke p95 0.5 ms; idle RAM 250 MB (450 on Linux CI).ui/scripts/compress.mjs, xtask/src/budgets.rsThe canvas is a separate, lazily loaded chunk with its own budget; new budgets for pan/zoom go in xtask and the web tests.
“Updates” already names Phase 9’s side panel (the feed of changes).lib/updates/The new section is About, its button Check for updates, and its toast “Drusite 1.0.1 is available”. Never “Updates”.

1. Canvas

1.1 What it is

A canvas is a page you draw on instead of type down: an endless surface you pan and zoom, holding sticky notes, text, shapes, connectors, ink, images, frames and page cards. It’s created from New page → Canvas, /canvas inside a page (which makes a canvas subpage and shows it in the page), or the sidebar’s “+” menu. In the tree it has the presentation icon unless it’s given its own. It has a title, an icon, a cover and properties like any page; its body is the board.

The UI calls it Canvas. (Notion has no equivalent; AFFiNE calls it “edgeless”, Excalidraw and FigJam “whiteboard”.)

1.2 The data model in Loro

A canvas is a page document (meta.kind-free; the kind is in the workspace tree, as for databases) with two more root containers and a higher schema:

  • meta.schema = CANVAS_SCHEMA (today’s SCHEMA_VERSION + 1). Apps and servers before Phase 10 refuse the document with NewerSchema.

  • shapes (map): one LoroMap per shape, keyed by its ShapeId (a UUID, like BlockId). Each holds plain values only:

    KeyValueNotes
    typenote, text, rect, ellipse, diamond, triangle, line, connector, ink, frame, image, page
    at[x, y] (f64, canvas units = CSS px at 100%)One value, so a concurrent move never mixes one device’s x with another’s y. Relative to the frame when frame is set.
    size[w, h]One value, as at.
    rotradiansOmitted when 0.
    zfractional index (string)Stacking order. “Bring to front” writes one key. Ties sort by ShapeId.
    frameShapeIdThe frame it’s in; one level only (frames don’t nest).
    groupgroup IDShapes sharing it select and move together.
    style{fill, stroke, width, dash, font, align, arrowStart, arrowEnd, route}Colours are palette names (yellow, blue…), never hex, so dark mode and the design tokens decide the paint.
    textBlockIdThe section block holding its text (below). Notes, text, shapes’ labels.
    from, to{shape, anchor: [u, v]} or {at: [x, y]}Connector ends: a point on a shape (0–1 across its box) or a free point. Each end also keeps fallback: [x, y], the last place it was drawn, for when its shape is deleted.
    inkbinaryFreehand points, written once when the stroke ends (below).
    blob, name, mimeAn image, in the workspace’s attachment store, as BlockKind::Attachment.
    pagePageIdA page card.
    namestringA frame’s name.
    lockedboolCan’t be selected by a click (only from the frame list or Select all).
  • Text lives in the page’s own blocks. A shape with text owns one block of the new kind BlockKind::CanvasText { shape } (no text of its own, like MeetingSection); its paragraphs are the blocks after it, indented one deeper. So text in a note is real rich text, typed with the same ProseMirror schema, merged by the same body Loro text, never lost to a merge, and is what search, Ask, MCP, history and Markdown export read with no new code. Deleting a shape deletes its section and its paragraphs in the same commit.

  • Ink (freehand) is stored as one binary value per stroke: points quantised to 1/8 px, delta-encoded as zig-zag varints, with pressure as one byte per point. A 300-point stroke is about 1 KB. Strokes are written once, on pointer-up, and never edited point by point; erasing deletes a stroke. Points are simplified (Ramer–Douglas–Peucker at 0.5 px of screen) before they’re written. This keeps a page full of handwriting from bloating the oplog, which history keeps forever (Phase 9).

  • Viewport state isn’t stored in the document. Where you are and how far you’re zoomed is kept per device per canvas in the store, like a page’s scroll.

The new Rust lives in drusite-crdt/src/canvas.rs (Canvas wraps a Page and adds the shape operations), with types in drusite-model/src/canvas.rs and Core API commands in drusite-core. Geometry that has to agree everywhere (connector routing, hit testing for the eraser, the SVG the server renders) is in a small Rust module shared by the core, the WebAssembly build and the server.

1.3 How it syncs and merges

A canvas syncs exactly as a page: DocKind::Page, the same update log, snapshots, compaction, row-level security and restricted trees. What merges how:

Concurrent editsResult
Two people move (or resize) the same shapeLast writer wins for at (or size), whole. The shape is never torn between the two.
One moves a shape, the other recolours itBoth apply: different keys.
Both type in the same noteMerged as page text is: nothing typed is lost.
One deletes a shape, the other edits itDelete wins; the other’s edit is gone with the shape. (Someone deleted it; “nothing typed is lost to a merge” still holds.)
One deletes a shape a connector is attached toThe connector stays, its end at fallback. It shows as a free end and can be reattached.
Two “bring to front” at onceBoth get a new top z; ties sort by ShapeId, so every device shows the same order.
One moves a frame, the other moves a shape inside itBoth apply, because children are positioned relative to the frame.
One moves a shape into a frame, the other deletes the frameThe frame’s children are deleted with it on the deleting device; the moved shape arrives after and is put back on the board at its last absolute position (the core repairs a frame that points nowhere on load).
One groups shapes, the other groups an overlapping setLast writer wins per shape’s group.

Every gesture is one commit: moving 100 selected shapes, pasting 30, deleting a frame and its children. Other devices see it whole or not at all. While dragging, the app moves the shapes on screen without writing; it writes the positions every 250 ms (so others see the drag) and at the end, and Loro’s 10-second merge folds these into one change. Undo is Loro’s UndoManager on the canvas document, local to the device, one step per gesture; ⌘Z inside a note’s text undoes typing, as on a page.

Repairs on load (never written back unless the next edit touches the shape): a shape whose text block is gone shows no text; a text section whose shape is gone is shown in a “Loose text” frame at the board’s origin rather than dropped; a frame that points at nothing is ignored.

1.4 Notion compatibility

It doesn’t apply in either direction. Notion has no canvas or whiteboard, and its export and API have nothing to import. What a canvas does with the formats Drusite already speaks:

  • Markdown export and the Markdown folder write a canvas as Canvas title.md: front matter drusite: canvas and readonly: true, then its text in reading order (each frame an H2 in left- to-right, top-to-bottom order, then shapes outside frames; each note or text a paragraph group). The folder doesn’t write edits from that file back: a note’s position can’t be expressed in Markdown, and a merge that guessed would move things. Editing the file shows “This file is a canvas’s text; edit the canvas in Drusite” in the bridge’s status.
  • Export from the canvas’s “…” menu: SVG and PNG (whole board, a frame, or the selection), at 1×/2×.
  • Notion import of a page that links to a Notion whiteboard-like embed (Miro, FigJam, Whimsical) keeps it as a link, as today.
  • Importing Excalidraw or tldraw files is a cheap later addition, not in this phase.

1.5 Canvas in a page, and pages in a canvas

A canvas in a page is a block, BlockKind::Canvas { canvas: PageId, frame: Option<ShapeId>, height: u16 }, exactly like an inline database:

  • /canvas makes a new canvas as a subpage and puts the block where you typed. Pasting a canvas’s link, or dragging a canvas from the sidebar into a page, makes a block for an existing one.
  • The block shows a live preview: the whole board fitted (or the chosen frame), drawn by the same renderer, read-only, updating as the canvas changes. Its height defaults to 360 px and drags from 200 to 1200 px (height). Wheel and two-finger gestures over it scroll the page, not the preview, so a canvas never traps the scroll.
  • Hovering shows Open (full screen) and a frame picker (“Whole canvas”, or one of its frames). Clicking or tapping the preview opens the canvas, zoomed to what the preview showed.
  • If the reader can’t see the canvas (it’s private to someone else, §1.11), the block shows the same “You don’t have access to this page” card a linked restricted page does.

A page in a canvas is a page shape, a page card:

  • Drag a page from the sidebar onto the board, paste its link, or use the toolbar’s Page tool to pick one (or make a new one).
  • The card shows the page’s icon, title and its first blocks, read-only, cut off at the card’s height with a fade. Cards load their page only when on screen and zoomed in past 40%; below that they draw as title only. Double-click (double-tap) opens the page in the side peek on desktop and full screen on phones.
  • A database shows as a card with its title and row count. A canvas on a canvas shows its preview.
  • A card for a page the reader can’t see draws as a grey “No access” card with no title.

Images dropped or pasted on the board become image shapes in the attachment store, as image blocks are.

1.6 Tools

One toolbar, floating at the bottom centre on desktop (--bg-elevated, --shadow-md, radius 12) and a bottom bar on phones (§1.9). Every tool has a key; the key list is in the “?” menu.

ToolKeyWhat it does
SelectVClick to select, drag to move, shift-click to add, drag on empty board for a marquee. Handles resize (shift keeps the ratio) and rotate. Snaps to other shapes’ edges and centres within 6 screen px, with pink guides; hold ⌘ (Ctrl) to not snap.
HandH, or hold SpaceDrag to pan.
Sticky noteNClick to place a 200×200 note in the last colour used (yellow first) and start typing. Tab in a selected note makes the next one beside it. Notes grow taller as their text does.
TextTClick to type free text; drag to set a width it wraps at.
ShapeR (rectangle), O (ellipse), D (diamond), then the menu for triangleDrag to draw; click for a 160×100 default. Typing with a shape selected writes its label.
ConnectorADrag from a shape (its four side anchors light up) to another; the line follows both as they move. Straight or elbow (right angles, routed around the two ends’ boxes), and arrowheads at either end. A connector can have a label.
LineLA free line or arrow not tied to shapes.
PenPFreehand ink, pressure-sensitive with a pen. Three widths, the palette’s colours, and a highlighter (40% opacity, drawn under other shapes).
EraserEDeletes whole strokes (and lines) it touches. Not a pixel eraser.
FrameFDrag to make a named area. Shapes dropped in it move with it. Frames list in the Frames panel, the canvas’s outline (§1.10).
Page—Places a page card (§1.5).
Image—Picks a file.

With something selected, a style bar floats above it: colour (the eight palette colours), fill (none, light, solid), stroke width and dash, font size (S/M/L/XL) and alignment for text, arrowheads and route for connectors, and “…” (bring forward/back, group, lock, duplicate, copy as PNG, delete). Copy and paste work between canvases and between devices as JSON on the clipboard (with a PNG beside it for other apps); pasting plain text makes notes, one per paragraph.

Zoom: 10%–800%. ⌘+ / ⌘− / ⌘0 (100%) / ⇧1 (fit all) / ⇧2 (fit selection). The zoom level and a minimap toggle sit bottom-right.

1.7 Drawing it, and the performance budgets

How it’s drawn: one <canvas> (2D) for everything that isn’t text (shapes, connectors, ink, frames’ borders, selection), redrawn on demand; and one DOM layer of the text (notes, labels, page cards) as absolutely positioned elements inside a single container with a CSS transform. Pan and zoom change that one transform and redraw the canvas; nothing re-lays out. Only shapes in view (plus a screen’s margin) have DOM or are drawn: a uniform-grid spatial index in TS finds them. While a pinch or wheel zoom is in progress the text layer scales with the transform and is re-rendered crisp when the gesture settles (150 ms). The note being edited is a ProseMirror editor restricted to its section’s blocks, reusing the page editor’s schema and binding.

The canvas UI is its own chunk, loaded when a canvas or a canvas block first appears, so the main bundle’s budget holds.

Budgets, checked in CI (desktop via cargo xtask budgets, browser via the web tests in Chromium), changed only by editing xtask/src/budgets.rs or compress.mjs:

WhatBudget
Pan and pinch-zoom a board of 1,000 shapes + 300 ink strokes (half with text)p95 frame ≤ 16.7 ms (60 fps) on CI; the target on a 120 Hz Mac or iPad is 8.3 ms, measured by hand, not gated
The same at 5,000 shapesp95 frame ≤ 33 ms (30 fps): it must degrade, not fall over
Open that 1,000-shape canvasfirst full paint ≤ 300 ms after the document is loaded
Core: move 100 selected shapes (one commit and its update)p95 ≤ 2 ms
Core: add one notep95 ≤ 0.5 ms (as a keystroke)
Document size: 1,000 notes with a sentence each≤ 200 KB snapshot
Document size: one 300-point stroke≤ 1.5 KB
RAM: open the 1,000-shape canvas≤ 60 MB over the idle budget
Download: the canvas chunk≤ 45 KB brotli; main bundle unchanged at 185 KB

1.8 Mouse, trackpad, touch and pen

All input is Pointer Events, with touch-action: none on the board.

  • Trackpad: two-finger scroll pans; pinch zooms (it arrives as ⌘-wheel). Mouse: wheel pans, ⌘/Ctrl-wheel zooms, middle-drag pans.
  • Touch: two fingers always pan and pinch-zoom, whatever the tool. One finger uses the tool; with Select, one finger on empty board pans (a marquee is long-press then drag). Long-press a shape for its menu. Double-tap empty board with Select to make a note.
  • Pen (Apple Pencil, Android stylus, Windows pen): the pen draws with Pen, whatever tool was chosen for fingers, and pressure sets the width. Once a pen has been used on this device, “Fingers pan, pen draws” turns on (palm rejection: touches while the pen is down are ignored); it’s a switch in the toolbar’s “…”, per device. Pencil hover (iPadOS), where WebKit reports it, shows a dot where the ink will land.
  • Edge swipes are left to the system: no gesture starts in the outer 16 px on phones, so Android’s back gesture and iOS’s swipe still work.

1.9 Phones (≤ 700 px)

  • The canvas is full screen under the top bar (title, sync dot, “…”); the tab bar steps aside.
  • Bottom toolbar: Select, Hand, Note, Pen, Shape, “+” (Text, Connector, Frame, Page, Image), 44 px targets, padded by env(safe-area-inset-bottom). The style bar is a bottom sheet.
  • Editing a note’s text zooms so the note sits above the keyboard (visualViewport) and shows the phone formatting toolbar; done returns to where you were.
  • Phones are full editors, but the design targets reading, notes and ink there; precise layout work is for bigger screens. A tablet (> 700 px) gets the desktop layout with touch targets.

1.10 Keyboard, screen readers, the frame list

  • The board is a region labelled with the canvas’s title. Tab moves through shapes in reading order (frames left to right, top to bottom; inside each, top to bottom); the focused shape is selected and scrolled into view. Enter edits its text, arrows move it 1 px (Shift: 10 px), Delete removes it, Esc leaves.
  • A hidden list mirrors the board for screen readers: each item is “Sticky note, yellow: <text>”, “Connector from <a> to <b>”, “Frame <name>, 6 items”.
  • Frames panel (the canvas’s version of Phase 9’s outline): the right-edge strip and its card list frames instead of headings; clicking one zooms to it. On phones it’s in “…” → Frames. “Present” steps through frames full screen with ←/→ (or swipes).
  • Reduced motion turns off zoom animations.

1.11 History, sharing, guests and private pages (Phase 9)

A canvas is a page, so Phase 9 applies as it is:

  • Version history: the list, grouping, named versions and restore all work unchanged (restore is fork_at and a new edit). The selected version is drawn as a read-only board at that version, fitted to what changed: added shapes outlined in --accent, changed ones in --warning, deleted ones as 40% ghosts in --danger, and text changes highlighted inside notes as on a page. The row’s summary says what changed: “Added 3 notes · moved 12 shapes · 4 strokes”.
  • Updates & analytics: edits appear in the feed as “Sam edited Canvas” with the same counts (no excerpts of ink). Views count as page views.
  • Workspaces, private pages, guests: a canvas can be moved to Private, shared with a guest or a member, and is subject to their role. A viewer pans, zooms, opens page cards and follows links, but can’t change anything; the toolbar shows only Hand and Frames.
  • Access is checked per document, as always: a page card or canvas block for a page the reader can’t see is a “No access” card (§1.5). Putting a private page on a shared canvas never shares the page.
  • Publish to web (Phase 5): a published canvas is rendered by the server as a static SVG of the board (text as HTML in foreignObject), in a page that scrolls and zooms with the browser’s own controls. No JavaScript, as for published pages. Page cards on it link to the page if that page is published too, and are titles only otherwise. “Include subpages” covers cards’ pages as it covers subpages.
  • Agents (MCP) read a canvas’s text through the existing page tools. Writing shapes from an agent isn’t in this phase.
  • Search and Ask find text in notes and shapes; opening a result zooms to the shape and flashes it.

1.12 Not in this phase

Live cursors and selections of other people (needs presence in the sync protocol); comments on shapes; nested frames; pixel erasing; templates; mind-map layout; Excalidraw/tldraw import; an agent tool that writes shapes. Each is a later, separate piece.


2. Check for Updates

2.1 Where it is

Settings → About, a new section at the end of the nav, in a new group Drusite (desktop) or the last inset group (phones). It shows:

  • Drusite 1.0.0 (the app), the channel (Stable or Pre-releases), and the platform (“macOS, Apple silicon”).
  • Server: the signed-in server’s address and version, and whether they match (§2.6).
  • Check for updates, a button; below it, the result.
  • Check automatically, a switch (§2.5), and Get pre-releases, a switch (§2.4).
  • Links: Release notes (GitHub), Source code, Licence (AGPL-3.0-or-later).

On the web the section shows “Drusite 1.0.0, served by your server” and the server’s address. There’s nothing to check: the web app updates when the server does.

2.2 Finding the latest release

One Rust function, drusite_core::release::latest(channel) (feature net), used by every platform:

  • GET https://api.github.com/repos/pranavajk1/drusite/releases?per_page=20 with Accept: application/vnd.github+json and a generic User-Agent: Drusite/<version>. No token, no account, nothing about the user or their notes. GitHub’s limit for unauthenticated calls (60 an hour per address) is far above one check a day.
  • Drafts are skipped. Pre-releases are skipped unless the channel is Pre-releases. Releases whose tag isn’t v<semver> are skipped. The highest version wins (semver order, so 1.0.0 beats 1.0.0-rc.2, which beats 1.0.0-alpha.7), not the newest date.
  • It returns the version, its notes (Markdown), its page URL, and its assets (name, URL, size). ETag is kept, so a repeat check that finds nothing new costs GitHub nothing.
  • The repository is a build-time constant (DRUSITE_RELEASES_REPO, default pranavajk1/drusite), so a fork that ships its own builds points its apps at its own releases.

Results: Up to date (“Drusite 1.0.0 is the latest version”); Update available (“Drusite 1.0.1 is available”, the first 12 lines of its notes and “Full release notes”); Couldn’t check (“GitHub couldn’t be reached. Check again later”, with the error in a details line). Offline, the button says so instead of trying.

2.3 Installing: what really happens on each platform

macOS, Windows, Linux (AppImage): Install and restart.

  • The app uses tauri-plugin-updater. Each desktop release carries the platform’s update bundle (Drusite.app.tar.gz, the NSIS setup.exe, the .AppImage), each with a minisign signature (.sig), and one manifest, latest.json, listing them. The app points the updater at the latest.json of the release §2.2 chose, so channels work without a second manifest.
  • The updater downloads the bundle (progress in the button: “Downloading… 40%”), checks its signature against the public key compiled into the app, and refuses anything else (“This update isn’t signed by Drusite’s release key, so it wasn’t installed”). Then the core flushes the store and the sync queue, and the app installs and relaunches. On Windows the NSIS installer runs in passive mode (a progress bar, no questions). After the restart, Settings → About says “Updated to 1.0.1”.
  • macOS and Gatekeeper, honestly (the app isn’t notarized today):
    • First install, from a browser download, is quarantined. With today’s ad-hoc signature, macOS 15+ blocks it until you go to System Settings → Privacy & Security → Open Anyway. In-app updates can’t fix this; only a Developer ID signature and notarization can.
    • In-app updates are downloaded by the app itself, not a browser, so they aren’t quarantined and Gatekeeper doesn’t stop them. The updater replaces the .app and relaunches. (To be confirmed on a real Mac during the build; if Gatekeeper does assess it, the app falls back to “Download” below.)
    • But ad-hoc signatures change with every build, and macOS ties Keychain access and microphone/screen-recording permission to the signature. So after each update, macOS asks again for the Keychain item (the store’s key) and for the meeting recorder’s permissions. That’s tolerable for alphas and wrong for 1.0.
    • Recommended: a Developer ID certificate and notarization (Apple Developer Program, $99 a year). CI signs with Developer ID and notarizes with notarytool, staples the ticket, and then: first install opens without warnings, updates install and relaunch silently, and Keychain and permissions survive updates. §2.7 says how the certificate is kept.
    • Without it, the plan still ships the updater, and the About section says on macOS: “After updating, macOS may ask again for Keychain and microphone access, because this build isn’t signed with an Apple Developer ID.” (A cheaper half-step, a self-signed code-signing certificate kept as a CI secret, would make the signature stable across updates so the prompts stop, but first install stays blocked as now.)
  • Windows: the installer isn’t code-signed. First install gets SmartScreen’s “Windows protected your PC” → More info → Run anyway. In-app updates aren’t downloaded by a browser, so they carry no Mark of the Web and SmartScreen doesn’t prompt. Signing (Azure Trusted Signing, about $10 a month) would remove the first-install warning; not recommended for 1.0.
  • Linux: the AppImage updates in place, as above. The .deb can’t self-update; on a .deb install the button becomes Download (the new .deb), with “Install it with your package manager”. Flatpak and other packages are out of scope.
  • A portable or read-only install (the app can’t write where it lives, say in /Applications without permission, or a mounted DMG) gets “Drusite can’t update itself here. Move it to Applications, or download the update” with Download.

Android: Download opens the release’s APK asset (drusite-1.0.1-arm64.apk) in the system’s browser/downloader, which installs it with the usual “allow installs from this source” prompt; Release page opens the GitHub page. A line says “Using Obtainium? It updates Drusite for you.” An in-app APK installer (REQUEST_INSTALL_PACKAGES) isn’t in this phase: it’s an extra permission for something the browser already does.

iOS: there’s no build of Drusite to install outside the App Store or TestFlight, so iOS shows “Drusite 1.0.1 is available” with Release notes, and nothing to download. (If a TestFlight or App Store build ever exists, this becomes a link there.)

Web: nothing (§2.1).

2.4 Stable and pre-releases

  • A tag with a pre-release part (v1.1.0-beta.1) is a GitHub pre-release; a tag without one is a stable release, as android.yml already decides.
  • Get pre-releases is off by default on stable builds and on by default on pre-release builds, so someone running an alpha keeps getting alphas until they turn it off. It’s per device.
  • Turning it off on a pre-release build means “the next stable release that’s higher than this one”: an alpha of 1.1 won’t offer 1.0.3.
  • Nothing ever downgrades. A version lower than or equal to this one is never offered.

2.5 Checking on launch

Check automatically, on by default, with the description “Once a day, Drusite asks GitHub whether there’s a newer version. Nothing about you or your notes is sent.” When on, the app checks 10 s after launch if the last check was more than 24 hours ago, and then once a day while running. If there’s an update, a toast says “Drusite 1.0.1 is available” with View (opens About) and dismiss. Dismissing it skips that version for automatic checks (not for the button). It never downloads or installs without a click. Off, the app never contacts GitHub unless you press the button.

2.6 The server’s version against the app’s

The app already gets server_version in Welcome; About shows it, and the comparison uses major.minor (patch releases are always compatible):

CaseWhat About saysElsewhere
Same major.minor“Up to date with your server”Nothing.
Server older“Your server runs 1.0.2, older than this app. Some features need its admin to update it.”Features that need the newer server say so where they are (below).
Server newer“Your server runs 1.2.0. Update this app to get everything it offers.” with Check for updatesNothing.
Protocol differs(already handled: sync refuses with its message)

New unauthenticated route GET /api/v1/version → {"version": "1.0.0", "protocol": 1}, so the sign-in form can say “This server runs Drusite 0.1.0-alpha.7, which is older than this app” before signing in.

Features gated on the server’s version: making a canvas needs a 1.0 server (older servers refuse canvas documents, §1.2), so on an older server New page → Canvas is disabled with “Your server needs Drusite 1.0 for canvases”. The reverse case, an app too old for a document, shows the NewerSchema refusal as “This page needs a newer version of Drusite” with Check for updates.

2.7 Keys: what Pranava makes, where it lives, what an agent never touches

There are up to two secrets, both made by Pranava on his own machine and stored in Doppler alongside the Android keystore (the one repository secret, DOPPLER_TOKEN, already reads that config). An agent never generates, sees, copies, holds or approves them, and never answers a Keychain or OS prompt for them.

The updater signing key (required):

  1. On his Mac: npx tauri signer generate -w ~/.tauri/drusite-updater.key, with a strong password (from his password manager). It writes the private key and drusite-updater.key.pub.
  2. Add to Doppler: TAURI_SIGNING_PRIVATE_KEY (the private key file’s contents) and TAURI_SIGNING_PRIVATE_KEY_PASSWORD.
  3. Keep an offline backup of the private key and its password (password manager plus one offline copy). If it’s lost, installed apps can never update in place again: everyone would have to download a new build by hand once, with a new public key.
  4. Give the agent the public key (the .pub file’s one line). It goes in tauri.conf.json under plugins.updater.pubkey, committed. That’s the only part of the key in the repository.

The release workflow fetches the private key from Doppler only in the desktop build jobs on v* tags, masks it, and deletes the temporary copy at the end, as android.yml does with the keystore. Pull requests build unsigned update bundles (or none), never with the key.

The Apple Developer ID (if he chooses §2.3’s recommendation):

  1. Join the Apple Developer Program; in Xcode or the developer site, create a Developer ID Application certificate; export it with its private key as a .p12 with a password.
  2. Create an App Store Connect API key (Users and Access → Integrations, role Developer) for notarization: the .p8 file, its Key ID and Issuer ID.
  3. Add to Doppler: APPLE_CERTIFICATE (the .p12, base64), APPLE_CERTIFICATE_PASSWORD, APPLE_SIGNING_IDENTITY (“Developer ID Application: … (TEAMID)”), APPLE_API_KEY (the .p8, base64), APPLE_API_KEY_ID, APPLE_API_ISSUER.
  4. The macOS job imports the certificate into a temporary keychain that it deletes at the end, and Tauri’s bundler signs and notarizes with those variables.

2.8 Release builds: one release, every platform

Today android.yml creates the GitHub release. With desktop builds that would race, so:

  • release.yml (new), on v* tags only: calls the Android build (android.yml becomes reusable with workflow_call, and keeps its pull-request check) and the new desktop build, then one Release job that
    • downloads every artifact;
    • writes latest.json from the desktop jobs’ .sig files (.github/scripts/latest-json.sh: version, notes, publish date, and darwin-aarch64, darwin-x86_64, windows-x86_64, linux-x86_64 URLs and signatures);
    • writes one SHA256SUMS over everything;
    • runs gh release create --verify-tag, with --prerelease for a tag with -, and --latest otherwise, attaching all of it.
  • desktop.yml (new, reusable, also run on pull requests that touch crates/drusite-app, ui or the workflow, without signing): a matrix of
    • macos-latest: universal-apple-darwin (Apple silicon and Intel in one app; minimum macOS 12.3 as today), .dmg plus the updater’s .app.tar.gz and .sig, signed and notarized when the Apple secrets exist, ad-hoc otherwise;
    • windows-latest: NSIS -setup.exe and its .sig;
    • ubuntu-22.04 (the oldest glibc we support, for the AppImage’s reach): .AppImage and .sig, and .deb. bundle.createUpdaterArtifacts: true in tauri.conf.json makes the update bundles.
  • image.yml is unchanged except §3’s tags.
  • Asset names: Drusite-1.0.0-macos-universal.dmg, Drusite-1.0.0-macos-universal.app.tar.gz, Drusite-1.0.0-windows-x64-setup.exe, Drusite-1.0.0-linux-x86_64.AppImage, drusite_1.0.0_amd64.deb, drusite-1.0.0-arm64.apk, latest.json, SHA256SUMS.

2.9 Versioning

Keep one version for everything (app on every platform, server, web app, Helm chart’s appVersion), bumped together on every release. New: cargo xtask bump <version> writes it to Cargo.toml’s [workspace.package], crates/drusite-app/tauri.conf.json and Cargo.lock, runs version.sh, and prints the tag command. Android’s versionCode stays 1000 + run number (always increasing). From 1.0: a patch release never changes the sync protocol or the server’s database in a way an app one minor version behind can’t handle; that’s what §2.6’s major.minor rule promises.

2.10 Tests

  • release::latest against recorded GitHub responses: channels, drafts, odd tags, semver order, never downgrading, ETag, errors.
  • Updater: a CI job builds two versions of the desktop app, signs them with a throwaway test key generated in the job (never the real one), serves the second from localhost, and checks the first updates to it and relaunches (macOS and Linux; Windows if the runner allows the installer). A bundle signed with another key must be refused.
  • UI: the About section’s states (up to date, available, downloading, failed, server older/newer, web) in the memory-core browser tests.
  • Real apps during the build: Mac debug build, Android emulator, iOS simulator and web, as every phase.

3. Release checklist for 1.0.0

Pranava decides when; this is what the cut takes.

  1. Merged: #37 (Phase 9) and this phase, CI green on every platform.
  2. Secrets in Doppler: the updater key (§2.7, required); the Apple Developer ID and API key (if chosen). A dry run: workflow_dispatch of release.yml on a v1.0.0-rc.1 tag, as a pre-release, installs on a Mac, Windows and Linux machine, and an rc.2 updates it in place.
  3. Bump: cargo xtask bump 1.0.0 → Cargo.toml, tauri.conf.json, Cargo.lock say 1.0.0; deploy/helm/drusite/Chart.yaml version: 1.0.0, appVersion: "1.0.0" (the workflow still sets both from the tag when it packages).
  4. Docs: README’s status line (it still says Phase 2 and “nothing here is a usable app yet”), install instructions per platform including the first-install Gatekeeper/SmartScreen steps, a CHANGELOG.md starting at 1.0.0, deploy/ docs pinning :1.0.0 instead of :main.
  5. Stable, not pre-release: the tag is v1.0.0 (no -), so release.yml creates a normal release with --latest. Stable builds default to the Stable channel; alpha users keep pre-releases on until they switch it off (one line in the notes says how). Obtainium users can turn off “Include prereleases”.
  6. Workflow changes for stable:
    • image.yml: add type=semver,pattern={{major}} (gives :1), and latest only for stable tags (docker/metadata-action’s latest=auto already skips pre-releases; check the output). :main stays the moving development tag.
    • android.yml: stops creating the release itself (now release.yml’s job); the APK and checks unchanged.
    • desktop.yml: signing and notarization required on tags (a missing secret fails the release, as Android’s keystore does).
  7. Mac signature change: if 1.0 is the first Developer ID build, alpha users’ Keychain item was made under the ad-hoc signature; the first launch of 1.0 asks once to allow it. Say so in the notes.
  8. Tag: git tag -s v1.0.0 -m "Drusite 1.0.0" and push it (signed, over HTTPS). Then check the release page has every asset, latest.json verifies, cosign verify passes for the image and chart, and an alpha.7 desktop app offers 1.0.0.

4. Decisions for Pranava

One recommendation each.

  1. Apple Developer ID and notarization ($99/year) for 1.0. Recommend yes: without it, every first install on a Mac goes through “Open Anyway”, and every update re-asks for Keychain and microphone access.
  2. Windows code signing. Recommend not for 1.0: SmartScreen warns once on first install; updates aren’t affected. Revisit if Windows users complain.
  3. Where the updater key lives: Doppler, next to the Android keystore, with an offline backup that only you hold. Recommend yes. You run tauri signer generate; the agent only gets the public key.
  4. Channels and the launch check: pre-releases off on stable builds and on for alpha builds; check once a day on launch, on by default, notify only (never auto-install). Recommend as written.
  5. The name: “Canvas” in the UI. Recommend “Canvas” (short, and not tied to one app’s vocabulary); “Whiteboard” is the alternative.

Phase 11: end-to-end encryption, and 1.0.0

Status: approved, with every recommendation in §16, and with agents reaching encrypted workspaces over MCP through an agent device as part of 1.0 (§6.4). Being built in the order of §13.

Changed from the plan, so far

Kept up to date as each step of §13 lands.

  • Keys and certificates travel inside sync (step 3). A workspace’s container keys (wrapped to the member) and the certificates of the devices that sealed a batch of entries come with Updates, the first time a connection needs them. There are no extra REST calls, so the browser’s worker and the native driver only pass frames, as before.
  • A device that doesn’t know a workspace is encrypted is told so (step 3). The server answers its subscription with a new error code, Encrypted, and the device subscribes again sealed. The workspace list (GET /api/v1/workspaces) also says encrypted, and the native app notes it ahead of time.
  • A snapshot declares no peers (step 3). A snapshot carries everyone’s changes, which their own updates already registered. So the server records no peers for it, and devices check peers only on updates. Snapshots are trusted as written by a member who may edit, as §4.4’s checks already assume. A member with the key could slip forged changes into one. That’s listed for the independent review (decision 6).
  • Device snapshots are stored by the server as the system (step 3). Only the server’s own compactor ever wrote document_snapshots and changed document_updates. Once a sealed snapshot passes every check, the push’s own transaction finishes as the system. A new row-level policy lets only the system mark updates replaced.
  • Key work travels in sync (step 4). The server can’t make a wrap or a key. When a device that may share connects, it gets KeyWork: people waiting for a container’s key, or a key due to rotate. It answers with ShareKeys or Rotate, which the server checks: wraps only to people with access, and a new epoch wrapped to exactly them. The first device online does it, so a newcomer waits for one of them.
  • Removing a member rotates every key of the workspace (step 4), its own and each tree’s, rather than working out which trees they had. Taking someone off one page rotates only that page’s tree.
  • A moved page’s old log is deleted, not kept 14 days (step 4), unlike a compacted one. It was sealed under the key of where the page was, which people who just lost access hold.
  • Opening an entry uses the container its header names (step 4), when this device has that key. A page another device just moved arrives under its new tree’s key before this device has caught up with the move.
  • The memory budgets are 50 MB higher, for now (asked for during step 4): idle RAM 300 MiB (500 on Linux CI) and the browser tab 98 MB. Linux CI was already measuring 444–452 MiB against 450 on main. §12’s “Idle RAM unchanged” still holds for what this phase adds.
  • A published page’s link token is kept readable (step 5) in encrypted workspaces. Standard workspaces seal it with the workspace key, which the server no longer has here; the token is the address of a page the server shows anyone who has it anyway.
  • The device, not the server, writes a published page’s share state into an encrypted workspace’s document (step 5), right after the server answers a publish, unpublish or new link.
  • Unpublishing deletes the copy’s readable files from storage too (step 5), unless another published page shows the same file.
  • The web app’s JS budget is 1 KB higher (step 5): 186 KB brotli. The main chunk was already within 200 bytes of 185 KB before publishing copies were added.
  • Your own document is a tree only you are in (step 5, §6.3). The server stores it as kind account with tree_id its own ID, so the policies that keep a tree to the people it’s shared with keep it to you, and its key is wrapped to you alone. Its first key comes from the account’s container seed, so every one of your devices makes the same one. A device makes the document with its first chat. If two did before hearing of each other, the server’s copy wins and the other’s chats go into it.
  • Phones don’t make vectors yet (step 5, §6.1). Desktops make them in the background. A phone searches by meaning with the vectors it has, which is none until it can tell it’s charging.
  • Meeting notes with the opt-in keep their progress in the job (step 5, §6). The server can’t write the Status column, so devices copy it in. Such a job keeps no parts to resume from: a restart begins again.
  • Analytics has a per-workspace switch (step 5, §6). “As today” was the server’s switch alone. Owners now have one too, beside the opt-in in Workspace settings → AI: off by default in an encrypted workspace, on in a standard one.
  • The browser asks, makes vectors and makes meeting notes only with the opt-in (step 5). It has no models of its own.
  • An agent device keeps one store per workspace (step 6, §6.4), each holding its identity, since a store holds one open workspace at a time. One MCP endpoint serves them all.
  • The agent device’s binary is drusite, with agent enroll and agent run (step 6). For a container’s first start, run enrolls first when it’s given a server and a code.
  • An agent device checks tokens with POST /api/v1/agent-devices/introspect (step 6), signed in as itself, rather than RFC 7662’s form endpoint. The server narrows the grant there to the workspaces the agent device holds and its own access.
  • The keys of trees an agent device may hold come through its person’s key work (step 6): approving it wraps only the workspaces’ own keys. After a rotation, its person’s devices wrap the new key to it, as they do for a new member.
  • Agent devices can’t publish (step 6): publishing makes a readable copy, which only the person’s own devices make.
  • A workspace being converted is encrypted, with converting saying which way (step 7, §8), rather than a converting state of its own: everything that treats a workspace as encrypted does so from the start, and each document’s own state says whether it’s sealed yet. A device subscribed the wrong way is told so (Encrypted, or the new Standard).
  • Old copies of files go when the conversion ends (step 7), not 14 days later: each page’s files are converted before its snapshot is, so nothing points at them by then.
  • Agents move to the agent device only when their grant reaches just this workspace (step 7). A grant that reaches others too stays on the server’s /mcp, which now names the agent device for this one.
  • Conversion runs in the apps (step 7). The browser shows where it’s up to, but a device that holds the keys and has the pages does the work.
  • Ask chats stay on the server until each person’s device moves them (step 7), into their own sealed document, when it first sees the conversion.
  • Account deletion is new (§14, item 8): there was none before, for any account. Settings → Account deletes the account, its sign-ins, keys, agent devices and the workspaces only it was in, at once; the workspaces it leaves rotate. It’s refused while the account is the last owner of a workspace others are in. created_by on workspaces and documents may now be empty.
  • The web app’s budgets are 1 KB (JS, 187 KB) and 2 KB (encryption screens, 14 KB) higher (§14): exporting, Members listing agent devices, deleting an account and starting over with new keys came to 718 and 1,086 bytes over.
  • The clean export is in Notion’s layout (§14, item 7), as a zip made on the device: Markdown pages, CSV databases, files beside them. Drusite’s Notion import reads it back.
  • Starting over after losing everything (§3.5) is “Lost every device and your recovery key?” on the Security screen. The other members accept the changed safety code, rather than a separate “Give access again”.
  • The Updates & analytics, Ask and search code on the server see encrypted documents as missing (store::load answers nothing for them), and the search queue never takes one. Step 5 gave each its device-side version (§6), and the opt-in its routes: ask/prompted, embed, and the sealed meeting job.

The plan in brief

  1. End-to-end encrypted workspaces. A workspace is either end-to-end encrypted or standard. In an encrypted one, every page, title, database, canvas, journal entry, meeting and attachment is sealed on the device with keys only its members’ devices hold. The server stores and relays ciphertext it cannot read. A standard workspace works exactly as it does today, so the server can still read it for its AI, agents and meeting jobs.
  2. Keys that survive real life. Each account has its own keys. A new device is approved from one you already have, by comparing a code. A 24-word recovery key works when every device is gone. None of this depends on how you sign in (passkey, OIDC, password or magic link).
  3. Sync, history and sharing over ciphertext. Loro updates are sealed and signed by the device that wrote them. Devices compact documents instead of the server, so Phase 9’s full history survives. Workspaces, invites, guests, private pages and single-page sharing all keep working. Removing someone rotates the keys.
  4. Every server feature that reads text gets a decision. Search and Ask move to the device. Meeting transcription runs from the device. Publishing uploads a readable copy only when you publish. A per-workspace opt-in lets your server’s AI read pages when you ask it to.
  5. Agents reach encrypted workspaces over MCP. An agent device (drusite agent, a headless Drusite) runs wherever the agent runs, is approved like a new phone, holds keys only for what you give it, and serves the same MCP tools. Agents sign in to it exactly as they sign in to the server’s /mcp today. The desktop’s local MCP works too. The server still never holds a key.
  6. Converting existing workspaces, one document at a time, resumable, with nothing lost.
  7. 1.0.0: this phase, plus Phase 10’s release checklist, a frozen protocol and a published security design.

As in every phase, design/DESIGN.md decides how it looks. Everything behaves the same on macOS, Windows, Linux, iOS, Android and the browser, and where a platform can’t do something the app says so where you’d look for it. Nothing assumes a particular deployment, identity provider or AI provider. Examples use made-up names (“Sam”, “Alex”, “Work”).


0. What the code says today

These facts decide most of the plan.

FactWhereWhat it means here
The server seals everything with a per-workspace data key (XChaCha20-Poly1305, random 192-bit nonces, AAD binding workspace, key version and object). The key is wrapped by a master key from the key source (env, file or a KMS).drusite-server/src/crypto.rs, keys.rs, workspace_keys in 0001_core.sqlThis is encryption at rest. The server unwraps the key to serve members, so the operator can read everything. The sealing format is reusable on the device. workspace_keys stays for standard workspaces.
The server parses every update. check_blob decodes Loro’s blob metadata, append_as refuses a log with a hole (Gap), Subscribed.version is the server’s version vector, check_first_snapshot loads the document to check its ID, and compact imports the log into a LoroDoc after 500 updates.sync/store.rsNone of this can happen over ciphertext. Gap checks, version vectors and compaction move to the devices (§4).
The peer register (document_peers) binds each Loro peer to a person and device grant, from the peers the server reads out of each update. It refuses a peer that belongs to someone else.0011_history.sql, store::record_peersThe device must declare its peers in clear and sign each push, so the binding still holds and members can’t forge each other’s edits (§4.2).
The server edits documents itself. Moving a page between Workspace and a restricted tree is access::move_to: it loads the workspace document, moves the entry and appends the updates. The OAuth consent page reads root page titles. Members read the workspace’s name from its document. Meeting jobs write transcripts into pages.access.rs, auth/oauth.rs, members.rs, meetings.rsIn an encrypted workspace, the device makes every one of these edits and the server only stores them (§5, §6).
Server features read plaintext: the indexer (search_blocks tsvector, search_embeddings pgvector), Ask’s retrieval and prompts, server-side MCP, meeting transcription and summaries, publishing’s renderer, and the Updates feed’s titles.search/, ask/, mcp.rs, meetings.rs, publish/, analytics.rsEach gets a line in §6: what moves to the device, what becomes opt-in, what is lost.
The device already has full-text search (tantivy, in memory only, never written to disk), and the browser has its own in-memory index.drusite-core/src/search*Search by words in an encrypted workspace already works offline. Search by meaning needs a local vector index.
Attachments are named by the BLAKE3 hash of their plaintext, and the server checks uploads against it.attachments.rs (both crates)A hash of the plaintext lets anyone with a candidate file test whether it’s in a workspace. Encrypted attachments are named by the hash of their ciphertext instead, so the server keeps its integrity check (§7).
The device’s store is SQLCipher with one 32-byte key in the OS keychain or keystore. In the browser that key is wrapped by a non-extractable WebCrypto key in IndexedDB and wiped on sign-out.drusite-core/src/key.rs, docs/phase7.mdAccount and device keys live inside the encrypted store, so no new keychain item and no new OS prompt (§3.7).
Restricted pages (private, shared with some people, shared with guests) live in tree documents that only the people in page_access can sync.access.rs, 0013_access.sql, docs/phase9.mdEach tree becomes a key container of its own. The server still enforces page_access. Encryption makes that check a second line, not the only one (§5.3).
The Notion import runs on the device (zip or Notion’s API, straight from drusite-core).drusite-core/src/database/notion*.rsNothing changes. What it makes is sealed like any other page.
Crypto crates already in the tree: chacha20poly1305, aead, hkdf, sha2, blake3, argon2, ed25519-dalek, curve25519-dalek, getrandom, zeroize. cargo vet and cargo deny gate new ones.Cargo.lock, supply-chain/, deny.tomlMost of what’s needed is already vetted. §9 adds HPKE and a post-quantum KEM.
PROTOCOL_VERSION is 1. A change that old clients can’t ignore is a new version and subprotocol.drusite-proto/src/lib.rsEncrypted documents need protocol 2. Standard documents keep working on 1, so an old app isn’t cut off from a standard workspace.

1. Threat model

1.1 Who we defend against

  • The server’s operator, and anyone who gets what the server has: the database, its backups, the S3 bucket, the key source, the server’s memory, its logs. For an encrypted workspace, none of that is enough to read your notes.
  • Someone who was removed from a workspace or a page. They lose everything written after their removal, even if they still have a copy of the database.
  • Another member forging edits. History’s “who changed this” must be true even against a member with the workspace’s key.
  • The network, as today: TLS, DPoP-bound tokens.

Out of scope, and the security page says so:

  • A compromised device that’s unlocked. It holds the keys and the notes, as any notes app’s device does.
  • The host of an agent device you add. It holds keys for what you gave it, by design (§6.4).
  • A server that changes the code it serves to the browser. The web app comes from the server. An operator who changes it can steal keys from that browser (§1.4).
  • A server that lies about someone’s public key, unless you compare safety codes (§3.6).
  • Availability. A server can refuse, delay or withhold updates. Devices notice some of this (§1.4) but can’t prevent it.

1.2 What the operator can and can’t see

In an encrypted workspaceIn a standard workspace (today)
Page text, titles, icons, properties, database columns, options, views and valuesNoYes
The page tree: which page is inside which, the sidebar’s order, the trashNo (it’s in the workspace document)Yes
The workspace’s name and icon, journal and meeting settingsNoYes
Canvas content, journal entries, meeting audio, transcripts and summariesNoYes
Attachment contents and file namesNoYes
Version history’s content, named versions’ namesNoYes
Ask questions and answers, search queriesNo, unless you opt in to the server’s AI for that workspace (§6)Yes
Who is a member and their role; guests; who has which restricted treeYes. The server enforces access, so it must know.Yes
How many documents there are, and which restricted tree each page document belongs toYes, as opaque IDsYes
Each document’s size, to within padding (§4.1), and each attachment’s size, to within paddingYesYes
When each person’s device pushes to which document, and from which addressYes. That’s when you type.Yes
Loro peer IDs (random 64-bit numbers) and which person and device each belongs toYesYes
Page views (Analytics), if the workspace turns Analytics onYes, by document ID, never by title. Off by default in encrypted workspaces.Yes
Published pagesYes. Publishing uploads a readable copy (§6).Yes
What an agent readsNo, through the server. An agent device (§6.4) reads what you gave it, on its own host, which you choose and trust.Yes, through the server’s /mcp

So an operator learns a workspace’s shape: who works with whom, how many pages there are, roughly how big they are and when they change. They learn nothing of what the pages say.

1.3 What happens to the server’s own at-rest encryption

It stays for standard workspaces. For encrypted ones, the device’s ciphertext is stored as it is, with no server layer on top: a second layer would protect nothing the first doesn’t, and it would cost a key the server must keep.

1.4 Limits, said plainly

  • The browser. The web app runs code the server sends it. Against an operator who’s curious, or a stolen database or backup, the browser is as safe as the apps. Against an operator who ships modified JavaScript, it isn’t. Settings → Security says so the first time you open an encrypted workspace in a browser. The desktop and phone apps are signed builds from GitHub releases, and they don’t run code from the server.
  • Withheld updates. A server can hide one device’s edits from another. Loro reports an update whose dependencies never arrive as pending. A document left pending for more than a day shows “Some changes to this page haven’t arrived. Your server may be missing them.” A device also checks, after a snapshot, that the server still has everything it pushed (§4.4).
  • Removed people keep what they had. Rotation protects what’s written after the removal. It can’t reach into a copy someone already downloaded. Phase 9 already says this on the Members screen.
  • Viewers hold the history. As Phase 9 already noted, a viewer’s device has the full document, history included. Encryption doesn’t change that.

2. Encrypted or standard, per workspace

The choice is made per workspace. The roadmap always said “end-to-end-encrypted spaces”, and the reason holds. Account AI providers and meeting jobs that outlive a locked phone need the server to read, and so does any agent that should work without a device of yours that holds keys. Some people want that for a workspace, and some want the opposite. One account can have both, side by side in the switcher.

  • New workspace asks: End-to-end encrypted (“Only your devices and the people you share with can read it. Your server’s AI can’t, and agents reach it through an agent device.”) or Standard (“Your server can read it, so its AI, agents and meeting jobs work.”). The server’s owner sets what’s offered: [e2ee] new_workspaces = "ask" | "encrypted" | "standard", default "ask" (decision 1).
  • An encrypted workspace shows a lock beside its name in the switcher, and Workspace settings → General says “End-to-end encrypted” with a link to what that means (§1.2, in plain words).
  • Converting: owners can turn encryption on for a standard workspace (§8), and off again, which is the same process in reverse. Both are resumable and lose nothing.
  • The first workspace of a new account follows the server’s setting. If it’s "ask", the question is part of the first-run screen.

3. Keys

3.1 The hierarchy

Recovery key (24 words; only you hold it)
  └─ decrypts → Account root key (ARK), versioned
Device key pairs (one per device; private half never leaves it)
  └─ receives the ARK when another device approves it
ARK
  └─ seals → the account's identity keys:
       • signing key pair (Ed25519): signs device certificates and key changes
       • encryption key pair (X25519 + ML-KEM-768, hybrid): receives container keys
       • the account container key: seals your own documents (Ask chats)
Container keys (32 bytes, versioned by epoch), one per:
  • encrypted workspace (its workspace document and every page in it)
  • restricted tree (private pages, pages shared with some people, guest trees)
  └─ wrapped to each member's account encryption key (HPKE)
  └─ each epoch also seals the previous epoch's key (a chain, so history stays readable)
Document keys = HKDF(container key at epoch e, document ID): derived, never stored
  └─ seal each update and snapshot of that document
Attachment keys: random per file, kept in the block that shows the file (inside the page)

Why this shape:

  • The account root key is the one thing a device needs. A new device gets it once and can then unseal everything else from the server. Recovery is a wrap of the root key and nothing more.
  • The recovery key is a key pair. The 24 words are the private half. The public half is stored with the account, so any device can wrap a new root key to it without ever knowing the words. When keys rotate after you lose a device, your recovery key keeps working and you don’t have to type it.
  • Container keys are wrapped per person, not per device. Adding a device touches no workspace. Inviting Sam is one wrap per container.
  • Document keys are derived, not stored. Rotating a container’s key changes every document key in it at once, with no table of page keys to keep in step. This covers the brief’s “page keys”: each page has its own key, but it’s never stored anywhere.
  • Moving a page to another container re-seals it under the new container (§5.3). There’s no per-page key to carry around, and nobody who loses access keeps one.

3.2 Setting up, and the recovery key

Encryption keys are made the first time you need them: when you create or join an encrypted workspace, or are invited to an encrypted page. Someone who only ever uses standard workspaces never sees this.

  1. “Set up encryption”. The device makes the root key, the identity keys and the recovery key. It uploads the identity keys’ public halves, the private halves sealed by the root key, and the root key wrapped to the recovery public key.
  2. “Save your recovery key” shows the 24 words, with Copy, Save as PDF (a printable page with the server’s address and the account’s email, made on the device) and Save to a password manager (the platform’s share sheet or a file). It’s the one key that opens your encrypted workspaces if every device is gone. Drusite and your server can’t recover it.
  3. “Check it” asks for words 3, 11 and 20. You can skip this, and Settings → Security then shows “Recovery key not checked” until you do.

Settings → Security (an Account page):

  • Recovery key: when it was made, and Make a new recovery key, which shows new words and stops the old ones working. The words are never shown again after setup, because the device doesn’t keep them.
  • Devices with your keys: every device that holds the root key, with its name, when it was approved and by which device, and Remove (§3.5).
  • Your safety code (§3.6).

The words come from the BIP-39 English list, which was chosen to be easy to write by hand and has a checksum. A mistyped word is caught as you type it. The words are only an encoding of 32 random bytes. Nothing about cryptocurrency is involved, and the UI never says “seed phrase”.

3.3 Adding a device

A new device signs in as it does today (any login method). It then has a server session but no keys, and shows “Open your encrypted workspaces” with two ways in:

  • Approve from another device (the default). The new device makes its device key pair and posts an approval request. Every signed-in device of yours that has the keys shows “A new device wants your keys: Firefox on Linux, signed in 1 minute ago”. Both screens show the same six-digit code. If they match, Approve on the old device seals the root key to the new device’s key and certifies it with your signing key. The new device has its keys within a second or two.
    • The code is a short authentication string over both devices’ public keys, with a commitment first. The new device commits to its key before it learns the approver’s nonce, so a server in the middle can’t search for a key pair that gives the same code. This is the numeric comparison pattern from Bluetooth pairing and ZRTP, built from HKDF-SHA256 and nothing new.
    • A request expires after 10 minutes. You can deny it, and Deny and sign it out ends that session too.
  • Use your recovery key: type or paste the 24 words.

Until one of these is done, the device can open standard workspaces as usual. Encrypted ones show in the switcher with “Waiting for your keys”.

The browser is a device like any other. Its keys live in its OPFS store, wiped on sign-out as Phase 7 does with everything else, so signing in again means approving it again.

The login is never the key. Signing in proves to the server who you are. Keys come only from an approved device or the recovery key. This is the same for every login method, so:

  • Changing how you sign in (adding a passkey, moving to OIDC, resetting a password) never touches your keys.
  • A server admin’s drusite-server account recover link gets you back into your account and your standard workspaces. It can’t open encrypted ones. The recovery page says: “Your encrypted workspaces need your recovery key or one of your devices.”
  • An identity provider that’s compromised can sign someone in as you. They still need one of your devices to approve them, or your recovery key.

Passkey unlock (WebAuthn’s PRF extension, which lets a passkey derive a secret) would let a passkey also unwrap the root key on a new device. Support varies too much across platforms and password managers today to count on, so it’s listed under Not in this phase. The wrap format leaves room for it as one more way to unlock.

3.5 Losing devices

  • One device lost, others left: Security → Devices → Remove. This signs it out on the server (as Account → Devices does today) and then, from the device you’re using:

    1. makes a new root key version and new identity keys, signed by the old signing key, so everyone you share with accepts the change without a warning (§3.6);
    2. wraps the new root key to your recovery public key and to each remaining device;
    3. rotates every container key the lost device could read (§5.5): your workspaces, your trees and the shared ones. Rotating a shared container needs only the members’ public keys, so you can rotate a workspace you don’t own.

    The lost device keeps the notes it already had. It can’t read anything written afterwards.

  • Every device lost, recovery key kept: sign in on a new device and use the recovery key. Then do the same rotation as above, because whoever has your old devices also has the old keys.

  • Every device lost, no recovery key:

    • Your private pages, and every encrypted workspace you’re the only member of, are gone for good. The server holds only ciphertext. Setup says this before showing the words, and in the same words.
    • Shared encrypted workspaces can be given back. Security → Start over with new keys makes fresh keys. The members who still have the workspace see “Sam’s keys were reset” and Give access again, which wraps the current key to Sam’s new one. Sam then has the whole workspace again, history included, through the epoch chain.

3.6 Knowing a key is really someone’s

The server hands out public keys, so a dishonest server could hand you its own key in place of Sam’s when you invite them. Two defences, both from Signal’s playbook:

  • Trust on first use, with signed changes. Each device remembers every account’s signing key the first time it sees it. A later key must be signed by the previous one. One that isn’t (Sam started over, or the server is lying) shows “Sam’s safety code changed” on Members and on the page’s Share panel. Nothing is shared with the new key until someone with the old key accepts it.
  • Safety codes. Members and Share show each person’s code: 30 digits in six groups of five, made from their signing key as Signal makes its half of a safety number (5,200 rounds of SHA-512), so faking one is out of reach. Two people can compare codes in person or over a call. Mark as verified keeps a check beside their name until the code changes.

Nobody has to do either for things to work. Both are there for the people who need them.

3.7 Where keys live on each platform

Desktop (macOS, Windows, Linux)iOS, AndroidBrowser
Root key, device private keys, unwrapped container keysInside the SQLCipher store, as rowsSameSame, in the OPFS store
What protects themThe store key in the Keychain, Credential Manager or Secret Service, as todayThe store key in the Keychain or Keystore (StrongBox where present), as todayThe store key wrapped by a non-extractable WebCrypto key, as today
New OS promptsNone: no new keychain itemNoneNone
In memoryZeroizing buffers, dropped when the workspace closesSameSame

The DPoP device key stays where it is, in the Secure Enclave or Keystore. It proves the device to the server. The new device key pair proves the device to other devices. Ed25519 and X25519 aren’t available in the Secure Enclave, so the device key pair can’t be hardware-bound. It sits behind the store key, as every note already does.


4. Loro sync over encrypted blobs

4.1 What a sealed entry is

Every update and snapshot an encrypted document’s device pushes is one sealed entry:

FieldIn clear?What it’s for
format (1 byte), suite (1 byte)YesVersioning, so the format and algorithms can change later
container, epochYesWhich key seals it. The server refuses entries sealed with an epoch older than the container’s current one (§5.5).
device (the device’s certified key ID)YesWhose signature to check
peers (the Loro peer IDs whose changes it carries)YesThe peer register (§4.2)
kind: update or snapshot, and for a snapshot, the server sequence it replaces throughYesCompaction (§4.4)
nonce (24 bytes) and the ciphertext of the padded Loro bytesCiphertextXChaCha20-Poly1305 under the document key. AAD: workspace, document, document kind, container, epoch, device, peers and kind.
For a snapshot: its Loro version vector, sealed separatelyCiphertextLets a device check a snapshot without downloading it (§4.4)
signatureYesEd25519, by the device, over everything above
  • Padding: plaintext is padded to at least 512 bytes, then with Padmé, which hides all but the top few bits of the length at a cost of at most 12%. A 1-character edit and a 40-character paste look the same.
  • Overhead: about 150 bytes per entry plus padding. Pushes are already batched per document (not per keystroke), so this is per batch.
  • The server still stores the server sequence number and receive time next to each entry, in clear, as today.

4.2 What the server checks, and what devices check

The server can still check, and does:

  • the push comes from the signed-in device: the signature verifies against that device’s certified public key;
  • every peer in peers is unclaimed or already belongs to this person and device, so document_peers keeps refusing a peer that belongs to someone else (Phase 9’s rule);
  • the container and epoch are current, and the person may write to that document (Cedar and row-level security, unchanged);
  • the size limit (MAX_UPDATE_BYTES).

The server can’t check that the ciphertext is a valid Loro update, that it belongs to this document, or that it has no gap. Every device checks, before importing:

  1. the signature, and that the device’s certificate chains to a member’s signing key the device trusts (§3.6);
  2. that the AEAD opens. This proves it was sealed with this document’s key, epoch and AAD, so an entry copied from another document, container or epoch fails;
  3. that the decrypted blob’s own peer set, read with decode_import_blob_meta, is within the declared peers. A member can’t push changes under someone else’s peer, even though they hold the key.

An entry that fails any check is quarantined: kept aside, never imported. The page shows “A change from Sam’s MacBook couldn’t be verified and wasn’t applied” with Details.

4.3 Catching up and pushing, without the server’s version vector

Today the server tells a device its log’s version vector (Subscribed.version), and the device pushes whatever goes beyond it. Over ciphertext, the device works the vector out itself:

  • The server log’s version is the union of the versions of every entry the device has pulled (each decrypted entry’s metadata gives its start and end) and every push the server has acked. The device keeps this per document in its store, as server_version.
  • After catching up, the device pushes oplog_version − server_version, as today. The sync protocol stays the same shape. Only the side doing the arithmetic changes.
  • Gaps are Loro’s pending changes: an update that depends on changes the device hasn’t got waits in Loro until they arrive, exactly as today when updates arrive out of order. The server’s Gap refusal is skipped for encrypted documents, because it can’t detect one.
  • A device that pushed and then lost its store (reinstalled) pulls everything from sequence 0, so its server_version is rebuilt from the entries it pulls.

4.4 Compaction by devices

The server can’t import a log, so a device makes the snapshots:

  1. When a document’s log passes COMPACT_AFTER (500) entries since its last snapshot, the server sets compact_wanted in Subscribed and Ack.
  2. A device that has caught up on that document, and may edit it, exports a full snapshot (ExportMode::Snapshot: current state and the whole oplog). It seals and signs the snapshot, then pushes it with kind = snapshot and through_seq. Phones do this only on Wi-Fi or a charger when the snapshot is over 1 MB. Desktops always do. Only one device does it: the server hands the job to the first device that asks and gives it 10 minutes.
  3. The server stores the snapshot and keeps the entries it replaces for 14 days, still encrypted, before deleting them.
  4. Every other device checks it. When a device sees a new snapshot on a document it has, it downloads only the snapshot’s sealed version vector (a few hundred bytes) and compares it with its own server_version. If the snapshot is missing anything the device knows the server had, the device pushes those changes again, and reports the snapshot with a BadSnapshot frame. That restores the old entries, deletes the snapshot and locks out that device’s compaction until a person looks. A buggy or malicious snapshot can’t lose an edit while any device, or the 14-day window, still holds it.

New devices load the snapshot and then the updates after it, as today.

4.5 Version history (Phase 9) survives

  • Snapshots keep the full oplog (§4.4 step 2), so every change, its time and its commit message (restore:…, import:notion, agent:…, encrypt) stay in the document. Shallow snapshots stay unused, as Phase 9 decided.
  • Who: document_peers still binds each peer to a person and device, from the declared and signed peers (§4.2). It’s now verified by every device as well as recorded by the server.
  • The server’s clock: Phase 9 uses the server’s receive time when a live edit’s clock is off by more than 5 minutes. The server can’t read the change’s time, so it sends received_at with each entry and the device applies the same rule.
  • Named versions live in the workspace or tree document, so they’re encrypted like everything else.
  • Restore is a new edit on the device, as today.

4.6 Protocol changes (protocol 2)

Added fields, so an encrypted-aware app on protocol 2 still speaks to standard documents the old way:

  • Welcome: e2ee: bool (the server supports it) and, per workspace, encryption (standard, encrypted or converting).
  • Push: the sealed entry’s clear fields (§4.1). Entry: received_at, and whether it’s a sealed entry.
  • Subscribed: compact_wanted, snapshot_seq, and an empty version for encrypted documents.
  • New frames: Snapshot (§4.4), BadSnapshot, KeysChanged (a container got a new epoch or a new member’s wrap, so fetch keys) and ApprovalRequest (§3.3).
  • New error codes: StaleEpoch (re-seal with the current key and push again; the device does this without asking), NeedsKeys (this device has no keys for that container yet) and NeedsUpdate (a protocol 1 app subscribing to an encrypted document; the app says “Update Drusite to open this workspace” and points at Check for Updates).
  • REST, under /api/v1/: account/keys (public keys, sealed private keys, recovery wrap), account/devices/{id}/approval, workspaces/{ws}/keys and workspaces/{ws}/trees/{t}/keys (epochs, wraps, the epoch chain), workspaces/{ws}/encryption (conversion, §8).

5. Sharing (Phase 9) over encrypted workspaces

5.1 Members and invites

Invites work as Phase 9 built them (email links, the invite link, roles, every login method). The key step comes after the invite:

  1. Sam opens the invite and joins, which needs encryption keys (§3.2) if they have none yet.
  2. Their membership exists at once on the server, but they have no key yet. Their switcher shows “Work · Waiting for access”.
  3. Any online device of someone who may invite (owners, and editors when “Editors can invite” is on) sees the new member, checks their signing key (§3.6: first use, or a signed change), wraps the current workspace key to them and uploads it. This runs in the background, with no prompt. If the person inviting is online, it happens within seconds.
  4. Sam’s devices get KeysChanged and open the workspace, history included.

If no one who may invite has a device online, Members shows Sam as “Joined, waiting for a device”, and the invite screen says “Sam can open Work once one of your devices is online.”

  • Invite pages and emails can’t show the workspace’s name, because the server can’t read it. They say “Alex invited you to an end-to-end encrypted workspace on (server)”. The name appears once Sam has the key.
  • The OAuth consent page lists encrypted workspaces as “End-to-end encrypted workspace”, with the agent device that serves each one (§6.4), or, with none, “Add an agent device to let agents read this workspace.”

5.2 Roles

Owner, editor and viewer stay as they are, enforced by the server (Cedar and row-level security) as today. Encryption adds:

  • Viewers hold the key, because reading needs it. The server refuses their pushes, as today. A viewer with a modified app could seal an update, but the server won’t store it, and other devices would reject it anyway: they check the signer’s role in the membership list before importing.
  • Who can rotate: any member, because rotating needs only public keys. In practice it’s the device of whoever removes someone (§5.5).

5.3 Private pages and restricted trees

Each restricted tree (Phase 9 as built: private pages, pages shared with some people, guest trees) is a container of its own, with its own key wrapped only to the people page_access lists. A private tree’s key is wrapped only to you. The server keeps checking page_access on every subscription. Encryption means a mistake there would leak ciphertext, not notes.

Moving a page (to Private, to Workspace, into a tree shared with a guest) is done by the device, not the server, because the server can’t edit the workspace document any more:

  1. The device makes both edits (delete the entry from one tree document, write it in the other), seals them, and re-seals a fresh snapshot of each moved page document (and its subpages) under the destination container’s key.
  2. It sends all of it to POST …/pages/{page}/move, which the server applies in one transaction. It appends both tree updates, swaps each page’s log for its new snapshot, and updates page_access, so nobody ever sees half a move.
  3. The page keeps its ID, links and history (the snapshot carries the whole oplog). The old entries are deleted, so the server never keeps the page under a key that people who’ve just lost access hold.

Moving still needs a connection, as Phase 9 built it.

5.4 Guests and single-page sharing

A page shared with a guest is a tree of its own (Phase 9 as built). Sharing it is a wrap of that tree’s key to the guest’s account key, done by the sharer’s device once the guest has keys, as in §5.1. The Share panel shows “Sam · Waiting for access” until then.

A link to a page the reader can’t decrypt shows the existing “No access” chip. A query block or inline database lists only rows from documents the reader can open. The device can’t show what it can’t decrypt, so these are now enforced twice.

5.5 Removal and key rotation

When someone is removed from a workspace or a tree (or their access to a shared page is taken away, or a lost device is removed, §3.5):

  1. The server cuts them off at once, as Phase 9 built it.
  2. The removing device rotates the container: it makes epoch e+1, wraps it to every remaining person, seals epoch e’s key under e+1 (the chain), and uploads all of it in one request. From then on, the server refuses new entries at epoch e (StaleEpoch).
  3. Devices with unsynced edits at epoch e get StaleEpoch and re-seal those edits under e+1 without asking. No edit is lost by a rotation.
  4. Old entries stay at their epochs until the document’s next compaction re-seals them under the current key. Everyone who can read the document can read them through the chain. Someone removed already had them.
  5. If the removal is made by the server’s admin (the CLI, or an account disabled), the container is marked rotation_due. The next device of a remaining member that connects does step 2. Until then, the server’s access check is what keeps the removed person out.

The cost is one HPKE wrap per remaining person, about 0.2 ms each with the hybrid KEM. A workspace of 50 people rotates in well under a second.


6. Server features that read plaintext

The per-workspace opt-in used below is Workspace settings → AI → Let your server’s AI read pages when asked (decision 3). It’s off by default and owners turn it on. While it’s on, the switcher’s lock shows a dot, and Settings says “Your server reads the pages it needs for Ask, search by meaning and meeting notes, when you use them. It keeps nothing afterwards.” It sends plaintext from the device to the server for one request at a time. The server never gets a key, never stores the text, and logs to ai_audit without the text, as today. The server’s owner can remove the option entirely with [e2ee] server_ai = false.

FeatureMoves to the deviceOpt-in (server reads, per request)Lost in an encrypted workspace
Search by wordsAlready on the device (tantivy, and the browser’s in-memory index)No needThe server’s index (search_blocks) isn’t built
Search by meaningVectors made from the device with a device provider’s embedding model, kept in the encrypted store, searched on the deviceThe device sends blocks to the server’s or account’s embedding model and keeps the vectorssearch_embeddings isn’t built. The browser has meaning search only with the opt-in (it has no device providers, Phase 8).
Ask your notesRetrieval on the device, the prompt built on the device, sent to a device providerThe prompt goes through the server to a server or account model, as Phase 8’s “server model” pathSaved chats move out of server tables into your encrypted account document
Meeting notesRecording and the audio attachment are encrypted. Transcription and summary run from the device, through a device provider. The app has to stay open, as Phase 8 says for device providers.The device uploads the audio for that one job, decrypted. The server transcribes it, seals the result to your account key, and your device writes it into the page when it next opens.A server job that writes into the page by itself
Updates & analyticsThe feed’s titles and excerpts come from the device’s own copy and its history. The server sends only who, which document and when.No needAnalytics is off by default in encrypted workspaces (views are metadata). Owners can turn it on as today.
Publish to webNot applicablePublishing is the opt-in: “Publishing puts a readable copy of this page on your server and the web.” The device uploads a plaintext snapshot of the published page, and re-uploads it a minute after edits while any editor’s device is online.Pages publish only when an editor’s device updates them, so a published page can lag behind until one is online
Agents (MCP)An agent device (§6.4) serves the same MCP tools from wherever the agent runs, with keys for only what you give it. The desktop’s local MCP works too.NoThe server’s own /mcp can’t open encrypted workspaces. It points agents at the agent device that serves them.
Notion import, Markdown import and folder syncAlready on the deviceNo needNothing

Details that matter:

6.1 Search by meaning on the device

  • Where vectors come from: the embedding model chosen in Settings → AI, if it’s a device provider (Ollama on a laptop, or any OpenAI-compatible endpoint whose key is on the device). With none, ⌘K searches by words only and says “Search by meaning needs an embedding model on this device” with a link to Settings → AI. No model is hardcoded or bundled (§15).
  • Where vectors live: in the encrypted store, one row per block (the same blocks the server indexes today), as int8-quantised vectors. 50,000 blocks at 768 dimensions is about 38 MB on disk. They’re loaded into memory only while searching.
  • Searching: brute-force cosine over int8 in Rust: 50,000 blocks in under 50 ms on a laptop, with no approximate-nearest-neighbour crate. Words and meaning are merged by the same rank fusion the server uses today (search/query.rs moves to drusite-model so both share it).
  • Per device: each device builds its own vectors as pages change, in the background, on desktops always and on phones when charging. Syncing vectors between devices is under Not in this phase.

6.2 Ask on the device

Phase 8’s device-provider path already builds the prompt on the server and sends it to the device. For encrypted workspaces, the retrieval and the prompt builder run in drusite-core instead (ask/retrieve.rs and ask/prompt.rs move to a shared crate), over local search. Nothing goes to the server unless the workspace has opted in. Ask works offline with a device provider on the same machine (Ollama), which also closes Phase 8’s “asking offline” gap for encrypted workspaces.

6.3 Your encrypted account document

Ask’s saved chats, and later anything else that’s yours alone, move into one document per person per encrypted workspace, sealed with the account container key. It syncs like a page. The server’s ask_conversations rows for that workspace are deleted after conversion (§8).

6.4 Agents: the agent device

An agent must be able to read and write an encrypted workspace over MCP, from anywhere it runs. Encryption changes only one thing: whatever serves MCP must hold the keys, and the server doesn’t. So 1.0 has two places that serve MCP for encrypted workspaces:

  • The desktop app’s local MCP, as today, for an agent on the same computer.
  • An agent device: a headless Drusite process, drusite agent, that runs wherever the agent runs, such as a container next to an agent in a cluster, a home server or a laptop. It is approved like a new phone, holds its own keys and serves the same MCP tools over Streamable HTTP. An agent that talks to it can read and write encrypted workspaces exactly as an agent on the server’s /mcp reads and writes standard ones.

The server’s own /mcp keeps serving standard workspaces, unchanged. For an encrypted workspace, it names the agent device to use instead (below).

What it is

  • It runs drusite-core with no UI, plus drusite-mcp’s tools. drusite-mcp already runs the same tools in two places through its Notes trait (the server’s documents and the desktop’s store). The agent device is a third Notes: its own encrypted store, kept in sync with the server like any device’s. No tool is written twice, and the policy is the same (no delete tools, journal read-only unless allowed, every change recorded and undoable).
  • It ships in every release as a container image (ghcr.io/pranavajk1/drusite-agent, signed with cosign like the server’s) and as Linux, macOS and Windows binaries. The Helm chart gets an optional agentDevice section, off by default, that runs it next to the server or anywhere else.
  • Its store is SQLCipher like every device’s. Its store key comes from a file or an environment variable, such as a Kubernetes Secret filled from whatever secret manager the deployment uses. It keeps a full local copy of what it’s given, so tools answer from the local store in milliseconds. It stays connected and live.

Adding one (Settings → Agents → Add an agent device):

  1. You name it (“Cluster agents”) and choose what it may read: which encrypted workspaces, and whether it gets your private pages and pages shared with you, or only the workspace’s pages (the default). You also choose its access: read-only, or edit up to your own role.
  2. Settings shows a one-time enrollment command, such as drusite agent enroll https://notes.example.com --code ABCD-EFGH. Run it on the agent’s host, or put the code in the chart’s values for a single first start. It’s valid for 15 minutes and works once.
  3. The agent device makes its key pair and sends an approval request, and both screens show a six-digit code (§3.3), the app’s and the agent device’s log or terminal. When they match, Approve wraps to the agent device only the container keys you chose. It never gets your root key, so it can never read a workspace or a private page you didn’t give it, and it can’t approve other devices.
  4. It shows under Settings → Agents and Security → Devices, with what it holds and when it was last connected.

How an agent connects to it

  • The agent device is an OAuth protected resource of your Drusite server. An agent signs in exactly as it signs in to the server’s /mcp today: the same consent screen, the same grants in Settings → Agents, the same revocation. The token names the agent device as its audience, and the agent device checks each token with the server (token introspection, cached for a minute). So there’s one list of agents and one place to revoke them, whichever endpoint they use.
  • The consent screen lists encrypted workspaces with the agent device that serves them: “Work (end-to-end encrypted) · through Cluster agents”. The server’s /mcp protected-resource metadata and its list_workspaces tool point at the agent device’s address for those, so an agent configured with the server’s address finds the right endpoint.
  • A grant can never reach more than the agent device holds keys for. The device checks this on every call, and the server checks it again when the agent device pushes.

What it writes, and the record

  • Edits are made as the agent device’s own Loro peers, with commit message agent:<grant>, signed by its device key (§4.2). History shows “Scout for Sam · via Cluster agents”, exactly as Phase 9 shows server agents.
  • The activity log and Undo work as today. The server keeps only what it can without reading: which grant, tool, page ID and time. The text of each change lives in the document’s history (the agent device’s peers and commit messages), where the apps read it, show it and undo it.
  • Search for agents: search runs on the agent device, by words always and by meaning when the agent device has an embedding model configured. Like any device, it takes any OpenAI-compatible endpoint you give it in its config, with nothing assumed.

Removing one: Settings → Agents → Remove revokes every grant that goes through it, signs it out and rotates every container it held (§5.5), as removing a lost device does. Changing what it may read works the same way: taking a workspace away rotates that workspace’s key. Giving it a new one wraps that key to it from any of your online devices.

What this trusts: whoever controls the agent device’s host can read what it holds, which is the point of it. The threat model says so (§1.2). Security → Devices marks it “Agent device · reads Work”. The server still never holds a key.

On shared workspaces: an agent device belongs to one person and gets keys through that person’s access. Other members see it in Members as “Cluster agents (Sam’s agent device)”, with its access. Owners can turn agent devices off for a workspace (Settings → Members, Allow agent devices, on by default), and the server’s owner can turn them off for the whole server ([e2ee] agent_devices = false).


7. Attachments and the canvas

7.1 Attachments in S3

  • Each file gets a random 32-byte key, kept in the block that shows it (the attachment block, a canvas image, a meeting’s audio), so it’s inside the encrypted page. Whoever can read the page can read the file, and nobody else, whichever tree the page moves to.
  • Sealing: the file is padded (Padmé) and sealed with the STREAM construction over XChaCha20-Poly1305 in 64 KiB chunks. Each chunk is authenticated, and the last is marked as last, so a file can’t be truncated or reordered. Video and audio can seek by downloading only the chunks they need.
  • Its ID is the BLAKE3 hash of the sealed file, not of the plaintext. The server keeps its check that a file is stored under its own hash, and uploading twice is still harmless. Because keys are random, the same photo in two pages is two different objects. Deduplication within a workspace is the cost (it’s rare in notes).
  • Who may download: the server’s existing check (a member, or a guest with a tree in that workspace) stays as a gate. The key in the block is what matters.
  • Thumbnails are made on the device and stored as attachments of their own, with their own keys.
  • Deleting: when no page refers to a file any more (the device sees this when trash is emptied), the device asks the server to delete it, as today.

7.2 The canvas (Phase 10)

A canvas is a page document with extra root containers, so it’s sealed, synced, compacted and kept in history like any page, with nothing of its own to change. Images on it are attachments (§7.1). Pan, zoom and drawing are local, so their budgets don’t move. A 1,000-note canvas is about 260 KB, well within one snapshot. A page card on a canvas that links to a page the reader can’t open shows “No access”, as links do.


8. Converting existing workspaces

8.1 What the owner sees

Workspace settings → General → Turn on end-to-end encryption (owners only):

  1. What changes: “Your server will no longer be able to read Work. Its AI, agents and meeting jobs will stop working here, unless you let its AI read pages when asked.” It names the agents and features in use: “2 agents are connected through your server.” With them, Serve them from an agent device: pick an agent device you have (or add one, §6.4), and each agent’s grant moves to it when the conversion finishes, with no new sign-in. Agents left on the server lose access to Work and are listed so you can see which.
  2. Who’s ready: members without encryption keys are listed: “Sam hasn’t set up encryption. They’ll be asked the next time they open Work.”
  3. Backups: “Backups your server made before today can still be read with its master key until they expire.” There’s a link to the admin docs on rotating the master key to shred them sooner.
  4. Turn on. Then progress: “Encrypting 214 of 1,032 pages · 380 MB of 1.2 GB of files”.

8.2 How it runs

  • The workspace becomes converting. The server stops indexing it and stops its meeting jobs, and refuses its agent tokens for the server’s /mcp. Agent devices chosen in §8.1 get the workspace key with the members, and their agents switch over when the last document is done.
  • Each document has its own state (standard, then encrypted), so the work is resumable and edits never stop:
    1. The owner’s device makes the workspace’s container key, wraps it to every member who has keys, and encrypts the workspace document and every page in it (it already has full copies). For each document, it pushes a sealed snapshot of the whole document, history included. The server switches that document’s log in one transaction.
    2. Restricted trees belong to their people. The owner’s device can’t read Sam’s private pages, so Sam’s device encrypts their trees the next time it opens Work. Members shows “3 people’s private pages are waiting for their devices.”
    3. Attachments: the device downloads each file (the server still decrypts it, as a standard file), seals it with a new random key, uploads it under its new ID, and rewrites the blocks that point at it. That’s one Loro change per page, with commit message encrypt, so history shows “Encrypted by Alex”.
  • A device pushing to a document that’s just switched gets NeedsKeys or StaleEpoch. It fetches the key, re-seals and pushes again, so no edit made during conversion is lost.
  • Protocol 1 apps get NeedsUpdate for encrypted documents. They keep working on the workspace’s standard documents until those are converted too.
  • When every document is done, the server deletes the server-sealed rows, search_blocks, search_embeddings and the workspace’s workspace_keys rows. Each person’s device moves their Ask chats into their account document (§6.3) and the server then deletes the rows. The old S3 objects go 14 days later, the same grace as compaction.
  • Turning it off (owners) runs the same steps the other way. A device uploads plaintext snapshots, which the server seals with a new server key.

8.3 Accounts and devices

  • Existing accounts have no encryption keys until they first need them (§3.2).
  • Devices change nothing on disk: the store stays the store. The root key and device keys are new rows in it.
  • The server’s migration (0015_e2ee.sql) adds tables and columns. It changes none of the data in standard workspaces.

9. Crypto choices

Only reviewed, widely used crates, mostly RustCrypto and dalek, most already vetted in supply-chain/. No primitive is written here. The formats and protocols built on them are written up in docs/security/e2ee.md with test vectors (§14).

JobChoiceCrateWhy
Sealing updates, snapshots, keysXChaCha20-Poly1305chacha20poly1305 (in tree)Already the server’s choice. Random 192-bit nonces need no counter, which matters with many devices sealing under one key. Fast in software and in wasm, with no AES-NI needed.
Sealing attachmentsSTREAM over XChaCha20-Poly1305, 64 KiB chunksaead’s STREAM (or aead-stream, wherever the current RustCrypto release keeps it)Streaming and seekable, with truncation and reordering caught. It’s the construction age uses.
Wrapping keys to people and devicesHPKE (RFC 9180), base mode, with X-Wing as its KEM (the X-Wing draft defines this)hpke (rust-hpke) or hpke-rs: whichever supports X-Wing at step 1, vetted with cargo vet before it landsA standard, with test vectors, for exactly “seal a key to a public key”
KEMX-Wing (X25519 + ML-KEM-768)RustCrypto x-wing and ml-kem (or libcrux-ml-kem, which is formally verified)Wrapped keys sit on the server for years. A hybrid protects them against later quantum attacks and is never weaker than X25519 alone (decision 5).
SignaturesEd25519, verify_strict, batch verification on catch-uped25519-dalek (in tree)Fast, deterministic and small. Already in Cargo.lock
Deriving document keys and approval codes; safety codesHKDF-SHA256; safety codes are 5,200 rounds of SHA-512, as Signal’shkdf, sha2 (in tree)Standard, with domain-separated labels
Attachment IDsBLAKE3 of the sealed fileblake3 (in tree)The server’s existing integrity check
Recovery wordsBIP-39 English wordlist, checksumbip39 (encoding only)A familiar, checked encoding of 32 bytes
Length hidingPadmé paddinga few lines, no crateIt’s arithmetic on lengths, not cryptography
Randomness, wipingOS randomness; zero on dropgetrandom, zeroize (in tree)As today

Considered and not chosen:

  • MLS (RFC 9420, openmls). It’s built for messaging. It gives forward secrecy per message and deliberately doesn’t give new members the past. A notes workspace needs the opposite: a new member and a new device must read the whole history.
  • libsodium bindings (libsodium-sys, dryoc). They would add C to the wasm build, and the RustCrypto crates already cover every primitive.
  • Random per-page keys in a table. Derived document keys (§3.1) rotate with their container and leave nothing to keep in step.
  • A passphrase instead of a recovery key. A passphrase-wrapped key on the server can be guessed offline by the operator. 24 random words can’t. A passphrase could be added later as an extra unlock (Argon2id, argon2 is in tree), never as the only one.
  • Encrypting everything, with no standard workspaces. It would end account providers and long meeting jobs for everyone, and every agent would need an agent device even where nobody wants the server kept out. The roadmap already chose per-space.

10. Server changes

  • Migration 0015_e2ee.sql, every table with row-level security like the rest:
    • account_keys (user, version, signing and encryption public keys, private keys sealed by the root key, the root key wrapped to the recovery public key, the recovery public key, the signature by the previous version);
    • device_keys (user, device grant, public keys, certificate, approved by, removed at);
    • device_approvals (request, commitment, expiry, state);
    • container_keys (workspace, container — the workspace or a tree, epoch, user, wrap, wrapped by, created) and container_epochs (container, epoch, previous epoch’s key sealed by this one, rotation_due);
    • workspaces.encryption (standard, converting, encrypted), documents.encryption;
    • document_updates/document_snapshots: the sealed entry’s clear fields (epoch, device, kind) and the 14-day replaced_at;
    • published_copies (page, plaintext snapshot uploaded by a device, uploaded by, at);
    • agent_devices (owner, device, name, address, what it may read, access, enrollment code hash and expiry), and container_keys rows wrapped to an agent device instead of a person;
    • agent_activity without text for encrypted workspaces (grant, tool, page, time; §6.4).
  • Code: sync/store.rs takes a sealed path that skips check_blob, Gap, compact and check_first_snapshot for encrypted documents and does §4.2’s checks instead. access::move_to gets a device-made variant (§5.3). The indexer, Ask, MCP, meetings and the consent page skip encrypted workspaces with a clear reason. members.rs and oauth.rs stop reading names from encrypted documents.
  • Agents: the OAuth server issues tokens whose audience is an agent device and answers its introspection requests. /mcp’s metadata and list_workspaces name the agent device for each encrypted workspace. A new binary, drusite-agent (in crates/drusite-agent): drusite-core without UI, drusite-mcp over Streamable HTTP, and enroll, run and status commands.
  • Config: [e2ee] enabled = true, new_workspaces = "ask", server_ai = true (whether the opt-in is offered at all), agent_devices = true.
  • Admin docs: what backups hold for each kind of workspace, how to rotate and retire the master key, and that an admin can never recover an encrypted workspace.

11. Testing

WhatHow
FormatsA new crate, drusite-e2ee, with no I/O. Golden test vectors for every format (sealed entry, snapshot header, wraps, epoch chain, device certificate, SAS and safety codes, recovery words) live in crates/drusite-e2ee/vectors/. The same vectors run natively on Linux, macOS and Windows in CI, and as wasm in Chromium, Firefox and WebKit through Playwright. That’s how every platform is proven to agree byte for byte.
PrimitivesThe crates’ own known-answer tests, plus RFC 9180’s HPKE vectors and X-Wing’s draft vectors re-run in our build
Propertiesproptest: seal then open round-trips; any changed byte, AAD field, epoch or signer fails; padding round-trips; derived keys differ per document and epoch
Fuzzingcargo fuzz targets for every parser: sealed entry, key bundle, approval messages, recovery words. They run nightly, plus 10 minutes on each PR that touches drusite-e2ee.
Sync simulation (drusite-core/tests/simulation.rs, turmoil)New cases: two devices editing an encrypted page offline and merging; device compaction racing live pushes; a snapshot missing changes, caught and healed by another device (§4.4); rotation while a device is partitioned with unsynced edits, which re-seals them and loses nothing; a member removed while partitioned can’t read anything written after; a page moved to Private while a guest edits it; conversion interrupted at every step, then resumed from another device; a reinstall rebuilding server_version from scratch
A hostile serverA simulation mode in which the server misbehaves on purpose: tampers with ciphertext, replays and reorders entries, moves an entry to another document, serves an old epoch, withholds one device’s updates, substitutes a public key at invite time, and forges a peer claim. Each must be refused, quarantined or flagged as §1 and §4 promise, and the test names which.
ServerPostgres tests: row-level security on every new table; refusal of stale epochs, bad signatures and foreign peers; the 14-day grace; conversion per document; the indexer, Ask, MCP and meetings skipping encrypted workspaces
Cross-platform matrixEvery pair approves the other: macOS, Windows, Linux, iOS, Android, and the browser in Chrome, Firefox and Safari. On each: set up, recovery key, live edit, attachment up and down, rotation, conversion. Desktops and the browser run in CI. The Android emulator and iOS simulator run in the release-candidate job, as Phase 10 runs app builds. Real devices are on Pranava’s checklist.
Agent devicesSimulation: an agent device enrolled, approved and given one workspace reads and writes it while the owner edits; it can’t open a workspace or private page it wasn’t given, even when the server hands it the ciphertext; removing it rotates and cuts it off mid-session; a workspace taken away from it rotates. End to end in CI: the container image against a test server, driven by a real MCP client (the MCP inspector’s CLI), with every tool run on an encrypted workspace and compared with the same tools on a standard one through /mcp; Undo of an agent change from the app; a revoked grant refused within a minute; conversion moving a grant from /mcp to an agent device.
MigrationA fixture workspace with history, named versions, restricted trees, a guest, a canvas, a meeting with audio and 200 attachments, converted and then compared: same text, same history (every version restorable), same attributions, every file readable. Then converted back, and compared again.
Losing thingsTests for every row of §3.5: one device lost, all devices lost with the words, all lost without (shared workspace given back, private pages gone, said as such)
UIThe memory-core browser tests: setup, recovery check, approval with matching and mismatching codes, waiting for access, safety code changed, the conversion screens

12. Performance budgets

New budgets in xtask/src/budgets.rs and the web tests. CI fails past any of them.

WhatBudget
Keystroke p95 in the coreUnchanged at 0.5 ms. Sealing happens on the push batch, off the keystroke path.
Sealing and signing one push of 1 KB≤ 0.1 ms desktop, ≤ 0.5 ms phone and wasm
Opening a 1,000-page encrypted workspace from the local storeUnchanged: the local copy is plaintext inside SQLCipher, as today
First sync of a 1,000-page workspace on a new device≤ 15% slower than a standard workspace (decrypting plus batch signature checks)
Catching up 10,000 entries≤ 1 s of crypto on a mid-range phone (batch Ed25519)
Device compaction of a 1 MB document≤ 200 ms of CPU on a phone, ≤ 50 ms desktop
Attachments≥ 300 MB/s sealing on desktop, ≥ 80 MB/s phone, ≥ 40 MB/s wasm
Rotation of a 50-person workspace≤ 1 s on a phone
Device approval, from the matching code to keys on the new device≤ 3 s on a normal connection
Search by meaning, 50,000 blocks≤ 50 ms desktop, ≤ 200 ms phone
Storage overhead of sealed entries≤ 15% over today’s sealed size, padding included, for a document’s whole log and snapshot. A single small update grows to the 512-byte minimum, but compaction folds those away.
wasm bundle≤ +150 KB brotli, so the budget moves from 2.15 MB to 2.30 MB
Idle RAMUnchanged. Keys are kilobytes, and the vector index loads only while searching.
Agent deviceIdle RAM ≤ 150 MB holding a 1,000-page workspace. A tool call (read a page, search by words) answers in ≤ 50 ms p95 on the agent’s host, plus the network. Enrollment to first tool call ≤ 30 s.
Conversion1,000 pages and 1 GB of files in ≤ 10 minutes on a desktop on the same network as the server; resumable at any point

13. Order of work

Each step lands on its own PR with its tests, and nothing is switched on for users until step 6:

  1. drusite-e2ee: formats, vectors, wasm build and fuzz targets. No app changes.
  2. Account keys: setup, recovery key, device approval, Security settings, safety codes. Server tables and routes.
  3. Encrypted documents: sealed entries, protocol 2, device-side version vectors, compaction and its checks, peer binding, history.
  4. Containers and sharing: encrypted workspaces, invites, trees, moves by device, guests, rotation.
  5. Attachments, the canvas, meetings, and §6’s moves: local search by meaning, Ask on the device, the account document, publishing copies, the opt-in.
  6. Agent devices: drusite-agent, enrollment and approval, scoped container keys, tokens for agent devices, /mcp pointing at them, the container image and the Helm chart’s agentDevice section. It needs steps 2–4 and can run alongside step 5.
  7. Conversion in both directions, including moving agents to an agent device, then the [e2ee] settings switched on.
  8. 1.0.0 (§14).

14. The 1.0.0 release

On top of Phase 10’s release checklist (§3 there: Developer ID and notarization, the updater key, the stable channel, the signed tag):

  1. The security design is public: docs/security/e2ee.md holds the threat model (§1), every format and protocol with its vectors, and the limits stated plainly. A SECURITY.md explains how to report a vulnerability (GitHub’s private advisories) and what’s in scope.
  2. An independent review of the design and drusite-e2ee (decision 6).
  3. The protocol is frozen: protocol 2 and the sealed formats are 1.0’s. From 1.0 a format only changes through its format and suite bytes, and 1.x apps read every format any 1.x wrote. This extends Phase 10’s major.minor promise.
  4. Upgrade order: the server first, then the apps. Encrypted workspaces need a 1.0 server and a 1.0 app. Standard workspaces keep working with alpha apps on protocol 1 until 1.1, and the release notes say so.
  5. Export compliance: update docs/releasing.md’s answers. Drusite now has end-to-end encryption with standard algorithms. Re-check Apple’s export questions, and whether the US mass-market self-classification report applies, before the App Store and Play uploads.
  6. Docs: README (what encrypted means, in a paragraph), setting up and the recovery key, adding a device, what admins can and can’t do, and backups per workspace kind.
  7. A clean export: Markdown and Notion-style export work from the device for encrypted workspaces. Leaving Drusite never needs the server to read anything.
  8. Account deletion deletes the account’s keys and wraps along with everything else, and rotates the containers the account shared. It also removes the account’s agent devices.
  9. Agent devices ship with the release: release.yml builds and signs the drusite-agent image (cosign, like the server’s) and its Linux, macOS and Windows binaries, and the Helm chart at that version carries the agentDevice section.
  10. The 1.0.0 checks on real hardware (Pranava): set up on the Mac, approve the phone and a browser, lose a device (remove it), recover with the words on a fresh install, convert a copy of a real-sized standard workspace on a test server, and update an rc build to 1.0.0 in place. Run an agent device in the cluster, connect a real agent to it, and have it read and edit an encrypted workspace.

15. Not in this phase

  • Passkey unlock (WebAuthn PRF) as another way to get your keys on a new device (§3.4).
  • Syncing search vectors between devices, and a bundled on-device embedding model.
  • Unlisted encrypted publishing: a link that carries its key after the #, so the server serves ciphertext and the reader’s browser decrypts it.
  • QR codes for device approval, alongside the six-digit code.
  • Hiding timing: cover traffic or batching pushes to blur when you type.
  • Comments, presence and live cursors, which don’t exist yet. Each will be sealed like everything else when it does.

16. Decisions for Pranava

One recommendation each.

  1. Per workspace, chosen when it’s made. Encrypted and standard workspaces side by side. Existing workspaces stay standard until an owner converts them, and the server’s default is "ask". Recommend yes: it keeps server agents and meeting jobs for the workspaces that want them, which is how the roadmap framed it.
  2. Recovery: device approval with a six-digit code, plus a 24-word recovery key that must be saved at setup. No passphrase. Recommend yes: the words can’t be guessed offline by an operator, and approval covers the everyday case.
  3. The “let your server’s AI read pages when asked” opt-in, per workspace, off by default, shown on the lock. Recommend offering it: without it, phones and the browser have no search by meaning and no long meeting jobs in encrypted workspaces.
  4. The browser opens encrypted workspaces, with the plain note about server-served code shown once. Recommend yes: it’s the same protection as the apps against everything except an operator who changes the app, and refusing would make the browser useless for encrypted work.
  5. Post-quantum hybrid key wraps (X-Wing) from 1.0. Recommend yes: the wraps sit on the server for years. The cost is about 1.1 KB per wrap and a fraction of a millisecond.
  6. An independent review before calling it 1.0.0. Recommend applying to NLnet’s NGI Zero fund, which pays for security audits of open-source projects. If the review can’t happen in time, 1.0.0 ships with the design public and its release notes say plainly that the encryption hasn’t been independently reviewed yet.