-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
76 lines (67 loc) · 1.93 KB
/
Copy pathnext.config.js
File metadata and controls
76 lines (67 loc) · 1.93 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
68
69
70
71
72
73
74
75
76
/** @type {import('next').NextConfig} */
const dotenvx = require("@dotenvx/dotenvx");
const { withPlausibleProxy } = require("next-plausible");
const { withSentryConfig } = require("@sentry/nextjs");
const envFile =
process.env.NODE_ENV === "production" ? ".env.production" : ".env";
dotenvx.config({ path: envFile, envKeysFile: ".env.keys" });
// Cut off at sentry.io
const reportURL = process.env.NEXT_PUBLIC_SENTRY_REPORT;
const reportURLStripped = `${reportURL.split("sentry.io")[0]}sentry.io`;
const contentSecurityPolicy = `
img-src 'self' data: blob:;
font-src 'self' data:;
style-src 'self' 'unsafe-inline';
worker-src 'self' blob:;
object-src 'none';
script-src 'self' blob: 'unsafe-inline' 'unsafe-eval';
connect-src 'self' data: ${reportURLStripped} wss://rqautahsvsoneozemjth.supabase.co https://rqautahsvsoneozemjth.supabase.co;
report-to csp-endpoint;
report-uri ${reportURLStripped};
upgrade-insecure-requests;
`;
const reportTo = {
group: "csp-endpoint",
max_age: 10886400,
endpoints: [
{
url: reportURL,
},
],
};
module.exports = withPlausibleProxy({
customDomain: "https://plausible.hedium.nl",
})(
withSentryConfig(
{
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "Content-Security-Policy",
value: contentSecurityPolicy.replace(/\n/g, ""),
},
{
key: "Report-To",
value: JSON.stringify(reportTo),
},
],
},
];
},
},
{
org: process.env.NEXT_PUBLIC_SENTRY_ORG,
project: process.env.NEXT_PUBLIC_SENTRY_PROJECT,
silent: !process.env.CI,
authToken: process.env.SENTRY_AUTH_TOKEN,
// Enable source maps and React annotations
widenClientFileUpload: true,
reactComponentAnnotation: {
enabled: true,
},
},
),
);