-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
58 lines (54 loc) · 1.73 KB
/
Copy pathnext.config.ts
File metadata and controls
58 lines (54 loc) · 1.73 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
import type { NextConfig } from "next";
// Report-only CSP. Tighten or remove `'unsafe-inline'` once dangerouslySetInnerHTML
// usage in components/cursors/cursors.tsx is migrated to a hashed/nonce style.
const cspReportOnly = [
"default-src 'self'",
"script-src 'self' 'unsafe-inline' 'unsafe-eval'",
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com",
"font-src 'self' https://fonts.gstatic.com data:",
"img-src 'self' data: blob: https://avatars.githubusercontent.com https://*.supabase.co https://avatar.vercel.sh",
"connect-src 'self' https://*.liveblocks.io wss://*.liveblocks.io https://*.supabase.co https://*.upstash.io",
"frame-ancestors 'none'",
"base-uri 'self'",
"form-action 'self'",
].join("; ");
const securityHeaders = [
{ key: "Content-Security-Policy-Report-Only", value: cspReportOnly },
{ key: "X-Frame-Options", value: "DENY" },
{ key: "X-Content-Type-Options", value: "nosniff" },
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
{ key: "Permissions-Policy", value: "camera=(), microphone=(), geolocation=()" },
];
const nextConfig: NextConfig = {
reactStrictMode: true,
poweredByHeader: false,
devIndicators: false,
images: {
remotePatterns: [
{
protocol: "https",
hostname: "avatars.githubusercontent.com",
pathname: "/**",
},
{
protocol: "https",
hostname: "*.supabase.co",
pathname: "/storage/v1/object/public/**",
},
{
protocol: "https",
hostname: "avatar.vercel.sh",
pathname: "/**",
},
],
},
async headers() {
return [
{
source: "/:path*",
headers: securityHeaders,
},
];
},
};
export default nextConfig;