Commit Graph
134 Commits
Author SHA1 Message Date
Leon TonhäuserandClaude Opus 5.5 4fb6f2d373 Ship all Drizzle migrations in the Docker image
.dockerignore whitelisted only 0000 and 0001, so 0002-0005 were missing
from the migrate image while the journal listed them. Allow
drizzle/*.sql instead of single file names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 22:50:07 +01:00
Leon TonhäuserandClaude Opus 5.5 d479e1e79b Release 2.2.2: version history linked from the release popup
- ReleaseHistory groups release notes by version (sorted by version
  number, newest marked "Aktuell") and renders them as Sakani cards on
  /redaktion/neuigkeiten and /admin/versionen (with audience + delete).
- The "Was ist neu?" popup links to the history ("Frühere Änderungen
  ansehen") and closes on navigation.
- Release notes for 2.2.2 seeded via custom migration 0005; popup
  version bumped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 22:45:37 +01:00
Leon TonhäuserandClaude Opus 5.5 71110208a9 Release 2.2.1: quarterly billing and Sakani form polish
- Billing is always quarterly: the billing page opens the current
  quarter, the month view is gone, old ?month= links land in their
  quarter and invalid quarters no longer throw.
- Calendar and release-note forms and the RSVP buttons use Sakani
  components (Card, Input, Textarea, FormSelect, Button, Alert).
- Sidebar logo stays visible in dark mode (Sakani's logo tile is light).
- Release notes for 2.2.1 seeded via custom migration 0004; popup
  version bumped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 22:38:32 +01:00
Leon TonhäuserandClaude Opus 5.5 c0c2425dda Merge v2.1-2.2.0 features onto SakaniUI base
Ports calendar, self-service, sorting, image descriptions, logo (2.1),
filename search (2.1.1), statistics page, collab option and bundled
invoice PDF delivery (2.2.0) onto the deployed SakaniUI portal.

Also fixes the statistics daily series, which ended yesterday and so
hid today's activity from the charts, and ignores Playwright
test-results/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 22:19:34 +01:00
Leon Tonhäuser 7204dd6b60 feat: v2.2 batch (calendar, self-service, sort, description, filename search, stats, collab, invoice) on pre-redesign base 2026-11-30 21:20:13 +01:00
Leon Tonhäuser 58a28e391c Merge branch 'codex/sakani-security' into 'main'
Codex/sakani security

See merge request leon/immich-redaktions-plugin!2
2026-11-30 18:36:05 +00:00
Leon Tonhäuser 319e3dc101 Exclude source tests from Docker production build 2026-11-30 19:34:44 +01:00
Leon Tonhäuser f899417b1e Update portal dependencies for security advisories 2026-11-30 19:30:30 +01:00
Leon Tonhäuser e8da50c998 Merge branch 'codex/sakani-security' into 'main'
Secure Sakani portal and show full album titles

See merge request leon/immich-redaktions-plugin!1
2026-11-30 18:18:12 +00:00
Leon Tonhäuser 69264ce165 Secure Sakani portal and show full album titles 2026-11-30 19:14:57 +01:00
Leon TonhäuserandClaude Opus 5.5 c40ccf77cf chore: drop parallel-run setup, document direct rollout and rollback
The UI goes live on the main domain directly, so the second-instance
compose file and the AUTO_RULE_SYNC_DISABLED switch are not needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 18:30:44 +01:00
Leon TonhäuserandClaude Opus 5.5 affa046b4a fix: name the editorial sidebar Redaktionsportal
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 18:26:42 +01:00
Leon TonhäuserandClaude Opus 5.5 9e938e4d07 feat: redesign portal UI with Sakani UI and add release notes
Replace the hand-rolled Tailwind/shadcn look with Sakani UI across the
editorial area, the admin area and all signed-out pages.

- AppShell (Sakani Sidebar + TopBar) for /redaktion and /admin, with a
  mobile drawer, theme toggle, sign-out, legal links and a "Was ist neu"
  button; PublicShell for login, registration, password, 2FA and errors.
- Shared primitives (Button, Card, Input, PageHeader) now render Sakani;
  components/ui/sakani.tsx is the client boundary for Server Components
  (Sakani ships no "use client") and adds FormSelect (native form value)
  and DataTable (element cells from the server).
- Legacy CSS variables map onto Sakani tokens; globals.css shrinks from
  ~2200 to ~700 lines. Geist replaces Inter. recharts/lucide-react dropped
  (charts via Sakani BarChart).
- Release notes popup per area, shown once per version (localStorage) and
  reopenable from the sidebar; native <dialog> for focus trapping.
- Fixes found while testing: TOTP field reused the typed password in
  clear text, modal dialogs sat top-left, invisible unchecked checkboxes
  in dark mode.
- Parallel run: compose.parallel.yaml, AUTO_RULE_SYNC_DISABLED switch and
  docs/operations.md §8 (start, rollback, cutover).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 18:24:05 +01:00
Leon Tonhäuser 453bece72c docs: preserve deployment and migration notes 2026-11-30 16:42:10 +01:00
Leon Tonhäuser bdf6399b35 fix: skip inaccessible album grants in global search 2026-11-30 16:42:10 +01:00
Leon Tonhäuser abe072b2d1 feat: admin hints with auto-expiry shown in album overview 2026-09-11 17:30:15 +02:00
Leon Tonhäuser 2a5a2f3815 feat: show outstanding unbilled amount next to net price in editorial overview
Grouped SUM over usages with billingStatus open/reopened (same selectable
set as the billing page; voided excluded) per editorial, rendered as an
amber-highlighted 'Offen' suffix in each card footer.
2026-09-01 17:23:38 +02:00
Leon Tonhäuser 0931ffc777 feat: add admin albums tab with access overview and bulk grants
New /admin/alben page: all Immich albums with per-album editorial grant
chips (link + one-click revoke) and a bulk-grant form (multiple albums x
multiple editorials, select-all, search). bulkGrantAlbums validates album
existence once via listAlbums, skips already-active pairs, and commits
each pair in its own transaction with full audit attribution.
2026-09-01 17:17:02 +02:00
Leon Tonhäuser 0b65fbba16 fix: rebuild migration history as baseline so migrate works on prod
Squash the 13 historical migrations into one generated baseline whose
journal entry reuses the original 0000 timestamp: the migrator skips it
on every existing database (prod journal stuck at 0006) and applies it
only on fresh ones. Parity with the old chain verified via pg_dump diff
plus fresh/existing/prod-simulated drizzle-kit migrate runs. Historical
files move to drizzle-history/pre-squash-2026-08/ for integration tests
that exercise legacy migration behavior.

Also repair db tests that already failed before this change:
- raw SQL targeted users, but the table has always been "user"
- membership recheck mocked legacy getAsset.albums instead of searchPhotos
- audit rollback assertion walks drizzle's wrapped error cause chain
- keyset index probe pinned to NULLS LAST ordering, removing a planner
  cost tie-break that flipped with index creation order
2026-08-25 11:56:52 +02:00
Leon Tonhäuser 2949149170 docs: record prod migration-journal debt and two_factor field contract 2026-08-25 03:32:52 +02:00
Leon Tonhäuser 11cde23cdb fix: complete two_factor schema to full plugin field set
Adds failedVerificationCount and lockedUntil (brute-force tracking
maintained by the two-factor plugin). The adapter rejects any
two-factor endpoint while declared fields are missing from the drizzle
schema; verified was already added in the previous commit.
2026-08-25 03:27:51 +02:00
Leon Tonhäuser f42f4d5d2d fix: add missing two_factor.verified column required by plugin
The two-factor plugin reads/writes a verified boolean on the twoFactor
model (set true by verify-totp); without it the drizzle adapter rejects
every /two-factor/enable call.
2026-08-25 03:13:02 +02:00
Leon Tonhäuser 0d939593c8 feat: enforce admin 2FA, step-up auth, stronger password policy
Implements OWASP audit recommendations P1-P3:

P1 - Two-factor authentication (TOTP) mandatory for admins:
- better-auth twoFactor plugin; new two_factor table + user flag
  (migration 0010, MUST run before deploying the app)
- requireAdmin throws TWO_FACTOR_REQUIRED without a finished setup;
  pages redirect to the new /zwei-faktor wizard which uses a weak
  guard (allowWithoutTwoFactor) so admins can never lock themselves
  out. Wizard lives outside /admin to avoid layout redirect loops.
- login flow handles twoFactorRedirect and asks for the TOTP code;
  backup codes are shown once during enablement

P2 - Step-up for destructive operations (ASVS 2.5.4):
- hardDeleteEditorialAction and resetUsageDataAction reject sessions
  older than 15 minutes (SESSION_STALE) with actionable German
  messages instead of throwing opaque digests

P3 - Password policy (NIST 800-63B):
- minimum length raised from 8 to 12 plus common-password denylist,
  enforced for registration AND reset/change via a before-hook
2026-08-25 02:30:58 +02:00
Leon Tonhäuser 9308b46d84 feat: unarchive editorials and restore archived grants
Adds an "Archivierung aufheben" action on the editorial detail page:
clears the archive markers, reactivates suspended accounts and
re-activates exactly the album grants that were revoked by the archive
step (matched via the archive timestamp, skipping albums that received
a fresh active grant in the meantime).
2026-08-25 01:38:20 +02:00
Leon Tonhäuser c9d3f3d1dc feat: reset editorial usage data; fix hard delete FK order
Admins can now wipe an editorial's usage footprint (usages, download
events, billing reports incl. items and related audit rows) so test
accounts no longer pollute dashboard statistics. Grants, price, status
and login stay untouched; the action is confirmed by typing the
editorial name.

Hard delete previously failed with FK violations as soon as a usage had
ever been billed or an address saved:
- billing_report_items (restrict -> usages) were never deleted
- billing_address_versions were deleted before the referencing
  current_billing_address_version_id and their self-referencing
  superseded_by_id, both restrict

Both are now handled in correct FK order inside the transaction; the
audit trail of the deleted editorial is purged and verification tokens
are removed.
2026-08-25 01:28:34 +02:00
Leon Tonhäuser c6b69eb88d fix: survive empty-string env vars from compose
Docker Compose passes undeclared variables as empty strings
(CRON_SECRET="" etc.), which crashed env validation while loading the
instrumentation hook. A throwing register() made Next.js answer every
route with 500 while the process stayed alive.

- parse optional CRON_SECRET / AUTO_RULE_SYNC_INTERVAL_SECONDS via
  plain preprocess helpers that map blank strings to unset (zod v4
  does not accept preprocess-produced undefined through .optional())
- guard instrumentation register() so scheduler failures can never
  break request handling
2026-08-25 01:16:13 +02:00
Leon Tonhäuser dd60fd6ee6 feat: auto-assign new Immich albums via keyword rules
Auto-assignment rules were only applied when an admin clicked
"Regeln jetzt anwenden". New albums created in Immich therefore
never reached editorials automatically.

- applyAllRules() syncs every active editorial's keywords against the
  full album list in one pass and grants matches as system actor
- in-process scheduler (src/instrumentation.ts) runs the sync every
  AUTO_RULE_SYNC_INTERVAL_SECONDS (default 120s)
- POST /api/cron/album-sync allows external triggers via CRON_SECRET
- overlapping sync runs coalesce to avoid duplicate grants/emails
2026-08-25 01:05:04 +02:00
Leon Tonhäuser a3dc56778d fix: prioritize authorized search album 2026-08-12 17:58:27 +02:00
Leon Tonhäuser 9aa79cbce9 feat: enable downloads from search results 2026-08-12 16:45:42 +02:00
Leon Tonhäuser cccb214229 docs: plan search result downloads 2026-08-12 16:40:50 +02:00
Leon Tonhäuser 9903d18b84 docs: specify search result downloads 2026-08-12 16:38:30 +02:00
Leon Tonhäuser 61b1dbe350 fix: restore mobile menu active contrast 2026-08-11 18:01:16 +02:00
Leon Tonhäuser d8c3508db2 docs: plan mobile menu active contrast 2026-08-11 17:54:39 +02:00
Leon Tonhäuser 3e0221b149 docs: specify mobile menu active contrast 2026-08-11 17:53:36 +02:00
Leon Tonhäuser f7a311dece Merge branch 'codex/mobile-portal-navigation' 2026-08-11 17:41:17 +02:00
Leon Tonhäuser 60d5a95651 fix: keep mobile portal menu reachable 2026-08-11 17:35:26 +02:00
Leon Tonhäuser e328267763 fix: centralize protected page access 2026-08-11 17:31:23 +02:00
Leon Tonhäuser 844b8f7afd feat: add portal error recovery page 2026-08-11 17:17:09 +02:00
Leon Tonhäuser 0085c721af feat: expose portal navigation on mobile 2026-08-11 17:14:52 +02:00
Leon Tonhäuser 1279f46b1f fix: redirect expired portal sessions 2026-08-11 17:13:44 +02:00
Leon Tonhäuser 9089dce74a fix: size mobile portal menu controls 2026-08-11 17:11:32 +02:00
Leon Tonhäuser b1ef4a8186 docs: plan session expiry recovery 2026-08-11 17:10:42 +02:00
Leon Tonhäuser ec5ed8b22a feat: add accessible mobile portal menu 2026-08-11 17:06:23 +02:00
Leon Tonhäuser 56f21a5289 docs: specify session expiry recovery 2026-08-11 17:06:23 +02:00
Leon Tonhäuser a98c7bc8ee docs: plan mobile portal navigation 2026-08-11 17:02:43 +02:00
Leon Tonhäuser 3a1f4274a4 docs: specify mobile portal navigation 2026-08-11 16:49:47 +02:00
Leon Tonhäuser c1bd620d91 fix: link approval emails to sign-in 2026-08-11 16:30:51 +02:00
Leon Tonhäuser 60ef5ddab9 fix: use runtime legal page URLs 2026-08-11 16:17:34 +02:00
Leon Tonhäuser 86dfe8053d fix: harden production flows and user messaging 2026-08-11 16:07:13 +02:00
Leon Tonhäuser 52dce168dd style: add underline to acknowledgement links, update .env.example 2026-08-11 14:58:08 +02:00