Whiteboards (boards)
Whiteboards on a Self Host Wizard box: the boards piece, served at board.<apps domain>, forward sign-in, memory limit 104 MB.
At a glance
| Field | Value |
|---|---|
| Address | https://board.<apps domain> |
| Sign-in | forward: Caddy asks Authelia before the app sees a request (forward auth) |
| Memory limit | 104 MB (ram_mb: measured peak × 1.3) |
| Database | none shared: it keeps its own data in THX_DATA |
| Needs | lldap, authelia |
| Needed by | nothing |
| Containers | boards |
Image: boards | thx-local/boards:excalidraw-0.17.6-1 (built on the box from pieces/boards/files/image) |
| Licence (from the README) | several; see the notes below |
| Upstream (from the README) | https://github.com/excalidraw/excalidraw |
Turn it on
thx enable adds boards and everything it needs to the box's state; thx apply then installs it. Apps are applied only once site_domain is set.
sudo thx enable boards
sudo thx apply
Engineering notes (pieces/boards/README.md)
Served at https://board.<apps_domain>, behind Caddy's forward_auth.
- Editor: Excalidraw 0.17.6
(
@excalidraw/excalidraw, MIT), with React and ReactDOM 18.3.1 (MIT). Their release builds are fetched from the npm registry when the image is built and checked against the registry's sha512 (files/image/Dockerfile); no Excalidraw source is in this repo. - Server: ours,
cmd/thx-boards(packageinternal/boards): stores boards per org/team, serves the list page and the editor, and relays live edits over a websocket (golang.org/x/net/websocket, BSD-3-Clause). No excalidraw-room or Firebase: one small process does storage and collaboration.
What users get
The list page shows one section per company (org-<org>) and team
(team-<org>-<team>) the user is in, with that space's boards: create, open,
rename, delete. Nobody sees or opens a board of a space they are not in (404).
On a board, everyone present sees each other's edits and pointers live;
after a network drop the page reconnects and resends what was drawn meanwhile (implemented, not covered by test.sh). Conflicts follow
Excalidraw's own rule (higher element version wins, ties to the lower
versionNonce), so clients and server converge without locking.
Identity is Remote-User/Remote-Groups, believed only from the
container's default gateway (where Caddy's connections arrive); other
containers on its network get 403. State changes must be same-origin JSON and the
websocket requires a same-origin Origin, so another site cannot act with a
user's Authelia cookie. The page CSP is default-src 'self' plus what
Excalidraw needs (inline styles, data:/blob: images). The editor never calls
excalidraw.com: fonts and locales load from /vendor/excalidraw/
(EXCALIDRAW_ASSET_PATH).
Caddy site: the standard forward piece thx writes (forward_auth, nothing public).
On disk (THX_DATA): <space>/<id>.meta.json and <id>.scene.json, written
atomically, at most 2 s after an edit and when the last person leaves. Limits:
20 000 elements and 16 MB (elements + embedded images) per board, 8 MB per
message.
Image
A fetch stage (digest-pinned alpine:3.23) downloads and verifies the three npm
tarballs; the final stage is digest-pinned
gcr.io/distroless/static-debian13:nonroot with /vendor copied in, and our
binary bind-mounted read-only from /usr/local/lib/thx/thx-boards. Fetching
runs on the build machine's platform and the target stage only copies, so
docker buildx build --platform linux/arm64 works on an amd64 PC without
emulation (proven: builds, image arch linux/arm64). Starts as root with
CHOWN/DAC_OVERRIDE/SETUID/SETGID only to own /data, then runs as 65532;
read-only root filesystem.
Excalidraw 0.18 is ESM-only (bare imports, needs a bundler); 0.17.6 is the
last release with a UMD build that loads with plain <script> tags, which keeps
the image free of a Node build step. Moving to 0.18 means adding a bundling
stage to the Dockerfile.
Measured (dev PC, ./test.sh)
35 checks plus a real browser: create/list/rename/delete per space; another company or a non-member of the team gets 404 on read, rename, write, delete and the socket; cross-site POST and cross-origin socket refused; two people on one board see each other's elements and pointer live; the newer copy of an element wins; an HTTP update merges the same way; content survives a restart; a spoofed Remote-User from another container gets 403; files owned by 65532. Headless Chrome (headers injected as Caddy would) loads the list page, opens the board under the real CSP, goes live, and a rectangle drawn with the mouse reaches the server, with no page errors.
RAM: a heavy board (3000 elements, 6 MB of images, opened by three people at
once) and a refused 16 MB one: working set peaked at 71 MiB; ram_mb =
mem_limit = 104: the highest measured peak × 1.3, and the highest is 80 MiB, from a rerun at a 92m limit
(2026-11-25, conform lane: 75 MiB). The kernel and dirty part grows with the room it is given, so part of a
higher peak is page cache the kernel would reclaim; the rule still applies uniformly, because 12 MB is cheaper
than an OOM on the box. Without GOMEMLIMIT=48MiB the same test was
OOM-killed at 64m (the heap doubles freely); without any limit memory.peak
reached 176 MiB.
Known gaps
- No per-board sharing beyond the space, no public/read-only links.
- No board history; deleting a board is final (backups have it).
- Embedded images count toward the 16 MB board limit and travel inside the scene; boards with many large photos will hit it.
- The UI (list page) was built plainly and accessibly, not through a design pass.