Critical bugs: - Fix bulk-download: UUID idempotency key, input validation, error handling, parallel asset validation - Fix leuchtkasten 404 link -> album page with search - Fix revalidatePath [id] -> [albumId] - Fix PDF crash on null invoiceNumber Logo: - Fix dimensions (1000x1000), dark mode support (logo-white.png), max-height constraint UI bugs: - Fix unsafe Date method calls (6 files) - Fix album UUID shown instead of name in catalog - Fix global search downloads (albumId from asset) - Add null guard for lightbox asset map Performance: - Parallelize admin dashboard queries (Promise.all) - Lazy-load recharts via next/dynamic - Add thumbnail caching headers (24h + ETag) - Reduce duplicate Immich API calls in usage service - Add DB index on usages(createdAt) - Add optimizePackageImports for lucide-react, recharts Security: - Input validation on bulk-download (max 100 items, UUID format, purpose length) - Verify security headers present in next.config.ts
62 lines
1.9 KiB
TypeScript
62 lines
1.9 KiB
TypeScript
import type { NextConfig } from "next";
|
|
|
|
const nextConfig: NextConfig = {
|
|
output: "standalone",
|
|
poweredByHeader: false,
|
|
experimental: {
|
|
optimizePackageImports: ["lucide-react", "recharts"],
|
|
},
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: "/(.*)",
|
|
headers: [
|
|
{
|
|
key: "Content-Security-Policy",
|
|
// ponytail: Next.js App Router injects inline scripts (RSC flight
|
|
// data + bootstrap) to hydrate client components. Without
|
|
// 'unsafe-inline' or a nonce in script-src the browser blocks them,
|
|
// hydration never runs, and every client form (login, registration,
|
|
// reset) falls back to a native GET submit. 'unsafe-inline' for
|
|
// scripts is the pragmatic fix; upgrade path is per-request nonces
|
|
// via middleware (Next attaches the nonce to its inline scripts).
|
|
value: [
|
|
"default-src 'self'",
|
|
"script-src 'self' 'unsafe-inline'",
|
|
"style-src 'self' 'unsafe-inline'",
|
|
"img-src 'self' data:",
|
|
"font-src 'self'",
|
|
"connect-src 'self'",
|
|
"frame-ancestors 'none'",
|
|
"base-uri 'self'",
|
|
"form-action 'self'",
|
|
].join("; "),
|
|
},
|
|
{
|
|
key: "Referrer-Policy",
|
|
value: "strict-origin-when-cross-origin",
|
|
},
|
|
{
|
|
key: "X-Content-Type-Options",
|
|
value: "nosniff",
|
|
},
|
|
{
|
|
key: "X-Frame-Options",
|
|
value: "DENY",
|
|
},
|
|
{
|
|
key: "Permissions-Policy",
|
|
value: [
|
|
"camera=()",
|
|
"microphone=()",
|
|
"geolocation=()",
|
|
"interest-cohort=()",
|
|
].join(", "),
|
|
},
|
|
],
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default nextConfig; |