release: v0.11.0 — journal fixes, admin URLs, design system cleanup (#432)
* fix(screenshots): sharp-Typen fuer 0.34 und 0.35 gleichzeitig (#410)
sharp 0.35 ist von `export =` auf ESM umgestellt: der Modul-Namespace
ist nicht mehr aufrufbar, die Factory sitzt unter .default. Der
Type-Check brach damit in scripts/screenshots.ts weg, sobald der
Next-Bump (#402) sharp von 0.34.5 auf 0.35.3 mitzieht -- sharp ist hier
keine deklarierte Dependency, sondern kommt ueber Next mit.
Die Form wird jetzt aus dem installierten Paket abgeleitet statt
festgeschrieben, zur Laufzeit wie im Typ. Geprueft mit beiden
Versionen: tsc laeuft mit 0.34.5 und mit 0.35.3 fehlerfrei durch.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(deps): bump the nextjs group across 1 directory with 2 updates (#402)
Bumps the nextjs group with 2 updates in the / directory: [next](https://github.com/vercel/next.js) and [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next).
Updates `next` from 16.2.12 to 16.3.0
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/compare/v16.2.12...v16.3.0)
Updates `eslint-config-next` from 16.2.12 to 16.3.0
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/commits/v16.3.0/packages/eslint-config-next)
---
updated-dependencies:
- dependency-name: eslint-config-next
dependency-version: 16.3.0
dependency-type: direct:development
update-type: version-update:semver-minor
dependency-group: nextjs
- dependency-name: next
dependency-version: 16.3.0
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: nextjs
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore(deps-dev): bump prettier from 3.8.3 to 3.9.6 (#405)
Bumps [prettier](https://github.com/prettier/prettier) from 3.8.3 to 3.9.6.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.8.3...3.9.6)
---
updated-dependencies:
- dependency-name: prettier
dependency-version: 3.9.6
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* docs(changelog): Unreleased-Sektion fuer die Bumps nach v0.10.0 (#413)
Die Dependency-PRs sind nach dem Release auf dev gelandet, teils auch
auf main. Ohne Eintrag waeren sie beim naechsten Release unsichtbar --
inklusive Next 16.3.0, das CVE-2025-13465 mitbringt.
Ausserdem im 0.10.0-Abschnitt nachgetragen, dass der Trivy-Scan bis
#409 nie gelaufen ist. Der Fix steckt im Tag v0.10.0, fehlte aber in der
Aufzaehlung -- und "Images werden bei jedem Publish gescannt" stand im
Changelog, waehrend der Job im Action-Setup abbrach.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(gallery): per-album sort order, independent of Immich (#408) (#414)
Album order was dictated entirely by Immich: getAlbum() sorted by the
album's own asc/desc flag, so a Folio album always mirrored the archive.
A curated series has a narrative order that has nothing to do with
capture time, and changing the Immich album's sort to fit the website
changes it for the archive too.
Adds an optional per-album `sort` in gallery.yaml, editable in /admin,
defaulting to today's behaviour so every existing config is unchanged:
immich (default) | newest | oldest | filename | manual
`manual` is a pinned *prefix*: `assetOrder` lists only the photos placed
by hand, everything else follows in the album's Immich order. A full
permutation of a 2,000-photo album would be ~80 KB of UUIDs in a file
that is rewritten and copied to content/.backups/ on every admin save.
It also makes drift fall out for free — photos removed in Immich never
match, new ones land in the tail rather than being hidden.
Sorting is applied after the cache read, not before the cache write, so
the LRU keeps one canonical Immich-ordered copy per album. That avoids
putting the mode in the cache key, lets a config change take effect
without depending on invalidation, and keeps the stale-serving path
correct. cache.get() returns the stored object by reference, so
withSort() returns a shallow clone with a new array — sorting in place
would reorder the shared entry, and under request coalescing every
concurrent caller would be sorting the same array.
Also fixes a prerequisite bug: /api/admin/albums/[albumId]/assets read
album.assets from GET /albums/:id, which Immich 3.x no longer populates
(lib/immich.ts:507). The hero picker's "This Album" tab returned nothing
and threw outright when the key was absent. It now goes through the
client's paginated metadata search, with ?types=all to opt videos in for
the reorder editor.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): drop decorative emoji from the sort select labels (#415)
An <option> cannot contain markup, so the SVG set in Icons is not
reachable there — but a decorative emoji is not a substitute for it.
Plain text instead; the album card badge already uses a real icon.
The remaining emoji in the admin panel (asset picker tabs, section
headings, layout picker options) predate this branch and are left for a
separate cleanup.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): replace emoji icons with the shared SVG icon set (#416)
The admin panel mixed two icon conventions: inline SVGs from
`Icons.tsx` in most components, and decorative emoji in the asset
picker and a few PageBuilder labels. Emoji render inconsistently
across platforms, ignore the accent colour, and cannot inherit the
`.svg-icon` sizing rules.
- Icons.tsx: add `IconStar` (filled — it marks a state, not an
action) and `IconImage`.
- AssetPicker: the three tab labels and the favourite tile badge now
use IconFolder / IconStar / IconImage.
- PageBuilder: the "Standalone Albums" and "Subpages" headings use
the icon set instead of an emoji.
- PageBuilder: the layout picker drops its emoji for plain text. An
<option> cannot contain markup, so an SVG is impossible there and a
decorative glyph is not a substitute.
- admin.css: align icon and label in the picker tabs, and swap the
favourite badge's text-shadow for drop-shadow, which is what
applies to an inline SVG.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): fold PageBuilder's local icons into the shared Icons module (#418)
* refactor(admin): fold PageBuilder's local icons into the shared module
PageBuilder.tsx carried its own `Icons` object duplicating most of the
glyphs already exported by Icons.tsx, with hardcoded sizes and slightly
divergent paths. Migrate all 32 call sites to the shared module and
delete the local object.
Five glyphs had no counterpart and are added to Icons.tsx as 1:1 ports
of the local paths: IconX, IconPlus, IconHome, IconCopy, IconImage.
The local ExternalLink and Check are dropped rather than ported — both
had zero call sites.
Two glyphs change shape slightly, which is the point of consolidating:
the shared IconCamera includes the viewfinder bump the local copy
omitted, and drag handles now use IconGripVertical.
IconGripVertical uses the module's square 24x24 viewBox, so `.svg-drag`
goes from 12x18 to 18x18 — the old non-square box would letterbox the
glyph down to 12x12 and shrink the handle.
* fix(admin): resolve icon-module integration after #416
Merging dev brought in #416, which added a second IconImage to Icons.tsx
and two <Icons.Camera>/<Icons.Folder> section headers that reference the
local Icons object this PR removes. Git merged both cleanly but the result
did not type-check.
- drop the duplicate IconImage (both copies were byte-identical)
- point the two section headers at the imported IconCamera/IconFolder
- refresh the SORT_LABELS comment: the icon set is imported now, not
declared below
---------
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* fix(config): allow an empty gallery, guard against a double /api suffix (#421)
An empty gallery is now a valid, rendered state instead of a throw: deriveGallery() no longer requires at least one album or subpage, so a deployment with no albums yet renders a bare homepage the owner can fill in via /admin.
getConfig() also stops appending /api to an Immich URL that already ends in it, which previously produced .../api/api and broke every upstream request.
Includes a restore of the per-album sort test cases, which the branch had lost by being cut before #408/#414.
* feat(admin): favicon upload, served from the content volume (#422)
Adds a bundled default favicon, an upload widget in admin Settings > General, and a route that serves the icon from the writable content/ volume with a fallback to the bundled default. Raster uploads (PNG/ICO/JPEG) are wrapped in an SVG container; the response carries its own CSP so an uploaded SVG cannot execute script on the origin.
The GET route revalidates with an ETag instead of caching immutably, so a newly uploaded icon shows up immediately. Uploads are written via temp file + rename, and a Reset button restores the bundled default.
* ci: flag unformatted files in a PR, without blocking it (#424)
Prettier is configured as an error rule in eslint.config.mjs but has never run in CI, so part of the tree predates it. A final CI step now diffs against the PR base, runs prettier --list-different over the changed files, and emits a warning annotation per offender plus a job summary.
Advisory by design: it never fails the job. Blocking would turn a PR red for merely touching a file that was already unformatted, and normalising the tree in one commit would wreck git blame and conflict with the PRs in flight.
Requires fetch-depth: 0, since diffing against the base needs its history.
* feat(install): first-run wizard gated by a one-time setup token (#419)
Adds /install, a four-step first-run wizard: connect to Immich, optionally pick albums, name the site, finish. It verifies the credentials against the Immich server before writing anything, then writes gallery.yaml, settings.yaml and a content/install.json carrying the Immich credentials and a generated site secret.
install.json exists because a running process cannot pick up new env vars — the wizard has to write configuration that takes effect without a restart. getInstallCredentials() merges it under the real environment, so env vars always win and rotation stays a matter of setting one.
Both the page and the API routes are gated by a one-time setup token printed to the server log, so a deployment that is reachable before gallery.yaml exists cannot be configured by whoever finds it first. The token is stored in content/.setup-token (0600) rather than a module variable: Next.js bundles the page and each route handler separately, so a module-level token left the page and the API disagreeing inside one process and the wizard stuck on step 1. It is removed once the install completes.
The admin password is stored as an scrypt hash using the scheme lib/auth.ts already applies to album passwords; a plaintext ADMIN_PASSWORD env var keeps working.
* docs: document the setup wizard, fix the read-only content mount (#425)
Quick Start now leads with the /install wizard, with the hand-written YAML route kept alongside it, and a First-Run Setup section covers the setup token, the files the wizard writes, and env-var precedence.
Two corrections: both Docker examples mounted content/ as :ro, which silently breaks the wizard, the admin panel and the backup rotation alike — docs/admin-panel.md already said so and the README contradicted it. And nothing documented that content/install.json holds the Immich API key, so a backup of content/ is a backup of credentials.
Also adds a Contributors section crediting the people whose work is in the project.
* feat(admin): floating save bar pinned to the bottom of the viewport (#426)
The save bar was the first, static element inside .admin-main. Since the
document itself scrolls, it left the viewport as soon as you scrolled down
— editing a subpage section or a settings block far below gave no visible
dirty hint and no reachable save button.
Replace it with a bottom-pinned floating bar shared by both editors. It
only mounts while there is something to act on (unsaved changes, an
in-flight save, or a result message), so it never covers content while
idle. The success message clears after 5s, which hides the bar again.
- new SaveBar component, replacing the duplicated markup in PageBuilder
and SettingsEditor
- adopt the previously unused .floating-save-bar CSS: slide-in keyframes
(carrying translateX(-50%)), dirty border, wrap/gap, mobile variant and
a prefers-reduced-motion opt-out; z-index 900 keeps it below modals
- .admin-main gains bottom padding so the bar never covers page content
- drop the now-unreachable idle hints: the ⌘S hint becomes a button title,
the Live Sync note becomes a static line above the settings layout
- header "Site" link now bypasses the cache (/?fresh=1), so the preview
stays reachable when the bar is hidden
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(admin): themed listbox for the album sort control (#427)
The per-album "Photo order" control was a native <select>. Because an
<option> cannot contain markup, its choices could not use the admin
panel's currentColor SVG set — the reason #415 had to fall back to plain
text after dropping the emoji labels.
Adds a Listbox component implementing the ARIA combobox/listbox pattern,
so options can render a glyph beside their label:
- DOM focus stays on the trigger button; the active option is announced
through aria-activedescendant, keeping focus management to one element
- Keyboard: arrows (clamped at the ends, like a native select),
Home/End, Enter/Space to commit, Escape to cancel, Tab commits and
moves on, and prefix type-ahead with a repeat-key cycle
- Outside dismissal on pointerdown, so a press starting outside closes
the popup before the click retargets
The sort options now carry an icon each: calendar, arrow-down, arrow-up,
an A→Z marker, and the drag glyph for manual — matching the badge the
album card already shows. SORT_LABELS stays plain text because the badge
feeds it to a title attribute.
Closes #417
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(git): ignore generated design handoff folders
* fix(admin): stop the album sort dropdown clipping, and simplify the panel (#428)
* fix(admin): render listbox popup in a portal so it escapes modal clipping
The sort control's popup was position:absolute inside three clipping ancestors
(.album-drawer overflow:hidden > .album-drawer-body overflow-y:auto >
.modal-right-column overflow-y:auto), so it was cut off at the bottom of the
Edit Album Details modal. z-index could not help: clipping happens before
stacking. It also always hung below the trigger, with no flip.
Portal the popup to document.body and position it from the trigger's viewport
rect, flipping above when there is more room there and capping max-height to the
space available so it scrolls internally rather than overflowing. It is
dismissed on scroll and resize, since the anchor is only measured on open.
The outside-pointerdown handler now also treats the popup as inside; without
that the portalled list counts as outside, and a click on an option would close
it before the selection commits.
* refactor(admin): single-column album details panel
The left column spent 1.2fr on a cover thumbnail and three stat rows, two of
which (Status, Custom Hero) only restated the form fields opposite them, while
the form itself was squeezed into 1.8fr behind a second nested scroller.
Stack the drawer in one column instead: cover as a banner, then the form at full
width, with the UUID moved into the footer. The body is now the only scroll
container, which also removes one of the ancestors that was clipping the sort
popup.
---------
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* fix(admin): give the portalled listbox its theme back, lock the page behind modals (#429)
Two defects in the album editor.
The sort listbox popup painted transparent. Every --admin-* variable is
scoped to .admin-layout, and since the popup moved into document.body it
sits outside that subtree, so background/border/text all resolved to
nothing. It now carries its own copy of the palette in both colour
schemes, plus the font it no longer inherits.
Scrolling inside a modal also moved the page behind it. No admin modal
ever locked body scroll: the overlay covers the page but does not absorb
wheel events, so a scroll starting on the backdrop — or continuing past
the end of the modal's own scroller — reaches the document.
overscroll-behavior cannot cover that case on its own, because it only
applies to scroll containers and the backdrop is not one.
useScrollLock freezes body while a modal is open and compensates for the
width the scrollbar gives up, so nothing shifts underneath. Each lock
restores the inline value it found, which makes nesting work without a
counter — a picker opened from the drawer restores the drawer's hidden
state instead of clearing it. Applied to both drawers and all four
picker modals, which share the defect. overscroll-behavior: contain on
the scrollers stops the chaining they can handle themselves.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* fix(security): allow unsafe-eval in CSP script-src during dev mode
* feat(journal): add Journal Studio with split-screen editor, live preview and dedicated routes
* fix(build): separate client parser from server journal-service and fix build type errors
* fix(journal): Fotos rendern, Layout und Lightbox-Steuerung korrigieren
Fünf unabhängige Fehler in der öffentlichen Journal- und Essay-Ansicht:
* Foto-Blöcke wurden nie angezeigt. EssayView löst ein Foto über
PhotoItem.id auf, und das sind verschlüsselte Tokens — die Blöcke aus
dem Markdown tragen aber rohe Asset-UUIDs. Jede Zuordnung lief ins
Leere, und nicht auflösbare Blöcke werden still verworfen. Die IDs
werden jetzt serverseitig übersetzt; damit verschwinden nebenbei die
rohen UUIDs aus dem Client-Payload, die dort laut Projektregel nie
auftauchen dürfen. Nicht auflösbare Referenzen werden geloggt.
* Überschriften standen weiter links als der Fließtext. Jeder Block
hatte einzeln `max-width: 68ch`, und `ch` ist relativ zur Schrift des
Elements — die Serif-Überschrift ergab eine breitere Spalte. Ersetzt
durch eine gemeinsame, font-unabhängige `--essay-measure`.
* Fullbleed-Fotos bluteten nur nach links aus: `.essay-figure` ist
`width: 100%`, wodurch die Box überbestimmt ist und der negative
rechte Margin verworfen wird.
* Foto-Paare stellten beide Bilder gleich breit dar, wodurch ein
Hochformat neben einem Querformat doppelt so hoch wurde. Jetzt eine
Justified-Reihe: Breite proportional zum Seitenverhältnis, dadurch
exakt gleiche Höhen ohne Beschnitt.
* Die Lightbox hatte im Journal keine Tastatursteuerung und keine
Scroll-Sperre — beides lag in PhotoGrid, also nur im Album-Raster.
Verlagert in die Lightbox selbst, der doppelte Handler in PhotoGrid
entfernt (sonst wäre pro Pfeildruck zwei Bilder weitergesprungen).
Zusätzlich sind Proofing-Herzen und das EXIF-Panel im redaktionellen
Modus abschaltbar und im Journal aus: Client-Proofing ist ein
Übergabe-Workflow für Alben, keine Funktion einer Reportage. Auf der
Übersicht wurde der Untertitel doppelt gerendert, weil extractExcerpt()
auf ihn zurückfällt.
* feat(admin): eigene URLs für alle Bereiche und überarbeiteter Journal Studio
Das Panel war eine einzige Client-Komponente, die ihre Tabs über
useState umschaltet: keine Route pro Bereich, kein Deep-Link, kein
Zurück-Button, und nach jedem Reload landete man wieder auf "Pages".
Auch der Journal-Editor hatte keine eigene URL.
Jetzt sieben echte Routen (/admin, /admin/pages, /admin/journal,
/admin/journal/<slug>, /admin/settings, /admin/settings/<section>,
/admin/analytics). Die Shell mit Auth-Prüfung und Kopfzeile sitzt im
Layout und umschließt children — so bleibt die Session-Prüfung über
Routenwechsel montiert, statt bei jedem Tab-Wechsel neu zu laufen und
den Spinner aufblitzen zu lassen. Unbekannte Settings-Sections fallen
auf General zurück.
Im selben Zug der Journal Studio, der die Routing-Änderung ohnehin
berührt:
* Alle Eingabefelder nutzten die Klasse `admin-input`, die in keinem
CSS definiert war — sie fielen auf Browser-Defaults zurück. Jetzt
gestylt, gescoped, damit der generische Name nicht ins übrige Panel
leckt.
* Der Split View ist per Divider verschiebbar (Maus, Tastatur,
Doppelklick zum Zurücksetzen), Breite in localStorage.
* Das Studio bricht aus der 1120px-Spalte aus, die Preview hat Platz.
* Die Preview zeigte für jedes Foto fest 3:2 und log damit über das
Layout der veröffentlichten Seite; die echten Verhältnisse werden
jetzt an den Thumbnails gemessen.
* Blöcke mit alten positionsbasierten Foto-Referenzen werden markiert —
die lassen sich auf einer eigenständigen Journal-Seite nicht auflösen
und verschwanden bisher stillschweigend.
* Blocktyp-Chips als gemeinsame Komponente, monochrom und per Icon
unterschieden statt in einer eigenen Blau/Lila/Orange-Palette, die
sonst nirgends im Panel vorkommt.
* Emojis raus, SVG-Icons rein.
* fix(admin): Designsystem-Lücken im Panel schließen
Eine systematische Suche nach Klassen, die im TSX benutzt, aber in
keinem CSS definiert sind, hat vier Stellen mit demselben Muster
gefunden:
* `admin-btn-secondary` und `admin-btn-danger` existierten nicht.
Sämtliche Löschen-Buttons sahen aus wie normale Buttons — keine
Warnwirkung. Als `.admin-btn.admin-btn-danger` geschrieben, weil die
Varianten mit den Größenklassen kombiniert werden, die weiter unten
ihren eigenen Hintergrund setzen.
* `page-progress-fill` fehlte: die Balken im Analytics-Panel waren
leere Rinnen, der Wert unsichtbar. Ebenso `analytics-empty` und
`admin-loading-container`.
* `subpage-drawer-section`, `subpage-drawer-title-group` und
`input-with-icon` im PageBuilder waren wirkungslos und teils mit
Inline-Styles notdürftig kompensiert.
* `grid-card-preview` fehlte, wodurch alle Layout-Vorschauen auf Höhe
null kollabierten. Nur "Showcase" war sichtbar — und das aus Versehen,
weil sein Tile `hero-tile` hieß und damit die `aspect-ratio` einer
fremden PageBuilder-Klasse erbte. Umbenannt.
Dazu die Theme-Vorschauen, die praktisch identisch aussahen: alle
sieben zeigten dieselben drei quadratischen Kacheln, einziger
Unterschied war die Hintergrundfarbe. Sie spiegeln jetzt die echten
Preset-Daten aus lib/config/theme.ts — Schriftcharakter, Eckradius,
Rasterdichte, Passepartout bzw. Schatten.
Die Kopfzeile richtet sich an einer gemeinsamen Steuerhöhe aus. Der
"Site"-Link war höher als die Buttons daneben: `.admin-btn` hatte keine
explizite line-height, und <button> bekommt box-sizing: border-box vom
Browser, <a> nicht. Die Statusanzeige setzte weder Schriftfamilie noch
-größe und fiel auf den Browser-Default zurück — sie war nie Teil des
Designsystems. Jetzt gleiche Höhe und Typografie, Pillenform als
Zustandsanzeige, Trenner zur Aktionsgruppe. Das dauerhafte Pulsieren
des grünen Punkts entfällt; Animation bleibt den Zuständen vorbehalten,
die Aufmerksamkeit brauchen.
Restliche Emojis durch SVG-Icons ersetzt.
* feat(admin): add scroll-to-top toggle and SVG arrow
The back-to-top button was always on and drew its arrow with the ↑ text
character. Add a `scrollToTop` setting (General section in the admin
panel, defaults to on so existing sites are unaffected) and replace the
glyph with a stroked SVG that inherits currentColor across all presets.
Scroll handling is now rAF-throttled, and prefers-reduced-motion turns
off both the hover lift and the smooth scroll.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* security(journal): escape author HTML instead of filtering it
CodeQL flags 26 high-severity alerts on the release PR; the bulk of them
point at sanitizeHtml(), a denylist of three regexes whose output goes
into dangerouslySetInnerHTML. I reproduced the bypasses before changing
anything — all four pass the old filter:
<img src=x onerror=alert(1)> unquoted handler, regex wants quotes
<img src=x onerror='alert(1)'> single quotes, same reason
<svg onload=alert(1)> not a <script> tag
javasjavascript:cript:alert(1) one-pass replace, the rest recombines
Plus an attribute breakout in the link renderer, which interpolated the
URL into href="${url}" unescaped:
[x](" onmouseover=alert(1) x=") -> <a href="" onmouseover=alert(1" ...>
Replaced with escaping. Every `&<>"'` in author text becomes an entity
before any markdown rule runs, so the only tags in the output are the
ones renderInlineMarkdown builds itself and a URL cannot leave its
attribute. Link schemes are now an allowlist (http, https, mailto, tel,
relative, anchor); anything else renders as plain text.
The serializer needed decodeHtmlEntities to match: without it a save
would write `<` into the Markdown file and the next parse would
escape the `&` again, corrupting the text further on every round trip.
A test covers parse -> serialize -> parse stability.
Two existing tests asserted the old behaviour and were rewritten rather
than deleted: one expected the script tag to be *removed* from the
output, the other expected the substring "onerror" to be absent. Both
now assert the property that matters — that no tag can form — because
`onerror` surviving as inert text is fine.
Exploitation required admin access either way: journal and essay text
comes from the studio or from content/*.md. This removes the weakness,
it does not close an open door.
* fix(journal): contain file paths, fix frontmatter escaping, defuse two regexes
Follow-up to the CodeQL findings on release PR #432. I went through all 23
alerts individually; this addresses the ones that are worth addressing and
documents the ones that are not.
Path containment (12 alerts, all false positives). Every path built from a
slug goes through isValidSlug(), a strict `/^[a-zA-Z0-9_-]+$/` allowlist —
verified against `../../etc/passwd`, `foo/../../bar`, `a/b`, `..` and
friends, all rejected. CodeQL cannot see it because the check lives in
another module. Added a containedPath() helper that resolves the path and
refuses anything landing outside the content directory: a second lock on a
door that was already locked, and a barrier the analysis can follow. Also
removed the dead `slug.endsWith('.md')` branches — isValidSlug rejects
dots, so they could never be taken.
Frontmatter escaping (1 alert, a real bug). The serializer escaped `"` but
not `\`, and the parser never unescaped anything. A title containing either
character gained a backslash on every save/load cycle:
Path C:\Users "quoted" -> Path C:\\Users \"quoted\" -> ...
Escaping now covers the backslash first and the parser undoes both. A round
trip test covers quotes, backslashes, colons and apostrophes.
Two of three ReDoS regexes (2 alerts). The heading pattern had `\s+` next to
`(.+)`, which overlap, so the engine tried every split of the whitespace run
before failing; it is `[ \t]+` and `(\S.*)` now. The quote author pattern
wrapped a lazy group around an optional group — the quadratic case — and is
an index split on the first separator now.
The third regex, the bold/italic pass, is deliberately left alone. Rewriting
it with a negated class removes the backtracking but breaks nesting:
`**bold *and italic* here**` renders as `*<em>bold </em>and italic<em> here</em>*`.
The input is Markdown from an authenticated admin, never a visitor, so the
worst case is an author slowing down their own page. The comment in the code
says so.
Not addressed: 5 js/insufficient-password-hash alerts. They ask for a slow
KDF where the code uses SHA-256/HMAC — correct in general, but the admin
password comes from an environment variable and is never stored, so a
stronger KDF protects nothing that is not already in plaintext in the
environment.
399 unit tests pass (18 new), build and tsc clean.
* fix(journal): split the quote author by scanning, not by pattern
Cleaning up after myself. #439 replaced the quote author regex
`/^(.*?)(?:\s+--\s+(.+))?$/` — a lazy group around an optional one, the
quadratic case — with `/\s+--\s+/`, and CodeQL promptly flagged the
replacement for the same reason. One reported pattern traded for another.
splitQuoteAuthor() scans for the first `--` that has whitespace on both
sides. Linear, and it needs no reasoning about the regex engine at all.
Behaviour is identical to the original regex, checked case by case
against it: separator, no separator, several separators, tabs, wide gaps,
`a--b` without spaces, leading and trailing separators, empty string. All
nine are covered by tests, plus one asserting it stays fast on a 50k
whitespace run.
* security(admin): derive the session signing key with scrypt
getSigningKey() ran the admin password through a single SHA-256 digest.
It is key derivation rather than password storage, so it was never a
stored-hash problem — but if the derived key ever leaked, one fast hash
makes recovering the password by brute force cheap. CodeQL flags it as
js/insufficient-password-hash and, for this particular alert, has a
point.
scrypt now. Two details that matter:
The salt has to be stable. A random salt would produce a different key on
every call and invalidate every session; it is derived from AUTH_SECRET,
which is deployment-specific. Verified across separate processes: same
inputs produce a verifying token, so a restart or redeploy does not log
everyone out.
The result is cached for the process lifetime. scrypt is deliberately
slow and getSigningKey() runs on every admin request — deriving per call
would add ~24ms to each one. The cache key is a digest of secret plus
password, so a rotation misses the cache and derives again, and no extra
plaintext copy of the password is kept around.
Measured: first derivation 24ms, subsequent calls 0.12ms. Password
change and secret change both invalidate an existing token, checked in
separate processes.
Note the one-time effect: existing admin sessions are invalidated by the
change in derivation, so everyone logs in once more.
* security(admin): key the signing-key cache on its inputs, not a digest
#441 removed the SHA-256 digest of the admin password from the key
derivation and introduced a new one three lines above it, as the cache
key. Same rule, same file: CodeQL reported it immediately.
The comment justifying it was wrong too. It claimed no second plaintext
copy of the password was retained, while building the digest input
allocates exactly that in order to hash it.
The cache now holds the two input strings and compares them directly.
They are the same objects the env and install caches already hold, so
nothing extra is retained, and no fast hash of the password exists in
memory for the life of the process.
Re-verified after the change, in separate processes: a token from one
process verifies in another with the same inputs, a changed password or
secret rejects it, first derivation 24ms, cached calls 0.001ms.
That leaves scrypt as the only place the password is hashed here. The
two HMACs further down operate on the derived key and on token data, not
on the password; the constant-time comparison in verifyAdminPassword is
the previously dismissed one.
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: lancetm714 <108419425+lancetm714@users.noreply.github.com>
2026-08-14 16:55:07 +02:00
|
|
|
/* ── Journal Studio & Editor CSS ──────────────────────────────────── */
|
|
|
|
|
|
|
|
|
|
/*
|
2026-10-02 18:14:23 +02:00
|
|
|
* The studio is a full-width workspace: it breaks out of the shared
|
|
|
|
|
* `--admin-content-width` column so the split view has room for editor *and*
|
|
|
|
|
* preview.
|
release: v0.11.0 — journal fixes, admin URLs, design system cleanup (#432)
* fix(screenshots): sharp-Typen fuer 0.34 und 0.35 gleichzeitig (#410)
sharp 0.35 ist von `export =` auf ESM umgestellt: der Modul-Namespace
ist nicht mehr aufrufbar, die Factory sitzt unter .default. Der
Type-Check brach damit in scripts/screenshots.ts weg, sobald der
Next-Bump (#402) sharp von 0.34.5 auf 0.35.3 mitzieht -- sharp ist hier
keine deklarierte Dependency, sondern kommt ueber Next mit.
Die Form wird jetzt aus dem installierten Paket abgeleitet statt
festgeschrieben, zur Laufzeit wie im Typ. Geprueft mit beiden
Versionen: tsc laeuft mit 0.34.5 und mit 0.35.3 fehlerfrei durch.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(deps): bump the nextjs group across 1 directory with 2 updates (#402)
Bumps the nextjs group with 2 updates in the / directory: [next](https://github.com/vercel/next.js) and [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next).
Updates `next` from 16.2.12 to 16.3.0
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/compare/v16.2.12...v16.3.0)
Updates `eslint-config-next` from 16.2.12 to 16.3.0
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/commits/v16.3.0/packages/eslint-config-next)
---
updated-dependencies:
- dependency-name: eslint-config-next
dependency-version: 16.3.0
dependency-type: direct:development
update-type: version-update:semver-minor
dependency-group: nextjs
- dependency-name: next
dependency-version: 16.3.0
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: nextjs
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore(deps-dev): bump prettier from 3.8.3 to 3.9.6 (#405)
Bumps [prettier](https://github.com/prettier/prettier) from 3.8.3 to 3.9.6.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.8.3...3.9.6)
---
updated-dependencies:
- dependency-name: prettier
dependency-version: 3.9.6
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* docs(changelog): Unreleased-Sektion fuer die Bumps nach v0.10.0 (#413)
Die Dependency-PRs sind nach dem Release auf dev gelandet, teils auch
auf main. Ohne Eintrag waeren sie beim naechsten Release unsichtbar --
inklusive Next 16.3.0, das CVE-2025-13465 mitbringt.
Ausserdem im 0.10.0-Abschnitt nachgetragen, dass der Trivy-Scan bis
#409 nie gelaufen ist. Der Fix steckt im Tag v0.10.0, fehlte aber in der
Aufzaehlung -- und "Images werden bei jedem Publish gescannt" stand im
Changelog, waehrend der Job im Action-Setup abbrach.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(gallery): per-album sort order, independent of Immich (#408) (#414)
Album order was dictated entirely by Immich: getAlbum() sorted by the
album's own asc/desc flag, so a Folio album always mirrored the archive.
A curated series has a narrative order that has nothing to do with
capture time, and changing the Immich album's sort to fit the website
changes it for the archive too.
Adds an optional per-album `sort` in gallery.yaml, editable in /admin,
defaulting to today's behaviour so every existing config is unchanged:
immich (default) | newest | oldest | filename | manual
`manual` is a pinned *prefix*: `assetOrder` lists only the photos placed
by hand, everything else follows in the album's Immich order. A full
permutation of a 2,000-photo album would be ~80 KB of UUIDs in a file
that is rewritten and copied to content/.backups/ on every admin save.
It also makes drift fall out for free — photos removed in Immich never
match, new ones land in the tail rather than being hidden.
Sorting is applied after the cache read, not before the cache write, so
the LRU keeps one canonical Immich-ordered copy per album. That avoids
putting the mode in the cache key, lets a config change take effect
without depending on invalidation, and keeps the stale-serving path
correct. cache.get() returns the stored object by reference, so
withSort() returns a shallow clone with a new array — sorting in place
would reorder the shared entry, and under request coalescing every
concurrent caller would be sorting the same array.
Also fixes a prerequisite bug: /api/admin/albums/[albumId]/assets read
album.assets from GET /albums/:id, which Immich 3.x no longer populates
(lib/immich.ts:507). The hero picker's "This Album" tab returned nothing
and threw outright when the key was absent. It now goes through the
client's paginated metadata search, with ?types=all to opt videos in for
the reorder editor.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): drop decorative emoji from the sort select labels (#415)
An <option> cannot contain markup, so the SVG set in Icons is not
reachable there — but a decorative emoji is not a substitute for it.
Plain text instead; the album card badge already uses a real icon.
The remaining emoji in the admin panel (asset picker tabs, section
headings, layout picker options) predate this branch and are left for a
separate cleanup.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): replace emoji icons with the shared SVG icon set (#416)
The admin panel mixed two icon conventions: inline SVGs from
`Icons.tsx` in most components, and decorative emoji in the asset
picker and a few PageBuilder labels. Emoji render inconsistently
across platforms, ignore the accent colour, and cannot inherit the
`.svg-icon` sizing rules.
- Icons.tsx: add `IconStar` (filled — it marks a state, not an
action) and `IconImage`.
- AssetPicker: the three tab labels and the favourite tile badge now
use IconFolder / IconStar / IconImage.
- PageBuilder: the "Standalone Albums" and "Subpages" headings use
the icon set instead of an emoji.
- PageBuilder: the layout picker drops its emoji for plain text. An
<option> cannot contain markup, so an SVG is impossible there and a
decorative glyph is not a substitute.
- admin.css: align icon and label in the picker tabs, and swap the
favourite badge's text-shadow for drop-shadow, which is what
applies to an inline SVG.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): fold PageBuilder's local icons into the shared Icons module (#418)
* refactor(admin): fold PageBuilder's local icons into the shared module
PageBuilder.tsx carried its own `Icons` object duplicating most of the
glyphs already exported by Icons.tsx, with hardcoded sizes and slightly
divergent paths. Migrate all 32 call sites to the shared module and
delete the local object.
Five glyphs had no counterpart and are added to Icons.tsx as 1:1 ports
of the local paths: IconX, IconPlus, IconHome, IconCopy, IconImage.
The local ExternalLink and Check are dropped rather than ported — both
had zero call sites.
Two glyphs change shape slightly, which is the point of consolidating:
the shared IconCamera includes the viewfinder bump the local copy
omitted, and drag handles now use IconGripVertical.
IconGripVertical uses the module's square 24x24 viewBox, so `.svg-drag`
goes from 12x18 to 18x18 — the old non-square box would letterbox the
glyph down to 12x12 and shrink the handle.
* fix(admin): resolve icon-module integration after #416
Merging dev brought in #416, which added a second IconImage to Icons.tsx
and two <Icons.Camera>/<Icons.Folder> section headers that reference the
local Icons object this PR removes. Git merged both cleanly but the result
did not type-check.
- drop the duplicate IconImage (both copies were byte-identical)
- point the two section headers at the imported IconCamera/IconFolder
- refresh the SORT_LABELS comment: the icon set is imported now, not
declared below
---------
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* fix(config): allow an empty gallery, guard against a double /api suffix (#421)
An empty gallery is now a valid, rendered state instead of a throw: deriveGallery() no longer requires at least one album or subpage, so a deployment with no albums yet renders a bare homepage the owner can fill in via /admin.
getConfig() also stops appending /api to an Immich URL that already ends in it, which previously produced .../api/api and broke every upstream request.
Includes a restore of the per-album sort test cases, which the branch had lost by being cut before #408/#414.
* feat(admin): favicon upload, served from the content volume (#422)
Adds a bundled default favicon, an upload widget in admin Settings > General, and a route that serves the icon from the writable content/ volume with a fallback to the bundled default. Raster uploads (PNG/ICO/JPEG) are wrapped in an SVG container; the response carries its own CSP so an uploaded SVG cannot execute script on the origin.
The GET route revalidates with an ETag instead of caching immutably, so a newly uploaded icon shows up immediately. Uploads are written via temp file + rename, and a Reset button restores the bundled default.
* ci: flag unformatted files in a PR, without blocking it (#424)
Prettier is configured as an error rule in eslint.config.mjs but has never run in CI, so part of the tree predates it. A final CI step now diffs against the PR base, runs prettier --list-different over the changed files, and emits a warning annotation per offender plus a job summary.
Advisory by design: it never fails the job. Blocking would turn a PR red for merely touching a file that was already unformatted, and normalising the tree in one commit would wreck git blame and conflict with the PRs in flight.
Requires fetch-depth: 0, since diffing against the base needs its history.
* feat(install): first-run wizard gated by a one-time setup token (#419)
Adds /install, a four-step first-run wizard: connect to Immich, optionally pick albums, name the site, finish. It verifies the credentials against the Immich server before writing anything, then writes gallery.yaml, settings.yaml and a content/install.json carrying the Immich credentials and a generated site secret.
install.json exists because a running process cannot pick up new env vars — the wizard has to write configuration that takes effect without a restart. getInstallCredentials() merges it under the real environment, so env vars always win and rotation stays a matter of setting one.
Both the page and the API routes are gated by a one-time setup token printed to the server log, so a deployment that is reachable before gallery.yaml exists cannot be configured by whoever finds it first. The token is stored in content/.setup-token (0600) rather than a module variable: Next.js bundles the page and each route handler separately, so a module-level token left the page and the API disagreeing inside one process and the wizard stuck on step 1. It is removed once the install completes.
The admin password is stored as an scrypt hash using the scheme lib/auth.ts already applies to album passwords; a plaintext ADMIN_PASSWORD env var keeps working.
* docs: document the setup wizard, fix the read-only content mount (#425)
Quick Start now leads with the /install wizard, with the hand-written YAML route kept alongside it, and a First-Run Setup section covers the setup token, the files the wizard writes, and env-var precedence.
Two corrections: both Docker examples mounted content/ as :ro, which silently breaks the wizard, the admin panel and the backup rotation alike — docs/admin-panel.md already said so and the README contradicted it. And nothing documented that content/install.json holds the Immich API key, so a backup of content/ is a backup of credentials.
Also adds a Contributors section crediting the people whose work is in the project.
* feat(admin): floating save bar pinned to the bottom of the viewport (#426)
The save bar was the first, static element inside .admin-main. Since the
document itself scrolls, it left the viewport as soon as you scrolled down
— editing a subpage section or a settings block far below gave no visible
dirty hint and no reachable save button.
Replace it with a bottom-pinned floating bar shared by both editors. It
only mounts while there is something to act on (unsaved changes, an
in-flight save, or a result message), so it never covers content while
idle. The success message clears after 5s, which hides the bar again.
- new SaveBar component, replacing the duplicated markup in PageBuilder
and SettingsEditor
- adopt the previously unused .floating-save-bar CSS: slide-in keyframes
(carrying translateX(-50%)), dirty border, wrap/gap, mobile variant and
a prefers-reduced-motion opt-out; z-index 900 keeps it below modals
- .admin-main gains bottom padding so the bar never covers page content
- drop the now-unreachable idle hints: the ⌘S hint becomes a button title,
the Live Sync note becomes a static line above the settings layout
- header "Site" link now bypasses the cache (/?fresh=1), so the preview
stays reachable when the bar is hidden
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(admin): themed listbox for the album sort control (#427)
The per-album "Photo order" control was a native <select>. Because an
<option> cannot contain markup, its choices could not use the admin
panel's currentColor SVG set — the reason #415 had to fall back to plain
text after dropping the emoji labels.
Adds a Listbox component implementing the ARIA combobox/listbox pattern,
so options can render a glyph beside their label:
- DOM focus stays on the trigger button; the active option is announced
through aria-activedescendant, keeping focus management to one element
- Keyboard: arrows (clamped at the ends, like a native select),
Home/End, Enter/Space to commit, Escape to cancel, Tab commits and
moves on, and prefix type-ahead with a repeat-key cycle
- Outside dismissal on pointerdown, so a press starting outside closes
the popup before the click retargets
The sort options now carry an icon each: calendar, arrow-down, arrow-up,
an A→Z marker, and the drag glyph for manual — matching the badge the
album card already shows. SORT_LABELS stays plain text because the badge
feeds it to a title attribute.
Closes #417
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(git): ignore generated design handoff folders
* fix(admin): stop the album sort dropdown clipping, and simplify the panel (#428)
* fix(admin): render listbox popup in a portal so it escapes modal clipping
The sort control's popup was position:absolute inside three clipping ancestors
(.album-drawer overflow:hidden > .album-drawer-body overflow-y:auto >
.modal-right-column overflow-y:auto), so it was cut off at the bottom of the
Edit Album Details modal. z-index could not help: clipping happens before
stacking. It also always hung below the trigger, with no flip.
Portal the popup to document.body and position it from the trigger's viewport
rect, flipping above when there is more room there and capping max-height to the
space available so it scrolls internally rather than overflowing. It is
dismissed on scroll and resize, since the anchor is only measured on open.
The outside-pointerdown handler now also treats the popup as inside; without
that the portalled list counts as outside, and a click on an option would close
it before the selection commits.
* refactor(admin): single-column album details panel
The left column spent 1.2fr on a cover thumbnail and three stat rows, two of
which (Status, Custom Hero) only restated the form fields opposite them, while
the form itself was squeezed into 1.8fr behind a second nested scroller.
Stack the drawer in one column instead: cover as a banner, then the form at full
width, with the UUID moved into the footer. The body is now the only scroll
container, which also removes one of the ancestors that was clipping the sort
popup.
---------
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* fix(admin): give the portalled listbox its theme back, lock the page behind modals (#429)
Two defects in the album editor.
The sort listbox popup painted transparent. Every --admin-* variable is
scoped to .admin-layout, and since the popup moved into document.body it
sits outside that subtree, so background/border/text all resolved to
nothing. It now carries its own copy of the palette in both colour
schemes, plus the font it no longer inherits.
Scrolling inside a modal also moved the page behind it. No admin modal
ever locked body scroll: the overlay covers the page but does not absorb
wheel events, so a scroll starting on the backdrop — or continuing past
the end of the modal's own scroller — reaches the document.
overscroll-behavior cannot cover that case on its own, because it only
applies to scroll containers and the backdrop is not one.
useScrollLock freezes body while a modal is open and compensates for the
width the scrollbar gives up, so nothing shifts underneath. Each lock
restores the inline value it found, which makes nesting work without a
counter — a picker opened from the drawer restores the drawer's hidden
state instead of clearing it. Applied to both drawers and all four
picker modals, which share the defect. overscroll-behavior: contain on
the scrollers stops the chaining they can handle themselves.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* fix(security): allow unsafe-eval in CSP script-src during dev mode
* feat(journal): add Journal Studio with split-screen editor, live preview and dedicated routes
* fix(build): separate client parser from server journal-service and fix build type errors
* fix(journal): Fotos rendern, Layout und Lightbox-Steuerung korrigieren
Fünf unabhängige Fehler in der öffentlichen Journal- und Essay-Ansicht:
* Foto-Blöcke wurden nie angezeigt. EssayView löst ein Foto über
PhotoItem.id auf, und das sind verschlüsselte Tokens — die Blöcke aus
dem Markdown tragen aber rohe Asset-UUIDs. Jede Zuordnung lief ins
Leere, und nicht auflösbare Blöcke werden still verworfen. Die IDs
werden jetzt serverseitig übersetzt; damit verschwinden nebenbei die
rohen UUIDs aus dem Client-Payload, die dort laut Projektregel nie
auftauchen dürfen. Nicht auflösbare Referenzen werden geloggt.
* Überschriften standen weiter links als der Fließtext. Jeder Block
hatte einzeln `max-width: 68ch`, und `ch` ist relativ zur Schrift des
Elements — die Serif-Überschrift ergab eine breitere Spalte. Ersetzt
durch eine gemeinsame, font-unabhängige `--essay-measure`.
* Fullbleed-Fotos bluteten nur nach links aus: `.essay-figure` ist
`width: 100%`, wodurch die Box überbestimmt ist und der negative
rechte Margin verworfen wird.
* Foto-Paare stellten beide Bilder gleich breit dar, wodurch ein
Hochformat neben einem Querformat doppelt so hoch wurde. Jetzt eine
Justified-Reihe: Breite proportional zum Seitenverhältnis, dadurch
exakt gleiche Höhen ohne Beschnitt.
* Die Lightbox hatte im Journal keine Tastatursteuerung und keine
Scroll-Sperre — beides lag in PhotoGrid, also nur im Album-Raster.
Verlagert in die Lightbox selbst, der doppelte Handler in PhotoGrid
entfernt (sonst wäre pro Pfeildruck zwei Bilder weitergesprungen).
Zusätzlich sind Proofing-Herzen und das EXIF-Panel im redaktionellen
Modus abschaltbar und im Journal aus: Client-Proofing ist ein
Übergabe-Workflow für Alben, keine Funktion einer Reportage. Auf der
Übersicht wurde der Untertitel doppelt gerendert, weil extractExcerpt()
auf ihn zurückfällt.
* feat(admin): eigene URLs für alle Bereiche und überarbeiteter Journal Studio
Das Panel war eine einzige Client-Komponente, die ihre Tabs über
useState umschaltet: keine Route pro Bereich, kein Deep-Link, kein
Zurück-Button, und nach jedem Reload landete man wieder auf "Pages".
Auch der Journal-Editor hatte keine eigene URL.
Jetzt sieben echte Routen (/admin, /admin/pages, /admin/journal,
/admin/journal/<slug>, /admin/settings, /admin/settings/<section>,
/admin/analytics). Die Shell mit Auth-Prüfung und Kopfzeile sitzt im
Layout und umschließt children — so bleibt die Session-Prüfung über
Routenwechsel montiert, statt bei jedem Tab-Wechsel neu zu laufen und
den Spinner aufblitzen zu lassen. Unbekannte Settings-Sections fallen
auf General zurück.
Im selben Zug der Journal Studio, der die Routing-Änderung ohnehin
berührt:
* Alle Eingabefelder nutzten die Klasse `admin-input`, die in keinem
CSS definiert war — sie fielen auf Browser-Defaults zurück. Jetzt
gestylt, gescoped, damit der generische Name nicht ins übrige Panel
leckt.
* Der Split View ist per Divider verschiebbar (Maus, Tastatur,
Doppelklick zum Zurücksetzen), Breite in localStorage.
* Das Studio bricht aus der 1120px-Spalte aus, die Preview hat Platz.
* Die Preview zeigte für jedes Foto fest 3:2 und log damit über das
Layout der veröffentlichten Seite; die echten Verhältnisse werden
jetzt an den Thumbnails gemessen.
* Blöcke mit alten positionsbasierten Foto-Referenzen werden markiert —
die lassen sich auf einer eigenständigen Journal-Seite nicht auflösen
und verschwanden bisher stillschweigend.
* Blocktyp-Chips als gemeinsame Komponente, monochrom und per Icon
unterschieden statt in einer eigenen Blau/Lila/Orange-Palette, die
sonst nirgends im Panel vorkommt.
* Emojis raus, SVG-Icons rein.
* fix(admin): Designsystem-Lücken im Panel schließen
Eine systematische Suche nach Klassen, die im TSX benutzt, aber in
keinem CSS definiert sind, hat vier Stellen mit demselben Muster
gefunden:
* `admin-btn-secondary` und `admin-btn-danger` existierten nicht.
Sämtliche Löschen-Buttons sahen aus wie normale Buttons — keine
Warnwirkung. Als `.admin-btn.admin-btn-danger` geschrieben, weil die
Varianten mit den Größenklassen kombiniert werden, die weiter unten
ihren eigenen Hintergrund setzen.
* `page-progress-fill` fehlte: die Balken im Analytics-Panel waren
leere Rinnen, der Wert unsichtbar. Ebenso `analytics-empty` und
`admin-loading-container`.
* `subpage-drawer-section`, `subpage-drawer-title-group` und
`input-with-icon` im PageBuilder waren wirkungslos und teils mit
Inline-Styles notdürftig kompensiert.
* `grid-card-preview` fehlte, wodurch alle Layout-Vorschauen auf Höhe
null kollabierten. Nur "Showcase" war sichtbar — und das aus Versehen,
weil sein Tile `hero-tile` hieß und damit die `aspect-ratio` einer
fremden PageBuilder-Klasse erbte. Umbenannt.
Dazu die Theme-Vorschauen, die praktisch identisch aussahen: alle
sieben zeigten dieselben drei quadratischen Kacheln, einziger
Unterschied war die Hintergrundfarbe. Sie spiegeln jetzt die echten
Preset-Daten aus lib/config/theme.ts — Schriftcharakter, Eckradius,
Rasterdichte, Passepartout bzw. Schatten.
Die Kopfzeile richtet sich an einer gemeinsamen Steuerhöhe aus. Der
"Site"-Link war höher als die Buttons daneben: `.admin-btn` hatte keine
explizite line-height, und <button> bekommt box-sizing: border-box vom
Browser, <a> nicht. Die Statusanzeige setzte weder Schriftfamilie noch
-größe und fiel auf den Browser-Default zurück — sie war nie Teil des
Designsystems. Jetzt gleiche Höhe und Typografie, Pillenform als
Zustandsanzeige, Trenner zur Aktionsgruppe. Das dauerhafte Pulsieren
des grünen Punkts entfällt; Animation bleibt den Zuständen vorbehalten,
die Aufmerksamkeit brauchen.
Restliche Emojis durch SVG-Icons ersetzt.
* feat(admin): add scroll-to-top toggle and SVG arrow
The back-to-top button was always on and drew its arrow with the ↑ text
character. Add a `scrollToTop` setting (General section in the admin
panel, defaults to on so existing sites are unaffected) and replace the
glyph with a stroked SVG that inherits currentColor across all presets.
Scroll handling is now rAF-throttled, and prefers-reduced-motion turns
off both the hover lift and the smooth scroll.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* security(journal): escape author HTML instead of filtering it
CodeQL flags 26 high-severity alerts on the release PR; the bulk of them
point at sanitizeHtml(), a denylist of three regexes whose output goes
into dangerouslySetInnerHTML. I reproduced the bypasses before changing
anything — all four pass the old filter:
<img src=x onerror=alert(1)> unquoted handler, regex wants quotes
<img src=x onerror='alert(1)'> single quotes, same reason
<svg onload=alert(1)> not a <script> tag
javasjavascript:cript:alert(1) one-pass replace, the rest recombines
Plus an attribute breakout in the link renderer, which interpolated the
URL into href="${url}" unescaped:
[x](" onmouseover=alert(1) x=") -> <a href="" onmouseover=alert(1" ...>
Replaced with escaping. Every `&<>"'` in author text becomes an entity
before any markdown rule runs, so the only tags in the output are the
ones renderInlineMarkdown builds itself and a URL cannot leave its
attribute. Link schemes are now an allowlist (http, https, mailto, tel,
relative, anchor); anything else renders as plain text.
The serializer needed decodeHtmlEntities to match: without it a save
would write `<` into the Markdown file and the next parse would
escape the `&` again, corrupting the text further on every round trip.
A test covers parse -> serialize -> parse stability.
Two existing tests asserted the old behaviour and were rewritten rather
than deleted: one expected the script tag to be *removed* from the
output, the other expected the substring "onerror" to be absent. Both
now assert the property that matters — that no tag can form — because
`onerror` surviving as inert text is fine.
Exploitation required admin access either way: journal and essay text
comes from the studio or from content/*.md. This removes the weakness,
it does not close an open door.
* fix(journal): contain file paths, fix frontmatter escaping, defuse two regexes
Follow-up to the CodeQL findings on release PR #432. I went through all 23
alerts individually; this addresses the ones that are worth addressing and
documents the ones that are not.
Path containment (12 alerts, all false positives). Every path built from a
slug goes through isValidSlug(), a strict `/^[a-zA-Z0-9_-]+$/` allowlist —
verified against `../../etc/passwd`, `foo/../../bar`, `a/b`, `..` and
friends, all rejected. CodeQL cannot see it because the check lives in
another module. Added a containedPath() helper that resolves the path and
refuses anything landing outside the content directory: a second lock on a
door that was already locked, and a barrier the analysis can follow. Also
removed the dead `slug.endsWith('.md')` branches — isValidSlug rejects
dots, so they could never be taken.
Frontmatter escaping (1 alert, a real bug). The serializer escaped `"` but
not `\`, and the parser never unescaped anything. A title containing either
character gained a backslash on every save/load cycle:
Path C:\Users "quoted" -> Path C:\\Users \"quoted\" -> ...
Escaping now covers the backslash first and the parser undoes both. A round
trip test covers quotes, backslashes, colons and apostrophes.
Two of three ReDoS regexes (2 alerts). The heading pattern had `\s+` next to
`(.+)`, which overlap, so the engine tried every split of the whitespace run
before failing; it is `[ \t]+` and `(\S.*)` now. The quote author pattern
wrapped a lazy group around an optional group — the quadratic case — and is
an index split on the first separator now.
The third regex, the bold/italic pass, is deliberately left alone. Rewriting
it with a negated class removes the backtracking but breaks nesting:
`**bold *and italic* here**` renders as `*<em>bold </em>and italic<em> here</em>*`.
The input is Markdown from an authenticated admin, never a visitor, so the
worst case is an author slowing down their own page. The comment in the code
says so.
Not addressed: 5 js/insufficient-password-hash alerts. They ask for a slow
KDF where the code uses SHA-256/HMAC — correct in general, but the admin
password comes from an environment variable and is never stored, so a
stronger KDF protects nothing that is not already in plaintext in the
environment.
399 unit tests pass (18 new), build and tsc clean.
* fix(journal): split the quote author by scanning, not by pattern
Cleaning up after myself. #439 replaced the quote author regex
`/^(.*?)(?:\s+--\s+(.+))?$/` — a lazy group around an optional one, the
quadratic case — with `/\s+--\s+/`, and CodeQL promptly flagged the
replacement for the same reason. One reported pattern traded for another.
splitQuoteAuthor() scans for the first `--` that has whitespace on both
sides. Linear, and it needs no reasoning about the regex engine at all.
Behaviour is identical to the original regex, checked case by case
against it: separator, no separator, several separators, tabs, wide gaps,
`a--b` without spaces, leading and trailing separators, empty string. All
nine are covered by tests, plus one asserting it stays fast on a 50k
whitespace run.
* security(admin): derive the session signing key with scrypt
getSigningKey() ran the admin password through a single SHA-256 digest.
It is key derivation rather than password storage, so it was never a
stored-hash problem — but if the derived key ever leaked, one fast hash
makes recovering the password by brute force cheap. CodeQL flags it as
js/insufficient-password-hash and, for this particular alert, has a
point.
scrypt now. Two details that matter:
The salt has to be stable. A random salt would produce a different key on
every call and invalidate every session; it is derived from AUTH_SECRET,
which is deployment-specific. Verified across separate processes: same
inputs produce a verifying token, so a restart or redeploy does not log
everyone out.
The result is cached for the process lifetime. scrypt is deliberately
slow and getSigningKey() runs on every admin request — deriving per call
would add ~24ms to each one. The cache key is a digest of secret plus
password, so a rotation misses the cache and derives again, and no extra
plaintext copy of the password is kept around.
Measured: first derivation 24ms, subsequent calls 0.12ms. Password
change and secret change both invalidate an existing token, checked in
separate processes.
Note the one-time effect: existing admin sessions are invalidated by the
change in derivation, so everyone logs in once more.
* security(admin): key the signing-key cache on its inputs, not a digest
#441 removed the SHA-256 digest of the admin password from the key
derivation and introduced a new one three lines above it, as the cache
key. Same rule, same file: CodeQL reported it immediately.
The comment justifying it was wrong too. It claimed no second plaintext
copy of the password was retained, while building the digest input
allocates exactly that in order to hash it.
The cache now holds the two input strings and compares them directly.
They are the same objects the env and install caches already hold, so
nothing extra is retained, and no fast hash of the password exists in
memory for the life of the process.
Re-verified after the change, in separate processes: a token from one
process verifies in another with the same inputs, a changed password or
secret rejects it, first derivation 24ms, cached calls 0.001ms.
That leaves scrypt as the only place the password is hashed here. The
two HMACs further down operate on the derived key and on token data, not
on the password; the constant-time comparison in verifyAdminPassword is
the previously dismissed one.
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: lancetm714 <108419425+lancetm714@users.noreply.github.com>
2026-08-14 16:55:07 +02:00
|
|
|
*/
|
|
|
|
|
.admin-main:has(> .journal-studio),
|
|
|
|
|
.admin-main:has(> .journal-editor-container) {
|
|
|
|
|
max-width: none;
|
|
|
|
|
padding: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ── Form controls ─────────────────────────────────────────────────
|
|
|
|
|
* Local field styling for the studio. Scoped so the generic class name
|
|
|
|
|
* cannot leak into the rest of the admin panel.
|
|
|
|
|
*/
|
|
|
|
|
.journal-studio .admin-input,
|
|
|
|
|
.journal-editor-container .admin-input,
|
|
|
|
|
.journal-modal-card .admin-input {
|
|
|
|
|
display: block;
|
|
|
|
|
width: 100%;
|
|
|
|
|
padding: 0.55rem 0.7rem;
|
|
|
|
|
background: var(--admin-bg-input, #161616);
|
|
|
|
|
border: 1px solid var(--admin-border, #2e2e2e);
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
color: var(--admin-text, #f0f0f0);
|
|
|
|
|
font-family: inherit;
|
|
|
|
|
font-size: 0.875rem;
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
transition:
|
|
|
|
|
border-color 0.15s ease,
|
|
|
|
|
background 0.15s ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-studio .admin-input:hover,
|
|
|
|
|
.journal-editor-container .admin-input:hover,
|
|
|
|
|
.journal-modal-card .admin-input:hover {
|
|
|
|
|
border-color: var(--admin-border-hover, #444);
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-19 22:24:10 +02:00
|
|
|
.journal-studio .admin-input:focus-visible,
|
|
|
|
|
.journal-editor-container .admin-input:focus-visible,
|
|
|
|
|
.journal-modal-card .admin-input:focus-visible {
|
|
|
|
|
outline: var(--admin-focus-ring);
|
|
|
|
|
outline-offset: 1px;
|
release: v0.11.0 — journal fixes, admin URLs, design system cleanup (#432)
* fix(screenshots): sharp-Typen fuer 0.34 und 0.35 gleichzeitig (#410)
sharp 0.35 ist von `export =` auf ESM umgestellt: der Modul-Namespace
ist nicht mehr aufrufbar, die Factory sitzt unter .default. Der
Type-Check brach damit in scripts/screenshots.ts weg, sobald der
Next-Bump (#402) sharp von 0.34.5 auf 0.35.3 mitzieht -- sharp ist hier
keine deklarierte Dependency, sondern kommt ueber Next mit.
Die Form wird jetzt aus dem installierten Paket abgeleitet statt
festgeschrieben, zur Laufzeit wie im Typ. Geprueft mit beiden
Versionen: tsc laeuft mit 0.34.5 und mit 0.35.3 fehlerfrei durch.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(deps): bump the nextjs group across 1 directory with 2 updates (#402)
Bumps the nextjs group with 2 updates in the / directory: [next](https://github.com/vercel/next.js) and [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next).
Updates `next` from 16.2.12 to 16.3.0
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/compare/v16.2.12...v16.3.0)
Updates `eslint-config-next` from 16.2.12 to 16.3.0
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/commits/v16.3.0/packages/eslint-config-next)
---
updated-dependencies:
- dependency-name: eslint-config-next
dependency-version: 16.3.0
dependency-type: direct:development
update-type: version-update:semver-minor
dependency-group: nextjs
- dependency-name: next
dependency-version: 16.3.0
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: nextjs
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore(deps-dev): bump prettier from 3.8.3 to 3.9.6 (#405)
Bumps [prettier](https://github.com/prettier/prettier) from 3.8.3 to 3.9.6.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.8.3...3.9.6)
---
updated-dependencies:
- dependency-name: prettier
dependency-version: 3.9.6
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* docs(changelog): Unreleased-Sektion fuer die Bumps nach v0.10.0 (#413)
Die Dependency-PRs sind nach dem Release auf dev gelandet, teils auch
auf main. Ohne Eintrag waeren sie beim naechsten Release unsichtbar --
inklusive Next 16.3.0, das CVE-2025-13465 mitbringt.
Ausserdem im 0.10.0-Abschnitt nachgetragen, dass der Trivy-Scan bis
#409 nie gelaufen ist. Der Fix steckt im Tag v0.10.0, fehlte aber in der
Aufzaehlung -- und "Images werden bei jedem Publish gescannt" stand im
Changelog, waehrend der Job im Action-Setup abbrach.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(gallery): per-album sort order, independent of Immich (#408) (#414)
Album order was dictated entirely by Immich: getAlbum() sorted by the
album's own asc/desc flag, so a Folio album always mirrored the archive.
A curated series has a narrative order that has nothing to do with
capture time, and changing the Immich album's sort to fit the website
changes it for the archive too.
Adds an optional per-album `sort` in gallery.yaml, editable in /admin,
defaulting to today's behaviour so every existing config is unchanged:
immich (default) | newest | oldest | filename | manual
`manual` is a pinned *prefix*: `assetOrder` lists only the photos placed
by hand, everything else follows in the album's Immich order. A full
permutation of a 2,000-photo album would be ~80 KB of UUIDs in a file
that is rewritten and copied to content/.backups/ on every admin save.
It also makes drift fall out for free — photos removed in Immich never
match, new ones land in the tail rather than being hidden.
Sorting is applied after the cache read, not before the cache write, so
the LRU keeps one canonical Immich-ordered copy per album. That avoids
putting the mode in the cache key, lets a config change take effect
without depending on invalidation, and keeps the stale-serving path
correct. cache.get() returns the stored object by reference, so
withSort() returns a shallow clone with a new array — sorting in place
would reorder the shared entry, and under request coalescing every
concurrent caller would be sorting the same array.
Also fixes a prerequisite bug: /api/admin/albums/[albumId]/assets read
album.assets from GET /albums/:id, which Immich 3.x no longer populates
(lib/immich.ts:507). The hero picker's "This Album" tab returned nothing
and threw outright when the key was absent. It now goes through the
client's paginated metadata search, with ?types=all to opt videos in for
the reorder editor.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): drop decorative emoji from the sort select labels (#415)
An <option> cannot contain markup, so the SVG set in Icons is not
reachable there — but a decorative emoji is not a substitute for it.
Plain text instead; the album card badge already uses a real icon.
The remaining emoji in the admin panel (asset picker tabs, section
headings, layout picker options) predate this branch and are left for a
separate cleanup.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): replace emoji icons with the shared SVG icon set (#416)
The admin panel mixed two icon conventions: inline SVGs from
`Icons.tsx` in most components, and decorative emoji in the asset
picker and a few PageBuilder labels. Emoji render inconsistently
across platforms, ignore the accent colour, and cannot inherit the
`.svg-icon` sizing rules.
- Icons.tsx: add `IconStar` (filled — it marks a state, not an
action) and `IconImage`.
- AssetPicker: the three tab labels and the favourite tile badge now
use IconFolder / IconStar / IconImage.
- PageBuilder: the "Standalone Albums" and "Subpages" headings use
the icon set instead of an emoji.
- PageBuilder: the layout picker drops its emoji for plain text. An
<option> cannot contain markup, so an SVG is impossible there and a
decorative glyph is not a substitute.
- admin.css: align icon and label in the picker tabs, and swap the
favourite badge's text-shadow for drop-shadow, which is what
applies to an inline SVG.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): fold PageBuilder's local icons into the shared Icons module (#418)
* refactor(admin): fold PageBuilder's local icons into the shared module
PageBuilder.tsx carried its own `Icons` object duplicating most of the
glyphs already exported by Icons.tsx, with hardcoded sizes and slightly
divergent paths. Migrate all 32 call sites to the shared module and
delete the local object.
Five glyphs had no counterpart and are added to Icons.tsx as 1:1 ports
of the local paths: IconX, IconPlus, IconHome, IconCopy, IconImage.
The local ExternalLink and Check are dropped rather than ported — both
had zero call sites.
Two glyphs change shape slightly, which is the point of consolidating:
the shared IconCamera includes the viewfinder bump the local copy
omitted, and drag handles now use IconGripVertical.
IconGripVertical uses the module's square 24x24 viewBox, so `.svg-drag`
goes from 12x18 to 18x18 — the old non-square box would letterbox the
glyph down to 12x12 and shrink the handle.
* fix(admin): resolve icon-module integration after #416
Merging dev brought in #416, which added a second IconImage to Icons.tsx
and two <Icons.Camera>/<Icons.Folder> section headers that reference the
local Icons object this PR removes. Git merged both cleanly but the result
did not type-check.
- drop the duplicate IconImage (both copies were byte-identical)
- point the two section headers at the imported IconCamera/IconFolder
- refresh the SORT_LABELS comment: the icon set is imported now, not
declared below
---------
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* fix(config): allow an empty gallery, guard against a double /api suffix (#421)
An empty gallery is now a valid, rendered state instead of a throw: deriveGallery() no longer requires at least one album or subpage, so a deployment with no albums yet renders a bare homepage the owner can fill in via /admin.
getConfig() also stops appending /api to an Immich URL that already ends in it, which previously produced .../api/api and broke every upstream request.
Includes a restore of the per-album sort test cases, which the branch had lost by being cut before #408/#414.
* feat(admin): favicon upload, served from the content volume (#422)
Adds a bundled default favicon, an upload widget in admin Settings > General, and a route that serves the icon from the writable content/ volume with a fallback to the bundled default. Raster uploads (PNG/ICO/JPEG) are wrapped in an SVG container; the response carries its own CSP so an uploaded SVG cannot execute script on the origin.
The GET route revalidates with an ETag instead of caching immutably, so a newly uploaded icon shows up immediately. Uploads are written via temp file + rename, and a Reset button restores the bundled default.
* ci: flag unformatted files in a PR, without blocking it (#424)
Prettier is configured as an error rule in eslint.config.mjs but has never run in CI, so part of the tree predates it. A final CI step now diffs against the PR base, runs prettier --list-different over the changed files, and emits a warning annotation per offender plus a job summary.
Advisory by design: it never fails the job. Blocking would turn a PR red for merely touching a file that was already unformatted, and normalising the tree in one commit would wreck git blame and conflict with the PRs in flight.
Requires fetch-depth: 0, since diffing against the base needs its history.
* feat(install): first-run wizard gated by a one-time setup token (#419)
Adds /install, a four-step first-run wizard: connect to Immich, optionally pick albums, name the site, finish. It verifies the credentials against the Immich server before writing anything, then writes gallery.yaml, settings.yaml and a content/install.json carrying the Immich credentials and a generated site secret.
install.json exists because a running process cannot pick up new env vars — the wizard has to write configuration that takes effect without a restart. getInstallCredentials() merges it under the real environment, so env vars always win and rotation stays a matter of setting one.
Both the page and the API routes are gated by a one-time setup token printed to the server log, so a deployment that is reachable before gallery.yaml exists cannot be configured by whoever finds it first. The token is stored in content/.setup-token (0600) rather than a module variable: Next.js bundles the page and each route handler separately, so a module-level token left the page and the API disagreeing inside one process and the wizard stuck on step 1. It is removed once the install completes.
The admin password is stored as an scrypt hash using the scheme lib/auth.ts already applies to album passwords; a plaintext ADMIN_PASSWORD env var keeps working.
* docs: document the setup wizard, fix the read-only content mount (#425)
Quick Start now leads with the /install wizard, with the hand-written YAML route kept alongside it, and a First-Run Setup section covers the setup token, the files the wizard writes, and env-var precedence.
Two corrections: both Docker examples mounted content/ as :ro, which silently breaks the wizard, the admin panel and the backup rotation alike — docs/admin-panel.md already said so and the README contradicted it. And nothing documented that content/install.json holds the Immich API key, so a backup of content/ is a backup of credentials.
Also adds a Contributors section crediting the people whose work is in the project.
* feat(admin): floating save bar pinned to the bottom of the viewport (#426)
The save bar was the first, static element inside .admin-main. Since the
document itself scrolls, it left the viewport as soon as you scrolled down
— editing a subpage section or a settings block far below gave no visible
dirty hint and no reachable save button.
Replace it with a bottom-pinned floating bar shared by both editors. It
only mounts while there is something to act on (unsaved changes, an
in-flight save, or a result message), so it never covers content while
idle. The success message clears after 5s, which hides the bar again.
- new SaveBar component, replacing the duplicated markup in PageBuilder
and SettingsEditor
- adopt the previously unused .floating-save-bar CSS: slide-in keyframes
(carrying translateX(-50%)), dirty border, wrap/gap, mobile variant and
a prefers-reduced-motion opt-out; z-index 900 keeps it below modals
- .admin-main gains bottom padding so the bar never covers page content
- drop the now-unreachable idle hints: the ⌘S hint becomes a button title,
the Live Sync note becomes a static line above the settings layout
- header "Site" link now bypasses the cache (/?fresh=1), so the preview
stays reachable when the bar is hidden
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(admin): themed listbox for the album sort control (#427)
The per-album "Photo order" control was a native <select>. Because an
<option> cannot contain markup, its choices could not use the admin
panel's currentColor SVG set — the reason #415 had to fall back to plain
text after dropping the emoji labels.
Adds a Listbox component implementing the ARIA combobox/listbox pattern,
so options can render a glyph beside their label:
- DOM focus stays on the trigger button; the active option is announced
through aria-activedescendant, keeping focus management to one element
- Keyboard: arrows (clamped at the ends, like a native select),
Home/End, Enter/Space to commit, Escape to cancel, Tab commits and
moves on, and prefix type-ahead with a repeat-key cycle
- Outside dismissal on pointerdown, so a press starting outside closes
the popup before the click retargets
The sort options now carry an icon each: calendar, arrow-down, arrow-up,
an A→Z marker, and the drag glyph for manual — matching the badge the
album card already shows. SORT_LABELS stays plain text because the badge
feeds it to a title attribute.
Closes #417
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(git): ignore generated design handoff folders
* fix(admin): stop the album sort dropdown clipping, and simplify the panel (#428)
* fix(admin): render listbox popup in a portal so it escapes modal clipping
The sort control's popup was position:absolute inside three clipping ancestors
(.album-drawer overflow:hidden > .album-drawer-body overflow-y:auto >
.modal-right-column overflow-y:auto), so it was cut off at the bottom of the
Edit Album Details modal. z-index could not help: clipping happens before
stacking. It also always hung below the trigger, with no flip.
Portal the popup to document.body and position it from the trigger's viewport
rect, flipping above when there is more room there and capping max-height to the
space available so it scrolls internally rather than overflowing. It is
dismissed on scroll and resize, since the anchor is only measured on open.
The outside-pointerdown handler now also treats the popup as inside; without
that the portalled list counts as outside, and a click on an option would close
it before the selection commits.
* refactor(admin): single-column album details panel
The left column spent 1.2fr on a cover thumbnail and three stat rows, two of
which (Status, Custom Hero) only restated the form fields opposite them, while
the form itself was squeezed into 1.8fr behind a second nested scroller.
Stack the drawer in one column instead: cover as a banner, then the form at full
width, with the UUID moved into the footer. The body is now the only scroll
container, which also removes one of the ancestors that was clipping the sort
popup.
---------
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* fix(admin): give the portalled listbox its theme back, lock the page behind modals (#429)
Two defects in the album editor.
The sort listbox popup painted transparent. Every --admin-* variable is
scoped to .admin-layout, and since the popup moved into document.body it
sits outside that subtree, so background/border/text all resolved to
nothing. It now carries its own copy of the palette in both colour
schemes, plus the font it no longer inherits.
Scrolling inside a modal also moved the page behind it. No admin modal
ever locked body scroll: the overlay covers the page but does not absorb
wheel events, so a scroll starting on the backdrop — or continuing past
the end of the modal's own scroller — reaches the document.
overscroll-behavior cannot cover that case on its own, because it only
applies to scroll containers and the backdrop is not one.
useScrollLock freezes body while a modal is open and compensates for the
width the scrollbar gives up, so nothing shifts underneath. Each lock
restores the inline value it found, which makes nesting work without a
counter — a picker opened from the drawer restores the drawer's hidden
state instead of clearing it. Applied to both drawers and all four
picker modals, which share the defect. overscroll-behavior: contain on
the scrollers stops the chaining they can handle themselves.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* fix(security): allow unsafe-eval in CSP script-src during dev mode
* feat(journal): add Journal Studio with split-screen editor, live preview and dedicated routes
* fix(build): separate client parser from server journal-service and fix build type errors
* fix(journal): Fotos rendern, Layout und Lightbox-Steuerung korrigieren
Fünf unabhängige Fehler in der öffentlichen Journal- und Essay-Ansicht:
* Foto-Blöcke wurden nie angezeigt. EssayView löst ein Foto über
PhotoItem.id auf, und das sind verschlüsselte Tokens — die Blöcke aus
dem Markdown tragen aber rohe Asset-UUIDs. Jede Zuordnung lief ins
Leere, und nicht auflösbare Blöcke werden still verworfen. Die IDs
werden jetzt serverseitig übersetzt; damit verschwinden nebenbei die
rohen UUIDs aus dem Client-Payload, die dort laut Projektregel nie
auftauchen dürfen. Nicht auflösbare Referenzen werden geloggt.
* Überschriften standen weiter links als der Fließtext. Jeder Block
hatte einzeln `max-width: 68ch`, und `ch` ist relativ zur Schrift des
Elements — die Serif-Überschrift ergab eine breitere Spalte. Ersetzt
durch eine gemeinsame, font-unabhängige `--essay-measure`.
* Fullbleed-Fotos bluteten nur nach links aus: `.essay-figure` ist
`width: 100%`, wodurch die Box überbestimmt ist und der negative
rechte Margin verworfen wird.
* Foto-Paare stellten beide Bilder gleich breit dar, wodurch ein
Hochformat neben einem Querformat doppelt so hoch wurde. Jetzt eine
Justified-Reihe: Breite proportional zum Seitenverhältnis, dadurch
exakt gleiche Höhen ohne Beschnitt.
* Die Lightbox hatte im Journal keine Tastatursteuerung und keine
Scroll-Sperre — beides lag in PhotoGrid, also nur im Album-Raster.
Verlagert in die Lightbox selbst, der doppelte Handler in PhotoGrid
entfernt (sonst wäre pro Pfeildruck zwei Bilder weitergesprungen).
Zusätzlich sind Proofing-Herzen und das EXIF-Panel im redaktionellen
Modus abschaltbar und im Journal aus: Client-Proofing ist ein
Übergabe-Workflow für Alben, keine Funktion einer Reportage. Auf der
Übersicht wurde der Untertitel doppelt gerendert, weil extractExcerpt()
auf ihn zurückfällt.
* feat(admin): eigene URLs für alle Bereiche und überarbeiteter Journal Studio
Das Panel war eine einzige Client-Komponente, die ihre Tabs über
useState umschaltet: keine Route pro Bereich, kein Deep-Link, kein
Zurück-Button, und nach jedem Reload landete man wieder auf "Pages".
Auch der Journal-Editor hatte keine eigene URL.
Jetzt sieben echte Routen (/admin, /admin/pages, /admin/journal,
/admin/journal/<slug>, /admin/settings, /admin/settings/<section>,
/admin/analytics). Die Shell mit Auth-Prüfung und Kopfzeile sitzt im
Layout und umschließt children — so bleibt die Session-Prüfung über
Routenwechsel montiert, statt bei jedem Tab-Wechsel neu zu laufen und
den Spinner aufblitzen zu lassen. Unbekannte Settings-Sections fallen
auf General zurück.
Im selben Zug der Journal Studio, der die Routing-Änderung ohnehin
berührt:
* Alle Eingabefelder nutzten die Klasse `admin-input`, die in keinem
CSS definiert war — sie fielen auf Browser-Defaults zurück. Jetzt
gestylt, gescoped, damit der generische Name nicht ins übrige Panel
leckt.
* Der Split View ist per Divider verschiebbar (Maus, Tastatur,
Doppelklick zum Zurücksetzen), Breite in localStorage.
* Das Studio bricht aus der 1120px-Spalte aus, die Preview hat Platz.
* Die Preview zeigte für jedes Foto fest 3:2 und log damit über das
Layout der veröffentlichten Seite; die echten Verhältnisse werden
jetzt an den Thumbnails gemessen.
* Blöcke mit alten positionsbasierten Foto-Referenzen werden markiert —
die lassen sich auf einer eigenständigen Journal-Seite nicht auflösen
und verschwanden bisher stillschweigend.
* Blocktyp-Chips als gemeinsame Komponente, monochrom und per Icon
unterschieden statt in einer eigenen Blau/Lila/Orange-Palette, die
sonst nirgends im Panel vorkommt.
* Emojis raus, SVG-Icons rein.
* fix(admin): Designsystem-Lücken im Panel schließen
Eine systematische Suche nach Klassen, die im TSX benutzt, aber in
keinem CSS definiert sind, hat vier Stellen mit demselben Muster
gefunden:
* `admin-btn-secondary` und `admin-btn-danger` existierten nicht.
Sämtliche Löschen-Buttons sahen aus wie normale Buttons — keine
Warnwirkung. Als `.admin-btn.admin-btn-danger` geschrieben, weil die
Varianten mit den Größenklassen kombiniert werden, die weiter unten
ihren eigenen Hintergrund setzen.
* `page-progress-fill` fehlte: die Balken im Analytics-Panel waren
leere Rinnen, der Wert unsichtbar. Ebenso `analytics-empty` und
`admin-loading-container`.
* `subpage-drawer-section`, `subpage-drawer-title-group` und
`input-with-icon` im PageBuilder waren wirkungslos und teils mit
Inline-Styles notdürftig kompensiert.
* `grid-card-preview` fehlte, wodurch alle Layout-Vorschauen auf Höhe
null kollabierten. Nur "Showcase" war sichtbar — und das aus Versehen,
weil sein Tile `hero-tile` hieß und damit die `aspect-ratio` einer
fremden PageBuilder-Klasse erbte. Umbenannt.
Dazu die Theme-Vorschauen, die praktisch identisch aussahen: alle
sieben zeigten dieselben drei quadratischen Kacheln, einziger
Unterschied war die Hintergrundfarbe. Sie spiegeln jetzt die echten
Preset-Daten aus lib/config/theme.ts — Schriftcharakter, Eckradius,
Rasterdichte, Passepartout bzw. Schatten.
Die Kopfzeile richtet sich an einer gemeinsamen Steuerhöhe aus. Der
"Site"-Link war höher als die Buttons daneben: `.admin-btn` hatte keine
explizite line-height, und <button> bekommt box-sizing: border-box vom
Browser, <a> nicht. Die Statusanzeige setzte weder Schriftfamilie noch
-größe und fiel auf den Browser-Default zurück — sie war nie Teil des
Designsystems. Jetzt gleiche Höhe und Typografie, Pillenform als
Zustandsanzeige, Trenner zur Aktionsgruppe. Das dauerhafte Pulsieren
des grünen Punkts entfällt; Animation bleibt den Zuständen vorbehalten,
die Aufmerksamkeit brauchen.
Restliche Emojis durch SVG-Icons ersetzt.
* feat(admin): add scroll-to-top toggle and SVG arrow
The back-to-top button was always on and drew its arrow with the ↑ text
character. Add a `scrollToTop` setting (General section in the admin
panel, defaults to on so existing sites are unaffected) and replace the
glyph with a stroked SVG that inherits currentColor across all presets.
Scroll handling is now rAF-throttled, and prefers-reduced-motion turns
off both the hover lift and the smooth scroll.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* security(journal): escape author HTML instead of filtering it
CodeQL flags 26 high-severity alerts on the release PR; the bulk of them
point at sanitizeHtml(), a denylist of three regexes whose output goes
into dangerouslySetInnerHTML. I reproduced the bypasses before changing
anything — all four pass the old filter:
<img src=x onerror=alert(1)> unquoted handler, regex wants quotes
<img src=x onerror='alert(1)'> single quotes, same reason
<svg onload=alert(1)> not a <script> tag
javasjavascript:cript:alert(1) one-pass replace, the rest recombines
Plus an attribute breakout in the link renderer, which interpolated the
URL into href="${url}" unescaped:
[x](" onmouseover=alert(1) x=") -> <a href="" onmouseover=alert(1" ...>
Replaced with escaping. Every `&<>"'` in author text becomes an entity
before any markdown rule runs, so the only tags in the output are the
ones renderInlineMarkdown builds itself and a URL cannot leave its
attribute. Link schemes are now an allowlist (http, https, mailto, tel,
relative, anchor); anything else renders as plain text.
The serializer needed decodeHtmlEntities to match: without it a save
would write `<` into the Markdown file and the next parse would
escape the `&` again, corrupting the text further on every round trip.
A test covers parse -> serialize -> parse stability.
Two existing tests asserted the old behaviour and were rewritten rather
than deleted: one expected the script tag to be *removed* from the
output, the other expected the substring "onerror" to be absent. Both
now assert the property that matters — that no tag can form — because
`onerror` surviving as inert text is fine.
Exploitation required admin access either way: journal and essay text
comes from the studio or from content/*.md. This removes the weakness,
it does not close an open door.
* fix(journal): contain file paths, fix frontmatter escaping, defuse two regexes
Follow-up to the CodeQL findings on release PR #432. I went through all 23
alerts individually; this addresses the ones that are worth addressing and
documents the ones that are not.
Path containment (12 alerts, all false positives). Every path built from a
slug goes through isValidSlug(), a strict `/^[a-zA-Z0-9_-]+$/` allowlist —
verified against `../../etc/passwd`, `foo/../../bar`, `a/b`, `..` and
friends, all rejected. CodeQL cannot see it because the check lives in
another module. Added a containedPath() helper that resolves the path and
refuses anything landing outside the content directory: a second lock on a
door that was already locked, and a barrier the analysis can follow. Also
removed the dead `slug.endsWith('.md')` branches — isValidSlug rejects
dots, so they could never be taken.
Frontmatter escaping (1 alert, a real bug). The serializer escaped `"` but
not `\`, and the parser never unescaped anything. A title containing either
character gained a backslash on every save/load cycle:
Path C:\Users "quoted" -> Path C:\\Users \"quoted\" -> ...
Escaping now covers the backslash first and the parser undoes both. A round
trip test covers quotes, backslashes, colons and apostrophes.
Two of three ReDoS regexes (2 alerts). The heading pattern had `\s+` next to
`(.+)`, which overlap, so the engine tried every split of the whitespace run
before failing; it is `[ \t]+` and `(\S.*)` now. The quote author pattern
wrapped a lazy group around an optional group — the quadratic case — and is
an index split on the first separator now.
The third regex, the bold/italic pass, is deliberately left alone. Rewriting
it with a negated class removes the backtracking but breaks nesting:
`**bold *and italic* here**` renders as `*<em>bold </em>and italic<em> here</em>*`.
The input is Markdown from an authenticated admin, never a visitor, so the
worst case is an author slowing down their own page. The comment in the code
says so.
Not addressed: 5 js/insufficient-password-hash alerts. They ask for a slow
KDF where the code uses SHA-256/HMAC — correct in general, but the admin
password comes from an environment variable and is never stored, so a
stronger KDF protects nothing that is not already in plaintext in the
environment.
399 unit tests pass (18 new), build and tsc clean.
* fix(journal): split the quote author by scanning, not by pattern
Cleaning up after myself. #439 replaced the quote author regex
`/^(.*?)(?:\s+--\s+(.+))?$/` — a lazy group around an optional one, the
quadratic case — with `/\s+--\s+/`, and CodeQL promptly flagged the
replacement for the same reason. One reported pattern traded for another.
splitQuoteAuthor() scans for the first `--` that has whitespace on both
sides. Linear, and it needs no reasoning about the regex engine at all.
Behaviour is identical to the original regex, checked case by case
against it: separator, no separator, several separators, tabs, wide gaps,
`a--b` without spaces, leading and trailing separators, empty string. All
nine are covered by tests, plus one asserting it stays fast on a 50k
whitespace run.
* security(admin): derive the session signing key with scrypt
getSigningKey() ran the admin password through a single SHA-256 digest.
It is key derivation rather than password storage, so it was never a
stored-hash problem — but if the derived key ever leaked, one fast hash
makes recovering the password by brute force cheap. CodeQL flags it as
js/insufficient-password-hash and, for this particular alert, has a
point.
scrypt now. Two details that matter:
The salt has to be stable. A random salt would produce a different key on
every call and invalidate every session; it is derived from AUTH_SECRET,
which is deployment-specific. Verified across separate processes: same
inputs produce a verifying token, so a restart or redeploy does not log
everyone out.
The result is cached for the process lifetime. scrypt is deliberately
slow and getSigningKey() runs on every admin request — deriving per call
would add ~24ms to each one. The cache key is a digest of secret plus
password, so a rotation misses the cache and derives again, and no extra
plaintext copy of the password is kept around.
Measured: first derivation 24ms, subsequent calls 0.12ms. Password
change and secret change both invalidate an existing token, checked in
separate processes.
Note the one-time effect: existing admin sessions are invalidated by the
change in derivation, so everyone logs in once more.
* security(admin): key the signing-key cache on its inputs, not a digest
#441 removed the SHA-256 digest of the admin password from the key
derivation and introduced a new one three lines above it, as the cache
key. Same rule, same file: CodeQL reported it immediately.
The comment justifying it was wrong too. It claimed no second plaintext
copy of the password was retained, while building the digest input
allocates exactly that in order to hash it.
The cache now holds the two input strings and compares them directly.
They are the same objects the env and install caches already hold, so
nothing extra is retained, and no fast hash of the password exists in
memory for the life of the process.
Re-verified after the change, in separate processes: a token from one
process verifies in another with the same inputs, a changed password or
secret rejects it, first derivation 24ms, cached calls 0.001ms.
That leaves scrypt as the only place the password is hashed here. The
two HMACs further down operate on the derived key and on token data, not
on the password; the constant-time comparison in verifyAdminPassword is
the previously dismissed one.
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: lancetm714 <108419425+lancetm714@users.noreply.github.com>
2026-08-14 16:55:07 +02:00
|
|
|
border-color: var(--admin-border-focus, #6366f1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-studio .admin-input::placeholder,
|
|
|
|
|
.journal-editor-container .admin-input::placeholder,
|
|
|
|
|
.journal-modal-card .admin-input::placeholder {
|
|
|
|
|
color: var(--admin-text-secondary, #a0a0a0);
|
|
|
|
|
opacity: 0.7;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-container textarea.admin-input,
|
|
|
|
|
.journal-modal-card textarea.admin-input {
|
|
|
|
|
resize: vertical;
|
|
|
|
|
min-height: 88px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-container select.admin-input {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
appearance: none;
|
|
|
|
|
padding-right: 2rem;
|
|
|
|
|
background-image:
|
|
|
|
|
linear-gradient(45deg, transparent 50%, currentColor 50%),
|
|
|
|
|
linear-gradient(135deg, currentColor 50%, transparent 50%);
|
|
|
|
|
background-position:
|
|
|
|
|
calc(100% - 16px) calc(50% + 1px),
|
|
|
|
|
calc(100% - 11px) calc(50% + 1px);
|
|
|
|
|
background-size: 5px 5px;
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-level-select {
|
|
|
|
|
width: 5.5rem;
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-studio {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
height: 100%;
|
|
|
|
|
min-height: calc(100vh - 70px);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-studio-header {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding: 1.5rem 2rem;
|
|
|
|
|
border-bottom: 1px solid var(--admin-border, rgba(255, 255, 255, 0.08));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-studio-header h2 {
|
|
|
|
|
margin: 0;
|
|
|
|
|
font-size: 1.5rem;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-list-grid {
|
|
|
|
|
display: grid;
|
2026-09-29 22:50:30 +02:00
|
|
|
/* min(): on a phone the column is narrower than 320px, and a fixed minimum
|
|
|
|
|
pushed every card past the right edge. */
|
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
|
release: v0.11.0 — journal fixes, admin URLs, design system cleanup (#432)
* fix(screenshots): sharp-Typen fuer 0.34 und 0.35 gleichzeitig (#410)
sharp 0.35 ist von `export =` auf ESM umgestellt: der Modul-Namespace
ist nicht mehr aufrufbar, die Factory sitzt unter .default. Der
Type-Check brach damit in scripts/screenshots.ts weg, sobald der
Next-Bump (#402) sharp von 0.34.5 auf 0.35.3 mitzieht -- sharp ist hier
keine deklarierte Dependency, sondern kommt ueber Next mit.
Die Form wird jetzt aus dem installierten Paket abgeleitet statt
festgeschrieben, zur Laufzeit wie im Typ. Geprueft mit beiden
Versionen: tsc laeuft mit 0.34.5 und mit 0.35.3 fehlerfrei durch.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(deps): bump the nextjs group across 1 directory with 2 updates (#402)
Bumps the nextjs group with 2 updates in the / directory: [next](https://github.com/vercel/next.js) and [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next).
Updates `next` from 16.2.12 to 16.3.0
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/compare/v16.2.12...v16.3.0)
Updates `eslint-config-next` from 16.2.12 to 16.3.0
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/commits/v16.3.0/packages/eslint-config-next)
---
updated-dependencies:
- dependency-name: eslint-config-next
dependency-version: 16.3.0
dependency-type: direct:development
update-type: version-update:semver-minor
dependency-group: nextjs
- dependency-name: next
dependency-version: 16.3.0
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: nextjs
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore(deps-dev): bump prettier from 3.8.3 to 3.9.6 (#405)
Bumps [prettier](https://github.com/prettier/prettier) from 3.8.3 to 3.9.6.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.8.3...3.9.6)
---
updated-dependencies:
- dependency-name: prettier
dependency-version: 3.9.6
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* docs(changelog): Unreleased-Sektion fuer die Bumps nach v0.10.0 (#413)
Die Dependency-PRs sind nach dem Release auf dev gelandet, teils auch
auf main. Ohne Eintrag waeren sie beim naechsten Release unsichtbar --
inklusive Next 16.3.0, das CVE-2025-13465 mitbringt.
Ausserdem im 0.10.0-Abschnitt nachgetragen, dass der Trivy-Scan bis
#409 nie gelaufen ist. Der Fix steckt im Tag v0.10.0, fehlte aber in der
Aufzaehlung -- und "Images werden bei jedem Publish gescannt" stand im
Changelog, waehrend der Job im Action-Setup abbrach.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(gallery): per-album sort order, independent of Immich (#408) (#414)
Album order was dictated entirely by Immich: getAlbum() sorted by the
album's own asc/desc flag, so a Folio album always mirrored the archive.
A curated series has a narrative order that has nothing to do with
capture time, and changing the Immich album's sort to fit the website
changes it for the archive too.
Adds an optional per-album `sort` in gallery.yaml, editable in /admin,
defaulting to today's behaviour so every existing config is unchanged:
immich (default) | newest | oldest | filename | manual
`manual` is a pinned *prefix*: `assetOrder` lists only the photos placed
by hand, everything else follows in the album's Immich order. A full
permutation of a 2,000-photo album would be ~80 KB of UUIDs in a file
that is rewritten and copied to content/.backups/ on every admin save.
It also makes drift fall out for free — photos removed in Immich never
match, new ones land in the tail rather than being hidden.
Sorting is applied after the cache read, not before the cache write, so
the LRU keeps one canonical Immich-ordered copy per album. That avoids
putting the mode in the cache key, lets a config change take effect
without depending on invalidation, and keeps the stale-serving path
correct. cache.get() returns the stored object by reference, so
withSort() returns a shallow clone with a new array — sorting in place
would reorder the shared entry, and under request coalescing every
concurrent caller would be sorting the same array.
Also fixes a prerequisite bug: /api/admin/albums/[albumId]/assets read
album.assets from GET /albums/:id, which Immich 3.x no longer populates
(lib/immich.ts:507). The hero picker's "This Album" tab returned nothing
and threw outright when the key was absent. It now goes through the
client's paginated metadata search, with ?types=all to opt videos in for
the reorder editor.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): drop decorative emoji from the sort select labels (#415)
An <option> cannot contain markup, so the SVG set in Icons is not
reachable there — but a decorative emoji is not a substitute for it.
Plain text instead; the album card badge already uses a real icon.
The remaining emoji in the admin panel (asset picker tabs, section
headings, layout picker options) predate this branch and are left for a
separate cleanup.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): replace emoji icons with the shared SVG icon set (#416)
The admin panel mixed two icon conventions: inline SVGs from
`Icons.tsx` in most components, and decorative emoji in the asset
picker and a few PageBuilder labels. Emoji render inconsistently
across platforms, ignore the accent colour, and cannot inherit the
`.svg-icon` sizing rules.
- Icons.tsx: add `IconStar` (filled — it marks a state, not an
action) and `IconImage`.
- AssetPicker: the three tab labels and the favourite tile badge now
use IconFolder / IconStar / IconImage.
- PageBuilder: the "Standalone Albums" and "Subpages" headings use
the icon set instead of an emoji.
- PageBuilder: the layout picker drops its emoji for plain text. An
<option> cannot contain markup, so an SVG is impossible there and a
decorative glyph is not a substitute.
- admin.css: align icon and label in the picker tabs, and swap the
favourite badge's text-shadow for drop-shadow, which is what
applies to an inline SVG.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): fold PageBuilder's local icons into the shared Icons module (#418)
* refactor(admin): fold PageBuilder's local icons into the shared module
PageBuilder.tsx carried its own `Icons` object duplicating most of the
glyphs already exported by Icons.tsx, with hardcoded sizes and slightly
divergent paths. Migrate all 32 call sites to the shared module and
delete the local object.
Five glyphs had no counterpart and are added to Icons.tsx as 1:1 ports
of the local paths: IconX, IconPlus, IconHome, IconCopy, IconImage.
The local ExternalLink and Check are dropped rather than ported — both
had zero call sites.
Two glyphs change shape slightly, which is the point of consolidating:
the shared IconCamera includes the viewfinder bump the local copy
omitted, and drag handles now use IconGripVertical.
IconGripVertical uses the module's square 24x24 viewBox, so `.svg-drag`
goes from 12x18 to 18x18 — the old non-square box would letterbox the
glyph down to 12x12 and shrink the handle.
* fix(admin): resolve icon-module integration after #416
Merging dev brought in #416, which added a second IconImage to Icons.tsx
and two <Icons.Camera>/<Icons.Folder> section headers that reference the
local Icons object this PR removes. Git merged both cleanly but the result
did not type-check.
- drop the duplicate IconImage (both copies were byte-identical)
- point the two section headers at the imported IconCamera/IconFolder
- refresh the SORT_LABELS comment: the icon set is imported now, not
declared below
---------
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* fix(config): allow an empty gallery, guard against a double /api suffix (#421)
An empty gallery is now a valid, rendered state instead of a throw: deriveGallery() no longer requires at least one album or subpage, so a deployment with no albums yet renders a bare homepage the owner can fill in via /admin.
getConfig() also stops appending /api to an Immich URL that already ends in it, which previously produced .../api/api and broke every upstream request.
Includes a restore of the per-album sort test cases, which the branch had lost by being cut before #408/#414.
* feat(admin): favicon upload, served from the content volume (#422)
Adds a bundled default favicon, an upload widget in admin Settings > General, and a route that serves the icon from the writable content/ volume with a fallback to the bundled default. Raster uploads (PNG/ICO/JPEG) are wrapped in an SVG container; the response carries its own CSP so an uploaded SVG cannot execute script on the origin.
The GET route revalidates with an ETag instead of caching immutably, so a newly uploaded icon shows up immediately. Uploads are written via temp file + rename, and a Reset button restores the bundled default.
* ci: flag unformatted files in a PR, without blocking it (#424)
Prettier is configured as an error rule in eslint.config.mjs but has never run in CI, so part of the tree predates it. A final CI step now diffs against the PR base, runs prettier --list-different over the changed files, and emits a warning annotation per offender plus a job summary.
Advisory by design: it never fails the job. Blocking would turn a PR red for merely touching a file that was already unformatted, and normalising the tree in one commit would wreck git blame and conflict with the PRs in flight.
Requires fetch-depth: 0, since diffing against the base needs its history.
* feat(install): first-run wizard gated by a one-time setup token (#419)
Adds /install, a four-step first-run wizard: connect to Immich, optionally pick albums, name the site, finish. It verifies the credentials against the Immich server before writing anything, then writes gallery.yaml, settings.yaml and a content/install.json carrying the Immich credentials and a generated site secret.
install.json exists because a running process cannot pick up new env vars — the wizard has to write configuration that takes effect without a restart. getInstallCredentials() merges it under the real environment, so env vars always win and rotation stays a matter of setting one.
Both the page and the API routes are gated by a one-time setup token printed to the server log, so a deployment that is reachable before gallery.yaml exists cannot be configured by whoever finds it first. The token is stored in content/.setup-token (0600) rather than a module variable: Next.js bundles the page and each route handler separately, so a module-level token left the page and the API disagreeing inside one process and the wizard stuck on step 1. It is removed once the install completes.
The admin password is stored as an scrypt hash using the scheme lib/auth.ts already applies to album passwords; a plaintext ADMIN_PASSWORD env var keeps working.
* docs: document the setup wizard, fix the read-only content mount (#425)
Quick Start now leads with the /install wizard, with the hand-written YAML route kept alongside it, and a First-Run Setup section covers the setup token, the files the wizard writes, and env-var precedence.
Two corrections: both Docker examples mounted content/ as :ro, which silently breaks the wizard, the admin panel and the backup rotation alike — docs/admin-panel.md already said so and the README contradicted it. And nothing documented that content/install.json holds the Immich API key, so a backup of content/ is a backup of credentials.
Also adds a Contributors section crediting the people whose work is in the project.
* feat(admin): floating save bar pinned to the bottom of the viewport (#426)
The save bar was the first, static element inside .admin-main. Since the
document itself scrolls, it left the viewport as soon as you scrolled down
— editing a subpage section or a settings block far below gave no visible
dirty hint and no reachable save button.
Replace it with a bottom-pinned floating bar shared by both editors. It
only mounts while there is something to act on (unsaved changes, an
in-flight save, or a result message), so it never covers content while
idle. The success message clears after 5s, which hides the bar again.
- new SaveBar component, replacing the duplicated markup in PageBuilder
and SettingsEditor
- adopt the previously unused .floating-save-bar CSS: slide-in keyframes
(carrying translateX(-50%)), dirty border, wrap/gap, mobile variant and
a prefers-reduced-motion opt-out; z-index 900 keeps it below modals
- .admin-main gains bottom padding so the bar never covers page content
- drop the now-unreachable idle hints: the ⌘S hint becomes a button title,
the Live Sync note becomes a static line above the settings layout
- header "Site" link now bypasses the cache (/?fresh=1), so the preview
stays reachable when the bar is hidden
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(admin): themed listbox for the album sort control (#427)
The per-album "Photo order" control was a native <select>. Because an
<option> cannot contain markup, its choices could not use the admin
panel's currentColor SVG set — the reason #415 had to fall back to plain
text after dropping the emoji labels.
Adds a Listbox component implementing the ARIA combobox/listbox pattern,
so options can render a glyph beside their label:
- DOM focus stays on the trigger button; the active option is announced
through aria-activedescendant, keeping focus management to one element
- Keyboard: arrows (clamped at the ends, like a native select),
Home/End, Enter/Space to commit, Escape to cancel, Tab commits and
moves on, and prefix type-ahead with a repeat-key cycle
- Outside dismissal on pointerdown, so a press starting outside closes
the popup before the click retargets
The sort options now carry an icon each: calendar, arrow-down, arrow-up,
an A→Z marker, and the drag glyph for manual — matching the badge the
album card already shows. SORT_LABELS stays plain text because the badge
feeds it to a title attribute.
Closes #417
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(git): ignore generated design handoff folders
* fix(admin): stop the album sort dropdown clipping, and simplify the panel (#428)
* fix(admin): render listbox popup in a portal so it escapes modal clipping
The sort control's popup was position:absolute inside three clipping ancestors
(.album-drawer overflow:hidden > .album-drawer-body overflow-y:auto >
.modal-right-column overflow-y:auto), so it was cut off at the bottom of the
Edit Album Details modal. z-index could not help: clipping happens before
stacking. It also always hung below the trigger, with no flip.
Portal the popup to document.body and position it from the trigger's viewport
rect, flipping above when there is more room there and capping max-height to the
space available so it scrolls internally rather than overflowing. It is
dismissed on scroll and resize, since the anchor is only measured on open.
The outside-pointerdown handler now also treats the popup as inside; without
that the portalled list counts as outside, and a click on an option would close
it before the selection commits.
* refactor(admin): single-column album details panel
The left column spent 1.2fr on a cover thumbnail and three stat rows, two of
which (Status, Custom Hero) only restated the form fields opposite them, while
the form itself was squeezed into 1.8fr behind a second nested scroller.
Stack the drawer in one column instead: cover as a banner, then the form at full
width, with the UUID moved into the footer. The body is now the only scroll
container, which also removes one of the ancestors that was clipping the sort
popup.
---------
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* fix(admin): give the portalled listbox its theme back, lock the page behind modals (#429)
Two defects in the album editor.
The sort listbox popup painted transparent. Every --admin-* variable is
scoped to .admin-layout, and since the popup moved into document.body it
sits outside that subtree, so background/border/text all resolved to
nothing. It now carries its own copy of the palette in both colour
schemes, plus the font it no longer inherits.
Scrolling inside a modal also moved the page behind it. No admin modal
ever locked body scroll: the overlay covers the page but does not absorb
wheel events, so a scroll starting on the backdrop — or continuing past
the end of the modal's own scroller — reaches the document.
overscroll-behavior cannot cover that case on its own, because it only
applies to scroll containers and the backdrop is not one.
useScrollLock freezes body while a modal is open and compensates for the
width the scrollbar gives up, so nothing shifts underneath. Each lock
restores the inline value it found, which makes nesting work without a
counter — a picker opened from the drawer restores the drawer's hidden
state instead of clearing it. Applied to both drawers and all four
picker modals, which share the defect. overscroll-behavior: contain on
the scrollers stops the chaining they can handle themselves.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* fix(security): allow unsafe-eval in CSP script-src during dev mode
* feat(journal): add Journal Studio with split-screen editor, live preview and dedicated routes
* fix(build): separate client parser from server journal-service and fix build type errors
* fix(journal): Fotos rendern, Layout und Lightbox-Steuerung korrigieren
Fünf unabhängige Fehler in der öffentlichen Journal- und Essay-Ansicht:
* Foto-Blöcke wurden nie angezeigt. EssayView löst ein Foto über
PhotoItem.id auf, und das sind verschlüsselte Tokens — die Blöcke aus
dem Markdown tragen aber rohe Asset-UUIDs. Jede Zuordnung lief ins
Leere, und nicht auflösbare Blöcke werden still verworfen. Die IDs
werden jetzt serverseitig übersetzt; damit verschwinden nebenbei die
rohen UUIDs aus dem Client-Payload, die dort laut Projektregel nie
auftauchen dürfen. Nicht auflösbare Referenzen werden geloggt.
* Überschriften standen weiter links als der Fließtext. Jeder Block
hatte einzeln `max-width: 68ch`, und `ch` ist relativ zur Schrift des
Elements — die Serif-Überschrift ergab eine breitere Spalte. Ersetzt
durch eine gemeinsame, font-unabhängige `--essay-measure`.
* Fullbleed-Fotos bluteten nur nach links aus: `.essay-figure` ist
`width: 100%`, wodurch die Box überbestimmt ist und der negative
rechte Margin verworfen wird.
* Foto-Paare stellten beide Bilder gleich breit dar, wodurch ein
Hochformat neben einem Querformat doppelt so hoch wurde. Jetzt eine
Justified-Reihe: Breite proportional zum Seitenverhältnis, dadurch
exakt gleiche Höhen ohne Beschnitt.
* Die Lightbox hatte im Journal keine Tastatursteuerung und keine
Scroll-Sperre — beides lag in PhotoGrid, also nur im Album-Raster.
Verlagert in die Lightbox selbst, der doppelte Handler in PhotoGrid
entfernt (sonst wäre pro Pfeildruck zwei Bilder weitergesprungen).
Zusätzlich sind Proofing-Herzen und das EXIF-Panel im redaktionellen
Modus abschaltbar und im Journal aus: Client-Proofing ist ein
Übergabe-Workflow für Alben, keine Funktion einer Reportage. Auf der
Übersicht wurde der Untertitel doppelt gerendert, weil extractExcerpt()
auf ihn zurückfällt.
* feat(admin): eigene URLs für alle Bereiche und überarbeiteter Journal Studio
Das Panel war eine einzige Client-Komponente, die ihre Tabs über
useState umschaltet: keine Route pro Bereich, kein Deep-Link, kein
Zurück-Button, und nach jedem Reload landete man wieder auf "Pages".
Auch der Journal-Editor hatte keine eigene URL.
Jetzt sieben echte Routen (/admin, /admin/pages, /admin/journal,
/admin/journal/<slug>, /admin/settings, /admin/settings/<section>,
/admin/analytics). Die Shell mit Auth-Prüfung und Kopfzeile sitzt im
Layout und umschließt children — so bleibt die Session-Prüfung über
Routenwechsel montiert, statt bei jedem Tab-Wechsel neu zu laufen und
den Spinner aufblitzen zu lassen. Unbekannte Settings-Sections fallen
auf General zurück.
Im selben Zug der Journal Studio, der die Routing-Änderung ohnehin
berührt:
* Alle Eingabefelder nutzten die Klasse `admin-input`, die in keinem
CSS definiert war — sie fielen auf Browser-Defaults zurück. Jetzt
gestylt, gescoped, damit der generische Name nicht ins übrige Panel
leckt.
* Der Split View ist per Divider verschiebbar (Maus, Tastatur,
Doppelklick zum Zurücksetzen), Breite in localStorage.
* Das Studio bricht aus der 1120px-Spalte aus, die Preview hat Platz.
* Die Preview zeigte für jedes Foto fest 3:2 und log damit über das
Layout der veröffentlichten Seite; die echten Verhältnisse werden
jetzt an den Thumbnails gemessen.
* Blöcke mit alten positionsbasierten Foto-Referenzen werden markiert —
die lassen sich auf einer eigenständigen Journal-Seite nicht auflösen
und verschwanden bisher stillschweigend.
* Blocktyp-Chips als gemeinsame Komponente, monochrom und per Icon
unterschieden statt in einer eigenen Blau/Lila/Orange-Palette, die
sonst nirgends im Panel vorkommt.
* Emojis raus, SVG-Icons rein.
* fix(admin): Designsystem-Lücken im Panel schließen
Eine systematische Suche nach Klassen, die im TSX benutzt, aber in
keinem CSS definiert sind, hat vier Stellen mit demselben Muster
gefunden:
* `admin-btn-secondary` und `admin-btn-danger` existierten nicht.
Sämtliche Löschen-Buttons sahen aus wie normale Buttons — keine
Warnwirkung. Als `.admin-btn.admin-btn-danger` geschrieben, weil die
Varianten mit den Größenklassen kombiniert werden, die weiter unten
ihren eigenen Hintergrund setzen.
* `page-progress-fill` fehlte: die Balken im Analytics-Panel waren
leere Rinnen, der Wert unsichtbar. Ebenso `analytics-empty` und
`admin-loading-container`.
* `subpage-drawer-section`, `subpage-drawer-title-group` und
`input-with-icon` im PageBuilder waren wirkungslos und teils mit
Inline-Styles notdürftig kompensiert.
* `grid-card-preview` fehlte, wodurch alle Layout-Vorschauen auf Höhe
null kollabierten. Nur "Showcase" war sichtbar — und das aus Versehen,
weil sein Tile `hero-tile` hieß und damit die `aspect-ratio` einer
fremden PageBuilder-Klasse erbte. Umbenannt.
Dazu die Theme-Vorschauen, die praktisch identisch aussahen: alle
sieben zeigten dieselben drei quadratischen Kacheln, einziger
Unterschied war die Hintergrundfarbe. Sie spiegeln jetzt die echten
Preset-Daten aus lib/config/theme.ts — Schriftcharakter, Eckradius,
Rasterdichte, Passepartout bzw. Schatten.
Die Kopfzeile richtet sich an einer gemeinsamen Steuerhöhe aus. Der
"Site"-Link war höher als die Buttons daneben: `.admin-btn` hatte keine
explizite line-height, und <button> bekommt box-sizing: border-box vom
Browser, <a> nicht. Die Statusanzeige setzte weder Schriftfamilie noch
-größe und fiel auf den Browser-Default zurück — sie war nie Teil des
Designsystems. Jetzt gleiche Höhe und Typografie, Pillenform als
Zustandsanzeige, Trenner zur Aktionsgruppe. Das dauerhafte Pulsieren
des grünen Punkts entfällt; Animation bleibt den Zuständen vorbehalten,
die Aufmerksamkeit brauchen.
Restliche Emojis durch SVG-Icons ersetzt.
* feat(admin): add scroll-to-top toggle and SVG arrow
The back-to-top button was always on and drew its arrow with the ↑ text
character. Add a `scrollToTop` setting (General section in the admin
panel, defaults to on so existing sites are unaffected) and replace the
glyph with a stroked SVG that inherits currentColor across all presets.
Scroll handling is now rAF-throttled, and prefers-reduced-motion turns
off both the hover lift and the smooth scroll.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* security(journal): escape author HTML instead of filtering it
CodeQL flags 26 high-severity alerts on the release PR; the bulk of them
point at sanitizeHtml(), a denylist of three regexes whose output goes
into dangerouslySetInnerHTML. I reproduced the bypasses before changing
anything — all four pass the old filter:
<img src=x onerror=alert(1)> unquoted handler, regex wants quotes
<img src=x onerror='alert(1)'> single quotes, same reason
<svg onload=alert(1)> not a <script> tag
javasjavascript:cript:alert(1) one-pass replace, the rest recombines
Plus an attribute breakout in the link renderer, which interpolated the
URL into href="${url}" unescaped:
[x](" onmouseover=alert(1) x=") -> <a href="" onmouseover=alert(1" ...>
Replaced with escaping. Every `&<>"'` in author text becomes an entity
before any markdown rule runs, so the only tags in the output are the
ones renderInlineMarkdown builds itself and a URL cannot leave its
attribute. Link schemes are now an allowlist (http, https, mailto, tel,
relative, anchor); anything else renders as plain text.
The serializer needed decodeHtmlEntities to match: without it a save
would write `<` into the Markdown file and the next parse would
escape the `&` again, corrupting the text further on every round trip.
A test covers parse -> serialize -> parse stability.
Two existing tests asserted the old behaviour and were rewritten rather
than deleted: one expected the script tag to be *removed* from the
output, the other expected the substring "onerror" to be absent. Both
now assert the property that matters — that no tag can form — because
`onerror` surviving as inert text is fine.
Exploitation required admin access either way: journal and essay text
comes from the studio or from content/*.md. This removes the weakness,
it does not close an open door.
* fix(journal): contain file paths, fix frontmatter escaping, defuse two regexes
Follow-up to the CodeQL findings on release PR #432. I went through all 23
alerts individually; this addresses the ones that are worth addressing and
documents the ones that are not.
Path containment (12 alerts, all false positives). Every path built from a
slug goes through isValidSlug(), a strict `/^[a-zA-Z0-9_-]+$/` allowlist —
verified against `../../etc/passwd`, `foo/../../bar`, `a/b`, `..` and
friends, all rejected. CodeQL cannot see it because the check lives in
another module. Added a containedPath() helper that resolves the path and
refuses anything landing outside the content directory: a second lock on a
door that was already locked, and a barrier the analysis can follow. Also
removed the dead `slug.endsWith('.md')` branches — isValidSlug rejects
dots, so they could never be taken.
Frontmatter escaping (1 alert, a real bug). The serializer escaped `"` but
not `\`, and the parser never unescaped anything. A title containing either
character gained a backslash on every save/load cycle:
Path C:\Users "quoted" -> Path C:\\Users \"quoted\" -> ...
Escaping now covers the backslash first and the parser undoes both. A round
trip test covers quotes, backslashes, colons and apostrophes.
Two of three ReDoS regexes (2 alerts). The heading pattern had `\s+` next to
`(.+)`, which overlap, so the engine tried every split of the whitespace run
before failing; it is `[ \t]+` and `(\S.*)` now. The quote author pattern
wrapped a lazy group around an optional group — the quadratic case — and is
an index split on the first separator now.
The third regex, the bold/italic pass, is deliberately left alone. Rewriting
it with a negated class removes the backtracking but breaks nesting:
`**bold *and italic* here**` renders as `*<em>bold </em>and italic<em> here</em>*`.
The input is Markdown from an authenticated admin, never a visitor, so the
worst case is an author slowing down their own page. The comment in the code
says so.
Not addressed: 5 js/insufficient-password-hash alerts. They ask for a slow
KDF where the code uses SHA-256/HMAC — correct in general, but the admin
password comes from an environment variable and is never stored, so a
stronger KDF protects nothing that is not already in plaintext in the
environment.
399 unit tests pass (18 new), build and tsc clean.
* fix(journal): split the quote author by scanning, not by pattern
Cleaning up after myself. #439 replaced the quote author regex
`/^(.*?)(?:\s+--\s+(.+))?$/` — a lazy group around an optional one, the
quadratic case — with `/\s+--\s+/`, and CodeQL promptly flagged the
replacement for the same reason. One reported pattern traded for another.
splitQuoteAuthor() scans for the first `--` that has whitespace on both
sides. Linear, and it needs no reasoning about the regex engine at all.
Behaviour is identical to the original regex, checked case by case
against it: separator, no separator, several separators, tabs, wide gaps,
`a--b` without spaces, leading and trailing separators, empty string. All
nine are covered by tests, plus one asserting it stays fast on a 50k
whitespace run.
* security(admin): derive the session signing key with scrypt
getSigningKey() ran the admin password through a single SHA-256 digest.
It is key derivation rather than password storage, so it was never a
stored-hash problem — but if the derived key ever leaked, one fast hash
makes recovering the password by brute force cheap. CodeQL flags it as
js/insufficient-password-hash and, for this particular alert, has a
point.
scrypt now. Two details that matter:
The salt has to be stable. A random salt would produce a different key on
every call and invalidate every session; it is derived from AUTH_SECRET,
which is deployment-specific. Verified across separate processes: same
inputs produce a verifying token, so a restart or redeploy does not log
everyone out.
The result is cached for the process lifetime. scrypt is deliberately
slow and getSigningKey() runs on every admin request — deriving per call
would add ~24ms to each one. The cache key is a digest of secret plus
password, so a rotation misses the cache and derives again, and no extra
plaintext copy of the password is kept around.
Measured: first derivation 24ms, subsequent calls 0.12ms. Password
change and secret change both invalidate an existing token, checked in
separate processes.
Note the one-time effect: existing admin sessions are invalidated by the
change in derivation, so everyone logs in once more.
* security(admin): key the signing-key cache on its inputs, not a digest
#441 removed the SHA-256 digest of the admin password from the key
derivation and introduced a new one three lines above it, as the cache
key. Same rule, same file: CodeQL reported it immediately.
The comment justifying it was wrong too. It claimed no second plaintext
copy of the password was retained, while building the digest input
allocates exactly that in order to hash it.
The cache now holds the two input strings and compares them directly.
They are the same objects the env and install caches already hold, so
nothing extra is retained, and no fast hash of the password exists in
memory for the life of the process.
Re-verified after the change, in separate processes: a token from one
process verifies in another with the same inputs, a changed password or
secret rejects it, first derivation 24ms, cached calls 0.001ms.
That leaves scrypt as the only place the password is hashed here. The
two HMACs further down operate on the derived key and on token data, not
on the password; the constant-time comparison in verifyAdminPassword is
the previously dismissed one.
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: lancetm714 <108419425+lancetm714@users.noreply.github.com>
2026-08-14 16:55:07 +02:00
|
|
|
gap: 1.5rem;
|
|
|
|
|
padding: 2rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-admin-card {
|
|
|
|
|
background: var(--admin-surface, rgba(255, 255, 255, 0.03));
|
|
|
|
|
border: 1px solid var(--admin-border, rgba(255, 255, 255, 0.08));
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
transition:
|
|
|
|
|
border-color 0.2s ease,
|
|
|
|
|
transform 0.2s ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-admin-card:hover {
|
|
|
|
|
border-color: var(--admin-accent, #6366f1);
|
|
|
|
|
transform: translateY(-2px);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-admin-card-cover {
|
|
|
|
|
position: relative;
|
|
|
|
|
width: 100%;
|
|
|
|
|
aspect-ratio: 16 / 9;
|
|
|
|
|
background: rgba(0, 0, 0, 0.2);
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-admin-card-cover img {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
object-fit: cover;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-admin-card-body {
|
|
|
|
|
padding: 1.25rem;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
flex-grow: 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-admin-card-title {
|
|
|
|
|
font-size: 1.15rem;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
margin: 0 0 0.4rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-admin-card-slug {
|
|
|
|
|
font-size: 0.75rem;
|
|
|
|
|
font-family: monospace;
|
|
|
|
|
opacity: 0.6;
|
|
|
|
|
margin-bottom: 0.75rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-admin-card-meta {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
font-size: 0.75rem;
|
|
|
|
|
opacity: 0.7;
|
|
|
|
|
margin-bottom: 1rem;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-admin-card-actions {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
margin-top: auto;
|
|
|
|
|
padding-top: 1rem;
|
|
|
|
|
border-top: 1px solid var(--admin-border, rgba(255, 255, 255, 0.06));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ── Split-Screen Studio Editor ────────────────────────────────────── */
|
|
|
|
|
|
|
|
|
|
.journal-editor-container {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
height: calc(100vh - 65px);
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-topbar {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding: 0.75rem 1.5rem;
|
|
|
|
|
background: var(--admin-surface, #18181b);
|
|
|
|
|
border-bottom: 1px solid var(--admin-border, rgba(255, 255, 255, 0.08));
|
|
|
|
|
gap: 1rem;
|
|
|
|
|
z-index: 10;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-topbar-left {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 1rem;
|
|
|
|
|
flex-grow: 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-title-input {
|
|
|
|
|
font-size: 1.1rem;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
background: transparent;
|
|
|
|
|
border: 1px solid transparent;
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
color: inherit;
|
|
|
|
|
padding: 4px 8px;
|
|
|
|
|
max-width: 400px;
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-title-input:focus {
|
|
|
|
|
border-color: var(--admin-accent, #6366f1);
|
|
|
|
|
background: rgba(255, 255, 255, 0.05);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-topbar-right {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 0.75rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-split {
|
|
|
|
|
display: grid;
|
|
|
|
|
/* Left width is driven by the draggable divider; the preview takes the rest. */
|
|
|
|
|
grid-template-columns: var(--journal-split-left, 46%) 7px minmax(0, 1fr);
|
|
|
|
|
flex-grow: 1;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Kill text selection and pointer flicker while the divider is being dragged. */
|
|
|
|
|
.journal-editor-split.is-dragging {
|
|
|
|
|
user-select: none;
|
|
|
|
|
cursor: col-resize;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-split.is-dragging .journal-editor-pane-right {
|
|
|
|
|
pointer-events: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-resizer {
|
|
|
|
|
position: relative;
|
|
|
|
|
cursor: col-resize;
|
|
|
|
|
background: var(--admin-border, rgba(255, 255, 255, 0.08));
|
|
|
|
|
transition: background 0.15s ease;
|
|
|
|
|
touch-action: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-resizer:hover,
|
|
|
|
|
.journal-editor-resizer:focus-visible,
|
|
|
|
|
.journal-editor-split.is-dragging .journal-editor-resizer {
|
|
|
|
|
background: var(--admin-accent, #6366f1);
|
2026-09-19 22:24:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* The resizer used to change colour on focus exactly as it does on hover,
|
|
|
|
|
so from the keyboard there was no telling whether it had the focus or the
|
|
|
|
|
mouse was merely resting on it. */
|
|
|
|
|
.journal-editor-resizer:focus-visible {
|
|
|
|
|
outline: var(--admin-focus-ring);
|
|
|
|
|
outline-offset: 2px;
|
release: v0.11.0 — journal fixes, admin URLs, design system cleanup (#432)
* fix(screenshots): sharp-Typen fuer 0.34 und 0.35 gleichzeitig (#410)
sharp 0.35 ist von `export =` auf ESM umgestellt: der Modul-Namespace
ist nicht mehr aufrufbar, die Factory sitzt unter .default. Der
Type-Check brach damit in scripts/screenshots.ts weg, sobald der
Next-Bump (#402) sharp von 0.34.5 auf 0.35.3 mitzieht -- sharp ist hier
keine deklarierte Dependency, sondern kommt ueber Next mit.
Die Form wird jetzt aus dem installierten Paket abgeleitet statt
festgeschrieben, zur Laufzeit wie im Typ. Geprueft mit beiden
Versionen: tsc laeuft mit 0.34.5 und mit 0.35.3 fehlerfrei durch.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(deps): bump the nextjs group across 1 directory with 2 updates (#402)
Bumps the nextjs group with 2 updates in the / directory: [next](https://github.com/vercel/next.js) and [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next).
Updates `next` from 16.2.12 to 16.3.0
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/compare/v16.2.12...v16.3.0)
Updates `eslint-config-next` from 16.2.12 to 16.3.0
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/commits/v16.3.0/packages/eslint-config-next)
---
updated-dependencies:
- dependency-name: eslint-config-next
dependency-version: 16.3.0
dependency-type: direct:development
update-type: version-update:semver-minor
dependency-group: nextjs
- dependency-name: next
dependency-version: 16.3.0
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: nextjs
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore(deps-dev): bump prettier from 3.8.3 to 3.9.6 (#405)
Bumps [prettier](https://github.com/prettier/prettier) from 3.8.3 to 3.9.6.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.8.3...3.9.6)
---
updated-dependencies:
- dependency-name: prettier
dependency-version: 3.9.6
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* docs(changelog): Unreleased-Sektion fuer die Bumps nach v0.10.0 (#413)
Die Dependency-PRs sind nach dem Release auf dev gelandet, teils auch
auf main. Ohne Eintrag waeren sie beim naechsten Release unsichtbar --
inklusive Next 16.3.0, das CVE-2025-13465 mitbringt.
Ausserdem im 0.10.0-Abschnitt nachgetragen, dass der Trivy-Scan bis
#409 nie gelaufen ist. Der Fix steckt im Tag v0.10.0, fehlte aber in der
Aufzaehlung -- und "Images werden bei jedem Publish gescannt" stand im
Changelog, waehrend der Job im Action-Setup abbrach.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(gallery): per-album sort order, independent of Immich (#408) (#414)
Album order was dictated entirely by Immich: getAlbum() sorted by the
album's own asc/desc flag, so a Folio album always mirrored the archive.
A curated series has a narrative order that has nothing to do with
capture time, and changing the Immich album's sort to fit the website
changes it for the archive too.
Adds an optional per-album `sort` in gallery.yaml, editable in /admin,
defaulting to today's behaviour so every existing config is unchanged:
immich (default) | newest | oldest | filename | manual
`manual` is a pinned *prefix*: `assetOrder` lists only the photos placed
by hand, everything else follows in the album's Immich order. A full
permutation of a 2,000-photo album would be ~80 KB of UUIDs in a file
that is rewritten and copied to content/.backups/ on every admin save.
It also makes drift fall out for free — photos removed in Immich never
match, new ones land in the tail rather than being hidden.
Sorting is applied after the cache read, not before the cache write, so
the LRU keeps one canonical Immich-ordered copy per album. That avoids
putting the mode in the cache key, lets a config change take effect
without depending on invalidation, and keeps the stale-serving path
correct. cache.get() returns the stored object by reference, so
withSort() returns a shallow clone with a new array — sorting in place
would reorder the shared entry, and under request coalescing every
concurrent caller would be sorting the same array.
Also fixes a prerequisite bug: /api/admin/albums/[albumId]/assets read
album.assets from GET /albums/:id, which Immich 3.x no longer populates
(lib/immich.ts:507). The hero picker's "This Album" tab returned nothing
and threw outright when the key was absent. It now goes through the
client's paginated metadata search, with ?types=all to opt videos in for
the reorder editor.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): drop decorative emoji from the sort select labels (#415)
An <option> cannot contain markup, so the SVG set in Icons is not
reachable there — but a decorative emoji is not a substitute for it.
Plain text instead; the album card badge already uses a real icon.
The remaining emoji in the admin panel (asset picker tabs, section
headings, layout picker options) predate this branch and are left for a
separate cleanup.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): replace emoji icons with the shared SVG icon set (#416)
The admin panel mixed two icon conventions: inline SVGs from
`Icons.tsx` in most components, and decorative emoji in the asset
picker and a few PageBuilder labels. Emoji render inconsistently
across platforms, ignore the accent colour, and cannot inherit the
`.svg-icon` sizing rules.
- Icons.tsx: add `IconStar` (filled — it marks a state, not an
action) and `IconImage`.
- AssetPicker: the three tab labels and the favourite tile badge now
use IconFolder / IconStar / IconImage.
- PageBuilder: the "Standalone Albums" and "Subpages" headings use
the icon set instead of an emoji.
- PageBuilder: the layout picker drops its emoji for plain text. An
<option> cannot contain markup, so an SVG is impossible there and a
decorative glyph is not a substitute.
- admin.css: align icon and label in the picker tabs, and swap the
favourite badge's text-shadow for drop-shadow, which is what
applies to an inline SVG.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): fold PageBuilder's local icons into the shared Icons module (#418)
* refactor(admin): fold PageBuilder's local icons into the shared module
PageBuilder.tsx carried its own `Icons` object duplicating most of the
glyphs already exported by Icons.tsx, with hardcoded sizes and slightly
divergent paths. Migrate all 32 call sites to the shared module and
delete the local object.
Five glyphs had no counterpart and are added to Icons.tsx as 1:1 ports
of the local paths: IconX, IconPlus, IconHome, IconCopy, IconImage.
The local ExternalLink and Check are dropped rather than ported — both
had zero call sites.
Two glyphs change shape slightly, which is the point of consolidating:
the shared IconCamera includes the viewfinder bump the local copy
omitted, and drag handles now use IconGripVertical.
IconGripVertical uses the module's square 24x24 viewBox, so `.svg-drag`
goes from 12x18 to 18x18 — the old non-square box would letterbox the
glyph down to 12x12 and shrink the handle.
* fix(admin): resolve icon-module integration after #416
Merging dev brought in #416, which added a second IconImage to Icons.tsx
and two <Icons.Camera>/<Icons.Folder> section headers that reference the
local Icons object this PR removes. Git merged both cleanly but the result
did not type-check.
- drop the duplicate IconImage (both copies were byte-identical)
- point the two section headers at the imported IconCamera/IconFolder
- refresh the SORT_LABELS comment: the icon set is imported now, not
declared below
---------
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* fix(config): allow an empty gallery, guard against a double /api suffix (#421)
An empty gallery is now a valid, rendered state instead of a throw: deriveGallery() no longer requires at least one album or subpage, so a deployment with no albums yet renders a bare homepage the owner can fill in via /admin.
getConfig() also stops appending /api to an Immich URL that already ends in it, which previously produced .../api/api and broke every upstream request.
Includes a restore of the per-album sort test cases, which the branch had lost by being cut before #408/#414.
* feat(admin): favicon upload, served from the content volume (#422)
Adds a bundled default favicon, an upload widget in admin Settings > General, and a route that serves the icon from the writable content/ volume with a fallback to the bundled default. Raster uploads (PNG/ICO/JPEG) are wrapped in an SVG container; the response carries its own CSP so an uploaded SVG cannot execute script on the origin.
The GET route revalidates with an ETag instead of caching immutably, so a newly uploaded icon shows up immediately. Uploads are written via temp file + rename, and a Reset button restores the bundled default.
* ci: flag unformatted files in a PR, without blocking it (#424)
Prettier is configured as an error rule in eslint.config.mjs but has never run in CI, so part of the tree predates it. A final CI step now diffs against the PR base, runs prettier --list-different over the changed files, and emits a warning annotation per offender plus a job summary.
Advisory by design: it never fails the job. Blocking would turn a PR red for merely touching a file that was already unformatted, and normalising the tree in one commit would wreck git blame and conflict with the PRs in flight.
Requires fetch-depth: 0, since diffing against the base needs its history.
* feat(install): first-run wizard gated by a one-time setup token (#419)
Adds /install, a four-step first-run wizard: connect to Immich, optionally pick albums, name the site, finish. It verifies the credentials against the Immich server before writing anything, then writes gallery.yaml, settings.yaml and a content/install.json carrying the Immich credentials and a generated site secret.
install.json exists because a running process cannot pick up new env vars — the wizard has to write configuration that takes effect without a restart. getInstallCredentials() merges it under the real environment, so env vars always win and rotation stays a matter of setting one.
Both the page and the API routes are gated by a one-time setup token printed to the server log, so a deployment that is reachable before gallery.yaml exists cannot be configured by whoever finds it first. The token is stored in content/.setup-token (0600) rather than a module variable: Next.js bundles the page and each route handler separately, so a module-level token left the page and the API disagreeing inside one process and the wizard stuck on step 1. It is removed once the install completes.
The admin password is stored as an scrypt hash using the scheme lib/auth.ts already applies to album passwords; a plaintext ADMIN_PASSWORD env var keeps working.
* docs: document the setup wizard, fix the read-only content mount (#425)
Quick Start now leads with the /install wizard, with the hand-written YAML route kept alongside it, and a First-Run Setup section covers the setup token, the files the wizard writes, and env-var precedence.
Two corrections: both Docker examples mounted content/ as :ro, which silently breaks the wizard, the admin panel and the backup rotation alike — docs/admin-panel.md already said so and the README contradicted it. And nothing documented that content/install.json holds the Immich API key, so a backup of content/ is a backup of credentials.
Also adds a Contributors section crediting the people whose work is in the project.
* feat(admin): floating save bar pinned to the bottom of the viewport (#426)
The save bar was the first, static element inside .admin-main. Since the
document itself scrolls, it left the viewport as soon as you scrolled down
— editing a subpage section or a settings block far below gave no visible
dirty hint and no reachable save button.
Replace it with a bottom-pinned floating bar shared by both editors. It
only mounts while there is something to act on (unsaved changes, an
in-flight save, or a result message), so it never covers content while
idle. The success message clears after 5s, which hides the bar again.
- new SaveBar component, replacing the duplicated markup in PageBuilder
and SettingsEditor
- adopt the previously unused .floating-save-bar CSS: slide-in keyframes
(carrying translateX(-50%)), dirty border, wrap/gap, mobile variant and
a prefers-reduced-motion opt-out; z-index 900 keeps it below modals
- .admin-main gains bottom padding so the bar never covers page content
- drop the now-unreachable idle hints: the ⌘S hint becomes a button title,
the Live Sync note becomes a static line above the settings layout
- header "Site" link now bypasses the cache (/?fresh=1), so the preview
stays reachable when the bar is hidden
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(admin): themed listbox for the album sort control (#427)
The per-album "Photo order" control was a native <select>. Because an
<option> cannot contain markup, its choices could not use the admin
panel's currentColor SVG set — the reason #415 had to fall back to plain
text after dropping the emoji labels.
Adds a Listbox component implementing the ARIA combobox/listbox pattern,
so options can render a glyph beside their label:
- DOM focus stays on the trigger button; the active option is announced
through aria-activedescendant, keeping focus management to one element
- Keyboard: arrows (clamped at the ends, like a native select),
Home/End, Enter/Space to commit, Escape to cancel, Tab commits and
moves on, and prefix type-ahead with a repeat-key cycle
- Outside dismissal on pointerdown, so a press starting outside closes
the popup before the click retargets
The sort options now carry an icon each: calendar, arrow-down, arrow-up,
an A→Z marker, and the drag glyph for manual — matching the badge the
album card already shows. SORT_LABELS stays plain text because the badge
feeds it to a title attribute.
Closes #417
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(git): ignore generated design handoff folders
* fix(admin): stop the album sort dropdown clipping, and simplify the panel (#428)
* fix(admin): render listbox popup in a portal so it escapes modal clipping
The sort control's popup was position:absolute inside three clipping ancestors
(.album-drawer overflow:hidden > .album-drawer-body overflow-y:auto >
.modal-right-column overflow-y:auto), so it was cut off at the bottom of the
Edit Album Details modal. z-index could not help: clipping happens before
stacking. It also always hung below the trigger, with no flip.
Portal the popup to document.body and position it from the trigger's viewport
rect, flipping above when there is more room there and capping max-height to the
space available so it scrolls internally rather than overflowing. It is
dismissed on scroll and resize, since the anchor is only measured on open.
The outside-pointerdown handler now also treats the popup as inside; without
that the portalled list counts as outside, and a click on an option would close
it before the selection commits.
* refactor(admin): single-column album details panel
The left column spent 1.2fr on a cover thumbnail and three stat rows, two of
which (Status, Custom Hero) only restated the form fields opposite them, while
the form itself was squeezed into 1.8fr behind a second nested scroller.
Stack the drawer in one column instead: cover as a banner, then the form at full
width, with the UUID moved into the footer. The body is now the only scroll
container, which also removes one of the ancestors that was clipping the sort
popup.
---------
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* fix(admin): give the portalled listbox its theme back, lock the page behind modals (#429)
Two defects in the album editor.
The sort listbox popup painted transparent. Every --admin-* variable is
scoped to .admin-layout, and since the popup moved into document.body it
sits outside that subtree, so background/border/text all resolved to
nothing. It now carries its own copy of the palette in both colour
schemes, plus the font it no longer inherits.
Scrolling inside a modal also moved the page behind it. No admin modal
ever locked body scroll: the overlay covers the page but does not absorb
wheel events, so a scroll starting on the backdrop — or continuing past
the end of the modal's own scroller — reaches the document.
overscroll-behavior cannot cover that case on its own, because it only
applies to scroll containers and the backdrop is not one.
useScrollLock freezes body while a modal is open and compensates for the
width the scrollbar gives up, so nothing shifts underneath. Each lock
restores the inline value it found, which makes nesting work without a
counter — a picker opened from the drawer restores the drawer's hidden
state instead of clearing it. Applied to both drawers and all four
picker modals, which share the defect. overscroll-behavior: contain on
the scrollers stops the chaining they can handle themselves.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* fix(security): allow unsafe-eval in CSP script-src during dev mode
* feat(journal): add Journal Studio with split-screen editor, live preview and dedicated routes
* fix(build): separate client parser from server journal-service and fix build type errors
* fix(journal): Fotos rendern, Layout und Lightbox-Steuerung korrigieren
Fünf unabhängige Fehler in der öffentlichen Journal- und Essay-Ansicht:
* Foto-Blöcke wurden nie angezeigt. EssayView löst ein Foto über
PhotoItem.id auf, und das sind verschlüsselte Tokens — die Blöcke aus
dem Markdown tragen aber rohe Asset-UUIDs. Jede Zuordnung lief ins
Leere, und nicht auflösbare Blöcke werden still verworfen. Die IDs
werden jetzt serverseitig übersetzt; damit verschwinden nebenbei die
rohen UUIDs aus dem Client-Payload, die dort laut Projektregel nie
auftauchen dürfen. Nicht auflösbare Referenzen werden geloggt.
* Überschriften standen weiter links als der Fließtext. Jeder Block
hatte einzeln `max-width: 68ch`, und `ch` ist relativ zur Schrift des
Elements — die Serif-Überschrift ergab eine breitere Spalte. Ersetzt
durch eine gemeinsame, font-unabhängige `--essay-measure`.
* Fullbleed-Fotos bluteten nur nach links aus: `.essay-figure` ist
`width: 100%`, wodurch die Box überbestimmt ist und der negative
rechte Margin verworfen wird.
* Foto-Paare stellten beide Bilder gleich breit dar, wodurch ein
Hochformat neben einem Querformat doppelt so hoch wurde. Jetzt eine
Justified-Reihe: Breite proportional zum Seitenverhältnis, dadurch
exakt gleiche Höhen ohne Beschnitt.
* Die Lightbox hatte im Journal keine Tastatursteuerung und keine
Scroll-Sperre — beides lag in PhotoGrid, also nur im Album-Raster.
Verlagert in die Lightbox selbst, der doppelte Handler in PhotoGrid
entfernt (sonst wäre pro Pfeildruck zwei Bilder weitergesprungen).
Zusätzlich sind Proofing-Herzen und das EXIF-Panel im redaktionellen
Modus abschaltbar und im Journal aus: Client-Proofing ist ein
Übergabe-Workflow für Alben, keine Funktion einer Reportage. Auf der
Übersicht wurde der Untertitel doppelt gerendert, weil extractExcerpt()
auf ihn zurückfällt.
* feat(admin): eigene URLs für alle Bereiche und überarbeiteter Journal Studio
Das Panel war eine einzige Client-Komponente, die ihre Tabs über
useState umschaltet: keine Route pro Bereich, kein Deep-Link, kein
Zurück-Button, und nach jedem Reload landete man wieder auf "Pages".
Auch der Journal-Editor hatte keine eigene URL.
Jetzt sieben echte Routen (/admin, /admin/pages, /admin/journal,
/admin/journal/<slug>, /admin/settings, /admin/settings/<section>,
/admin/analytics). Die Shell mit Auth-Prüfung und Kopfzeile sitzt im
Layout und umschließt children — so bleibt die Session-Prüfung über
Routenwechsel montiert, statt bei jedem Tab-Wechsel neu zu laufen und
den Spinner aufblitzen zu lassen. Unbekannte Settings-Sections fallen
auf General zurück.
Im selben Zug der Journal Studio, der die Routing-Änderung ohnehin
berührt:
* Alle Eingabefelder nutzten die Klasse `admin-input`, die in keinem
CSS definiert war — sie fielen auf Browser-Defaults zurück. Jetzt
gestylt, gescoped, damit der generische Name nicht ins übrige Panel
leckt.
* Der Split View ist per Divider verschiebbar (Maus, Tastatur,
Doppelklick zum Zurücksetzen), Breite in localStorage.
* Das Studio bricht aus der 1120px-Spalte aus, die Preview hat Platz.
* Die Preview zeigte für jedes Foto fest 3:2 und log damit über das
Layout der veröffentlichten Seite; die echten Verhältnisse werden
jetzt an den Thumbnails gemessen.
* Blöcke mit alten positionsbasierten Foto-Referenzen werden markiert —
die lassen sich auf einer eigenständigen Journal-Seite nicht auflösen
und verschwanden bisher stillschweigend.
* Blocktyp-Chips als gemeinsame Komponente, monochrom und per Icon
unterschieden statt in einer eigenen Blau/Lila/Orange-Palette, die
sonst nirgends im Panel vorkommt.
* Emojis raus, SVG-Icons rein.
* fix(admin): Designsystem-Lücken im Panel schließen
Eine systematische Suche nach Klassen, die im TSX benutzt, aber in
keinem CSS definiert sind, hat vier Stellen mit demselben Muster
gefunden:
* `admin-btn-secondary` und `admin-btn-danger` existierten nicht.
Sämtliche Löschen-Buttons sahen aus wie normale Buttons — keine
Warnwirkung. Als `.admin-btn.admin-btn-danger` geschrieben, weil die
Varianten mit den Größenklassen kombiniert werden, die weiter unten
ihren eigenen Hintergrund setzen.
* `page-progress-fill` fehlte: die Balken im Analytics-Panel waren
leere Rinnen, der Wert unsichtbar. Ebenso `analytics-empty` und
`admin-loading-container`.
* `subpage-drawer-section`, `subpage-drawer-title-group` und
`input-with-icon` im PageBuilder waren wirkungslos und teils mit
Inline-Styles notdürftig kompensiert.
* `grid-card-preview` fehlte, wodurch alle Layout-Vorschauen auf Höhe
null kollabierten. Nur "Showcase" war sichtbar — und das aus Versehen,
weil sein Tile `hero-tile` hieß und damit die `aspect-ratio` einer
fremden PageBuilder-Klasse erbte. Umbenannt.
Dazu die Theme-Vorschauen, die praktisch identisch aussahen: alle
sieben zeigten dieselben drei quadratischen Kacheln, einziger
Unterschied war die Hintergrundfarbe. Sie spiegeln jetzt die echten
Preset-Daten aus lib/config/theme.ts — Schriftcharakter, Eckradius,
Rasterdichte, Passepartout bzw. Schatten.
Die Kopfzeile richtet sich an einer gemeinsamen Steuerhöhe aus. Der
"Site"-Link war höher als die Buttons daneben: `.admin-btn` hatte keine
explizite line-height, und <button> bekommt box-sizing: border-box vom
Browser, <a> nicht. Die Statusanzeige setzte weder Schriftfamilie noch
-größe und fiel auf den Browser-Default zurück — sie war nie Teil des
Designsystems. Jetzt gleiche Höhe und Typografie, Pillenform als
Zustandsanzeige, Trenner zur Aktionsgruppe. Das dauerhafte Pulsieren
des grünen Punkts entfällt; Animation bleibt den Zuständen vorbehalten,
die Aufmerksamkeit brauchen.
Restliche Emojis durch SVG-Icons ersetzt.
* feat(admin): add scroll-to-top toggle and SVG arrow
The back-to-top button was always on and drew its arrow with the ↑ text
character. Add a `scrollToTop` setting (General section in the admin
panel, defaults to on so existing sites are unaffected) and replace the
glyph with a stroked SVG that inherits currentColor across all presets.
Scroll handling is now rAF-throttled, and prefers-reduced-motion turns
off both the hover lift and the smooth scroll.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* security(journal): escape author HTML instead of filtering it
CodeQL flags 26 high-severity alerts on the release PR; the bulk of them
point at sanitizeHtml(), a denylist of three regexes whose output goes
into dangerouslySetInnerHTML. I reproduced the bypasses before changing
anything — all four pass the old filter:
<img src=x onerror=alert(1)> unquoted handler, regex wants quotes
<img src=x onerror='alert(1)'> single quotes, same reason
<svg onload=alert(1)> not a <script> tag
javasjavascript:cript:alert(1) one-pass replace, the rest recombines
Plus an attribute breakout in the link renderer, which interpolated the
URL into href="${url}" unescaped:
[x](" onmouseover=alert(1) x=") -> <a href="" onmouseover=alert(1" ...>
Replaced with escaping. Every `&<>"'` in author text becomes an entity
before any markdown rule runs, so the only tags in the output are the
ones renderInlineMarkdown builds itself and a URL cannot leave its
attribute. Link schemes are now an allowlist (http, https, mailto, tel,
relative, anchor); anything else renders as plain text.
The serializer needed decodeHtmlEntities to match: without it a save
would write `<` into the Markdown file and the next parse would
escape the `&` again, corrupting the text further on every round trip.
A test covers parse -> serialize -> parse stability.
Two existing tests asserted the old behaviour and were rewritten rather
than deleted: one expected the script tag to be *removed* from the
output, the other expected the substring "onerror" to be absent. Both
now assert the property that matters — that no tag can form — because
`onerror` surviving as inert text is fine.
Exploitation required admin access either way: journal and essay text
comes from the studio or from content/*.md. This removes the weakness,
it does not close an open door.
* fix(journal): contain file paths, fix frontmatter escaping, defuse two regexes
Follow-up to the CodeQL findings on release PR #432. I went through all 23
alerts individually; this addresses the ones that are worth addressing and
documents the ones that are not.
Path containment (12 alerts, all false positives). Every path built from a
slug goes through isValidSlug(), a strict `/^[a-zA-Z0-9_-]+$/` allowlist —
verified against `../../etc/passwd`, `foo/../../bar`, `a/b`, `..` and
friends, all rejected. CodeQL cannot see it because the check lives in
another module. Added a containedPath() helper that resolves the path and
refuses anything landing outside the content directory: a second lock on a
door that was already locked, and a barrier the analysis can follow. Also
removed the dead `slug.endsWith('.md')` branches — isValidSlug rejects
dots, so they could never be taken.
Frontmatter escaping (1 alert, a real bug). The serializer escaped `"` but
not `\`, and the parser never unescaped anything. A title containing either
character gained a backslash on every save/load cycle:
Path C:\Users "quoted" -> Path C:\\Users \"quoted\" -> ...
Escaping now covers the backslash first and the parser undoes both. A round
trip test covers quotes, backslashes, colons and apostrophes.
Two of three ReDoS regexes (2 alerts). The heading pattern had `\s+` next to
`(.+)`, which overlap, so the engine tried every split of the whitespace run
before failing; it is `[ \t]+` and `(\S.*)` now. The quote author pattern
wrapped a lazy group around an optional group — the quadratic case — and is
an index split on the first separator now.
The third regex, the bold/italic pass, is deliberately left alone. Rewriting
it with a negated class removes the backtracking but breaks nesting:
`**bold *and italic* here**` renders as `*<em>bold </em>and italic<em> here</em>*`.
The input is Markdown from an authenticated admin, never a visitor, so the
worst case is an author slowing down their own page. The comment in the code
says so.
Not addressed: 5 js/insufficient-password-hash alerts. They ask for a slow
KDF where the code uses SHA-256/HMAC — correct in general, but the admin
password comes from an environment variable and is never stored, so a
stronger KDF protects nothing that is not already in plaintext in the
environment.
399 unit tests pass (18 new), build and tsc clean.
* fix(journal): split the quote author by scanning, not by pattern
Cleaning up after myself. #439 replaced the quote author regex
`/^(.*?)(?:\s+--\s+(.+))?$/` — a lazy group around an optional one, the
quadratic case — with `/\s+--\s+/`, and CodeQL promptly flagged the
replacement for the same reason. One reported pattern traded for another.
splitQuoteAuthor() scans for the first `--` that has whitespace on both
sides. Linear, and it needs no reasoning about the regex engine at all.
Behaviour is identical to the original regex, checked case by case
against it: separator, no separator, several separators, tabs, wide gaps,
`a--b` without spaces, leading and trailing separators, empty string. All
nine are covered by tests, plus one asserting it stays fast on a 50k
whitespace run.
* security(admin): derive the session signing key with scrypt
getSigningKey() ran the admin password through a single SHA-256 digest.
It is key derivation rather than password storage, so it was never a
stored-hash problem — but if the derived key ever leaked, one fast hash
makes recovering the password by brute force cheap. CodeQL flags it as
js/insufficient-password-hash and, for this particular alert, has a
point.
scrypt now. Two details that matter:
The salt has to be stable. A random salt would produce a different key on
every call and invalidate every session; it is derived from AUTH_SECRET,
which is deployment-specific. Verified across separate processes: same
inputs produce a verifying token, so a restart or redeploy does not log
everyone out.
The result is cached for the process lifetime. scrypt is deliberately
slow and getSigningKey() runs on every admin request — deriving per call
would add ~24ms to each one. The cache key is a digest of secret plus
password, so a rotation misses the cache and derives again, and no extra
plaintext copy of the password is kept around.
Measured: first derivation 24ms, subsequent calls 0.12ms. Password
change and secret change both invalidate an existing token, checked in
separate processes.
Note the one-time effect: existing admin sessions are invalidated by the
change in derivation, so everyone logs in once more.
* security(admin): key the signing-key cache on its inputs, not a digest
#441 removed the SHA-256 digest of the admin password from the key
derivation and introduced a new one three lines above it, as the cache
key. Same rule, same file: CodeQL reported it immediately.
The comment justifying it was wrong too. It claimed no second plaintext
copy of the password was retained, while building the digest input
allocates exactly that in order to hash it.
The cache now holds the two input strings and compares them directly.
They are the same objects the env and install caches already hold, so
nothing extra is retained, and no fast hash of the password exists in
memory for the life of the process.
Re-verified after the change, in separate processes: a token from one
process verifies in another with the same inputs, a changed password or
secret rejects it, first derivation 24ms, cached calls 0.001ms.
That leaves scrypt as the only place the password is hashed here. The
two HMACs further down operate on the derived key and on token data, not
on the password; the constant-time comparison in verifyAdminPassword is
the previously dismissed one.
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: lancetm714 <108419425+lancetm714@users.noreply.github.com>
2026-08-14 16:55:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Grip dots, and a widened invisible hit area so the divider is easy to grab. */
|
|
|
|
|
.journal-editor-resizer-grip {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 50%;
|
|
|
|
|
left: 50%;
|
|
|
|
|
transform: translate(-50%, -50%);
|
|
|
|
|
width: 15px;
|
|
|
|
|
height: 44px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
background: repeating-linear-gradient(to bottom, currentColor 0 2px, transparent 2px 5px);
|
|
|
|
|
color: rgba(255, 255, 255, 0.35);
|
|
|
|
|
background-clip: content-box;
|
|
|
|
|
padding: 0 6px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-resizer:hover .journal-editor-resizer-grip {
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-pane-left {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
padding: 1.5rem 2rem 4rem;
|
|
|
|
|
background: var(--admin-bg, #09090b);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-pane-right {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
overflow-y: auto;
|
2026-09-19 22:24:10 +02:00
|
|
|
background: var(--admin-bg, #111);
|
release: v0.11.0 — journal fixes, admin URLs, design system cleanup (#432)
* fix(screenshots): sharp-Typen fuer 0.34 und 0.35 gleichzeitig (#410)
sharp 0.35 ist von `export =` auf ESM umgestellt: der Modul-Namespace
ist nicht mehr aufrufbar, die Factory sitzt unter .default. Der
Type-Check brach damit in scripts/screenshots.ts weg, sobald der
Next-Bump (#402) sharp von 0.34.5 auf 0.35.3 mitzieht -- sharp ist hier
keine deklarierte Dependency, sondern kommt ueber Next mit.
Die Form wird jetzt aus dem installierten Paket abgeleitet statt
festgeschrieben, zur Laufzeit wie im Typ. Geprueft mit beiden
Versionen: tsc laeuft mit 0.34.5 und mit 0.35.3 fehlerfrei durch.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(deps): bump the nextjs group across 1 directory with 2 updates (#402)
Bumps the nextjs group with 2 updates in the / directory: [next](https://github.com/vercel/next.js) and [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next).
Updates `next` from 16.2.12 to 16.3.0
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/compare/v16.2.12...v16.3.0)
Updates `eslint-config-next` from 16.2.12 to 16.3.0
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/commits/v16.3.0/packages/eslint-config-next)
---
updated-dependencies:
- dependency-name: eslint-config-next
dependency-version: 16.3.0
dependency-type: direct:development
update-type: version-update:semver-minor
dependency-group: nextjs
- dependency-name: next
dependency-version: 16.3.0
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: nextjs
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore(deps-dev): bump prettier from 3.8.3 to 3.9.6 (#405)
Bumps [prettier](https://github.com/prettier/prettier) from 3.8.3 to 3.9.6.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.8.3...3.9.6)
---
updated-dependencies:
- dependency-name: prettier
dependency-version: 3.9.6
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* docs(changelog): Unreleased-Sektion fuer die Bumps nach v0.10.0 (#413)
Die Dependency-PRs sind nach dem Release auf dev gelandet, teils auch
auf main. Ohne Eintrag waeren sie beim naechsten Release unsichtbar --
inklusive Next 16.3.0, das CVE-2025-13465 mitbringt.
Ausserdem im 0.10.0-Abschnitt nachgetragen, dass der Trivy-Scan bis
#409 nie gelaufen ist. Der Fix steckt im Tag v0.10.0, fehlte aber in der
Aufzaehlung -- und "Images werden bei jedem Publish gescannt" stand im
Changelog, waehrend der Job im Action-Setup abbrach.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(gallery): per-album sort order, independent of Immich (#408) (#414)
Album order was dictated entirely by Immich: getAlbum() sorted by the
album's own asc/desc flag, so a Folio album always mirrored the archive.
A curated series has a narrative order that has nothing to do with
capture time, and changing the Immich album's sort to fit the website
changes it for the archive too.
Adds an optional per-album `sort` in gallery.yaml, editable in /admin,
defaulting to today's behaviour so every existing config is unchanged:
immich (default) | newest | oldest | filename | manual
`manual` is a pinned *prefix*: `assetOrder` lists only the photos placed
by hand, everything else follows in the album's Immich order. A full
permutation of a 2,000-photo album would be ~80 KB of UUIDs in a file
that is rewritten and copied to content/.backups/ on every admin save.
It also makes drift fall out for free — photos removed in Immich never
match, new ones land in the tail rather than being hidden.
Sorting is applied after the cache read, not before the cache write, so
the LRU keeps one canonical Immich-ordered copy per album. That avoids
putting the mode in the cache key, lets a config change take effect
without depending on invalidation, and keeps the stale-serving path
correct. cache.get() returns the stored object by reference, so
withSort() returns a shallow clone with a new array — sorting in place
would reorder the shared entry, and under request coalescing every
concurrent caller would be sorting the same array.
Also fixes a prerequisite bug: /api/admin/albums/[albumId]/assets read
album.assets from GET /albums/:id, which Immich 3.x no longer populates
(lib/immich.ts:507). The hero picker's "This Album" tab returned nothing
and threw outright when the key was absent. It now goes through the
client's paginated metadata search, with ?types=all to opt videos in for
the reorder editor.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): drop decorative emoji from the sort select labels (#415)
An <option> cannot contain markup, so the SVG set in Icons is not
reachable there — but a decorative emoji is not a substitute for it.
Plain text instead; the album card badge already uses a real icon.
The remaining emoji in the admin panel (asset picker tabs, section
headings, layout picker options) predate this branch and are left for a
separate cleanup.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): replace emoji icons with the shared SVG icon set (#416)
The admin panel mixed two icon conventions: inline SVGs from
`Icons.tsx` in most components, and decorative emoji in the asset
picker and a few PageBuilder labels. Emoji render inconsistently
across platforms, ignore the accent colour, and cannot inherit the
`.svg-icon` sizing rules.
- Icons.tsx: add `IconStar` (filled — it marks a state, not an
action) and `IconImage`.
- AssetPicker: the three tab labels and the favourite tile badge now
use IconFolder / IconStar / IconImage.
- PageBuilder: the "Standalone Albums" and "Subpages" headings use
the icon set instead of an emoji.
- PageBuilder: the layout picker drops its emoji for plain text. An
<option> cannot contain markup, so an SVG is impossible there and a
decorative glyph is not a substitute.
- admin.css: align icon and label in the picker tabs, and swap the
favourite badge's text-shadow for drop-shadow, which is what
applies to an inline SVG.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): fold PageBuilder's local icons into the shared Icons module (#418)
* refactor(admin): fold PageBuilder's local icons into the shared module
PageBuilder.tsx carried its own `Icons` object duplicating most of the
glyphs already exported by Icons.tsx, with hardcoded sizes and slightly
divergent paths. Migrate all 32 call sites to the shared module and
delete the local object.
Five glyphs had no counterpart and are added to Icons.tsx as 1:1 ports
of the local paths: IconX, IconPlus, IconHome, IconCopy, IconImage.
The local ExternalLink and Check are dropped rather than ported — both
had zero call sites.
Two glyphs change shape slightly, which is the point of consolidating:
the shared IconCamera includes the viewfinder bump the local copy
omitted, and drag handles now use IconGripVertical.
IconGripVertical uses the module's square 24x24 viewBox, so `.svg-drag`
goes from 12x18 to 18x18 — the old non-square box would letterbox the
glyph down to 12x12 and shrink the handle.
* fix(admin): resolve icon-module integration after #416
Merging dev brought in #416, which added a second IconImage to Icons.tsx
and two <Icons.Camera>/<Icons.Folder> section headers that reference the
local Icons object this PR removes. Git merged both cleanly but the result
did not type-check.
- drop the duplicate IconImage (both copies were byte-identical)
- point the two section headers at the imported IconCamera/IconFolder
- refresh the SORT_LABELS comment: the icon set is imported now, not
declared below
---------
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* fix(config): allow an empty gallery, guard against a double /api suffix (#421)
An empty gallery is now a valid, rendered state instead of a throw: deriveGallery() no longer requires at least one album or subpage, so a deployment with no albums yet renders a bare homepage the owner can fill in via /admin.
getConfig() also stops appending /api to an Immich URL that already ends in it, which previously produced .../api/api and broke every upstream request.
Includes a restore of the per-album sort test cases, which the branch had lost by being cut before #408/#414.
* feat(admin): favicon upload, served from the content volume (#422)
Adds a bundled default favicon, an upload widget in admin Settings > General, and a route that serves the icon from the writable content/ volume with a fallback to the bundled default. Raster uploads (PNG/ICO/JPEG) are wrapped in an SVG container; the response carries its own CSP so an uploaded SVG cannot execute script on the origin.
The GET route revalidates with an ETag instead of caching immutably, so a newly uploaded icon shows up immediately. Uploads are written via temp file + rename, and a Reset button restores the bundled default.
* ci: flag unformatted files in a PR, without blocking it (#424)
Prettier is configured as an error rule in eslint.config.mjs but has never run in CI, so part of the tree predates it. A final CI step now diffs against the PR base, runs prettier --list-different over the changed files, and emits a warning annotation per offender plus a job summary.
Advisory by design: it never fails the job. Blocking would turn a PR red for merely touching a file that was already unformatted, and normalising the tree in one commit would wreck git blame and conflict with the PRs in flight.
Requires fetch-depth: 0, since diffing against the base needs its history.
* feat(install): first-run wizard gated by a one-time setup token (#419)
Adds /install, a four-step first-run wizard: connect to Immich, optionally pick albums, name the site, finish. It verifies the credentials against the Immich server before writing anything, then writes gallery.yaml, settings.yaml and a content/install.json carrying the Immich credentials and a generated site secret.
install.json exists because a running process cannot pick up new env vars — the wizard has to write configuration that takes effect without a restart. getInstallCredentials() merges it under the real environment, so env vars always win and rotation stays a matter of setting one.
Both the page and the API routes are gated by a one-time setup token printed to the server log, so a deployment that is reachable before gallery.yaml exists cannot be configured by whoever finds it first. The token is stored in content/.setup-token (0600) rather than a module variable: Next.js bundles the page and each route handler separately, so a module-level token left the page and the API disagreeing inside one process and the wizard stuck on step 1. It is removed once the install completes.
The admin password is stored as an scrypt hash using the scheme lib/auth.ts already applies to album passwords; a plaintext ADMIN_PASSWORD env var keeps working.
* docs: document the setup wizard, fix the read-only content mount (#425)
Quick Start now leads with the /install wizard, with the hand-written YAML route kept alongside it, and a First-Run Setup section covers the setup token, the files the wizard writes, and env-var precedence.
Two corrections: both Docker examples mounted content/ as :ro, which silently breaks the wizard, the admin panel and the backup rotation alike — docs/admin-panel.md already said so and the README contradicted it. And nothing documented that content/install.json holds the Immich API key, so a backup of content/ is a backup of credentials.
Also adds a Contributors section crediting the people whose work is in the project.
* feat(admin): floating save bar pinned to the bottom of the viewport (#426)
The save bar was the first, static element inside .admin-main. Since the
document itself scrolls, it left the viewport as soon as you scrolled down
— editing a subpage section or a settings block far below gave no visible
dirty hint and no reachable save button.
Replace it with a bottom-pinned floating bar shared by both editors. It
only mounts while there is something to act on (unsaved changes, an
in-flight save, or a result message), so it never covers content while
idle. The success message clears after 5s, which hides the bar again.
- new SaveBar component, replacing the duplicated markup in PageBuilder
and SettingsEditor
- adopt the previously unused .floating-save-bar CSS: slide-in keyframes
(carrying translateX(-50%)), dirty border, wrap/gap, mobile variant and
a prefers-reduced-motion opt-out; z-index 900 keeps it below modals
- .admin-main gains bottom padding so the bar never covers page content
- drop the now-unreachable idle hints: the ⌘S hint becomes a button title,
the Live Sync note becomes a static line above the settings layout
- header "Site" link now bypasses the cache (/?fresh=1), so the preview
stays reachable when the bar is hidden
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(admin): themed listbox for the album sort control (#427)
The per-album "Photo order" control was a native <select>. Because an
<option> cannot contain markup, its choices could not use the admin
panel's currentColor SVG set — the reason #415 had to fall back to plain
text after dropping the emoji labels.
Adds a Listbox component implementing the ARIA combobox/listbox pattern,
so options can render a glyph beside their label:
- DOM focus stays on the trigger button; the active option is announced
through aria-activedescendant, keeping focus management to one element
- Keyboard: arrows (clamped at the ends, like a native select),
Home/End, Enter/Space to commit, Escape to cancel, Tab commits and
moves on, and prefix type-ahead with a repeat-key cycle
- Outside dismissal on pointerdown, so a press starting outside closes
the popup before the click retargets
The sort options now carry an icon each: calendar, arrow-down, arrow-up,
an A→Z marker, and the drag glyph for manual — matching the badge the
album card already shows. SORT_LABELS stays plain text because the badge
feeds it to a title attribute.
Closes #417
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(git): ignore generated design handoff folders
* fix(admin): stop the album sort dropdown clipping, and simplify the panel (#428)
* fix(admin): render listbox popup in a portal so it escapes modal clipping
The sort control's popup was position:absolute inside three clipping ancestors
(.album-drawer overflow:hidden > .album-drawer-body overflow-y:auto >
.modal-right-column overflow-y:auto), so it was cut off at the bottom of the
Edit Album Details modal. z-index could not help: clipping happens before
stacking. It also always hung below the trigger, with no flip.
Portal the popup to document.body and position it from the trigger's viewport
rect, flipping above when there is more room there and capping max-height to the
space available so it scrolls internally rather than overflowing. It is
dismissed on scroll and resize, since the anchor is only measured on open.
The outside-pointerdown handler now also treats the popup as inside; without
that the portalled list counts as outside, and a click on an option would close
it before the selection commits.
* refactor(admin): single-column album details panel
The left column spent 1.2fr on a cover thumbnail and three stat rows, two of
which (Status, Custom Hero) only restated the form fields opposite them, while
the form itself was squeezed into 1.8fr behind a second nested scroller.
Stack the drawer in one column instead: cover as a banner, then the form at full
width, with the UUID moved into the footer. The body is now the only scroll
container, which also removes one of the ancestors that was clipping the sort
popup.
---------
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* fix(admin): give the portalled listbox its theme back, lock the page behind modals (#429)
Two defects in the album editor.
The sort listbox popup painted transparent. Every --admin-* variable is
scoped to .admin-layout, and since the popup moved into document.body it
sits outside that subtree, so background/border/text all resolved to
nothing. It now carries its own copy of the palette in both colour
schemes, plus the font it no longer inherits.
Scrolling inside a modal also moved the page behind it. No admin modal
ever locked body scroll: the overlay covers the page but does not absorb
wheel events, so a scroll starting on the backdrop — or continuing past
the end of the modal's own scroller — reaches the document.
overscroll-behavior cannot cover that case on its own, because it only
applies to scroll containers and the backdrop is not one.
useScrollLock freezes body while a modal is open and compensates for the
width the scrollbar gives up, so nothing shifts underneath. Each lock
restores the inline value it found, which makes nesting work without a
counter — a picker opened from the drawer restores the drawer's hidden
state instead of clearing it. Applied to both drawers and all four
picker modals, which share the defect. overscroll-behavior: contain on
the scrollers stops the chaining they can handle themselves.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* fix(security): allow unsafe-eval in CSP script-src during dev mode
* feat(journal): add Journal Studio with split-screen editor, live preview and dedicated routes
* fix(build): separate client parser from server journal-service and fix build type errors
* fix(journal): Fotos rendern, Layout und Lightbox-Steuerung korrigieren
Fünf unabhängige Fehler in der öffentlichen Journal- und Essay-Ansicht:
* Foto-Blöcke wurden nie angezeigt. EssayView löst ein Foto über
PhotoItem.id auf, und das sind verschlüsselte Tokens — die Blöcke aus
dem Markdown tragen aber rohe Asset-UUIDs. Jede Zuordnung lief ins
Leere, und nicht auflösbare Blöcke werden still verworfen. Die IDs
werden jetzt serverseitig übersetzt; damit verschwinden nebenbei die
rohen UUIDs aus dem Client-Payload, die dort laut Projektregel nie
auftauchen dürfen. Nicht auflösbare Referenzen werden geloggt.
* Überschriften standen weiter links als der Fließtext. Jeder Block
hatte einzeln `max-width: 68ch`, und `ch` ist relativ zur Schrift des
Elements — die Serif-Überschrift ergab eine breitere Spalte. Ersetzt
durch eine gemeinsame, font-unabhängige `--essay-measure`.
* Fullbleed-Fotos bluteten nur nach links aus: `.essay-figure` ist
`width: 100%`, wodurch die Box überbestimmt ist und der negative
rechte Margin verworfen wird.
* Foto-Paare stellten beide Bilder gleich breit dar, wodurch ein
Hochformat neben einem Querformat doppelt so hoch wurde. Jetzt eine
Justified-Reihe: Breite proportional zum Seitenverhältnis, dadurch
exakt gleiche Höhen ohne Beschnitt.
* Die Lightbox hatte im Journal keine Tastatursteuerung und keine
Scroll-Sperre — beides lag in PhotoGrid, also nur im Album-Raster.
Verlagert in die Lightbox selbst, der doppelte Handler in PhotoGrid
entfernt (sonst wäre pro Pfeildruck zwei Bilder weitergesprungen).
Zusätzlich sind Proofing-Herzen und das EXIF-Panel im redaktionellen
Modus abschaltbar und im Journal aus: Client-Proofing ist ein
Übergabe-Workflow für Alben, keine Funktion einer Reportage. Auf der
Übersicht wurde der Untertitel doppelt gerendert, weil extractExcerpt()
auf ihn zurückfällt.
* feat(admin): eigene URLs für alle Bereiche und überarbeiteter Journal Studio
Das Panel war eine einzige Client-Komponente, die ihre Tabs über
useState umschaltet: keine Route pro Bereich, kein Deep-Link, kein
Zurück-Button, und nach jedem Reload landete man wieder auf "Pages".
Auch der Journal-Editor hatte keine eigene URL.
Jetzt sieben echte Routen (/admin, /admin/pages, /admin/journal,
/admin/journal/<slug>, /admin/settings, /admin/settings/<section>,
/admin/analytics). Die Shell mit Auth-Prüfung und Kopfzeile sitzt im
Layout und umschließt children — so bleibt die Session-Prüfung über
Routenwechsel montiert, statt bei jedem Tab-Wechsel neu zu laufen und
den Spinner aufblitzen zu lassen. Unbekannte Settings-Sections fallen
auf General zurück.
Im selben Zug der Journal Studio, der die Routing-Änderung ohnehin
berührt:
* Alle Eingabefelder nutzten die Klasse `admin-input`, die in keinem
CSS definiert war — sie fielen auf Browser-Defaults zurück. Jetzt
gestylt, gescoped, damit der generische Name nicht ins übrige Panel
leckt.
* Der Split View ist per Divider verschiebbar (Maus, Tastatur,
Doppelklick zum Zurücksetzen), Breite in localStorage.
* Das Studio bricht aus der 1120px-Spalte aus, die Preview hat Platz.
* Die Preview zeigte für jedes Foto fest 3:2 und log damit über das
Layout der veröffentlichten Seite; die echten Verhältnisse werden
jetzt an den Thumbnails gemessen.
* Blöcke mit alten positionsbasierten Foto-Referenzen werden markiert —
die lassen sich auf einer eigenständigen Journal-Seite nicht auflösen
und verschwanden bisher stillschweigend.
* Blocktyp-Chips als gemeinsame Komponente, monochrom und per Icon
unterschieden statt in einer eigenen Blau/Lila/Orange-Palette, die
sonst nirgends im Panel vorkommt.
* Emojis raus, SVG-Icons rein.
* fix(admin): Designsystem-Lücken im Panel schließen
Eine systematische Suche nach Klassen, die im TSX benutzt, aber in
keinem CSS definiert sind, hat vier Stellen mit demselben Muster
gefunden:
* `admin-btn-secondary` und `admin-btn-danger` existierten nicht.
Sämtliche Löschen-Buttons sahen aus wie normale Buttons — keine
Warnwirkung. Als `.admin-btn.admin-btn-danger` geschrieben, weil die
Varianten mit den Größenklassen kombiniert werden, die weiter unten
ihren eigenen Hintergrund setzen.
* `page-progress-fill` fehlte: die Balken im Analytics-Panel waren
leere Rinnen, der Wert unsichtbar. Ebenso `analytics-empty` und
`admin-loading-container`.
* `subpage-drawer-section`, `subpage-drawer-title-group` und
`input-with-icon` im PageBuilder waren wirkungslos und teils mit
Inline-Styles notdürftig kompensiert.
* `grid-card-preview` fehlte, wodurch alle Layout-Vorschauen auf Höhe
null kollabierten. Nur "Showcase" war sichtbar — und das aus Versehen,
weil sein Tile `hero-tile` hieß und damit die `aspect-ratio` einer
fremden PageBuilder-Klasse erbte. Umbenannt.
Dazu die Theme-Vorschauen, die praktisch identisch aussahen: alle
sieben zeigten dieselben drei quadratischen Kacheln, einziger
Unterschied war die Hintergrundfarbe. Sie spiegeln jetzt die echten
Preset-Daten aus lib/config/theme.ts — Schriftcharakter, Eckradius,
Rasterdichte, Passepartout bzw. Schatten.
Die Kopfzeile richtet sich an einer gemeinsamen Steuerhöhe aus. Der
"Site"-Link war höher als die Buttons daneben: `.admin-btn` hatte keine
explizite line-height, und <button> bekommt box-sizing: border-box vom
Browser, <a> nicht. Die Statusanzeige setzte weder Schriftfamilie noch
-größe und fiel auf den Browser-Default zurück — sie war nie Teil des
Designsystems. Jetzt gleiche Höhe und Typografie, Pillenform als
Zustandsanzeige, Trenner zur Aktionsgruppe. Das dauerhafte Pulsieren
des grünen Punkts entfällt; Animation bleibt den Zuständen vorbehalten,
die Aufmerksamkeit brauchen.
Restliche Emojis durch SVG-Icons ersetzt.
* feat(admin): add scroll-to-top toggle and SVG arrow
The back-to-top button was always on and drew its arrow with the ↑ text
character. Add a `scrollToTop` setting (General section in the admin
panel, defaults to on so existing sites are unaffected) and replace the
glyph with a stroked SVG that inherits currentColor across all presets.
Scroll handling is now rAF-throttled, and prefers-reduced-motion turns
off both the hover lift and the smooth scroll.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* security(journal): escape author HTML instead of filtering it
CodeQL flags 26 high-severity alerts on the release PR; the bulk of them
point at sanitizeHtml(), a denylist of three regexes whose output goes
into dangerouslySetInnerHTML. I reproduced the bypasses before changing
anything — all four pass the old filter:
<img src=x onerror=alert(1)> unquoted handler, regex wants quotes
<img src=x onerror='alert(1)'> single quotes, same reason
<svg onload=alert(1)> not a <script> tag
javasjavascript:cript:alert(1) one-pass replace, the rest recombines
Plus an attribute breakout in the link renderer, which interpolated the
URL into href="${url}" unescaped:
[x](" onmouseover=alert(1) x=") -> <a href="" onmouseover=alert(1" ...>
Replaced with escaping. Every `&<>"'` in author text becomes an entity
before any markdown rule runs, so the only tags in the output are the
ones renderInlineMarkdown builds itself and a URL cannot leave its
attribute. Link schemes are now an allowlist (http, https, mailto, tel,
relative, anchor); anything else renders as plain text.
The serializer needed decodeHtmlEntities to match: without it a save
would write `<` into the Markdown file and the next parse would
escape the `&` again, corrupting the text further on every round trip.
A test covers parse -> serialize -> parse stability.
Two existing tests asserted the old behaviour and were rewritten rather
than deleted: one expected the script tag to be *removed* from the
output, the other expected the substring "onerror" to be absent. Both
now assert the property that matters — that no tag can form — because
`onerror` surviving as inert text is fine.
Exploitation required admin access either way: journal and essay text
comes from the studio or from content/*.md. This removes the weakness,
it does not close an open door.
* fix(journal): contain file paths, fix frontmatter escaping, defuse two regexes
Follow-up to the CodeQL findings on release PR #432. I went through all 23
alerts individually; this addresses the ones that are worth addressing and
documents the ones that are not.
Path containment (12 alerts, all false positives). Every path built from a
slug goes through isValidSlug(), a strict `/^[a-zA-Z0-9_-]+$/` allowlist —
verified against `../../etc/passwd`, `foo/../../bar`, `a/b`, `..` and
friends, all rejected. CodeQL cannot see it because the check lives in
another module. Added a containedPath() helper that resolves the path and
refuses anything landing outside the content directory: a second lock on a
door that was already locked, and a barrier the analysis can follow. Also
removed the dead `slug.endsWith('.md')` branches — isValidSlug rejects
dots, so they could never be taken.
Frontmatter escaping (1 alert, a real bug). The serializer escaped `"` but
not `\`, and the parser never unescaped anything. A title containing either
character gained a backslash on every save/load cycle:
Path C:\Users "quoted" -> Path C:\\Users \"quoted\" -> ...
Escaping now covers the backslash first and the parser undoes both. A round
trip test covers quotes, backslashes, colons and apostrophes.
Two of three ReDoS regexes (2 alerts). The heading pattern had `\s+` next to
`(.+)`, which overlap, so the engine tried every split of the whitespace run
before failing; it is `[ \t]+` and `(\S.*)` now. The quote author pattern
wrapped a lazy group around an optional group — the quadratic case — and is
an index split on the first separator now.
The third regex, the bold/italic pass, is deliberately left alone. Rewriting
it with a negated class removes the backtracking but breaks nesting:
`**bold *and italic* here**` renders as `*<em>bold </em>and italic<em> here</em>*`.
The input is Markdown from an authenticated admin, never a visitor, so the
worst case is an author slowing down their own page. The comment in the code
says so.
Not addressed: 5 js/insufficient-password-hash alerts. They ask for a slow
KDF where the code uses SHA-256/HMAC — correct in general, but the admin
password comes from an environment variable and is never stored, so a
stronger KDF protects nothing that is not already in plaintext in the
environment.
399 unit tests pass (18 new), build and tsc clean.
* fix(journal): split the quote author by scanning, not by pattern
Cleaning up after myself. #439 replaced the quote author regex
`/^(.*?)(?:\s+--\s+(.+))?$/` — a lazy group around an optional one, the
quadratic case — with `/\s+--\s+/`, and CodeQL promptly flagged the
replacement for the same reason. One reported pattern traded for another.
splitQuoteAuthor() scans for the first `--` that has whitespace on both
sides. Linear, and it needs no reasoning about the regex engine at all.
Behaviour is identical to the original regex, checked case by case
against it: separator, no separator, several separators, tabs, wide gaps,
`a--b` without spaces, leading and trailing separators, empty string. All
nine are covered by tests, plus one asserting it stays fast on a 50k
whitespace run.
* security(admin): derive the session signing key with scrypt
getSigningKey() ran the admin password through a single SHA-256 digest.
It is key derivation rather than password storage, so it was never a
stored-hash problem — but if the derived key ever leaked, one fast hash
makes recovering the password by brute force cheap. CodeQL flags it as
js/insufficient-password-hash and, for this particular alert, has a
point.
scrypt now. Two details that matter:
The salt has to be stable. A random salt would produce a different key on
every call and invalidate every session; it is derived from AUTH_SECRET,
which is deployment-specific. Verified across separate processes: same
inputs produce a verifying token, so a restart or redeploy does not log
everyone out.
The result is cached for the process lifetime. scrypt is deliberately
slow and getSigningKey() runs on every admin request — deriving per call
would add ~24ms to each one. The cache key is a digest of secret plus
password, so a rotation misses the cache and derives again, and no extra
plaintext copy of the password is kept around.
Measured: first derivation 24ms, subsequent calls 0.12ms. Password
change and secret change both invalidate an existing token, checked in
separate processes.
Note the one-time effect: existing admin sessions are invalidated by the
change in derivation, so everyone logs in once more.
* security(admin): key the signing-key cache on its inputs, not a digest
#441 removed the SHA-256 digest of the admin password from the key
derivation and introduced a new one three lines above it, as the cache
key. Same rule, same file: CodeQL reported it immediately.
The comment justifying it was wrong too. It claimed no second plaintext
copy of the password was retained, while building the digest input
allocates exactly that in order to hash it.
The cache now holds the two input strings and compares them directly.
They are the same objects the env and install caches already hold, so
nothing extra is retained, and no fast hash of the password exists in
memory for the life of the process.
Re-verified after the change, in separate processes: a token from one
process verifies in another with the same inputs, a changed password or
secret rejects it, first derivation 24ms, cached calls 0.001ms.
That leaves scrypt as the only place the password is hashed here. The
two HMACs further down operate on the derived key and on token data, not
on the password; the constant-time comparison in verifyAdminPassword is
the previously dismissed one.
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: lancetm714 <108419425+lancetm714@users.noreply.github.com>
2026-08-14 16:55:07 +02:00
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-preview-bar {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding: 0.5rem 1rem;
|
|
|
|
|
background: rgba(0, 0, 0, 0.4);
|
|
|
|
|
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
|
|
|
|
|
font-size: 0.75rem;
|
|
|
|
|
position: sticky;
|
|
|
|
|
top: 0;
|
|
|
|
|
z-index: 5;
|
|
|
|
|
backdrop-filter: blur(8px);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-preview-frame {
|
|
|
|
|
padding: 2.5rem 2rem;
|
|
|
|
|
max-width: 1080px;
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
width: 100%;
|
|
|
|
|
transition: max-width 0.3s ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* The essay's full-bleed and wide figures are sized against the viewport on the
|
|
|
|
|
* live site. Inside the preview pane that overshoots — the photo would bleed out
|
|
|
|
|
* of the pane and drift as the split is dragged — so they are re-anchored to the
|
|
|
|
|
* frame. 100% is the container's content box, so reaching the pane edges means
|
|
|
|
|
* adding back both horizontal paddings: 4rem for this frame plus 3rem for
|
|
|
|
|
* .essay-container. Keep in sync if either padding changes.
|
|
|
|
|
*/
|
|
|
|
|
.journal-preview-frame .essay-container {
|
|
|
|
|
--essay-bleed: calc(100% + 7rem);
|
|
|
|
|
--essay-wide: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-preview-frame.mobile {
|
|
|
|
|
max-width: 380px;
|
|
|
|
|
border-left: 1px solid rgba(255, 255, 255, 0.1);
|
|
|
|
|
border-right: 1px solid rgba(255, 255, 255, 0.1);
|
|
|
|
|
min-height: 100%;
|
|
|
|
|
background: var(--background, #000);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-raw-markdown-editor {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
min-height: 500px;
|
|
|
|
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
|
|
|
font-size: 0.9rem;
|
|
|
|
|
line-height: 1.6;
|
|
|
|
|
background: rgba(0, 0, 0, 0.3);
|
|
|
|
|
color: #f4f4f5;
|
|
|
|
|
border: 1px solid var(--admin-border, rgba(255, 255, 255, 0.1));
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
padding: 1.25rem;
|
|
|
|
|
resize: none;
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-19 22:24:10 +02:00
|
|
|
.journal-raw-markdown-editor:focus-visible {
|
|
|
|
|
outline: var(--admin-focus-ring);
|
|
|
|
|
outline-offset: 1px;
|
release: v0.11.0 — journal fixes, admin URLs, design system cleanup (#432)
* fix(screenshots): sharp-Typen fuer 0.34 und 0.35 gleichzeitig (#410)
sharp 0.35 ist von `export =` auf ESM umgestellt: der Modul-Namespace
ist nicht mehr aufrufbar, die Factory sitzt unter .default. Der
Type-Check brach damit in scripts/screenshots.ts weg, sobald der
Next-Bump (#402) sharp von 0.34.5 auf 0.35.3 mitzieht -- sharp ist hier
keine deklarierte Dependency, sondern kommt ueber Next mit.
Die Form wird jetzt aus dem installierten Paket abgeleitet statt
festgeschrieben, zur Laufzeit wie im Typ. Geprueft mit beiden
Versionen: tsc laeuft mit 0.34.5 und mit 0.35.3 fehlerfrei durch.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(deps): bump the nextjs group across 1 directory with 2 updates (#402)
Bumps the nextjs group with 2 updates in the / directory: [next](https://github.com/vercel/next.js) and [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next).
Updates `next` from 16.2.12 to 16.3.0
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/compare/v16.2.12...v16.3.0)
Updates `eslint-config-next` from 16.2.12 to 16.3.0
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/commits/v16.3.0/packages/eslint-config-next)
---
updated-dependencies:
- dependency-name: eslint-config-next
dependency-version: 16.3.0
dependency-type: direct:development
update-type: version-update:semver-minor
dependency-group: nextjs
- dependency-name: next
dependency-version: 16.3.0
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: nextjs
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore(deps-dev): bump prettier from 3.8.3 to 3.9.6 (#405)
Bumps [prettier](https://github.com/prettier/prettier) from 3.8.3 to 3.9.6.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.8.3...3.9.6)
---
updated-dependencies:
- dependency-name: prettier
dependency-version: 3.9.6
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* docs(changelog): Unreleased-Sektion fuer die Bumps nach v0.10.0 (#413)
Die Dependency-PRs sind nach dem Release auf dev gelandet, teils auch
auf main. Ohne Eintrag waeren sie beim naechsten Release unsichtbar --
inklusive Next 16.3.0, das CVE-2025-13465 mitbringt.
Ausserdem im 0.10.0-Abschnitt nachgetragen, dass der Trivy-Scan bis
#409 nie gelaufen ist. Der Fix steckt im Tag v0.10.0, fehlte aber in der
Aufzaehlung -- und "Images werden bei jedem Publish gescannt" stand im
Changelog, waehrend der Job im Action-Setup abbrach.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(gallery): per-album sort order, independent of Immich (#408) (#414)
Album order was dictated entirely by Immich: getAlbum() sorted by the
album's own asc/desc flag, so a Folio album always mirrored the archive.
A curated series has a narrative order that has nothing to do with
capture time, and changing the Immich album's sort to fit the website
changes it for the archive too.
Adds an optional per-album `sort` in gallery.yaml, editable in /admin,
defaulting to today's behaviour so every existing config is unchanged:
immich (default) | newest | oldest | filename | manual
`manual` is a pinned *prefix*: `assetOrder` lists only the photos placed
by hand, everything else follows in the album's Immich order. A full
permutation of a 2,000-photo album would be ~80 KB of UUIDs in a file
that is rewritten and copied to content/.backups/ on every admin save.
It also makes drift fall out for free — photos removed in Immich never
match, new ones land in the tail rather than being hidden.
Sorting is applied after the cache read, not before the cache write, so
the LRU keeps one canonical Immich-ordered copy per album. That avoids
putting the mode in the cache key, lets a config change take effect
without depending on invalidation, and keeps the stale-serving path
correct. cache.get() returns the stored object by reference, so
withSort() returns a shallow clone with a new array — sorting in place
would reorder the shared entry, and under request coalescing every
concurrent caller would be sorting the same array.
Also fixes a prerequisite bug: /api/admin/albums/[albumId]/assets read
album.assets from GET /albums/:id, which Immich 3.x no longer populates
(lib/immich.ts:507). The hero picker's "This Album" tab returned nothing
and threw outright when the key was absent. It now goes through the
client's paginated metadata search, with ?types=all to opt videos in for
the reorder editor.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): drop decorative emoji from the sort select labels (#415)
An <option> cannot contain markup, so the SVG set in Icons is not
reachable there — but a decorative emoji is not a substitute for it.
Plain text instead; the album card badge already uses a real icon.
The remaining emoji in the admin panel (asset picker tabs, section
headings, layout picker options) predate this branch and are left for a
separate cleanup.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): replace emoji icons with the shared SVG icon set (#416)
The admin panel mixed two icon conventions: inline SVGs from
`Icons.tsx` in most components, and decorative emoji in the asset
picker and a few PageBuilder labels. Emoji render inconsistently
across platforms, ignore the accent colour, and cannot inherit the
`.svg-icon` sizing rules.
- Icons.tsx: add `IconStar` (filled — it marks a state, not an
action) and `IconImage`.
- AssetPicker: the three tab labels and the favourite tile badge now
use IconFolder / IconStar / IconImage.
- PageBuilder: the "Standalone Albums" and "Subpages" headings use
the icon set instead of an emoji.
- PageBuilder: the layout picker drops its emoji for plain text. An
<option> cannot contain markup, so an SVG is impossible there and a
decorative glyph is not a substitute.
- admin.css: align icon and label in the picker tabs, and swap the
favourite badge's text-shadow for drop-shadow, which is what
applies to an inline SVG.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): fold PageBuilder's local icons into the shared Icons module (#418)
* refactor(admin): fold PageBuilder's local icons into the shared module
PageBuilder.tsx carried its own `Icons` object duplicating most of the
glyphs already exported by Icons.tsx, with hardcoded sizes and slightly
divergent paths. Migrate all 32 call sites to the shared module and
delete the local object.
Five glyphs had no counterpart and are added to Icons.tsx as 1:1 ports
of the local paths: IconX, IconPlus, IconHome, IconCopy, IconImage.
The local ExternalLink and Check are dropped rather than ported — both
had zero call sites.
Two glyphs change shape slightly, which is the point of consolidating:
the shared IconCamera includes the viewfinder bump the local copy
omitted, and drag handles now use IconGripVertical.
IconGripVertical uses the module's square 24x24 viewBox, so `.svg-drag`
goes from 12x18 to 18x18 — the old non-square box would letterbox the
glyph down to 12x12 and shrink the handle.
* fix(admin): resolve icon-module integration after #416
Merging dev brought in #416, which added a second IconImage to Icons.tsx
and two <Icons.Camera>/<Icons.Folder> section headers that reference the
local Icons object this PR removes. Git merged both cleanly but the result
did not type-check.
- drop the duplicate IconImage (both copies were byte-identical)
- point the two section headers at the imported IconCamera/IconFolder
- refresh the SORT_LABELS comment: the icon set is imported now, not
declared below
---------
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* fix(config): allow an empty gallery, guard against a double /api suffix (#421)
An empty gallery is now a valid, rendered state instead of a throw: deriveGallery() no longer requires at least one album or subpage, so a deployment with no albums yet renders a bare homepage the owner can fill in via /admin.
getConfig() also stops appending /api to an Immich URL that already ends in it, which previously produced .../api/api and broke every upstream request.
Includes a restore of the per-album sort test cases, which the branch had lost by being cut before #408/#414.
* feat(admin): favicon upload, served from the content volume (#422)
Adds a bundled default favicon, an upload widget in admin Settings > General, and a route that serves the icon from the writable content/ volume with a fallback to the bundled default. Raster uploads (PNG/ICO/JPEG) are wrapped in an SVG container; the response carries its own CSP so an uploaded SVG cannot execute script on the origin.
The GET route revalidates with an ETag instead of caching immutably, so a newly uploaded icon shows up immediately. Uploads are written via temp file + rename, and a Reset button restores the bundled default.
* ci: flag unformatted files in a PR, without blocking it (#424)
Prettier is configured as an error rule in eslint.config.mjs but has never run in CI, so part of the tree predates it. A final CI step now diffs against the PR base, runs prettier --list-different over the changed files, and emits a warning annotation per offender plus a job summary.
Advisory by design: it never fails the job. Blocking would turn a PR red for merely touching a file that was already unformatted, and normalising the tree in one commit would wreck git blame and conflict with the PRs in flight.
Requires fetch-depth: 0, since diffing against the base needs its history.
* feat(install): first-run wizard gated by a one-time setup token (#419)
Adds /install, a four-step first-run wizard: connect to Immich, optionally pick albums, name the site, finish. It verifies the credentials against the Immich server before writing anything, then writes gallery.yaml, settings.yaml and a content/install.json carrying the Immich credentials and a generated site secret.
install.json exists because a running process cannot pick up new env vars — the wizard has to write configuration that takes effect without a restart. getInstallCredentials() merges it under the real environment, so env vars always win and rotation stays a matter of setting one.
Both the page and the API routes are gated by a one-time setup token printed to the server log, so a deployment that is reachable before gallery.yaml exists cannot be configured by whoever finds it first. The token is stored in content/.setup-token (0600) rather than a module variable: Next.js bundles the page and each route handler separately, so a module-level token left the page and the API disagreeing inside one process and the wizard stuck on step 1. It is removed once the install completes.
The admin password is stored as an scrypt hash using the scheme lib/auth.ts already applies to album passwords; a plaintext ADMIN_PASSWORD env var keeps working.
* docs: document the setup wizard, fix the read-only content mount (#425)
Quick Start now leads with the /install wizard, with the hand-written YAML route kept alongside it, and a First-Run Setup section covers the setup token, the files the wizard writes, and env-var precedence.
Two corrections: both Docker examples mounted content/ as :ro, which silently breaks the wizard, the admin panel and the backup rotation alike — docs/admin-panel.md already said so and the README contradicted it. And nothing documented that content/install.json holds the Immich API key, so a backup of content/ is a backup of credentials.
Also adds a Contributors section crediting the people whose work is in the project.
* feat(admin): floating save bar pinned to the bottom of the viewport (#426)
The save bar was the first, static element inside .admin-main. Since the
document itself scrolls, it left the viewport as soon as you scrolled down
— editing a subpage section or a settings block far below gave no visible
dirty hint and no reachable save button.
Replace it with a bottom-pinned floating bar shared by both editors. It
only mounts while there is something to act on (unsaved changes, an
in-flight save, or a result message), so it never covers content while
idle. The success message clears after 5s, which hides the bar again.
- new SaveBar component, replacing the duplicated markup in PageBuilder
and SettingsEditor
- adopt the previously unused .floating-save-bar CSS: slide-in keyframes
(carrying translateX(-50%)), dirty border, wrap/gap, mobile variant and
a prefers-reduced-motion opt-out; z-index 900 keeps it below modals
- .admin-main gains bottom padding so the bar never covers page content
- drop the now-unreachable idle hints: the ⌘S hint becomes a button title,
the Live Sync note becomes a static line above the settings layout
- header "Site" link now bypasses the cache (/?fresh=1), so the preview
stays reachable when the bar is hidden
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(admin): themed listbox for the album sort control (#427)
The per-album "Photo order" control was a native <select>. Because an
<option> cannot contain markup, its choices could not use the admin
panel's currentColor SVG set — the reason #415 had to fall back to plain
text after dropping the emoji labels.
Adds a Listbox component implementing the ARIA combobox/listbox pattern,
so options can render a glyph beside their label:
- DOM focus stays on the trigger button; the active option is announced
through aria-activedescendant, keeping focus management to one element
- Keyboard: arrows (clamped at the ends, like a native select),
Home/End, Enter/Space to commit, Escape to cancel, Tab commits and
moves on, and prefix type-ahead with a repeat-key cycle
- Outside dismissal on pointerdown, so a press starting outside closes
the popup before the click retargets
The sort options now carry an icon each: calendar, arrow-down, arrow-up,
an A→Z marker, and the drag glyph for manual — matching the badge the
album card already shows. SORT_LABELS stays plain text because the badge
feeds it to a title attribute.
Closes #417
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(git): ignore generated design handoff folders
* fix(admin): stop the album sort dropdown clipping, and simplify the panel (#428)
* fix(admin): render listbox popup in a portal so it escapes modal clipping
The sort control's popup was position:absolute inside three clipping ancestors
(.album-drawer overflow:hidden > .album-drawer-body overflow-y:auto >
.modal-right-column overflow-y:auto), so it was cut off at the bottom of the
Edit Album Details modal. z-index could not help: clipping happens before
stacking. It also always hung below the trigger, with no flip.
Portal the popup to document.body and position it from the trigger's viewport
rect, flipping above when there is more room there and capping max-height to the
space available so it scrolls internally rather than overflowing. It is
dismissed on scroll and resize, since the anchor is only measured on open.
The outside-pointerdown handler now also treats the popup as inside; without
that the portalled list counts as outside, and a click on an option would close
it before the selection commits.
* refactor(admin): single-column album details panel
The left column spent 1.2fr on a cover thumbnail and three stat rows, two of
which (Status, Custom Hero) only restated the form fields opposite them, while
the form itself was squeezed into 1.8fr behind a second nested scroller.
Stack the drawer in one column instead: cover as a banner, then the form at full
width, with the UUID moved into the footer. The body is now the only scroll
container, which also removes one of the ancestors that was clipping the sort
popup.
---------
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* fix(admin): give the portalled listbox its theme back, lock the page behind modals (#429)
Two defects in the album editor.
The sort listbox popup painted transparent. Every --admin-* variable is
scoped to .admin-layout, and since the popup moved into document.body it
sits outside that subtree, so background/border/text all resolved to
nothing. It now carries its own copy of the palette in both colour
schemes, plus the font it no longer inherits.
Scrolling inside a modal also moved the page behind it. No admin modal
ever locked body scroll: the overlay covers the page but does not absorb
wheel events, so a scroll starting on the backdrop — or continuing past
the end of the modal's own scroller — reaches the document.
overscroll-behavior cannot cover that case on its own, because it only
applies to scroll containers and the backdrop is not one.
useScrollLock freezes body while a modal is open and compensates for the
width the scrollbar gives up, so nothing shifts underneath. Each lock
restores the inline value it found, which makes nesting work without a
counter — a picker opened from the drawer restores the drawer's hidden
state instead of clearing it. Applied to both drawers and all four
picker modals, which share the defect. overscroll-behavior: contain on
the scrollers stops the chaining they can handle themselves.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* fix(security): allow unsafe-eval in CSP script-src during dev mode
* feat(journal): add Journal Studio with split-screen editor, live preview and dedicated routes
* fix(build): separate client parser from server journal-service and fix build type errors
* fix(journal): Fotos rendern, Layout und Lightbox-Steuerung korrigieren
Fünf unabhängige Fehler in der öffentlichen Journal- und Essay-Ansicht:
* Foto-Blöcke wurden nie angezeigt. EssayView löst ein Foto über
PhotoItem.id auf, und das sind verschlüsselte Tokens — die Blöcke aus
dem Markdown tragen aber rohe Asset-UUIDs. Jede Zuordnung lief ins
Leere, und nicht auflösbare Blöcke werden still verworfen. Die IDs
werden jetzt serverseitig übersetzt; damit verschwinden nebenbei die
rohen UUIDs aus dem Client-Payload, die dort laut Projektregel nie
auftauchen dürfen. Nicht auflösbare Referenzen werden geloggt.
* Überschriften standen weiter links als der Fließtext. Jeder Block
hatte einzeln `max-width: 68ch`, und `ch` ist relativ zur Schrift des
Elements — die Serif-Überschrift ergab eine breitere Spalte. Ersetzt
durch eine gemeinsame, font-unabhängige `--essay-measure`.
* Fullbleed-Fotos bluteten nur nach links aus: `.essay-figure` ist
`width: 100%`, wodurch die Box überbestimmt ist und der negative
rechte Margin verworfen wird.
* Foto-Paare stellten beide Bilder gleich breit dar, wodurch ein
Hochformat neben einem Querformat doppelt so hoch wurde. Jetzt eine
Justified-Reihe: Breite proportional zum Seitenverhältnis, dadurch
exakt gleiche Höhen ohne Beschnitt.
* Die Lightbox hatte im Journal keine Tastatursteuerung und keine
Scroll-Sperre — beides lag in PhotoGrid, also nur im Album-Raster.
Verlagert in die Lightbox selbst, der doppelte Handler in PhotoGrid
entfernt (sonst wäre pro Pfeildruck zwei Bilder weitergesprungen).
Zusätzlich sind Proofing-Herzen und das EXIF-Panel im redaktionellen
Modus abschaltbar und im Journal aus: Client-Proofing ist ein
Übergabe-Workflow für Alben, keine Funktion einer Reportage. Auf der
Übersicht wurde der Untertitel doppelt gerendert, weil extractExcerpt()
auf ihn zurückfällt.
* feat(admin): eigene URLs für alle Bereiche und überarbeiteter Journal Studio
Das Panel war eine einzige Client-Komponente, die ihre Tabs über
useState umschaltet: keine Route pro Bereich, kein Deep-Link, kein
Zurück-Button, und nach jedem Reload landete man wieder auf "Pages".
Auch der Journal-Editor hatte keine eigene URL.
Jetzt sieben echte Routen (/admin, /admin/pages, /admin/journal,
/admin/journal/<slug>, /admin/settings, /admin/settings/<section>,
/admin/analytics). Die Shell mit Auth-Prüfung und Kopfzeile sitzt im
Layout und umschließt children — so bleibt die Session-Prüfung über
Routenwechsel montiert, statt bei jedem Tab-Wechsel neu zu laufen und
den Spinner aufblitzen zu lassen. Unbekannte Settings-Sections fallen
auf General zurück.
Im selben Zug der Journal Studio, der die Routing-Änderung ohnehin
berührt:
* Alle Eingabefelder nutzten die Klasse `admin-input`, die in keinem
CSS definiert war — sie fielen auf Browser-Defaults zurück. Jetzt
gestylt, gescoped, damit der generische Name nicht ins übrige Panel
leckt.
* Der Split View ist per Divider verschiebbar (Maus, Tastatur,
Doppelklick zum Zurücksetzen), Breite in localStorage.
* Das Studio bricht aus der 1120px-Spalte aus, die Preview hat Platz.
* Die Preview zeigte für jedes Foto fest 3:2 und log damit über das
Layout der veröffentlichten Seite; die echten Verhältnisse werden
jetzt an den Thumbnails gemessen.
* Blöcke mit alten positionsbasierten Foto-Referenzen werden markiert —
die lassen sich auf einer eigenständigen Journal-Seite nicht auflösen
und verschwanden bisher stillschweigend.
* Blocktyp-Chips als gemeinsame Komponente, monochrom und per Icon
unterschieden statt in einer eigenen Blau/Lila/Orange-Palette, die
sonst nirgends im Panel vorkommt.
* Emojis raus, SVG-Icons rein.
* fix(admin): Designsystem-Lücken im Panel schließen
Eine systematische Suche nach Klassen, die im TSX benutzt, aber in
keinem CSS definiert sind, hat vier Stellen mit demselben Muster
gefunden:
* `admin-btn-secondary` und `admin-btn-danger` existierten nicht.
Sämtliche Löschen-Buttons sahen aus wie normale Buttons — keine
Warnwirkung. Als `.admin-btn.admin-btn-danger` geschrieben, weil die
Varianten mit den Größenklassen kombiniert werden, die weiter unten
ihren eigenen Hintergrund setzen.
* `page-progress-fill` fehlte: die Balken im Analytics-Panel waren
leere Rinnen, der Wert unsichtbar. Ebenso `analytics-empty` und
`admin-loading-container`.
* `subpage-drawer-section`, `subpage-drawer-title-group` und
`input-with-icon` im PageBuilder waren wirkungslos und teils mit
Inline-Styles notdürftig kompensiert.
* `grid-card-preview` fehlte, wodurch alle Layout-Vorschauen auf Höhe
null kollabierten. Nur "Showcase" war sichtbar — und das aus Versehen,
weil sein Tile `hero-tile` hieß und damit die `aspect-ratio` einer
fremden PageBuilder-Klasse erbte. Umbenannt.
Dazu die Theme-Vorschauen, die praktisch identisch aussahen: alle
sieben zeigten dieselben drei quadratischen Kacheln, einziger
Unterschied war die Hintergrundfarbe. Sie spiegeln jetzt die echten
Preset-Daten aus lib/config/theme.ts — Schriftcharakter, Eckradius,
Rasterdichte, Passepartout bzw. Schatten.
Die Kopfzeile richtet sich an einer gemeinsamen Steuerhöhe aus. Der
"Site"-Link war höher als die Buttons daneben: `.admin-btn` hatte keine
explizite line-height, und <button> bekommt box-sizing: border-box vom
Browser, <a> nicht. Die Statusanzeige setzte weder Schriftfamilie noch
-größe und fiel auf den Browser-Default zurück — sie war nie Teil des
Designsystems. Jetzt gleiche Höhe und Typografie, Pillenform als
Zustandsanzeige, Trenner zur Aktionsgruppe. Das dauerhafte Pulsieren
des grünen Punkts entfällt; Animation bleibt den Zuständen vorbehalten,
die Aufmerksamkeit brauchen.
Restliche Emojis durch SVG-Icons ersetzt.
* feat(admin): add scroll-to-top toggle and SVG arrow
The back-to-top button was always on and drew its arrow with the ↑ text
character. Add a `scrollToTop` setting (General section in the admin
panel, defaults to on so existing sites are unaffected) and replace the
glyph with a stroked SVG that inherits currentColor across all presets.
Scroll handling is now rAF-throttled, and prefers-reduced-motion turns
off both the hover lift and the smooth scroll.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* security(journal): escape author HTML instead of filtering it
CodeQL flags 26 high-severity alerts on the release PR; the bulk of them
point at sanitizeHtml(), a denylist of three regexes whose output goes
into dangerouslySetInnerHTML. I reproduced the bypasses before changing
anything — all four pass the old filter:
<img src=x onerror=alert(1)> unquoted handler, regex wants quotes
<img src=x onerror='alert(1)'> single quotes, same reason
<svg onload=alert(1)> not a <script> tag
javasjavascript:cript:alert(1) one-pass replace, the rest recombines
Plus an attribute breakout in the link renderer, which interpolated the
URL into href="${url}" unescaped:
[x](" onmouseover=alert(1) x=") -> <a href="" onmouseover=alert(1" ...>
Replaced with escaping. Every `&<>"'` in author text becomes an entity
before any markdown rule runs, so the only tags in the output are the
ones renderInlineMarkdown builds itself and a URL cannot leave its
attribute. Link schemes are now an allowlist (http, https, mailto, tel,
relative, anchor); anything else renders as plain text.
The serializer needed decodeHtmlEntities to match: without it a save
would write `<` into the Markdown file and the next parse would
escape the `&` again, corrupting the text further on every round trip.
A test covers parse -> serialize -> parse stability.
Two existing tests asserted the old behaviour and were rewritten rather
than deleted: one expected the script tag to be *removed* from the
output, the other expected the substring "onerror" to be absent. Both
now assert the property that matters — that no tag can form — because
`onerror` surviving as inert text is fine.
Exploitation required admin access either way: journal and essay text
comes from the studio or from content/*.md. This removes the weakness,
it does not close an open door.
* fix(journal): contain file paths, fix frontmatter escaping, defuse two regexes
Follow-up to the CodeQL findings on release PR #432. I went through all 23
alerts individually; this addresses the ones that are worth addressing and
documents the ones that are not.
Path containment (12 alerts, all false positives). Every path built from a
slug goes through isValidSlug(), a strict `/^[a-zA-Z0-9_-]+$/` allowlist —
verified against `../../etc/passwd`, `foo/../../bar`, `a/b`, `..` and
friends, all rejected. CodeQL cannot see it because the check lives in
another module. Added a containedPath() helper that resolves the path and
refuses anything landing outside the content directory: a second lock on a
door that was already locked, and a barrier the analysis can follow. Also
removed the dead `slug.endsWith('.md')` branches — isValidSlug rejects
dots, so they could never be taken.
Frontmatter escaping (1 alert, a real bug). The serializer escaped `"` but
not `\`, and the parser never unescaped anything. A title containing either
character gained a backslash on every save/load cycle:
Path C:\Users "quoted" -> Path C:\\Users \"quoted\" -> ...
Escaping now covers the backslash first and the parser undoes both. A round
trip test covers quotes, backslashes, colons and apostrophes.
Two of three ReDoS regexes (2 alerts). The heading pattern had `\s+` next to
`(.+)`, which overlap, so the engine tried every split of the whitespace run
before failing; it is `[ \t]+` and `(\S.*)` now. The quote author pattern
wrapped a lazy group around an optional group — the quadratic case — and is
an index split on the first separator now.
The third regex, the bold/italic pass, is deliberately left alone. Rewriting
it with a negated class removes the backtracking but breaks nesting:
`**bold *and italic* here**` renders as `*<em>bold </em>and italic<em> here</em>*`.
The input is Markdown from an authenticated admin, never a visitor, so the
worst case is an author slowing down their own page. The comment in the code
says so.
Not addressed: 5 js/insufficient-password-hash alerts. They ask for a slow
KDF where the code uses SHA-256/HMAC — correct in general, but the admin
password comes from an environment variable and is never stored, so a
stronger KDF protects nothing that is not already in plaintext in the
environment.
399 unit tests pass (18 new), build and tsc clean.
* fix(journal): split the quote author by scanning, not by pattern
Cleaning up after myself. #439 replaced the quote author regex
`/^(.*?)(?:\s+--\s+(.+))?$/` — a lazy group around an optional one, the
quadratic case — with `/\s+--\s+/`, and CodeQL promptly flagged the
replacement for the same reason. One reported pattern traded for another.
splitQuoteAuthor() scans for the first `--` that has whitespace on both
sides. Linear, and it needs no reasoning about the regex engine at all.
Behaviour is identical to the original regex, checked case by case
against it: separator, no separator, several separators, tabs, wide gaps,
`a--b` without spaces, leading and trailing separators, empty string. All
nine are covered by tests, plus one asserting it stays fast on a 50k
whitespace run.
* security(admin): derive the session signing key with scrypt
getSigningKey() ran the admin password through a single SHA-256 digest.
It is key derivation rather than password storage, so it was never a
stored-hash problem — but if the derived key ever leaked, one fast hash
makes recovering the password by brute force cheap. CodeQL flags it as
js/insufficient-password-hash and, for this particular alert, has a
point.
scrypt now. Two details that matter:
The salt has to be stable. A random salt would produce a different key on
every call and invalidate every session; it is derived from AUTH_SECRET,
which is deployment-specific. Verified across separate processes: same
inputs produce a verifying token, so a restart or redeploy does not log
everyone out.
The result is cached for the process lifetime. scrypt is deliberately
slow and getSigningKey() runs on every admin request — deriving per call
would add ~24ms to each one. The cache key is a digest of secret plus
password, so a rotation misses the cache and derives again, and no extra
plaintext copy of the password is kept around.
Measured: first derivation 24ms, subsequent calls 0.12ms. Password
change and secret change both invalidate an existing token, checked in
separate processes.
Note the one-time effect: existing admin sessions are invalidated by the
change in derivation, so everyone logs in once more.
* security(admin): key the signing-key cache on its inputs, not a digest
#441 removed the SHA-256 digest of the admin password from the key
derivation and introduced a new one three lines above it, as the cache
key. Same rule, same file: CodeQL reported it immediately.
The comment justifying it was wrong too. It claimed no second plaintext
copy of the password was retained, while building the digest input
allocates exactly that in order to hash it.
The cache now holds the two input strings and compares them directly.
They are the same objects the env and install caches already hold, so
nothing extra is retained, and no fast hash of the password exists in
memory for the life of the process.
Re-verified after the change, in separate processes: a token from one
process verifies in another with the same inputs, a changed password or
secret rejects it, first derivation 24ms, cached calls 0.001ms.
That leaves scrypt as the only place the password is hashed here. The
two HMACs further down operate on the derived key and on token data, not
on the password; the constant-time comparison in verifyAdminPassword is
the previously dismissed one.
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: lancetm714 <108419425+lancetm714@users.noreply.github.com>
2026-08-14 16:55:07 +02:00
|
|
|
border-color: var(--admin-accent, #6366f1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Modal styling for Entry creation / Metadata */
|
|
|
|
|
.journal-modal-overlay {
|
|
|
|
|
position: fixed;
|
|
|
|
|
inset: 0;
|
|
|
|
|
background: rgba(0, 0, 0, 0.75);
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
z-index: 100;
|
|
|
|
|
backdrop-filter: blur(4px);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-modal-card {
|
|
|
|
|
background: var(--admin-surface, #18181b);
|
|
|
|
|
border: 1px solid var(--admin-border, rgba(255, 255, 255, 0.1));
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
width: 90%;
|
|
|
|
|
max-width: 620px;
|
|
|
|
|
max-height: 88vh;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
padding: 1.75rem;
|
|
|
|
|
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-23 12:09:08 +02:00
|
|
|
/* ── Template picker (Create modal) ──────────────────────────────── */
|
|
|
|
|
|
|
|
|
|
.journal-template-grid {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(2, 1fr);
|
|
|
|
|
gap: 0.5rem;
|
|
|
|
|
max-height: 260px;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
padding: 2px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-template-card {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 2px;
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
text-align: left;
|
|
|
|
|
padding: 0.55rem 0.7rem;
|
|
|
|
|
background: var(--admin-bg-input, #161616);
|
|
|
|
|
/* <button> does not inherit color or font from its parent — without these
|
|
|
|
|
the cards render in the UA default, black on the dark admin surface. */
|
|
|
|
|
color: var(--admin-text, #f0f0f0);
|
|
|
|
|
font: inherit;
|
|
|
|
|
border: 2px solid transparent;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: border-color 0.15s ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-template-card:hover {
|
|
|
|
|
border-color: var(--admin-border-hover, #444);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-template-card.is-selected {
|
|
|
|
|
border-color: var(--admin-accent, #6366f1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-template-card-name {
|
|
|
|
|
font-size: 0.85rem;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-template-card-desc {
|
|
|
|
|
font-size: 0.75rem;
|
|
|
|
|
opacity: 0.65;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ── Photo grid block (editor tiles) ─────────────────────────────── */
|
|
|
|
|
|
|
|
|
|
.journal-grid-tiles {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
|
|
|
|
|
gap: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-grid-tile {
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-grid-tile-pick {
|
|
|
|
|
height: 80px;
|
|
|
|
|
background: rgba(0, 0, 0, 0.3);
|
|
|
|
|
border: 1px dashed rgba(255, 255, 255, 0.15);
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
font-size: 0.8rem;
|
|
|
|
|
opacity: 0.85;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-grid-tile-pick img {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
object-fit: cover;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-grid-tile-remove {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 4px;
|
|
|
|
|
right: 4px;
|
|
|
|
|
padding: 2px 5px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ── Facts block (editor rows) ───────────────────────────────────── */
|
|
|
|
|
|
|
|
|
|
.journal-facts-row {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: 1fr 2fr auto;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ── Album block (editor) ────────────────────────────────────────── */
|
|
|
|
|
|
|
|
|
|
.journal-album-row {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
align-items: center;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-album-field {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 2px;
|
|
|
|
|
font-size: 0.7rem;
|
|
|
|
|
opacity: 0.85;
|
|
|
|
|
flex: 1 1 120px;
|
|
|
|
|
min-width: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-album-field .admin-input {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ── Map block (editor pin rows) ─────────────────────────────────── */
|
|
|
|
|
|
|
|
|
|
.journal-map-row {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 6px;
|
|
|
|
|
align-items: center;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-map-row .admin-input {
|
|
|
|
|
flex: 1 1 140px;
|
|
|
|
|
width: auto;
|
|
|
|
|
min-width: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-map-row .journal-map-coord {
|
|
|
|
|
flex: 0 1 110px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-map-index {
|
|
|
|
|
width: 1.4rem;
|
|
|
|
|
font-size: 0.7rem;
|
|
|
|
|
opacity: 0.6;
|
|
|
|
|
text-align: right;
|
|
|
|
|
flex: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-map-photo {
|
|
|
|
|
width: 96px;
|
|
|
|
|
height: 64px;
|
|
|
|
|
flex: none;
|
|
|
|
|
background: rgba(0, 0, 0, 0.3);
|
|
|
|
|
border: 1px dashed rgba(255, 255, 255, 0.15);
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
font-size: 0.75rem;
|
|
|
|
|
opacity: 0.85;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-map-photo img {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
object-fit: cover;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-map-all {
|
|
|
|
|
flex: 1;
|
|
|
|
|
font-size: 0.8rem;
|
|
|
|
|
opacity: 0.8;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-map-line-toggle {
|
|
|
|
|
margin-left: auto;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 6px;
|
|
|
|
|
font-size: 0.8rem;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
release: v0.11.0 — journal fixes, admin URLs, design system cleanup (#432)
* fix(screenshots): sharp-Typen fuer 0.34 und 0.35 gleichzeitig (#410)
sharp 0.35 ist von `export =` auf ESM umgestellt: der Modul-Namespace
ist nicht mehr aufrufbar, die Factory sitzt unter .default. Der
Type-Check brach damit in scripts/screenshots.ts weg, sobald der
Next-Bump (#402) sharp von 0.34.5 auf 0.35.3 mitzieht -- sharp ist hier
keine deklarierte Dependency, sondern kommt ueber Next mit.
Die Form wird jetzt aus dem installierten Paket abgeleitet statt
festgeschrieben, zur Laufzeit wie im Typ. Geprueft mit beiden
Versionen: tsc laeuft mit 0.34.5 und mit 0.35.3 fehlerfrei durch.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(deps): bump the nextjs group across 1 directory with 2 updates (#402)
Bumps the nextjs group with 2 updates in the / directory: [next](https://github.com/vercel/next.js) and [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next).
Updates `next` from 16.2.12 to 16.3.0
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/compare/v16.2.12...v16.3.0)
Updates `eslint-config-next` from 16.2.12 to 16.3.0
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/commits/v16.3.0/packages/eslint-config-next)
---
updated-dependencies:
- dependency-name: eslint-config-next
dependency-version: 16.3.0
dependency-type: direct:development
update-type: version-update:semver-minor
dependency-group: nextjs
- dependency-name: next
dependency-version: 16.3.0
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: nextjs
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore(deps-dev): bump prettier from 3.8.3 to 3.9.6 (#405)
Bumps [prettier](https://github.com/prettier/prettier) from 3.8.3 to 3.9.6.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.8.3...3.9.6)
---
updated-dependencies:
- dependency-name: prettier
dependency-version: 3.9.6
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* docs(changelog): Unreleased-Sektion fuer die Bumps nach v0.10.0 (#413)
Die Dependency-PRs sind nach dem Release auf dev gelandet, teils auch
auf main. Ohne Eintrag waeren sie beim naechsten Release unsichtbar --
inklusive Next 16.3.0, das CVE-2025-13465 mitbringt.
Ausserdem im 0.10.0-Abschnitt nachgetragen, dass der Trivy-Scan bis
#409 nie gelaufen ist. Der Fix steckt im Tag v0.10.0, fehlte aber in der
Aufzaehlung -- und "Images werden bei jedem Publish gescannt" stand im
Changelog, waehrend der Job im Action-Setup abbrach.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(gallery): per-album sort order, independent of Immich (#408) (#414)
Album order was dictated entirely by Immich: getAlbum() sorted by the
album's own asc/desc flag, so a Folio album always mirrored the archive.
A curated series has a narrative order that has nothing to do with
capture time, and changing the Immich album's sort to fit the website
changes it for the archive too.
Adds an optional per-album `sort` in gallery.yaml, editable in /admin,
defaulting to today's behaviour so every existing config is unchanged:
immich (default) | newest | oldest | filename | manual
`manual` is a pinned *prefix*: `assetOrder` lists only the photos placed
by hand, everything else follows in the album's Immich order. A full
permutation of a 2,000-photo album would be ~80 KB of UUIDs in a file
that is rewritten and copied to content/.backups/ on every admin save.
It also makes drift fall out for free — photos removed in Immich never
match, new ones land in the tail rather than being hidden.
Sorting is applied after the cache read, not before the cache write, so
the LRU keeps one canonical Immich-ordered copy per album. That avoids
putting the mode in the cache key, lets a config change take effect
without depending on invalidation, and keeps the stale-serving path
correct. cache.get() returns the stored object by reference, so
withSort() returns a shallow clone with a new array — sorting in place
would reorder the shared entry, and under request coalescing every
concurrent caller would be sorting the same array.
Also fixes a prerequisite bug: /api/admin/albums/[albumId]/assets read
album.assets from GET /albums/:id, which Immich 3.x no longer populates
(lib/immich.ts:507). The hero picker's "This Album" tab returned nothing
and threw outright when the key was absent. It now goes through the
client's paginated metadata search, with ?types=all to opt videos in for
the reorder editor.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): drop decorative emoji from the sort select labels (#415)
An <option> cannot contain markup, so the SVG set in Icons is not
reachable there — but a decorative emoji is not a substitute for it.
Plain text instead; the album card badge already uses a real icon.
The remaining emoji in the admin panel (asset picker tabs, section
headings, layout picker options) predate this branch and are left for a
separate cleanup.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): replace emoji icons with the shared SVG icon set (#416)
The admin panel mixed two icon conventions: inline SVGs from
`Icons.tsx` in most components, and decorative emoji in the asset
picker and a few PageBuilder labels. Emoji render inconsistently
across platforms, ignore the accent colour, and cannot inherit the
`.svg-icon` sizing rules.
- Icons.tsx: add `IconStar` (filled — it marks a state, not an
action) and `IconImage`.
- AssetPicker: the three tab labels and the favourite tile badge now
use IconFolder / IconStar / IconImage.
- PageBuilder: the "Standalone Albums" and "Subpages" headings use
the icon set instead of an emoji.
- PageBuilder: the layout picker drops its emoji for plain text. An
<option> cannot contain markup, so an SVG is impossible there and a
decorative glyph is not a substitute.
- admin.css: align icon and label in the picker tabs, and swap the
favourite badge's text-shadow for drop-shadow, which is what
applies to an inline SVG.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* refactor(admin): fold PageBuilder's local icons into the shared Icons module (#418)
* refactor(admin): fold PageBuilder's local icons into the shared module
PageBuilder.tsx carried its own `Icons` object duplicating most of the
glyphs already exported by Icons.tsx, with hardcoded sizes and slightly
divergent paths. Migrate all 32 call sites to the shared module and
delete the local object.
Five glyphs had no counterpart and are added to Icons.tsx as 1:1 ports
of the local paths: IconX, IconPlus, IconHome, IconCopy, IconImage.
The local ExternalLink and Check are dropped rather than ported — both
had zero call sites.
Two glyphs change shape slightly, which is the point of consolidating:
the shared IconCamera includes the viewfinder bump the local copy
omitted, and drag handles now use IconGripVertical.
IconGripVertical uses the module's square 24x24 viewBox, so `.svg-drag`
goes from 12x18 to 18x18 — the old non-square box would letterbox the
glyph down to 12x12 and shrink the handle.
* fix(admin): resolve icon-module integration after #416
Merging dev brought in #416, which added a second IconImage to Icons.tsx
and two <Icons.Camera>/<Icons.Folder> section headers that reference the
local Icons object this PR removes. Git merged both cleanly but the result
did not type-check.
- drop the duplicate IconImage (both copies were byte-identical)
- point the two section headers at the imported IconCamera/IconFolder
- refresh the SORT_LABELS comment: the icon set is imported now, not
declared below
---------
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* fix(config): allow an empty gallery, guard against a double /api suffix (#421)
An empty gallery is now a valid, rendered state instead of a throw: deriveGallery() no longer requires at least one album or subpage, so a deployment with no albums yet renders a bare homepage the owner can fill in via /admin.
getConfig() also stops appending /api to an Immich URL that already ends in it, which previously produced .../api/api and broke every upstream request.
Includes a restore of the per-album sort test cases, which the branch had lost by being cut before #408/#414.
* feat(admin): favicon upload, served from the content volume (#422)
Adds a bundled default favicon, an upload widget in admin Settings > General, and a route that serves the icon from the writable content/ volume with a fallback to the bundled default. Raster uploads (PNG/ICO/JPEG) are wrapped in an SVG container; the response carries its own CSP so an uploaded SVG cannot execute script on the origin.
The GET route revalidates with an ETag instead of caching immutably, so a newly uploaded icon shows up immediately. Uploads are written via temp file + rename, and a Reset button restores the bundled default.
* ci: flag unformatted files in a PR, without blocking it (#424)
Prettier is configured as an error rule in eslint.config.mjs but has never run in CI, so part of the tree predates it. A final CI step now diffs against the PR base, runs prettier --list-different over the changed files, and emits a warning annotation per offender plus a job summary.
Advisory by design: it never fails the job. Blocking would turn a PR red for merely touching a file that was already unformatted, and normalising the tree in one commit would wreck git blame and conflict with the PRs in flight.
Requires fetch-depth: 0, since diffing against the base needs its history.
* feat(install): first-run wizard gated by a one-time setup token (#419)
Adds /install, a four-step first-run wizard: connect to Immich, optionally pick albums, name the site, finish. It verifies the credentials against the Immich server before writing anything, then writes gallery.yaml, settings.yaml and a content/install.json carrying the Immich credentials and a generated site secret.
install.json exists because a running process cannot pick up new env vars — the wizard has to write configuration that takes effect without a restart. getInstallCredentials() merges it under the real environment, so env vars always win and rotation stays a matter of setting one.
Both the page and the API routes are gated by a one-time setup token printed to the server log, so a deployment that is reachable before gallery.yaml exists cannot be configured by whoever finds it first. The token is stored in content/.setup-token (0600) rather than a module variable: Next.js bundles the page and each route handler separately, so a module-level token left the page and the API disagreeing inside one process and the wizard stuck on step 1. It is removed once the install completes.
The admin password is stored as an scrypt hash using the scheme lib/auth.ts already applies to album passwords; a plaintext ADMIN_PASSWORD env var keeps working.
* docs: document the setup wizard, fix the read-only content mount (#425)
Quick Start now leads with the /install wizard, with the hand-written YAML route kept alongside it, and a First-Run Setup section covers the setup token, the files the wizard writes, and env-var precedence.
Two corrections: both Docker examples mounted content/ as :ro, which silently breaks the wizard, the admin panel and the backup rotation alike — docs/admin-panel.md already said so and the README contradicted it. And nothing documented that content/install.json holds the Immich API key, so a backup of content/ is a backup of credentials.
Also adds a Contributors section crediting the people whose work is in the project.
* feat(admin): floating save bar pinned to the bottom of the viewport (#426)
The save bar was the first, static element inside .admin-main. Since the
document itself scrolls, it left the viewport as soon as you scrolled down
— editing a subpage section or a settings block far below gave no visible
dirty hint and no reachable save button.
Replace it with a bottom-pinned floating bar shared by both editors. It
only mounts while there is something to act on (unsaved changes, an
in-flight save, or a result message), so it never covers content while
idle. The success message clears after 5s, which hides the bar again.
- new SaveBar component, replacing the duplicated markup in PageBuilder
and SettingsEditor
- adopt the previously unused .floating-save-bar CSS: slide-in keyframes
(carrying translateX(-50%)), dirty border, wrap/gap, mobile variant and
a prefers-reduced-motion opt-out; z-index 900 keeps it below modals
- .admin-main gains bottom padding so the bar never covers page content
- drop the now-unreachable idle hints: the ⌘S hint becomes a button title,
the Live Sync note becomes a static line above the settings layout
- header "Site" link now bypasses the cache (/?fresh=1), so the preview
stays reachable when the bar is hidden
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(admin): themed listbox for the album sort control (#427)
The per-album "Photo order" control was a native <select>. Because an
<option> cannot contain markup, its choices could not use the admin
panel's currentColor SVG set — the reason #415 had to fall back to plain
text after dropping the emoji labels.
Adds a Listbox component implementing the ARIA combobox/listbox pattern,
so options can render a glyph beside their label:
- DOM focus stays on the trigger button; the active option is announced
through aria-activedescendant, keeping focus management to one element
- Keyboard: arrows (clamped at the ends, like a native select),
Home/End, Enter/Space to commit, Escape to cancel, Tab commits and
moves on, and prefix type-ahead with a repeat-key cycle
- Outside dismissal on pointerdown, so a press starting outside closes
the popup before the click retargets
The sort options now carry an icon each: calendar, arrow-down, arrow-up,
an A→Z marker, and the drag glyph for manual — matching the badge the
album card already shows. SORT_LABELS stays plain text because the badge
feeds it to a title attribute.
Closes #417
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(git): ignore generated design handoff folders
* fix(admin): stop the album sort dropdown clipping, and simplify the panel (#428)
* fix(admin): render listbox popup in a portal so it escapes modal clipping
The sort control's popup was position:absolute inside three clipping ancestors
(.album-drawer overflow:hidden > .album-drawer-body overflow-y:auto >
.modal-right-column overflow-y:auto), so it was cut off at the bottom of the
Edit Album Details modal. z-index could not help: clipping happens before
stacking. It also always hung below the trigger, with no flip.
Portal the popup to document.body and position it from the trigger's viewport
rect, flipping above when there is more room there and capping max-height to the
space available so it scrolls internally rather than overflowing. It is
dismissed on scroll and resize, since the anchor is only measured on open.
The outside-pointerdown handler now also treats the popup as inside; without
that the portalled list counts as outside, and a click on an option would close
it before the selection commits.
* refactor(admin): single-column album details panel
The left column spent 1.2fr on a cover thumbnail and three stat rows, two of
which (Status, Custom Hero) only restated the form fields opposite them, while
the form itself was squeezed into 1.8fr behind a second nested scroller.
Stack the drawer in one column instead: cover as a banner, then the form at full
width, with the UUID moved into the footer. The body is now the only scroll
container, which also removes one of the ancestors that was clipping the sort
popup.
---------
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
* fix(admin): give the portalled listbox its theme back, lock the page behind modals (#429)
Two defects in the album editor.
The sort listbox popup painted transparent. Every --admin-* variable is
scoped to .admin-layout, and since the popup moved into document.body it
sits outside that subtree, so background/border/text all resolved to
nothing. It now carries its own copy of the palette in both colour
schemes, plus the font it no longer inherits.
Scrolling inside a modal also moved the page behind it. No admin modal
ever locked body scroll: the overlay covers the page but does not absorb
wheel events, so a scroll starting on the backdrop — or continuing past
the end of the modal's own scroller — reaches the document.
overscroll-behavior cannot cover that case on its own, because it only
applies to scroll containers and the backdrop is not one.
useScrollLock freezes body while a modal is open and compensates for the
width the scrollbar gives up, so nothing shifts underneath. Each lock
restores the inline value it found, which makes nesting work without a
counter — a picker opened from the drawer restores the drawer's hidden
state instead of clearing it. Applied to both drawers and all four
picker modals, which share the defect. overscroll-behavior: contain on
the scrollers stops the chaining they can handle themselves.
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* fix(security): allow unsafe-eval in CSP script-src during dev mode
* feat(journal): add Journal Studio with split-screen editor, live preview and dedicated routes
* fix(build): separate client parser from server journal-service and fix build type errors
* fix(journal): Fotos rendern, Layout und Lightbox-Steuerung korrigieren
Fünf unabhängige Fehler in der öffentlichen Journal- und Essay-Ansicht:
* Foto-Blöcke wurden nie angezeigt. EssayView löst ein Foto über
PhotoItem.id auf, und das sind verschlüsselte Tokens — die Blöcke aus
dem Markdown tragen aber rohe Asset-UUIDs. Jede Zuordnung lief ins
Leere, und nicht auflösbare Blöcke werden still verworfen. Die IDs
werden jetzt serverseitig übersetzt; damit verschwinden nebenbei die
rohen UUIDs aus dem Client-Payload, die dort laut Projektregel nie
auftauchen dürfen. Nicht auflösbare Referenzen werden geloggt.
* Überschriften standen weiter links als der Fließtext. Jeder Block
hatte einzeln `max-width: 68ch`, und `ch` ist relativ zur Schrift des
Elements — die Serif-Überschrift ergab eine breitere Spalte. Ersetzt
durch eine gemeinsame, font-unabhängige `--essay-measure`.
* Fullbleed-Fotos bluteten nur nach links aus: `.essay-figure` ist
`width: 100%`, wodurch die Box überbestimmt ist und der negative
rechte Margin verworfen wird.
* Foto-Paare stellten beide Bilder gleich breit dar, wodurch ein
Hochformat neben einem Querformat doppelt so hoch wurde. Jetzt eine
Justified-Reihe: Breite proportional zum Seitenverhältnis, dadurch
exakt gleiche Höhen ohne Beschnitt.
* Die Lightbox hatte im Journal keine Tastatursteuerung und keine
Scroll-Sperre — beides lag in PhotoGrid, also nur im Album-Raster.
Verlagert in die Lightbox selbst, der doppelte Handler in PhotoGrid
entfernt (sonst wäre pro Pfeildruck zwei Bilder weitergesprungen).
Zusätzlich sind Proofing-Herzen und das EXIF-Panel im redaktionellen
Modus abschaltbar und im Journal aus: Client-Proofing ist ein
Übergabe-Workflow für Alben, keine Funktion einer Reportage. Auf der
Übersicht wurde der Untertitel doppelt gerendert, weil extractExcerpt()
auf ihn zurückfällt.
* feat(admin): eigene URLs für alle Bereiche und überarbeiteter Journal Studio
Das Panel war eine einzige Client-Komponente, die ihre Tabs über
useState umschaltet: keine Route pro Bereich, kein Deep-Link, kein
Zurück-Button, und nach jedem Reload landete man wieder auf "Pages".
Auch der Journal-Editor hatte keine eigene URL.
Jetzt sieben echte Routen (/admin, /admin/pages, /admin/journal,
/admin/journal/<slug>, /admin/settings, /admin/settings/<section>,
/admin/analytics). Die Shell mit Auth-Prüfung und Kopfzeile sitzt im
Layout und umschließt children — so bleibt die Session-Prüfung über
Routenwechsel montiert, statt bei jedem Tab-Wechsel neu zu laufen und
den Spinner aufblitzen zu lassen. Unbekannte Settings-Sections fallen
auf General zurück.
Im selben Zug der Journal Studio, der die Routing-Änderung ohnehin
berührt:
* Alle Eingabefelder nutzten die Klasse `admin-input`, die in keinem
CSS definiert war — sie fielen auf Browser-Defaults zurück. Jetzt
gestylt, gescoped, damit der generische Name nicht ins übrige Panel
leckt.
* Der Split View ist per Divider verschiebbar (Maus, Tastatur,
Doppelklick zum Zurücksetzen), Breite in localStorage.
* Das Studio bricht aus der 1120px-Spalte aus, die Preview hat Platz.
* Die Preview zeigte für jedes Foto fest 3:2 und log damit über das
Layout der veröffentlichten Seite; die echten Verhältnisse werden
jetzt an den Thumbnails gemessen.
* Blöcke mit alten positionsbasierten Foto-Referenzen werden markiert —
die lassen sich auf einer eigenständigen Journal-Seite nicht auflösen
und verschwanden bisher stillschweigend.
* Blocktyp-Chips als gemeinsame Komponente, monochrom und per Icon
unterschieden statt in einer eigenen Blau/Lila/Orange-Palette, die
sonst nirgends im Panel vorkommt.
* Emojis raus, SVG-Icons rein.
* fix(admin): Designsystem-Lücken im Panel schließen
Eine systematische Suche nach Klassen, die im TSX benutzt, aber in
keinem CSS definiert sind, hat vier Stellen mit demselben Muster
gefunden:
* `admin-btn-secondary` und `admin-btn-danger` existierten nicht.
Sämtliche Löschen-Buttons sahen aus wie normale Buttons — keine
Warnwirkung. Als `.admin-btn.admin-btn-danger` geschrieben, weil die
Varianten mit den Größenklassen kombiniert werden, die weiter unten
ihren eigenen Hintergrund setzen.
* `page-progress-fill` fehlte: die Balken im Analytics-Panel waren
leere Rinnen, der Wert unsichtbar. Ebenso `analytics-empty` und
`admin-loading-container`.
* `subpage-drawer-section`, `subpage-drawer-title-group` und
`input-with-icon` im PageBuilder waren wirkungslos und teils mit
Inline-Styles notdürftig kompensiert.
* `grid-card-preview` fehlte, wodurch alle Layout-Vorschauen auf Höhe
null kollabierten. Nur "Showcase" war sichtbar — und das aus Versehen,
weil sein Tile `hero-tile` hieß und damit die `aspect-ratio` einer
fremden PageBuilder-Klasse erbte. Umbenannt.
Dazu die Theme-Vorschauen, die praktisch identisch aussahen: alle
sieben zeigten dieselben drei quadratischen Kacheln, einziger
Unterschied war die Hintergrundfarbe. Sie spiegeln jetzt die echten
Preset-Daten aus lib/config/theme.ts — Schriftcharakter, Eckradius,
Rasterdichte, Passepartout bzw. Schatten.
Die Kopfzeile richtet sich an einer gemeinsamen Steuerhöhe aus. Der
"Site"-Link war höher als die Buttons daneben: `.admin-btn` hatte keine
explizite line-height, und <button> bekommt box-sizing: border-box vom
Browser, <a> nicht. Die Statusanzeige setzte weder Schriftfamilie noch
-größe und fiel auf den Browser-Default zurück — sie war nie Teil des
Designsystems. Jetzt gleiche Höhe und Typografie, Pillenform als
Zustandsanzeige, Trenner zur Aktionsgruppe. Das dauerhafte Pulsieren
des grünen Punkts entfällt; Animation bleibt den Zuständen vorbehalten,
die Aufmerksamkeit brauchen.
Restliche Emojis durch SVG-Icons ersetzt.
* feat(admin): add scroll-to-top toggle and SVG arrow
The back-to-top button was always on and drew its arrow with the ↑ text
character. Add a `scrollToTop` setting (General section in the admin
panel, defaults to on so existing sites are unaffected) and replace the
glyph with a stroked SVG that inherits currentColor across all presets.
Scroll handling is now rAF-throttled, and prefers-reduced-motion turns
off both the hover lift and the smooth scroll.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* security(journal): escape author HTML instead of filtering it
CodeQL flags 26 high-severity alerts on the release PR; the bulk of them
point at sanitizeHtml(), a denylist of three regexes whose output goes
into dangerouslySetInnerHTML. I reproduced the bypasses before changing
anything — all four pass the old filter:
<img src=x onerror=alert(1)> unquoted handler, regex wants quotes
<img src=x onerror='alert(1)'> single quotes, same reason
<svg onload=alert(1)> not a <script> tag
javasjavascript:cript:alert(1) one-pass replace, the rest recombines
Plus an attribute breakout in the link renderer, which interpolated the
URL into href="${url}" unescaped:
[x](" onmouseover=alert(1) x=") -> <a href="" onmouseover=alert(1" ...>
Replaced with escaping. Every `&<>"'` in author text becomes an entity
before any markdown rule runs, so the only tags in the output are the
ones renderInlineMarkdown builds itself and a URL cannot leave its
attribute. Link schemes are now an allowlist (http, https, mailto, tel,
relative, anchor); anything else renders as plain text.
The serializer needed decodeHtmlEntities to match: without it a save
would write `<` into the Markdown file and the next parse would
escape the `&` again, corrupting the text further on every round trip.
A test covers parse -> serialize -> parse stability.
Two existing tests asserted the old behaviour and were rewritten rather
than deleted: one expected the script tag to be *removed* from the
output, the other expected the substring "onerror" to be absent. Both
now assert the property that matters — that no tag can form — because
`onerror` surviving as inert text is fine.
Exploitation required admin access either way: journal and essay text
comes from the studio or from content/*.md. This removes the weakness,
it does not close an open door.
* fix(journal): contain file paths, fix frontmatter escaping, defuse two regexes
Follow-up to the CodeQL findings on release PR #432. I went through all 23
alerts individually; this addresses the ones that are worth addressing and
documents the ones that are not.
Path containment (12 alerts, all false positives). Every path built from a
slug goes through isValidSlug(), a strict `/^[a-zA-Z0-9_-]+$/` allowlist —
verified against `../../etc/passwd`, `foo/../../bar`, `a/b`, `..` and
friends, all rejected. CodeQL cannot see it because the check lives in
another module. Added a containedPath() helper that resolves the path and
refuses anything landing outside the content directory: a second lock on a
door that was already locked, and a barrier the analysis can follow. Also
removed the dead `slug.endsWith('.md')` branches — isValidSlug rejects
dots, so they could never be taken.
Frontmatter escaping (1 alert, a real bug). The serializer escaped `"` but
not `\`, and the parser never unescaped anything. A title containing either
character gained a backslash on every save/load cycle:
Path C:\Users "quoted" -> Path C:\\Users \"quoted\" -> ...
Escaping now covers the backslash first and the parser undoes both. A round
trip test covers quotes, backslashes, colons and apostrophes.
Two of three ReDoS regexes (2 alerts). The heading pattern had `\s+` next to
`(.+)`, which overlap, so the engine tried every split of the whitespace run
before failing; it is `[ \t]+` and `(\S.*)` now. The quote author pattern
wrapped a lazy group around an optional group — the quadratic case — and is
an index split on the first separator now.
The third regex, the bold/italic pass, is deliberately left alone. Rewriting
it with a negated class removes the backtracking but breaks nesting:
`**bold *and italic* here**` renders as `*<em>bold </em>and italic<em> here</em>*`.
The input is Markdown from an authenticated admin, never a visitor, so the
worst case is an author slowing down their own page. The comment in the code
says so.
Not addressed: 5 js/insufficient-password-hash alerts. They ask for a slow
KDF where the code uses SHA-256/HMAC — correct in general, but the admin
password comes from an environment variable and is never stored, so a
stronger KDF protects nothing that is not already in plaintext in the
environment.
399 unit tests pass (18 new), build and tsc clean.
* fix(journal): split the quote author by scanning, not by pattern
Cleaning up after myself. #439 replaced the quote author regex
`/^(.*?)(?:\s+--\s+(.+))?$/` — a lazy group around an optional one, the
quadratic case — with `/\s+--\s+/`, and CodeQL promptly flagged the
replacement for the same reason. One reported pattern traded for another.
splitQuoteAuthor() scans for the first `--` that has whitespace on both
sides. Linear, and it needs no reasoning about the regex engine at all.
Behaviour is identical to the original regex, checked case by case
against it: separator, no separator, several separators, tabs, wide gaps,
`a--b` without spaces, leading and trailing separators, empty string. All
nine are covered by tests, plus one asserting it stays fast on a 50k
whitespace run.
* security(admin): derive the session signing key with scrypt
getSigningKey() ran the admin password through a single SHA-256 digest.
It is key derivation rather than password storage, so it was never a
stored-hash problem — but if the derived key ever leaked, one fast hash
makes recovering the password by brute force cheap. CodeQL flags it as
js/insufficient-password-hash and, for this particular alert, has a
point.
scrypt now. Two details that matter:
The salt has to be stable. A random salt would produce a different key on
every call and invalidate every session; it is derived from AUTH_SECRET,
which is deployment-specific. Verified across separate processes: same
inputs produce a verifying token, so a restart or redeploy does not log
everyone out.
The result is cached for the process lifetime. scrypt is deliberately
slow and getSigningKey() runs on every admin request — deriving per call
would add ~24ms to each one. The cache key is a digest of secret plus
password, so a rotation misses the cache and derives again, and no extra
plaintext copy of the password is kept around.
Measured: first derivation 24ms, subsequent calls 0.12ms. Password
change and secret change both invalidate an existing token, checked in
separate processes.
Note the one-time effect: existing admin sessions are invalidated by the
change in derivation, so everyone logs in once more.
* security(admin): key the signing-key cache on its inputs, not a digest
#441 removed the SHA-256 digest of the admin password from the key
derivation and introduced a new one three lines above it, as the cache
key. Same rule, same file: CodeQL reported it immediately.
The comment justifying it was wrong too. It claimed no second plaintext
copy of the password was retained, while building the digest input
allocates exactly that in order to hash it.
The cache now holds the two input strings and compares them directly.
They are the same objects the env and install caches already hold, so
nothing extra is retained, and no fast hash of the password exists in
memory for the life of the process.
Re-verified after the change, in separate processes: a token from one
process verifies in another with the same inputs, a changed password or
secret rejects it, first derivation 24ms, cached calls 0.001ms.
That leaves scrypt as the only place the password is hashed here. The
two HMACs further down operate on the derived key and on token data, not
on the password; the constant-time comparison in verifyAdminPassword is
the previously dismissed one.
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: lancetm714 <108419425+lancetm714@users.noreply.github.com>
2026-08-14 16:55:07 +02:00
|
|
|
/* ── Card meta & status ───────────────────────────────────────────── */
|
|
|
|
|
|
|
|
|
|
.journal-admin-card-meta span {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-card-cover-placeholder {
|
|
|
|
|
opacity: 0.25;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-status-pill {
|
|
|
|
|
padding: 0.15rem 0.5rem;
|
|
|
|
|
border-radius: 9999px;
|
|
|
|
|
font-size: 0.7rem;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
letter-spacing: 0.04em;
|
|
|
|
|
opacity: 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-status-pill.is-draft {
|
|
|
|
|
background: rgba(234, 179, 8, 0.15);
|
|
|
|
|
color: #eab308;
|
|
|
|
|
border: 1px solid rgba(234, 179, 8, 0.3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-status-pill.is-published {
|
|
|
|
|
background: rgba(34, 197, 94, 0.15);
|
|
|
|
|
color: #22c55e;
|
|
|
|
|
border: 1px solid rgba(34, 197, 94, 0.3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-preview-bar-label {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 6px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ── Block field rows ─────────────────────────────────────────────
|
|
|
|
|
* The generic `.admin-input { width: 100% }` would blow these rows apart,
|
|
|
|
|
* so the fixed-width controls are pinned here (higher specificity wins).
|
|
|
|
|
*/
|
|
|
|
|
.journal-heading-row,
|
|
|
|
|
.journal-photo-layout-row {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-container .journal-heading-row .journal-level-select {
|
|
|
|
|
flex: 0 0 5.5rem;
|
|
|
|
|
width: 5.5rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-container .journal-heading-row input {
|
|
|
|
|
flex: 1 1 auto;
|
|
|
|
|
min-width: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-container .journal-photo-layout-row select {
|
|
|
|
|
flex: 1 1 auto;
|
|
|
|
|
min-width: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-photo-layout-row .admin-btn {
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Stack the split view on narrow screens instead of squeezing both panes. */
|
|
|
|
|
@media (max-width: 1100px) {
|
|
|
|
|
.journal-editor-split {
|
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
|
grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-resizer {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-pane-left {
|
|
|
|
|
border-bottom: 1px solid var(--admin-border, rgba(255, 255, 255, 0.08));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* An unresolvable photo reference — shown in the block editor, not to visitors. */
|
|
|
|
|
.journal-block-warning {
|
|
|
|
|
margin: 0 0 0.75rem;
|
|
|
|
|
padding: 0.55rem 0.7rem;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
font-size: 0.78rem;
|
|
|
|
|
line-height: 1.45;
|
|
|
|
|
color: #fca5a5;
|
|
|
|
|
background: rgba(239, 68, 68, 0.1);
|
|
|
|
|
border: 1px solid rgba(239, 68, 68, 0.3);
|
|
|
|
|
}
|
release: v0.18.0 (#725)
Release v0.18.0 — merges `dev` into `main`.
## Thanks
- [@lancetm714](https://github.com/lancetm714) for the accent-contrast
fix (#680 → #724).
- [@RichKidsDev](https://github.com/RichKidsDev) for reporting the
outdated Impressum (#697).
### Security
- **Journal drafts and password-protected entries no longer render
publicly
as a subpage essay**
([#684](https://github.com/ralksta/immich-folio/pull/684),
[GHSA-987w-cpwm-c9g9](https://github.com/ralksta/immich-folio/security/advisories/GHSA-987w-cpwm-c9g9),
medium). A subpage's `essayFile` read the journal entry straight from
disk,
skipping the draft and password rules `/journal/<slug>` applies. It now
resolves through the same rules: a draft reads as missing for visitors,
and
a protected entry shows its password gate, sharing the
`lb_auth_journal_<slug>` cookie.
- **Immich descriptions are escaped in generated subpage essays**
([#684](https://github.com/ralksta/immich-folio/pull/684),
[GHSA-8ppx-39jv-q5xm](https://github.com/ralksta/immich-folio/security/advisories/GHSA-8ppx-39jv-q5xm),
low). The essay built from a subpage's albums (`layout: essay` without
markdown) put each asset's Immich description into the page as raw HTML.
Captions are now HTML-escaped, and they go through `assetCaption()`, so
`exif.caption: false` is respected there as well. Tracked in
[#689](https://github.com/ralksta/immich-folio/issues/689).
- **Admin drafts no longer keep a typed password, and the contact form's
email check runs in linear time**
([#727](https://github.com/ralksta/immich-folio/pull/727)). The admin's
session drafts wrote a password as typed to `sessionStorage`; a draft
holding a plaintext password is now not kept (the unsaved-changes guard
still warns). The email pattern could backtrack polynomially on a
crafted
domain; its labels now exclude the dot and the length is checked first.
Both found by CodeQL before release.
### Added
- **A built-in contact form with an inbox in the admin**
([#703](https://github.com/ralksta/immich-folio/pull/703), closes
[#702](https://github.com/ralksta/immich-folio/issues/702)). `/contact`
needs neither SMTP nor a form service: each message is one file in
`content/messages/` (mode `0600`), read under the new _Messages_ tab,
where
_Reply by email_ opens the owner's mail client with the message quoted.
Messages older than `contact.retentionDays` (default 90) are deleted. An
optional ntfy push goes to `contact.notifyUrl` or `CONTACT_NOTIFY_URL`,
and
since [#709](https://github.com/ralksta/immich-folio/pull/709) it
carries a
fixed "new message" line and nothing about the sender — no name, no
address, no text. Spam is kept out without a captcha: an off-screen
honeypot, a minimum fill time, three submissions a minute per IP and a
cap
of 500 stored messages. With the Impressum on and no `legal.contactUrl`,
the Impressum links the form as its second contact channel. A new doctor
check warns when the form is on but nobody is notified.
- **A privacy policy page, next to a list of what the site processes**
([#708](https://github.com/ralksta/immich-folio/pull/708)). `/privacy`
renders `content/privacy.md`, edited under Settings → Legal, and the
footer
links it once the file has text; `privacy.enabled: false` hides it.
Folio
writes no legal text. Beside the editor it lists what _this_
installation
does, read off the configuration — the map, statistics, contact form,
password cookies, CDN — and marks every entry that involves a third
party.
_Insert headings_ adds the matching section headings and nothing else.
The
doctor warns while the Impressum is on and there is no policy.
- **French, Spanish, Italian and Dutch interface translations**
([#681](https://github.com/ralksta/immich-folio/pull/681)), selected
with
`settings.yaml: lang` as before. The admin panel stays English.
- **CDN mode for photos and videos**
([#681](https://github.com/ralksta/immich-folio/pull/681)). With
`CDN_URL`
set, image and video URLs point at a pull CDN whose origin is this
server,
so repeat views reach neither the server nor Immich. A site password
switches the mode off, since a CDN would hand out cached photos without
checking the unlock cookie. The CDN origin is added to the CSP, and a
doctor check covers the password and `TRUSTED_PROXY_HOPS` cases. See
`docs/deployment.md#cdn-mode`.
- **A reworked admin panel**
([#712](https://github.com/ralksta/immich-folio/pull/712),
[#713](https://github.com/ralksta/immich-folio/pull/713),
[#714](https://github.com/ralksta/immich-folio/pull/714),
[#716](https://github.com/ralksta/immich-folio/pull/716),
[#717](https://github.com/ralksta/immich-folio/pull/717),
[#718](https://github.com/ralksta/immich-folio/pull/718),
[#719](https://github.com/ralksta/immich-folio/pull/719),
[#721](https://github.com/ralksta/immich-folio/pull/721)):
- **A sidebar instead of the header row**, grouped by task, with an
unread
count on Messages and a dot on Diagnostics while Immich is down. It
collapses to an icon rail, with names shown on hover and focus, and
remembers that per browser.
- **`/admin` is an overview**: what needs attention (unread messages,
doctor warnings), published pages, journal entries and recent views.
- **The site's own visual language** — the preset's fonts, hairline
borders, the square marker — and one page header on every screen. The
accent is kept for the current place and the primary action; switches
are now pills reading ON or OFF, in green rather than the accent, so
Studio Modern's red no longer makes an enabled setting look like an
error.
- **The page builder is a structure list and a panel.** Hero, subpages
and
standalone albums sit in one list on the left, subpages drag-sorted in
place; the selected entry is edited on the right instead of in an
overlay.
- **Dialogs only where a change is permanent.** Deleting a message or a
journal entry, and resetting the favicon (which used to delete the file
without asking), go through one confirm dialog in the admin's own look.
Removals in the page builder, which only touch unsaved state, happen at
once and offer _Undo_. No `window.confirm()` is left.
- **Feature switches are grouped by meaning** as one-line rows under
Settings → General; page transitions and scroll-to-top moved to Theme →
Look & motion. No setting keys changed.
### Changed
- **Fonts and the Leaflet stylesheet are served from the site itself**
([#700](https://github.com/ralksta/immich-folio/pull/700)). Every page
used
to link `fonts.googleapis.com`, which sends each visitor's IP address to
Google. The server now fetches a theme's Google fonts once, rewrites the
stylesheet and caches the files in `content/.fonts/`; custom fonts in
`theme.fonts` keep working. If Google cannot be reached before a font is
cached, the page falls back to the theme's system fonts. `leaflet.css`
comes from the npm package instead of unpkg. The CSP drops
`fonts.googleapis.com`, `fonts.gstatic.com` and `unpkg.com`.
- **Email addresses are kept out of the served HTML**
([#705](https://github.com/ralksta/immich-folio/pull/705)). The
Impressum
and footer render the address only after hydration, from an encoded
form,
so harvesters reading raw HTML find nothing. Without JavaScript the
Impressum shows `name [at] example [dot] de`. This defeats bulk
harvesting,
not a person with a browser.
- **The Impressum cites § 5 DDG and links its contacts**
([#698](https://github.com/ralksta/immich-folio/pull/698), reported in
[#697](https://github.com/ralksta/immich-folio/issues/697) by
[@RichKidsDev](https://github.com/RichKidsDev)). The TMG was replaced by
the
DDG in May 2024; `legal.heading` replaces the line for other laws (e.g.
§ 5 ECG in Austria). `legal.contactUrl` and `legal.contactLabel` add a
contact form as the second channel, so a phone number stays optional.
Email, phone and contact URL are now links, and the "Created with the
Impressum generator by eRecht24" line, shown on every site whether true
or
not, is gone. Settings → Legal gains fields for heading, contact URL,
VAT
ID and tax number, and a doctor check flags missing details.
- **Missing pages answer `404`**
([#704](https://github.com/ralksta/immich-folio/pull/704)). Every
missing
page used to answer `200`, because streaming had started before
`notFound()` ran. `/contact`, `/impressum`, `/map` and `/privacy` while
switched off, and `/journal/<slug>` without an entry, now return a real
404 with the same not-found page. Album and subpage slugs still depend
on
Immich and stay soft 404s.
- **Passwords set in the admin are stored as scrypt hashes**
([#706](https://github.com/ralksta/immich-folio/pull/706), closes
[#690](https://github.com/ralksta/immich-folio/issues/690)). Subpage,
album, journal-entry and site passwords were written as typed. The save
routes now hash them; a stored hash reads _Protected_ with _Change_ and
_Remove_ and is never put into an input. Visitors who unlocked a page
stay
signed in across unrelated saves. Existing plaintext passwords are
hashed
the next time their file is saved in the admin.
- **One notification surface in the admin**
([#707](https://github.com/ralksta/immich-folio/pull/707)) replaces
every
`alert()`: errors stay until dismissed, successes clear themselves, and
screen readers announce both.
### Fixed
- **Map tiles load again**
([#701](https://github.com/ralksta/immich-folio/pull/701)). CARTO
started
answering every tile with an "API KEY REQUIRED" image, leaving `/map`
and
journal map blocks as a grey grid. Tiles now come from OpenStreetMap;
the
dark look is a CSS filter, so the map now follows the colour mode.
- **The page builder no longer drops a subpage's `proofing:` flag on
save**
([#711](https://github.com/ralksta/immich-folio/pull/711)). A page
switched
off for proofing by hand reverted after any unrelated edit.
- **Unsaved edits in Settings and About survive switching admin tabs,
and a
backup restore is no longer overwritten by the next save**
([#687](https://github.com/ralksta/immich-folio/pull/687)). Editors that
were open during a restore now reload and offer unsaved edits back as a
conflict. Also: "Restore my changes" after a conflict found nothing,
removing an album left its drawer showing the next album, and the
journal
saved (rotating a backup) without changes.
- **Accent-backed buttons stay readable with a light or malformed
accent**
([#724](https://github.com/ralksta/immich-folio/pull/724), supersedes
[#680](https://github.com/ralksta/immich-folio/pull/680)) — contributed
by
[@lancetm714](https://github.com/lancetm714). A white accent made the
proofing dialog's _Download selected (.zip)_ button white on white.
`theme.accent` is now accepted as hex only and normalised to `#rrggbb`,
anything else falls back to the preset, and the proofing dialog and
filter
pills use the mode-aware `--on-accent` text colour from #688.
- **Every preset's accent is visible in both colour modes**
([#688](https://github.com/ralksta/immich-folio/pull/688)). Presets had
one
accent for both modes; minimal's dark mode drew black buttons on black.
Presets now carry a light and a dark accent, and text on accent-filled
buttons picks black or white for contrast. A custom accent stays the
owner's choice in both modes.
- **Visitor-side inconsistencies**
([#685](https://github.com/ralksta/immich-folio/pull/685)): after
visiting
`/impressum`, every subpage header turned centred and uppercase; back
links
announced "Back to Back to …"; the hero EXIF chip ignored
`exif.location`/`camera`/`settings`; videos in journal entries opened as
stills; the setup screen named a non-existent `.env.example`.
- **An essay's lightbox walks only the photos the story shows**
([#686](https://github.com/ralksta/immich-folio/pull/686)), not every
photo
of the subpage's albums, and the proofing bar in essays shows the
selection
count instead of a filter button that did nothing.
- **The page panel scrolls with the mouse wheel**
([#720](https://github.com/ralksta/immich-folio/pull/720)).
- **The journal editor's top bar wraps on phones**
([#723](https://github.com/ralksta/immich-folio/pull/723), closes
[#675](https://github.com/ralksta/immich-folio/issues/675)), so the
title
stays editable and Save stays on screen.
- **Every admin form field has a name for assistive technology**
([#715](https://github.com/ralksta/immich-folio/pull/715)). Only two
inputs
had a linked label; 47 are linked now, and clicking a label focuses its
field.
### Internal
- **`SettingsEditor` and `PageBuilder` are split up**
([#710](https://github.com/ralksta/immich-folio/pull/710),
[#711](https://github.com/ralksta/immich-folio/pull/711)). The
2,200-line
settings editor is a shell with one file per section; the page builder's
YAML handling and edits are pure functions under test. Both were checked
side by side against `dev` for identical output.
- **`useAdminFetch()`**
([#707](https://github.com/ralksta/immich-folio/pull/707))
gives Analytics, Messages, Backups and the journal list one loading and
error pattern.
- README brought up to v0.17.0
([#678](https://github.com/ralksta/immich-folio/pull/678),
[#679](https://github.com/ralksta/immich-folio/pull/679)).
### Upgrade notes
**`content/` gains two directories the app writes to:**
`content/.fonts/`
for the cached fonts and `content/messages/` for contact-form messages.
Both
are created on demand, so a writable `content/` is enough, as before.
**The server needs outbound HTTPS to Google once per font** to fill the
font
cache. Until then pages fall back to the theme's system fonts. Visitors'
browsers no longer contact Google.
**A custom CSP or reverse-proxy allowlist** must now allow
`tile.openstreetmap.org` for images instead of
`*.basemaps.cartocdn.com`,
and no longer needs `fonts.googleapis.com`, `fonts.gstatic.com` or
`unpkg.com`. The built-in CSP is updated.
**`theme.accent` must be hex** (`#rgb`, `#rrggbb` or `#rrggbbaa`).
Anything
else, including a value without `#`, falls back to the preset's accent.
**Plaintext passwords in `gallery.yaml`, `settings.yaml` or journal
entries**
are hashed the next time that file is saved in the admin; one save
clears the
doctor's warning.
**New, optional settings:** `contact.*` (the form is off by default),
`privacy.enabled`, `legal.heading`, `legal.contactUrl`,
`legal.contactLabel`,
and the `CDN_URL` and `CONTACT_NOTIFY_URL` environment variables. See
`content/settings.yaml.example` and `.env.local.example`. In the example
file,
`vatId` and `taxId` had swapped sample values; check yours if you copied
them.
No `IMAGE_CACHE_VERSION` bump is needed this time.
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Ralf <rohlenbo79@gmail.com>
Co-authored-by: Paul Thies <110185070+ImScheinox@users.noreply.github.com>
Co-authored-by: lancetm714 <108419425+lancetm714@users.noreply.github.com>
Co-authored-by: Lance Martin <lancetaylor95@gmail.com>
2026-09-27 14:43:38 +02:00
|
|
|
|
|
|
|
|
/* Phones: the top bar was one non-wrapping row, so the title input shrank to
|
|
|
|
|
nothing and Save ran off the screen — and there is no ⌘S on a phone (#675).
|
|
|
|
|
Below 700px it wraps: back button and mode toggle, the title on a line of
|
|
|
|
|
its own, then the actions with Save taking the remaining width. */
|
|
|
|
|
@media (max-width: 700px) {
|
2026-09-29 22:50:30 +02:00
|
|
|
/* The workspace already keeps a gutter; a second 2rem one left the cards
|
|
|
|
|
under 300px wide. */
|
|
|
|
|
.journal-list-grid {
|
|
|
|
|
padding: 1.25rem 0;
|
|
|
|
|
}
|
|
|
|
|
|
release: v0.18.0 (#725)
Release v0.18.0 — merges `dev` into `main`.
## Thanks
- [@lancetm714](https://github.com/lancetm714) for the accent-contrast
fix (#680 → #724).
- [@RichKidsDev](https://github.com/RichKidsDev) for reporting the
outdated Impressum (#697).
### Security
- **Journal drafts and password-protected entries no longer render
publicly
as a subpage essay**
([#684](https://github.com/ralksta/immich-folio/pull/684),
[GHSA-987w-cpwm-c9g9](https://github.com/ralksta/immich-folio/security/advisories/GHSA-987w-cpwm-c9g9),
medium). A subpage's `essayFile` read the journal entry straight from
disk,
skipping the draft and password rules `/journal/<slug>` applies. It now
resolves through the same rules: a draft reads as missing for visitors,
and
a protected entry shows its password gate, sharing the
`lb_auth_journal_<slug>` cookie.
- **Immich descriptions are escaped in generated subpage essays**
([#684](https://github.com/ralksta/immich-folio/pull/684),
[GHSA-8ppx-39jv-q5xm](https://github.com/ralksta/immich-folio/security/advisories/GHSA-8ppx-39jv-q5xm),
low). The essay built from a subpage's albums (`layout: essay` without
markdown) put each asset's Immich description into the page as raw HTML.
Captions are now HTML-escaped, and they go through `assetCaption()`, so
`exif.caption: false` is respected there as well. Tracked in
[#689](https://github.com/ralksta/immich-folio/issues/689).
- **Admin drafts no longer keep a typed password, and the contact form's
email check runs in linear time**
([#727](https://github.com/ralksta/immich-folio/pull/727)). The admin's
session drafts wrote a password as typed to `sessionStorage`; a draft
holding a plaintext password is now not kept (the unsaved-changes guard
still warns). The email pattern could backtrack polynomially on a
crafted
domain; its labels now exclude the dot and the length is checked first.
Both found by CodeQL before release.
### Added
- **A built-in contact form with an inbox in the admin**
([#703](https://github.com/ralksta/immich-folio/pull/703), closes
[#702](https://github.com/ralksta/immich-folio/issues/702)). `/contact`
needs neither SMTP nor a form service: each message is one file in
`content/messages/` (mode `0600`), read under the new _Messages_ tab,
where
_Reply by email_ opens the owner's mail client with the message quoted.
Messages older than `contact.retentionDays` (default 90) are deleted. An
optional ntfy push goes to `contact.notifyUrl` or `CONTACT_NOTIFY_URL`,
and
since [#709](https://github.com/ralksta/immich-folio/pull/709) it
carries a
fixed "new message" line and nothing about the sender — no name, no
address, no text. Spam is kept out without a captcha: an off-screen
honeypot, a minimum fill time, three submissions a minute per IP and a
cap
of 500 stored messages. With the Impressum on and no `legal.contactUrl`,
the Impressum links the form as its second contact channel. A new doctor
check warns when the form is on but nobody is notified.
- **A privacy policy page, next to a list of what the site processes**
([#708](https://github.com/ralksta/immich-folio/pull/708)). `/privacy`
renders `content/privacy.md`, edited under Settings → Legal, and the
footer
links it once the file has text; `privacy.enabled: false` hides it.
Folio
writes no legal text. Beside the editor it lists what _this_
installation
does, read off the configuration — the map, statistics, contact form,
password cookies, CDN — and marks every entry that involves a third
party.
_Insert headings_ adds the matching section headings and nothing else.
The
doctor warns while the Impressum is on and there is no policy.
- **French, Spanish, Italian and Dutch interface translations**
([#681](https://github.com/ralksta/immich-folio/pull/681)), selected
with
`settings.yaml: lang` as before. The admin panel stays English.
- **CDN mode for photos and videos**
([#681](https://github.com/ralksta/immich-folio/pull/681)). With
`CDN_URL`
set, image and video URLs point at a pull CDN whose origin is this
server,
so repeat views reach neither the server nor Immich. A site password
switches the mode off, since a CDN would hand out cached photos without
checking the unlock cookie. The CDN origin is added to the CSP, and a
doctor check covers the password and `TRUSTED_PROXY_HOPS` cases. See
`docs/deployment.md#cdn-mode`.
- **A reworked admin panel**
([#712](https://github.com/ralksta/immich-folio/pull/712),
[#713](https://github.com/ralksta/immich-folio/pull/713),
[#714](https://github.com/ralksta/immich-folio/pull/714),
[#716](https://github.com/ralksta/immich-folio/pull/716),
[#717](https://github.com/ralksta/immich-folio/pull/717),
[#718](https://github.com/ralksta/immich-folio/pull/718),
[#719](https://github.com/ralksta/immich-folio/pull/719),
[#721](https://github.com/ralksta/immich-folio/pull/721)):
- **A sidebar instead of the header row**, grouped by task, with an
unread
count on Messages and a dot on Diagnostics while Immich is down. It
collapses to an icon rail, with names shown on hover and focus, and
remembers that per browser.
- **`/admin` is an overview**: what needs attention (unread messages,
doctor warnings), published pages, journal entries and recent views.
- **The site's own visual language** — the preset's fonts, hairline
borders, the square marker — and one page header on every screen. The
accent is kept for the current place and the primary action; switches
are now pills reading ON or OFF, in green rather than the accent, so
Studio Modern's red no longer makes an enabled setting look like an
error.
- **The page builder is a structure list and a panel.** Hero, subpages
and
standalone albums sit in one list on the left, subpages drag-sorted in
place; the selected entry is edited on the right instead of in an
overlay.
- **Dialogs only where a change is permanent.** Deleting a message or a
journal entry, and resetting the favicon (which used to delete the file
without asking), go through one confirm dialog in the admin's own look.
Removals in the page builder, which only touch unsaved state, happen at
once and offer _Undo_. No `window.confirm()` is left.
- **Feature switches are grouped by meaning** as one-line rows under
Settings → General; page transitions and scroll-to-top moved to Theme →
Look & motion. No setting keys changed.
### Changed
- **Fonts and the Leaflet stylesheet are served from the site itself**
([#700](https://github.com/ralksta/immich-folio/pull/700)). Every page
used
to link `fonts.googleapis.com`, which sends each visitor's IP address to
Google. The server now fetches a theme's Google fonts once, rewrites the
stylesheet and caches the files in `content/.fonts/`; custom fonts in
`theme.fonts` keep working. If Google cannot be reached before a font is
cached, the page falls back to the theme's system fonts. `leaflet.css`
comes from the npm package instead of unpkg. The CSP drops
`fonts.googleapis.com`, `fonts.gstatic.com` and `unpkg.com`.
- **Email addresses are kept out of the served HTML**
([#705](https://github.com/ralksta/immich-folio/pull/705)). The
Impressum
and footer render the address only after hydration, from an encoded
form,
so harvesters reading raw HTML find nothing. Without JavaScript the
Impressum shows `name [at] example [dot] de`. This defeats bulk
harvesting,
not a person with a browser.
- **The Impressum cites § 5 DDG and links its contacts**
([#698](https://github.com/ralksta/immich-folio/pull/698), reported in
[#697](https://github.com/ralksta/immich-folio/issues/697) by
[@RichKidsDev](https://github.com/RichKidsDev)). The TMG was replaced by
the
DDG in May 2024; `legal.heading` replaces the line for other laws (e.g.
§ 5 ECG in Austria). `legal.contactUrl` and `legal.contactLabel` add a
contact form as the second channel, so a phone number stays optional.
Email, phone and contact URL are now links, and the "Created with the
Impressum generator by eRecht24" line, shown on every site whether true
or
not, is gone. Settings → Legal gains fields for heading, contact URL,
VAT
ID and tax number, and a doctor check flags missing details.
- **Missing pages answer `404`**
([#704](https://github.com/ralksta/immich-folio/pull/704)). Every
missing
page used to answer `200`, because streaming had started before
`notFound()` ran. `/contact`, `/impressum`, `/map` and `/privacy` while
switched off, and `/journal/<slug>` without an entry, now return a real
404 with the same not-found page. Album and subpage slugs still depend
on
Immich and stay soft 404s.
- **Passwords set in the admin are stored as scrypt hashes**
([#706](https://github.com/ralksta/immich-folio/pull/706), closes
[#690](https://github.com/ralksta/immich-folio/issues/690)). Subpage,
album, journal-entry and site passwords were written as typed. The save
routes now hash them; a stored hash reads _Protected_ with _Change_ and
_Remove_ and is never put into an input. Visitors who unlocked a page
stay
signed in across unrelated saves. Existing plaintext passwords are
hashed
the next time their file is saved in the admin.
- **One notification surface in the admin**
([#707](https://github.com/ralksta/immich-folio/pull/707)) replaces
every
`alert()`: errors stay until dismissed, successes clear themselves, and
screen readers announce both.
### Fixed
- **Map tiles load again**
([#701](https://github.com/ralksta/immich-folio/pull/701)). CARTO
started
answering every tile with an "API KEY REQUIRED" image, leaving `/map`
and
journal map blocks as a grey grid. Tiles now come from OpenStreetMap;
the
dark look is a CSS filter, so the map now follows the colour mode.
- **The page builder no longer drops a subpage's `proofing:` flag on
save**
([#711](https://github.com/ralksta/immich-folio/pull/711)). A page
switched
off for proofing by hand reverted after any unrelated edit.
- **Unsaved edits in Settings and About survive switching admin tabs,
and a
backup restore is no longer overwritten by the next save**
([#687](https://github.com/ralksta/immich-folio/pull/687)). Editors that
were open during a restore now reload and offer unsaved edits back as a
conflict. Also: "Restore my changes" after a conflict found nothing,
removing an album left its drawer showing the next album, and the
journal
saved (rotating a backup) without changes.
- **Accent-backed buttons stay readable with a light or malformed
accent**
([#724](https://github.com/ralksta/immich-folio/pull/724), supersedes
[#680](https://github.com/ralksta/immich-folio/pull/680)) — contributed
by
[@lancetm714](https://github.com/lancetm714). A white accent made the
proofing dialog's _Download selected (.zip)_ button white on white.
`theme.accent` is now accepted as hex only and normalised to `#rrggbb`,
anything else falls back to the preset, and the proofing dialog and
filter
pills use the mode-aware `--on-accent` text colour from #688.
- **Every preset's accent is visible in both colour modes**
([#688](https://github.com/ralksta/immich-folio/pull/688)). Presets had
one
accent for both modes; minimal's dark mode drew black buttons on black.
Presets now carry a light and a dark accent, and text on accent-filled
buttons picks black or white for contrast. A custom accent stays the
owner's choice in both modes.
- **Visitor-side inconsistencies**
([#685](https://github.com/ralksta/immich-folio/pull/685)): after
visiting
`/impressum`, every subpage header turned centred and uppercase; back
links
announced "Back to Back to …"; the hero EXIF chip ignored
`exif.location`/`camera`/`settings`; videos in journal entries opened as
stills; the setup screen named a non-existent `.env.example`.
- **An essay's lightbox walks only the photos the story shows**
([#686](https://github.com/ralksta/immich-folio/pull/686)), not every
photo
of the subpage's albums, and the proofing bar in essays shows the
selection
count instead of a filter button that did nothing.
- **The page panel scrolls with the mouse wheel**
([#720](https://github.com/ralksta/immich-folio/pull/720)).
- **The journal editor's top bar wraps on phones**
([#723](https://github.com/ralksta/immich-folio/pull/723), closes
[#675](https://github.com/ralksta/immich-folio/issues/675)), so the
title
stays editable and Save stays on screen.
- **Every admin form field has a name for assistive technology**
([#715](https://github.com/ralksta/immich-folio/pull/715)). Only two
inputs
had a linked label; 47 are linked now, and clicking a label focuses its
field.
### Internal
- **`SettingsEditor` and `PageBuilder` are split up**
([#710](https://github.com/ralksta/immich-folio/pull/710),
[#711](https://github.com/ralksta/immich-folio/pull/711)). The
2,200-line
settings editor is a shell with one file per section; the page builder's
YAML handling and edits are pure functions under test. Both were checked
side by side against `dev` for identical output.
- **`useAdminFetch()`**
([#707](https://github.com/ralksta/immich-folio/pull/707))
gives Analytics, Messages, Backups and the journal list one loading and
error pattern.
- README brought up to v0.17.0
([#678](https://github.com/ralksta/immich-folio/pull/678),
[#679](https://github.com/ralksta/immich-folio/pull/679)).
### Upgrade notes
**`content/` gains two directories the app writes to:**
`content/.fonts/`
for the cached fonts and `content/messages/` for contact-form messages.
Both
are created on demand, so a writable `content/` is enough, as before.
**The server needs outbound HTTPS to Google once per font** to fill the
font
cache. Until then pages fall back to the theme's system fonts. Visitors'
browsers no longer contact Google.
**A custom CSP or reverse-proxy allowlist** must now allow
`tile.openstreetmap.org` for images instead of
`*.basemaps.cartocdn.com`,
and no longer needs `fonts.googleapis.com`, `fonts.gstatic.com` or
`unpkg.com`. The built-in CSP is updated.
**`theme.accent` must be hex** (`#rgb`, `#rrggbb` or `#rrggbbaa`).
Anything
else, including a value without `#`, falls back to the preset's accent.
**Plaintext passwords in `gallery.yaml`, `settings.yaml` or journal
entries**
are hashed the next time that file is saved in the admin; one save
clears the
doctor's warning.
**New, optional settings:** `contact.*` (the form is off by default),
`privacy.enabled`, `legal.heading`, `legal.contactUrl`,
`legal.contactLabel`,
and the `CDN_URL` and `CONTACT_NOTIFY_URL` environment variables. See
`content/settings.yaml.example` and `.env.local.example`. In the example
file,
`vatId` and `taxId` had swapped sample values; check yours if you copied
them.
No `IMAGE_CACHE_VERSION` bump is needed this time.
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Ralf <rohlenbo79@gmail.com>
Co-authored-by: Paul Thies <110185070+ImScheinox@users.noreply.github.com>
Co-authored-by: lancetm714 <108419425+lancetm714@users.noreply.github.com>
Co-authored-by: Lance Martin <lancetaylor95@gmail.com>
2026-09-27 14:43:38 +02:00
|
|
|
.journal-editor-topbar {
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
padding: 0.75rem 1rem;
|
|
|
|
|
gap: 0.75rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-topbar-left {
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
gap: 0.5rem 0.75rem;
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-title-input {
|
|
|
|
|
order: 3;
|
|
|
|
|
flex: 1 1 100%;
|
|
|
|
|
max-width: none;
|
|
|
|
|
min-width: 0;
|
|
|
|
|
border-color: var(--admin-border, rgba(255, 255, 255, 0.08));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-topbar-right {
|
|
|
|
|
width: 100%;
|
|
|
|
|
gap: 0.5rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.journal-editor-topbar-right > .admin-btn-primary {
|
|
|
|
|
flex: 1;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-09-29 22:50:30 +02:00
|
|
|
|
|
|
|
|
/* ── Content page settings: a side panel, not a modal (#722) ── */
|
|
|
|
|
.page-settings-panel {
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
width: min(360px, 100vw);
|
|
|
|
|
z-index: 100;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 1rem;
|
|
|
|
|
padding: 1.25rem;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
background: var(--admin-bg-raised);
|
|
|
|
|
border-left: 1px solid var(--admin-border);
|
|
|
|
|
box-shadow: -12px 0 32px rgba(0, 0, 0, 0.25);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.page-settings-panel-head {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.page-settings-panel-head h3 {
|
|
|
|
|
margin: 0;
|
|
|
|
|
font-size: 1rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.page-settings-panel textarea {
|
|
|
|
|
width: 100%;
|
|
|
|
|
resize: vertical;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.page-settings-panel-note {
|
|
|
|
|
margin: 0;
|
|
|
|
|
font-size: 0.75rem;
|
|
|
|
|
color: var(--admin-text-muted);
|
|
|
|
|
}
|