-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.mjs
72 lines (68 loc) · 2.32 KB
/
next.config.mjs
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
68
69
70
71
72
const paddleCdn =
process.env.NEXT_PUBLIC_SITE_ENV === "production" ? "cdn" : "sandbox-cdn";
const paddleBuy =
process.env.NEXT_PUBLIC_SITE_ENV === "production" ? "buy" : "sandbox-buy";
const cspHeader = `
default-src 'self';
connect-src 'self' ${process.env.NEXT_PUBLIC_CORE_URL} ${process.env.NEXT_PUBLIC_R2_BUCKET_URL} ${process.env.NEXT_PUBLIC_POSTHOG_HOST} https://sockjs-ap2.pusher.com wss://ws-ap2.pusher.com https://accounts.google.com/gsi/ https://images.unsplash.com https://images.pexels.com https://ik.imagekit.io https://api.giphy.com https://www2.profitwell.com https://us-assets.i.posthog.com;
script-src 'self' 'unsafe-eval' 'unsafe-inline' https://challenges.cloudflare.com https://accounts.google.com/gsi/client https://media-library.cloudinary.com https://us-assets.i.posthog.com https://cdn.paddle.com https://public.profitwell.com;
frame-src 'self' https://challenges.cloudflare.com https://accounts.google.com/gsi/ https://eml.imagekit.io https://media-library.cloudinary.com https://console.cloudinary.com https://${paddleBuy}.paddle.com/;
style-src 'self' 'unsafe-inline' https://accounts.google.com/gsi/style https://${paddleCdn}.paddle.com;
img-src * blob: data:;
font-src 'self';
object-src 'none';
base-uri 'self';
form-action 'self';
frame-ancestors 'none';
block-all-mixed-content;
upgrade-insecure-requests;
`;
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "**",
},
],
},
webpack: (config) => {
config.resolve.fallback = {
aws4: false,
};
return config;
},
poweredByHeader: false,
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "Content-Security-Policy",
value: cspHeader.replace(/\n/g, ""),
},
{
key: "X-Content-Type-Options",
value: "nosniff",
},
{
key: "Referrer-Policy",
value: "same-origin",
},
{
key: "Permissions-Policy",
value: "geolocation=(), microphone=(self), camera=()",
},
{
key: "X-Frame-Options",
value: "DENY",
},
],
},
];
},
transpilePackages: ["highlight.js"],
};
export default nextConfig;