Files
Claw3D/next.config.mjs
T
iamlukethedevandiamlukethedev 4ba6b40b24 fix(docker): ship a runtime-safe Next config.
Replace the TypeScript Next config with an mjs file so the production container can start without trying to install TypeScript at runtime.

Made-with: Cursor
2026-04-07 23:54:51 -05:00

62 lines
1.4 KiB
JavaScript

const securityHeaders = [
{
key: "Content-Security-Policy",
value: [
"default-src 'self'",
"base-uri 'self'",
"form-action 'self'",
"frame-ancestors 'self'",
"img-src 'self' data: blob: http: https:",
"font-src 'self' data: https:",
"style-src 'self' 'unsafe-inline' https:",
"script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:",
"connect-src 'self' ws: wss: http: https:",
"media-src 'self' blob: data: http: https:",
"worker-src 'self' blob:",
"object-src 'none'",
"upgrade-insecure-requests",
].join("; "),
},
{
key: "Referrer-Policy",
value: "strict-origin-when-cross-origin",
},
{
key: "X-Content-Type-Options",
value: "nosniff",
},
{
key: "X-Frame-Options",
value: "SAMEORIGIN",
},
{
key: "Permissions-Policy",
value: "camera=(), microphone=(self), geolocation=(), browsing-topics=()",
},
{
key: "Cross-Origin-Resource-Policy",
value: "same-origin",
},
];
if (process.env.NODE_ENV === "production") {
securityHeaders.push({
key: "Strict-Transport-Security",
value: "max-age=31536000; includeSubDomains",
});
}
/** @type {import('next').NextConfig} */
const nextConfig = {
async headers() {
return [
{
source: "/:path*",
headers: securityHeaders,
},
];
},
};
export default nextConfig;