forked from mskayyali/nodepad
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
67 lines (66 loc) · 2.5 KB
/
Copy pathnext.config.mjs
File metadata and controls
67 lines (66 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/** @type {import('next').NextConfig} */
const nextConfig = {
typescript: {
// Build errors are intentionally ignored — see CLAUDE.md
ignoreBuildErrors: true,
},
images: {
unoptimized: true,
},
async headers() {
return [
{
// Apply security headers to every route
source: "/(.*)",
headers: [
{
// Prevent framing (clickjacking)
key: "X-Frame-Options",
value: "DENY",
},
{
// Stop MIME-type sniffing
key: "X-Content-Type-Options",
value: "nosniff",
},
{
// Limit referrer info sent to third-party origins
key: "Referrer-Policy",
value: "strict-origin-when-cross-origin",
},
{
// Permissions policy — disable features the app doesn't use
key: "Permissions-Policy",
value: "camera=(), microphone=(), geolocation=()",
},
{
// Content Security Policy
// - default-src self: everything defaults to same-origin
// - script-src: Next.js needs 'unsafe-inline' + 'unsafe-eval' in dev;
// nonces are the proper fix but require custom server — this is the
// pragmatic baseline for a static/Vercel deployment.
// - connect-src: https: allows any user-configured custom endpoint
// - img-src: data URIs for inline images, blob for canvas exports
// - style-src unsafe-inline: Tailwind injects inline styles at runtime
key: "Content-Security-Policy",
value: [
"default-src 'self'",
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cloud.umami.is",
"style-src 'self' 'unsafe-inline'",
// Allow all HTTPS so user-configured custom base URLs (arbitrary
// OpenAI-compatible endpoints) are not blocked by CSP. Enumerating
// specific provider domains is incompatible with a custom-URL feature.
// http://localhost:* covers local providers (Ollama, LM Studio, vLLM).
"connect-src 'self' https: http://localhost:*",
"img-src 'self' data: blob: https://i.ytimg.com",
"font-src 'self' data:",
"frame-src https://www.youtube-nocookie.com https://www.youtube.com",
"frame-ancestors 'none'",
].join("; "),
},
],
},
]
},
}
export default nextConfig