Commit Graph
4 Commits
Author SHA1 Message Date
till 2c2ef9d458 Astro 7: die AVIF-Lücke in sharp/Astro 5 schließen
GHSA-26w7-cxv4-gfx2 (kritisch, RCE beim Verarbeiten von AVIF) hat für
Astro 5 keinen Fix. Also hoch auf Astro 7.3.2, @astrojs/node 11,
@astrojs/react 6 und sharp 0.35. `npm audit`: 0 Funde.

Zwei Stellen mussten mit:

- `experimental.csp` heißt seit Astro 7 `security.csp`. Das ist keine
  kosmetische Umbenennung: ein `csp` auf oberster Ebene wird ohne Warnung
  geschluckt und die Seite läuft ganz ohne Policy. Gemessen — Header
  vorher weg, nach der Korrektur wieder da, mit denselben Skript-Hashes
  wie unter Astro 5.
- sharp exportiert den Typ `Sharp` jetzt benannt statt als Namensraum.

Dazu das Image: node 20 → 22 (Astro 7 verlangt mehr als 20.19, die Tests
brauchen 22.6 für --experimental-strip-types), und `npm ci` mit Lockfile
statt `npm install` — sonst baut das Image nicht die Versionen, die
getestet wurden.

Geprüft gegen echtes Postgres: alle Seiten 200, Upload durch sharp 0.35,
Bogen-PDF auf 210,00 × 297,00 mm gemessen, Einzelbild 35 × 45 mm bei
300 dpi = 413 × 531 px mit korrekter dpi-Angabe. 124 Tests grün.
2026-09-15 20:14:10 +02:00
tillandClaude Opus 5 6ae6e0348c feat: CSP and security headers, memory limit, AI provenance, one crop core
Five things off the open list in the wiki.

CSP with real hashes for every inline script (Astro's experimental.csp), so no
'unsafe-inline' for scripts. style-src is deliberately reopened in middleware:
React sets styles as attributes and attributes cannot be hashed -- measured, the
hash-only policy blocks them and the print preview loses its layout. Plus
nosniff, referrer-policy, X-Frame-Options and a permissions-policy. Verified
across all pages: zero violations.

mem_limit 3g in compose. sharp can spike; without a limit an outlier takes the
whole container down instead of just the process, and the healthcheck can't
help.

AI results now carry IPTC DigitalSourceType (trainedAlgorithmicMedia, or
compositeWithTrainedAlgorithmicMedia for edited photos) plus the model, embedded
as XMP -- written by hand into PNG iTXt and JPEG APP1 rather than pulling in a
sharp upgrade with a native postinstall. exiftool reads it back from both
formats; pixels, dimensions and dpi are provably untouched.

Crop maths lived twice, in the browser preview and the server renderer, with
nothing holding them together. Now one dependency-free module, and 60000
randomised cases assert both entry points agree. That test immediately found a
real bug: the zoom limits (0.02 / 8x) also clamped the *initial* crop, so an
extreme format silently broke the aspect ratio -- "Rand lassen" would have
cropped after all. Limits are now widened to whatever the format needs.

Also: the colour flag sat exactly on the selection circle in the library and
covered it. Moved to the bottom left.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BNhLunz586g6DeYMa7Qsd1
2026-09-01 02:44:45 +00:00
till 8304e810b2 fix: disable astro checkOrigin (breaks multipart uploads behind proxy); SameSite=Lax covers CSRF 2026-07-23 14:49:14 +00:00
till b46dbbe889 feat: scaffold klarbild foundation (astro+postgres+s3, auth, migrations, health)
- Astro 5 SSR (node standalone) + React, OKLCH tokens (no tailwind)
- migrations/001_init.sql: full schema per 03-datenmodell-api
- lib: db+migrations, crypto (AES-256-GCM), auth (argon2+signed session, ratelimit),
  storage (S3/MinIO, presigned URLs), openrouter (POST /v1/images, cost)
- middleware: init-once + session guard + admin gate; /api/health (db+storage)
- login + studio placeholder; seeds (till/lea, default recipes); Dockerfile
- verified: astro build passes
2026-07-23 11:11:08 +00:00