forked from boticlaw/SuperBotijo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
98 lines (92 loc) · 2.52 KB
/
Copy pathnext.config.mjs
File metadata and controls
98 lines (92 loc) · 2.52 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import path from "path";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
/** @type {import('next').NextConfig} */
const nextConfig = {
// M-1: Remove x-powered-by header
poweredByHeader: false,
typescript: {
ignoreBuildErrors: true,
},
outputFileTracingRoot: __dirname,
// Avoid NFT tracing the entire workspace via dynamic fs reads in API routes
outputFileTracingExcludes: [
'../reports/**/*',
'../memory/**/*',
'../output/**/*',
'../scripts/**/*',
'../docs/**/*',
'../skills/**/*',
],
allowedDevOrigins: [
"100.84.105.74",
"127.0.0.1",
"localhost",
"jokerserver.tail30eb25.ts.net",
"*.tail30eb25.ts.net",
"192.168.1.39",
"100.80.144.13",
],
serverExternalPackages: ["better-sqlite3"],
turbopack: {
resolveAlias: {
// Ensure better-sqlite3 is resolved as a native module
},
},
webpack: (config, { isServer }) => {
if (isServer) {
// Mark better-sqlite3 as external so it's loaded natively, not bundled
config.externals = config.externals || [];
if (Array.isArray(config.externals)) {
config.externals.push('better-sqlite3');
}
}
return config;
},
// Security headers (redundant with Traefik, added for defense in depth)
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'Strict-Transport-Security',
value: 'max-age=31536000; includeSubDomains; preload'
},
{
key: 'X-Frame-Options',
value: 'SAMEORIGIN'
},
{
key: 'X-Content-Type-Options',
value: 'nosniff'
},
{
key: 'Referrer-Policy',
value: 'strict-origin-when-cross-origin'
},
{
key: 'Permissions-Policy',
value: 'camera=(), microphone=(), geolocation=(), payment=()'
},
{
key: 'Content-Security-Policy',
value: [
"default-src 'self'",
"script-src 'self' 'unsafe-eval' 'unsafe-inline'",
"style-src 'self' 'unsafe-inline'",
"img-src 'self' data: blob:",
"font-src 'self' data:",
"connect-src 'self' ws: wss:",
"frame-ancestors 'none'",
"base-uri 'self'",
"form-action 'self'",
].join('; ')
}
]
}
]
}
};
export default nextConfig;