forked from jordanlambrecht/tracker-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
52 lines (48 loc) · 1.33 KB
/
next.config.ts
File metadata and controls
52 lines (48 loc) · 1.33 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
// next.config.ts
import type { NextConfig } from "next"
const securityHeaders = [
{ key: "X-Content-Type-Options", value: "nosniff" },
{ key: "X-Frame-Options", value: "DENY" },
{ key: "X-XSS-Protection", value: "0" },
{ key: "X-DNS-Prefetch-Control", value: "off" },
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
{ key: "Permissions-Policy", value: "camera=(), microphone=(), geolocation=()" },
]
if (process.env.BASE_URL) {
try {
const parsed = new URL(process.env.BASE_URL)
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
console.error(`BASE_URL must use http or https protocol, got: ${parsed.protocol}`)
process.exit(1)
}
} catch {
console.error(`BASE_URL is not a valid URL: ${process.env.BASE_URL}`)
process.exit(1)
}
}
const nextConfig: NextConfig = {
output: "standalone",
serverExternalPackages: ["argon2"],
env: {
NEXT_PUBLIC_APP_VERSION: process.env.npm_package_version ?? "0.0.0",
},
allowedDevOrigins: ["*.local", "*.lan", "192.168.*.*", "10.*.*.*"],
devIndicators: {
position: "bottom-right",
},
logging: {
fetches: {
fullUrl: false,
hmrRefreshes: false,
},
},
async headers() {
return [
{
source: "/(.*)",
headers: securityHeaders,
},
]
},
}
export default nextConfig