Files
immich-redaktions-plugin/next.config.ts
T

61 lines
1.8 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,
// client forms cannot hydrate. '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;