2026-02-14 11:47:26 +01:00
|
|
|
import type { NextConfig } from 'next';
|
2026-02-13 23:26:37 +01:00
|
|
|
|
2026-02-15 11:07:39 +01:00
|
|
|
// ── Content Security Policy ────────────────────────────────────
|
|
|
|
|
// Locks down the public-facing site to only trusted sources.
|
|
|
|
|
const cspDirectives = [
|
|
|
|
|
"default-src 'self'",
|
|
|
|
|
"script-src 'self'",
|
|
|
|
|
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com",
|
|
|
|
|
"font-src 'self' https://fonts.gstatic.com",
|
|
|
|
|
"img-src 'self' data:",
|
|
|
|
|
"connect-src 'self'",
|
|
|
|
|
"frame-ancestors 'none'",
|
|
|
|
|
"base-uri 'self'",
|
|
|
|
|
"form-action 'self'",
|
|
|
|
|
].join('; ');
|
|
|
|
|
|
2026-02-13 23:26:37 +01:00
|
|
|
const nextConfig: NextConfig = {
|
2026-02-14 00:59:57 +01:00
|
|
|
output: 'standalone',
|
2026-02-14 10:30:27 +01:00
|
|
|
images: {
|
|
|
|
|
loader: 'custom',
|
|
|
|
|
loaderFile: './lib/immichLoader.ts',
|
|
|
|
|
},
|
2026-02-15 11:07:39 +01:00
|
|
|
async headers() {
|
|
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
source: '/(.*)',
|
|
|
|
|
headers: [
|
|
|
|
|
{ key: 'Content-Security-Policy', value: cspDirectives },
|
|
|
|
|
{ key: 'X-Content-Type-Options', value: 'nosniff' },
|
|
|
|
|
{ key: 'X-Frame-Options', value: 'DENY' },
|
|
|
|
|
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
|
|
|
|
|
{
|
|
|
|
|
key: 'Permissions-Policy',
|
|
|
|
|
value: 'camera=(), microphone=(), geolocation=()',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
},
|
2026-02-13 23:26:37 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default nextConfig;
|