Skip to content

v0.22.0

Choose a tag to compare

@PROVE1352 PROVE1352 released this 12 Nov 09:12
· 48 commits to main since this release

A minor release for operators who want to bound disk use and the number of people on their server, and for those
who open a server to strangers as a demo. "Restricted mode" is a set of optional settings: limits on accounts,
owned workspaces, members, pages, file size, storage and versions, and on the server's workspaces and sign-ups per
hour; a storage fuse for the whole server; features turned off on the whole server;
sign-up with an ID and a nickname instead of an email address; terms and consent at sign-up; accounts deleted some
days after sign-up; a label such as "Demo" on every screen. A server that sets none of them behaves as 0.21.1,
except for what is listed under "What changes on every server" below.
One database migration, additive
(0062_limits_accounts; a 0.21 database goes from 62 to 63 applied migrations). No new dependency. The MCP tool list
and the server instructions are unchanged; tool errors for the new codes say what to do next. Design notes are
docs/adr/2500-* .. 2539-; 2530- .. 2539-* are the fixes of an independent security review before release (below).
A preset for a demo server is in deploy/demo/, run through deploy/demo/demo.sh, with the
steps in docs/DEMO.md; the settings reference is docs/OPERATIONS.md, section 17. The preset and
the steps for a public demo are included, but do not open a public demo for strangers with 0.22.0
: the review
found problems for a demo that shares a machine with other services, to be fixed in 0.22.1 (docs/KNOWN-ISSUES.md,
"Added in 0.22.0").

Not tried in Safari, Firefox or on a real phone (docs/KNOWN-ISSUES.md, "Added in 0.22.0").

What changes on every server

These change with no new setting, on every server that upgrades:

  • Every account can delete itself (Settings → Account → Delete account, DELETE /api/me), from a browser
    session, with the current password (and two-step code), or within ten minutes of signing in for delegated and
    OIDC accounts. It is immediate and cannot be undone: workspaces where the person is the only member, and
    deleted workspaces they own alone that could still be restored, are deleted with their files; a shared workspace
    they own alone passes to its oldest admin-role member, else its oldest member;
    their private pages are deleted, and their shared pages, comments and versions stay without their name. The only
    admin cannot (409 LAST_ADMIN). Backups keep the data until they rotate out.
  • A sole owner who is the workspace's only member can leave it, and the workspace is deleted at once with its
    pages and files (no restore), after typing its name. Before, leaving was refused (400). A sole owner with other
    members is still refused: transfer ownership first. Tabs still open on the deleted pages, page guests' included,
    are disconnected (docs/adr/2529-*).
  • An owner can delete a deleted workspace for good at once ("Delete now" in Settings → Account → Deleted
    workspaces, DELETE /api/workspaces/:id/permanent), instead of waiting for the end of its restore window.
  • Housekeeping deletes ip_bans rows whose ban ended more than 30 days ago. An active ban is never touched.
    Before, nothing deleted them (KNOWN-ISSUES B-L7).
  • The admin's account deletion runs through the same deletion code as leaving and expiry. What it does and
    answers is unchanged (409 SOLE_OWNER while the person is a sole owner, private pages to the trash, the signup
    key's use given back).
  • The first account to sign up on a server without an admin is made admin inside the sign-up transaction, under
    the admin lock, instead of right after it. The old call after the commit stays and does nothing then. The rule is
    the same: with no admin, the first sign-up becomes the admin.
  • Workspace settings → General shows the workspace's usage: members, pages (the trash included) and storage. The
    server counts the storage again when the stored count is more than a minute old, so at most once a minute per
    workspace, also without limits (docs/PERFORMANCE.md).
  • Admin → Server status shows a new "Account cap" item under the security settings while anyone can sign up
    (SIGNUP_REQUIRE_KEY=0); in production it is amber until SIGNUP_MAX_USERS is set.
  • A new notification, "You are now the owner of …: its previous owner deleted their account". The hourly
    housekeeping also deletes sign-up address records older than 30 days (there are none without
    SIGNUP_PER_IP_PER_DAY).
  • The request rate limit counts an IPv6 client by its /64 instead of its full address, so one subscriber's
    addresses share one budget (docs/adr/2537-*). IPv4 is unchanged; the sign-in failure bans are unchanged.
  • Account deletion and expiry find the copied names by the account's id only (docs/adr/2535-*): the audit rows
    it acted in or was the target of, the names write sites keep beside an id, and the workspace it made at sign-up.
    Records of another person with the same name are not changed. A name written without an id beside it stays: the
    person of the page access rows and the invited address of page invitations, also in rows this release writes, and
    in older rows the names of locking a page, changing a lock's editors, and blocking and unblocking an agent
    (KNOWN-ISSUES LIMITS-8; to be removed in 0.22.1).
  • Audit JSON keeps ids beside names: page.locked and page.lock_editors_changed store editorIds,
    agent.blocked and agent.unblocked store userId. The audit screen and route do not show them.
  • The deletion preview (GET /api/me/delete-preview) answers browser sessions only: a token gets 403. The
    preview is new in this release, so nothing that worked before stops working.
  • The OAuth token exchange is one transaction: consuming the authorization code and storing the grant commit
    together. The answers are unchanged.

Added

  • Limits (docs/adr/2505-, 2506-): LIMIT_WORKSPACES_PER_USER (owned workspaces, deleted ones still restorable
    included), LIMIT_MEMBERS_PER_WORKSPACE (page guests do not count), LIMIT_PAGES_PER_WORKSPACE (the trash
    included), LIMIT_FILE_MB (one upload, at most 25; connections get the smaller of it and AGENT_UPLOAD_MAX_MB),
    LIMIT_WORKSPACE_STORAGE_MB and LIMIT_VERSIONS_PER_PAGE (1–50). Checked in the transaction that creates the
    row (transfer of ownership and restore included, docs/adr/2528-*), under a lock, on every path that creates pages, files, members or workspaces (REST and the MCP tools that
    call it); a test lists every insert site and fails on a new unchecked one. Errors 403 LIMIT_WORKSPACES,
    LIMIT_MEMBERS, LIMIT_PAGES and 413 LIMIT_STORAGE, LIMIT_FILE, each with { limit, used }.
  • Storage and read-only workspaces (docs/adr/2506-, 2530-, 2533-*): storage counts files, page bodies, version
    history, handwriting, comments, page rows, database fields and views, templates, the change log's texts and agent
    suggestions, the trash included. A workspace that has reached its limit is read-only: every write that can grow
    it is refused (a test lists every POST, PUT and PATCH route as checked or open with its reason), live edits are
    counted when they arrive and one that does not fit is not stored, live editing turns read-only, and a notice says
    what to delete. Deleting,
    emptying the trash and exporting always work. When a count finds the workspace back under its limit, open editors
    reconnect and can edit again. One page body may hold at most a quarter of the limit.
  • Features turned off (docs/adr/2507-*): DISABLED_FEATURES takes public-links, public-forms, webhooks,
    slack, link-preview, web-clipper, ical, notion-import, web-push, password-reset, email-invites,
    automations-webhooks, oauth-cimd, embeds and member-direct-add. Their routes answer 404 FEATURE_DISABLED,
    what exists stops working without being deleted, clean-up stays possible, and the app hides their menus.
  • Sign-in IDs and sign-up limits (docs/adr/2512-, 2516-): LOGIN_ID_MODE=username (an ID and a nickname
    instead of an email; needs mail, OIDC and delegated sign-in off and password-reset turned off),
    SIGNUP_MAX_USERS (403 SIGNUP_FULL), SIGNUP_PER_IP_PER_DAY (429 SIGNUP_IP_LIMIT), and with either cap (or
    SIGNUP_PER_HOUR) a hidden
    field and a two-second minimum on the form (400 SIGNUP_CHECK_FAILED). On a restricted server without an admin,
    sign-up without the setup code is refused (403 SETUP_REQUIRED, docs/adr/2527-*) and the sign-up screen says it
    waits for its operator, so a stranger cannot become the first admin by signing up.
  • Terms and consent (docs/adr/2519-, 2520-): LEGAL_DIR holds the terms, the privacy policy and signup.json
    (the notice and the tick boxes). Each ticked item is stored with the document version (a hash of the files). /terms and
    /privacy open without signing in. Accounts without consent to the current version, including everyone after the
    texts change, see a consent screen and are refused on every way in (browser, API tokens, MCP, the collaboration
    socket) with 403 CONSENT_REQUIRED until they agree, sign out or delete their account (the consent screen has
    Delete my account, without export). The documents are Markdown drawn without any HTML.
  • Instance label and notice (docs/adr/2520-, 2526-): INSTANCE_LABEL (up to 20 characters) on every screen,
    phones included. INSTANCE_NOTICE (up to 500 characters of plain text, line breaks kept, no links) under the title
    of the sign-in, sign-up, consent and setup-waiting screens and as a strip above every app screen; nobody can close
    it, and it changes with a restart.
  • Account lifetime (docs/adr/2515-*): ACCOUNT_LIFETIME_DAYS deletes accounts that signed up while it was set,
    N days after sign-up, never admins and never accounts from before it; ACCOUNT_LIFETIME_DRY_RUN=1 only logs. The
    date is shown in the app with an Export link; admins lift or move it (Admin → Users, PATCH /api/admin/users/:id/expiry).
  • Restore and trash windows: WORKSPACE_RESTORE_DAYS (30 by default) replaces the fixed 30 days of workspace
    restore, and the screens say the number. LIMIT_TRASH_DAYS (at least 7, docs/adr/2525-*) caps each workspace's
    trash retention: pages go after min(the workspace's setting, the cap) days, Workspace settings take nothing above
    it (400 LIMIT_TRASH_DAYS), and list_trash gives the same date.
  • Server-wide limits (docs/adr/2531-, 2532-, 2536-, 2537-): LIMIT_WORKSPACES_TOTAL (workspaces on the
    whole server, deleted ones still restorable included; 403 LIMIT_WORKSPACES_TOTAL, and SIGNUP_FULL at
    sign-up), LIMIT_INSTANCE_STORAGE_MB (a fuse over the database size and the data folder, measured once a minute:
    at it the server only reads, signs in, exports and deletes, 503 INSTANCE_FULL; it usually stays tripped until
    the operator makes room, docs/OPERATIONS.md, "Instance storage fuse"), SIGNUP_PER_HOUR (accounts the server
    makes in one hour, 429 SIGNUP_RATE_LIMIT), and OAUTH_UNUSED_CLIENT_HOURS and OAUTH_UNUSED_CLIENT_MAX
    (self-registered OAuth clients nothing ever used are deleted after N hours, and at most N are kept). Each is off
    when unset.
  • Demo preset (docs/adr/2521-, 2538-): deploy/demo/demo.sh (the only way to start, stop and check the demo:
    it fixes the project inkling-demo, its volumes, network and database names, runs Compose with a clean
    environment, refuses a shell that sets COMPOSE_PROJECT_NAME, COMPOSE_FILE or INKLING_DATA_NAME, keeps the
    volumes on down and asks for the name on destroy; it needs python3 on the host),
    deploy/demo/compose.demo.yaml (an overlay that refuses to start outside the script, with the demo's own
    secrets and port), demo.env.example and terms templates in deploy/demo/legal/; docs/DEMO.md.
  • API: GET /api/workspaces/:id/usage, GET /api/me/delete-preview, DELETE /api/me, DELETE /api/workspaces/:id/permanent, GET /api/legal, GET /api/legal/:doc, POST /api/legal/consent, GET and PATCH /api/admin/users/:id/expiry; optional fields in /api/auth/mode, /api/auth/me, the sign-up body and
    AdminUserDTO (docs/API.md, "v0.22.0 additions").

Changed

  • The "restore within N days" texts take the number from the server (30 unless WORKSPACE_RESTORE_DAYS is set).
  • With LOGIN_ID_MODE=username, screens that showed an email show the ID without the "email" label (sign-in,
    Settings → Account, Admin → Users, member and access search), and inklingctl login asks for an ID.
  • compose.yaml passes all twenty-two 0.22 variables to the app and .env.example has a commented example of each;
    an empty value means unset for every one of them (docs/adr/2528-*).
  • MCP tool errors for LIMIT_*, FEATURE_DISABLED, INSTANCE_FULL and CONSENT_REQUIRED carry their own next step instead of the
    status hint ("not a member" for a 403, "not found" for a 404), and upload_file states and checks
    min(AGENT_UPLOAD_MAX_MB, LIMIT_FILE_MB).

Security

  • The consent gate runs on every authenticated way in: REST with a cookie or a token (MCP tools included), the
    /mcp endpoint itself, and the collaboration socket (docs/adr/2502-*). Only sign-out, /api/auth/me, the legal
    routes and account deletion are exempt.
  • Account deletion by the person or by expiry removes their name and sign-in ID from the columns that copy them as
    text with the account's id (audit events, the change log, invitations, the workspace named after them), in the
    deletion's transaction; a test scans every text and uuid column after a deletion. Names
    written without an id stay, among them the page access audit rows: KNOWN-ISSUES LIMITS-8.
  • DELETE /api/me needs a browser session and the password (and two-step code); failures count against the
    sign-in guard. Deleting for good (leaving alone, "Delete now") is browser-only too: no token or agent can do it.
  • In ID mode, signing in with an unknown ID costs the same password check as a wrong password.
  • Open items for operators of public servers: TRUST_PROXY should name the proxy only, and the app port must not be
    reachable from other hosts, or SIGNUP_PER_IP_PER_DAY can be passed with a made-up X-Forwarded-For (LIMITS-11);
    POST /oauth/register stays open without sign-in, and its rows are cleaned up only with the
    OAUTH_UNUSED_CLIENT_* settings (LIMITS-9).
  • Found and fixed in an independent security review before release (docs/adr/2530-* .. 2539-*). A second
    review of these fixes found that 0.22.0 can run production servers, and found more problems for a public demo,
    listed after this list. Marked
    "earlier versions too" where 0.21.1 behaves the same; the others concern what 0.22.0 adds.
    • Account deletion handed shared workspaces to a member without looking at their workspace limit, and freed a
      sign-up place, so one account could collect workspaces without end. Now LIMIT_WORKSPACES_TOTAL bounds the
      server's workspaces; the handover still does not look at the per-person limit.
    • Writing over the collaboration socket passed the storage limit (33.5 MB stored under a 20 MB limit), and 40
      pages × 8 MB on one socket could exhaust the server's memory: read-only was decided only at connection. Now each
      update is counted when it arrives and one that does not fit is not stored, and the bytes a client address may
      send are bounded. These checks run only with a storage setting; without one a document's size has no bound, as
      in earlier versions too. Other ways to exhaust the memory remain (below).
    • POST /oauth/register stored a row of about 23 KB per call without sign-in, nothing removed them, and the rate
      limit keyed IPv6 by the full address (earlier versions too). Now the rate key groups IPv6 by /64 on every server,
      the OAUTH_UNUSED_CLIENT_* settings delete never-used clients, and the storage fuse refuses registrations.
    • The demo's volumes had no size limit and several tables grow outside the workspace count. Now the
      LIMIT_INSTANCE_STORAGE_MB fuse; a public demo also needs a filesystem with a size limit of its own.
    • A full workspace still took PATCH /api/pages/:id/props writes (five of about 800 KB). Now every write that can
      grow a workspace is checked.
    • The sign-up address cap counted IPv6 per /64 and the bot checks were easy to pass, so the account cap could be
      filled cheaply. Now the sign-up key is the /56 and SIGNUP_PER_HOUR bounds the rate; filling it is slowed, not
      prevented (KNOWN-ISSUES).
    • With COMPOSE_PROJECT_NAME or INKLING_DATA_NAME set in the shell, the demo overlay pointed at the main
      instance's project and volumes, and the documented down -v would have deleted them. Now demo.sh fixes the
      names and refuses such a shell.
    • Name removal at account deletion matched the display name as text and changed records and workspace names of
      another person with the same name. Now by id only.
    • GET /api/me/delete-preview answered scoped API tokens with workspace and member names outside their range.
      Now browser sessions only.
    • A sign-up answered "taken" without counting against the address's sign-ups, so IDs could be probed (email
      addresses in email mode too, as in earlier versions). Now, while SIGNUP_PER_IP_PER_DAY is set, an address gets
      at most 10 such answers in 24 hours.
  • Found in the second review and left for 0.22.1 (they stop a public demo, not a production server; details in
    KNOWN-ISSUES LIMITS-37 to LIMITS-42 and LIMITS-8):
    • A signed-in account can make the server process run out of memory through live-editing connections, also with a
      storage limit; the process restarts and unsaved edits are lost. Part of it is in earlier versions too.
    • Very small files count far less than the disk they take, in the storage limit and in the fuse.
    • The fuse can trip before the workspaces reach their limits (the search index is not counted), and the demo
      preset's values do not match each other.
    • A member with edit rights can make the workspace's storage use count larger than it is and block the others'
      writes for a while; a member who can only view a page can read the storage numbers from one route.
    • Names in page access audit rows stay after account deletion.
    • The demo preset uses the same image name and tag as the main instance.
    • The three ways to block sign-up on a public server (KNOWN-ISSUES LIMITS-28) stay as they are.

Upgrade notes

  • Migration 0062 (the only one) adds the tables signup_events and user_consents and four columns:
    users.expires_at (null), workspaces.storage_bytes (default 0), workspaces.storage_checked_at (null) and
    workspaces.over_storage (default false). Additive; the SQL is in apps/server/drizzle/0062_limits_accounts.sql.
  • Every new setting is optional and off when unset or empty. A value the server cannot read as written stops
    the boot with the variable and the reason (docs/OPERATIONS.md, section 17, "When the server refuses to start").
  • Turning on ACCOUNT_LIFETIME_DAYS for the first time: start with ACCOUNT_LIFETIME_DRY_RUN=1 and read the
    hourly log lines before letting it delete. Accounts that existed before the setting was turned on, and admins,
    never expire, whatever the setting.
  • Open sign-up with limits: create your own admin account with the setup code before opening sign-up, and set
    TRUST_PROXY to your proxy's address before relying on SIGNUP_PER_IP_PER_DAY.
  • Turning ACCOUNT_LIFETIME_DAYS off and on again deletes at the next hourly run every account whose date
    passed while it was off (docs/OPERATIONS.md, "Account lifetime").
  • Do not open a public demo with 0.22.0 (above). A demo runs only through deploy/demo/demo.sh, from a
    checkout of its own, with new secrets; give its volumes a filesystem with a size limit (docs/DEMO.md).
  • Reload open tabs to get the new screens. Going back to 0.21.1 after the migration was not tried.