dorfteich/packages/shared/src
Claude Opus 5 6377faf332
All checks were successful
CI / Lint, typecheck, test (pull_request) Successful in 7m28s
CI / Build container images (pull_request) Successful in 2m7s
CI / Auth e2e pack (pull_request) Successful in 9m37s
CI / Import/export fidelity gate (pull_request) Successful in 1m7s
CD / Build and push images (push) Successful in 23s
CD / Deploy to Test (push) Successful in 12s
CD / Smoke tests against Test (push) Successful in 1m47s
CD / Promote to Int (push) Successful in 16s
CI / Lint, typecheck, test (push) Successful in 7m25s
CI / Build container images (push) Has been skipped
CI / Auth e2e pack (push) Successful in 9m41s
CI / Import/export fidelity gate (push) Successful in 1m12s
#306: instance branding — logo and favicon, cropped in the browser
An instance had no way to look like itself: the top bar said "Dorfteich"
whatever the operator called their instance, `instance.name` was never
rendered in the running app at all, and there was no favicon anywhere —
`index.html` had no `<link rel="icon">` and `public/` held only fonts and
theme-init.js.

Where the line is drawn, and why:

- **The api never decodes an image.** Cropping, scaling and the conversion
  to PNG happen on a canvas in the browser; the api checks the PNG
  signature, reads the IHDR dimensions at their fixed offsets and enforces
  the caps. An image library would put a decoder in front of
  attacker-supplied bytes AND would have to be carried through the
  `--network none` offline build. Reading two big-endian integers is not
  decoding.
- **SVG is refused**, with its own error message rather than a generic
  "not a PNG": it can carry script, and serving it from our own origin
  would be a cross-site-scripting vector. An operator who tried one should
  learn that it is deliberate.
- **The crop is driven by number inputs, not by dragging.** A drag-only
  cropper excludes keyboard and switch users outright; a number input is
  arrow-key operable and screen-reader readable without any custom aria.
  The resulting pixel size is stated in text, not only drawn as a frame.
- **The variant is chosen by CSS, not JavaScript.** `theme-init.js` has
  already resolved `data-theme` before first paint, so the correct logo is
  the one painted rather than the one that appears after a flash. Without a
  dark variant the LIGHT logo carries both themes — the operator's own
  asset shown unchanged beats one they did not choose (the rule #307
  extends to ponds). The settings screen warns; it never blocks.
- **The favicon link is static, its resource dynamic.** index.html stays a
  static file and the api answers with the uploaded icon or a shipped
  default — that route must never 404, or the browser keeps its generic
  icon for good. The default is generated by a script from Node's own zlib
  (`gen-default-favicon.mjs`), for the same offline-build reason.
- Both favicon sizes are uploaded together: one source, one crop, so the
  tab icon and the home-screen icon can never disagree.
- Branding is served WITHOUT a session, because the login screen carries it
  and the browser fetches the favicon before anyone signs in. The admin
  screen says so — an operator may not expect their logo to be public.
- The metadata is not writable through the settings endpoint: it describes
  bytes on disk, and hand-writing it would claim an asset that is not
  there.

`./data/branding` follows the three-step rule #303 paid for: env default +
`data-dirs.ts` entry, compose volume (repo AND the stages on ONE), and the
`mkdir`/`chown` line in the api Dockerfile. `data-dirs.test.ts` is new and
closes the hole that made #303's variant invisible: the nightly archive
skips a missing directory WORDLESSLY, so the fence now demands that every
`*_DIR` the backup env declares actually travels in the archive. Verified
against the real defect — removing the line fails it by name.

Audit catalogue v1.7 (`branding.changed`), carrying `scope` from the start
so #307 is the same event with a different scope, not a second id.

Verified: api suite 103 files green (a lone `public-api` ECONNRESET under
local parallel load, green in isolation — the documented local flake);
branding suite 12 tests against a real directory; crop arithmetic unit
tests; a11y pack 11/11 in both schemes; /admin measured at 320px with the
new section (overflow 0); and the whole flow walked in the browser: upload
→ crop 780×180 → stored as 512×118 → logo in the sidebar linking home with
the instance name as its accessible name → topbar wordmark following
`instance.name` → light logo still shown under `data-theme="dark"`.
2026-08-01 19:30:52 +02:00
..
editor-schema #169: Nicht-Text-Inhalte — Task-Checkboxen, Wissensgraph 2026-07-21 14:35:16 +02:00
permissions #205: classification inherits down the tree; lowering is a guarded, audited act 2026-07-31 06:12:26 +02:00
admin-users.ts Add Site-Admin user management (#59) 2026-07-10 00:31:41 +02:00
api-error.ts Add NestJS API skeleton with config, logging, and /healthz 2026-07-04 19:10:07 +02:00
api-tokens.ts Public REST API v1: personal access tokens, instance switch + per-pond opt-in (#104) 2026-07-12 11:17:03 +02:00
auth.test.ts Add user, identity, session, and auth-support data model 2026-07-05 00:42:22 +02:00
auth.ts #214: OIDC Authorization Code with PKCE, Keycloak as reference IdP 2026-07-31 12:44:52 +02:00
backup-set.ts Nextcloud backup target: admin-configured, manual + scheduled uploads, in-app restore (#103) 2026-07-12 10:39:18 +02:00
backup-status.ts Backup mirror to BASEL: rsync of the sets after every successful run (#84) 2026-07-12 12:20:32 +02:00
backup-target-policy.test.ts #192: deploy-level backup target allowlist 2026-07-30 12:17:14 +02:00
backup-target-policy.ts #192: deploy-level backup target allowlist 2026-07-30 12:17:14 +02:00
branding.ts #306: instance branding — logo and favicon, cropped in the browser 2026-08-01 19:30:52 +02:00
collab-token.test.ts #188: purpose-bound token keys via HKDF, jose replaces the homegrown JWT 2026-07-30 06:41:11 +02:00
collab-token.ts #188: purpose-bound token keys via HKDF, jose replaces the homegrown JWT 2026-07-30 06:41:11 +02:00
comments.ts Add threaded page comments: data model, API, and comment policy (#91) 2026-07-11 21:42:29 +02:00
conversion.ts Obsidian vault import: endpoint, job orchestration, rollback (#117) 2026-07-14 17:13:11 +02:00
custom-fonts.test.ts #303: operator-uploaded fonts — storage, API, PDF embedding, backup 2026-08-01 14:49:13 +02:00
env.test.ts Add Prisma with PostgreSQL, automatic migrations, and /readyz 2026-07-04 19:16:44 +02:00
env.ts #306: instance branding — logo and favicon, cropped in the browser 2026-08-01 19:30:52 +02:00
favorites.ts Favorites: personal page stars, golden icons, sidebar filter (#132) 2026-07-16 12:03:55 +02:00
feed-tokens.ts #149: Atom-Feeds für Teiche und Seiten, privat via Feed-Token 2026-07-20 00:49:53 +02:00
files.ts Add non-image attachments with allowlist, SVG policy, and file managers (#61) 2026-07-10 02:52:40 +02:00
fonts.test.ts Add per-pond fonts: catalog, build, application, and admin UI (#66) 2026-07-10 11:16:29 +02:00
fonts.ts #303: operator-uploaded fonts — storage, API, PDF embedding, backup 2026-08-01 14:49:13 +02:00
health.test.ts Scaffold pnpm monorepo with lint, format, and test tooling 2026-07-04 19:06:27 +02:00
health.ts Scaffold pnpm monorepo with lint, format, and test tooling 2026-07-04 19:06:27 +02:00
home.ts Editable landing page for the Site Admin 2026-07-12 23:50:16 +02:00
i18n-tools.test.ts Add i18n with i18next, German and English, and a key-parity check 2026-07-04 19:23:45 +02:00
i18n-tools.ts Add i18n with i18next, German and English, and a key-parity check 2026-07-04 19:23:45 +02:00
index.ts #306: instance branding — logo and favicon, cropped in the browser 2026-08-01 19:30:52 +02:00
labels.test.ts Add label UI: tree management, page assignment, and sidebar filter (#44) 2026-07-09 11:41:42 +02:00
labels.ts Page hierarchy: parentId, create-under-parent, reparent (#106) 2026-07-14 09:57:47 +02:00
legal.ts Add instance legal pages with public rendering and footer links (#82) 2026-07-11 16:40:04 +02:00
links.ts Pond-wide wikilink graph endpoint (#111) 2026-07-14 10:21:25 +02:00
members.ts Add pond member management UI (#54) 2026-07-09 20:22:52 +02:00
notifications.ts #151: Mention-Benachrichtigungen über die Glocke 2026-07-20 01:25:16 +02:00
pages.ts #212: mark attachment downloads by filename prefix and companion file 2026-07-31 07:29:16 +02:00
plugins.ts #232: plugin allowlist with SHA-256 hash pinning 2026-07-31 21:26:36 +02:00
ponds.ts #302: configurable pond start page, created with every new pond 2026-08-01 08:06:35 +02:00
public-api.ts #211: classification through feeds, public API, search and the no-JS shell 2026-07-31 07:23:53 +02:00
quotas.ts Add Site-Admin quota override management UI (#58) 2026-07-10 00:14:28 +02:00
search.test.ts Add SearchProvider interface with PostgreSQL FTS (#49) 2026-07-09 13:25:05 +02:00
search.ts #211: classification through feeds, public API, search and the no-JS shell 2026-07-31 07:23:53 +02:00
secret-store.ts Add backup sidecar: nightly dump, volume archive, prune, status, restore (#83) 2026-07-11 17:29:15 +02:00
setup.ts Add the first-run setup wizard UI (#81) 2026-07-11 16:05:01 +02:00
system.ts #224: read-trail storage — partitioning, retention, admin query path 2026-07-31 12:21:45 +02:00
text-diff.test.ts Add version history UI: list, view, diff, restore (#42) 2026-07-09 08:53:42 +02:00
text-diff.ts Add version history UI: list, view, diff, restore (#42) 2026-07-09 08:53:42 +02:00
theme.test.ts #184: shared accent engine — WCAG-conforming tokens by construction 2026-07-29 08:59:27 +02:00
theme.ts #184: shared accent engine — WCAG-conforming tokens by construction 2026-07-29 08:59:27 +02:00
token-crypto.crossruntime.test.ts #188: purpose-bound token keys via HKDF, jose replaces the homegrown JWT 2026-07-30 06:41:11 +02:00
token-crypto.ts #214: OIDC Authorization Code with PKCE, Keycloak as reference IdP 2026-07-31 12:44:52 +02:00
tree.ts Page hierarchy: parentId, create-under-parent, reparent (#106) 2026-07-14 09:57:47 +02:00
users.ts #150: @-Mentions — Inline-Node, instanzweite User-Suche, Autocomplete 2026-07-20 00:56:07 +02:00
vs-nfd-profile.test.ts #243: VS_NFD_MODE and the machine-readable hardening-profile catalog 2026-07-31 18:24:04 +02:00
vs-nfd-profile.ts #232: plugin allowlist with SHA-256 hash pinning 2026-07-31 21:26:36 +02:00
watches.ts Add watches: follow pages and ponds with auto-watch preferences (#93) 2026-07-11 22:59:11 +02:00
webdav.test.ts Nextcloud backup target: admin-configured, manual + scheduled uploads, in-app restore (#103) 2026-07-12 10:39:18 +02:00
webdav.ts Nextcloud backup target: admin-configured, manual + scheduled uploads, in-app restore (#103) 2026-07-12 10:39:18 +02:00