Skip to content

Administration

cyril-fl edited this page Nov 30, 2026 · 1 revision

Administration

For whoever runs a Tide server. Installing it is in Installation.

Accounts

Each note, folder and tag belongs to an account, and an account never sees those of the others.

The first account in the database is the admin. Only it invites, lists and deletes the others, from Settings > Users. It is created in one of three ways:

  • on an empty database, the app leads straight to the account creation page;
  • if TIDE_HOST_NAME and TIDE_HOST_PASSWORD are set in the .env, Tide creates it at startup (then empty those two lines);
  • tide-server user add <name> works in every case.

After that, TIDE_ADD_USER_MODE decides who can create an account:

Mode Behavior
invitation (default) The admin creates an invitation link in the settings and sends it. It works once and expires after 7 days. The invitee chooses their own name and password. Without an invitation, the account creation page is closed.
public Anyone who can reach the app can create an account. Reserve it for a trusted network (Tailscale), since nothing limits the number of creations beyond a growing delay per address.

Admin commands

They belong to tide-server and run on the server, in the container (-i alone with --password-stdin):

docker exec -it tide-api /tide-server user add cyril              # asks for the password twice (8 characters at least)
docker exec -it tide-api /tide-server user reset-password cyril   # forgotten password: new password, all devices logged out
docker exec -it tide-api /tide-server rotate-secret               # re-encrypts the accounts' keys with a new TIDE_SECRET
  • --password-stdin reads the password from standard input, for user add and user reset-password.
  • The admin flag is set on the first account created in an empty database. To move it or add one, touch the database: UPDATE users SET admin = true WHERE name = '<name>'.
  • Deleting an account permanently erases its notes, folders, tags and images. An admin can neither delete themselves nor delete the last admin.
  • tide account purge empties the logged-in account (notes, folders, tags, images, snippets, saved searches), after typing its name. The account and its settings stay.

Encryption

The text and titles of notes, the names of folders, the tags, the snippets and the names of images are encrypted in the database, and the images in Silo (AES-256-GCM). Each account has its own key, drawn at random at its first login and stored in users.data_key, itself encrypted by the server secret TIDE_SECRET. A stolen database, backup or disk stays unreadable without this secret. A compromised server, on the other hand, holds it: encryption does not protect against that.

  • Generate the key with openssl rand -base64 32, and use the same one wherever the server runs.
  • Keep a copy of the key in a password manager, never in a backup. If you lose it, the notes become unreadable, even with a backup.
  • A forgotten password loses nothing: the admin resets it in Settings > Users (or tide-server user reset-password, the only recourse for their own account), since the keys do not depend on the password.
  • tide export outputs clear text.
  • Not encrypted: the dates and the tree (which item is in which folder). To find a tag, a folder or a note by name and keep names unique, the database keeps an HMAC fingerprint of the lowercase name.

Changing the secret

  1. make backup.
  2. Put the new secret in TIDE_SECRET.
  3. Run TIDE_OLD_SECRET=<old> tide-server rotate-secret (in the container: docker exec -e TIDE_OLD_SECRET=<old> -e TIDE_SECRET=<new> tide-api /tide-server rotate-secret). Only the accounts' keys are re-encrypted, not the notes.
  4. Put the new secret in the server's environment and restart. A second pass does nothing.

Security

Every request must come from a logged-in account. Keep the API on 127.0.0.1 behind Tailscale or an HTTPS proxy: the password and the cookie must never travel in clear. The session cookie requires HTTPS, which the proxy provides.

  • A request whose Origin header differs from WEB_ORIGIN is refused (403). Without it, no web page can call the API. The SameSite=Strict cookie adds protection against other sites.
  • A request without Origin (curl, scripts) is accepted if it carries a session or a token.
  • The Host header must be localhost, 127.0.0.1, [::1] or the host of WEB_ORIGIN, which blocks DNS rebinding.
  • After consecutive wrong passwords, the login answers 429 with a growing delay (nothing up to 3 failures, then 30 s, 1 min, 5 min, 15 min, and 1 h from 8). The counts are kept in the database, so a restart forgets none.
  • The MCP address only serves /mcp and its OAuth sign-in, a token or a sign-in required, so a tunnel can open it to the Internet while the rest stays private (Agents).
  • Behind a proxy on 127.0.0.1, the server takes each device's address from X-Forwarded-For, so the delay only blocks the faulty device.

Cleanups

The server purges every hour: the notes and folders past the trash's retention, the files no note cites, the expired invitations, sessions and tokens.

Monitoring

GET /api/version (the admin sees it in Settings > General) shows the running version, to spot a deployment that is behind. The Docker logs of the server are its log.

Back up

See Installation.

Clone this wiki locally