Self Host Wizard Documentación

Pizarras (boards)

Pizarras en una caja Self Host Wizard: la pieza boards, en board.<dominio de apps>, ingreso forward, límite de memoria 104 MB.

De un vistazo

DatoValor
Direcciónhttps://board.<dominio de apps>
Ingresoforward: Caddy le pregunta a Authelia antes de que la app vea el pedido (forward auth)
Límite de memoria104 MB (ram_mb: pico medido × 1,3)
Base de datosninguna compartida: guarda sus datos en THX_DATA
Necesitalldap, authelia
La necesitannada
Contenedoresboards
Imagen: boardsthx-local/boards:excalidraw-0.17.6-1 (se construye en la caja desde pieces/boards/files/image)
Licencia (según el README)varias; mirá las notas de abajo
Proyecto original (según el README)https://github.com/excalidraw/excalidraw

Cómo activarla

thx enable agrega boards y todo lo que necesita al estado de la caja; después thx apply la instala. Las apps se aplican recién cuando site_domain está definido.

sudo thx enable boards
sudo thx apply

Notas técnicas (pieces/boards/README.md)

Las notas técnicas de cada pieza están en inglés, tal como están en el repositorio.

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 (package internal/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.

Los datos de esta página salen de estos archivos del repositorio selfhostwizard:

  • pieces/boards/piece.toml
  • pieces/boards/compose.yaml
  • pieces/boards/README.md
  • internal/piece/piece.go

Esta página se genera desde el código al compilar el sitio, así que cambia cuando cambia el código.