feat(project): init

This commit is contained in:
2026-02-03 17:34:55 +08:00
commit bdede98cde
20 changed files with 485 additions and 0 deletions

40
next.config.js Normal file
View File

@@ -0,0 +1,40 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
async headers() {
const isDev = process.env.NODE_ENV === "development"
const csp = [
"default-src 'self'",
"base-uri 'self'",
"frame-ancestors 'none'",
"object-src 'none'",
"form-action 'self'",
"img-src 'self' data:",
isDev
? "script-src 'self' 'unsafe-eval' 'unsafe-inline'"
: "script-src 'self'",
"style-src 'self' 'unsafe-inline'",
"connect-src 'self'",
].join("; ")
return [
{
source: "/(.*)",
headers: [
{ key: "Content-Security-Policy", value: csp },
{ key: "X-Frame-Options", value: "DENY" },
{ key: "X-Content-Type-Options", value: "nosniff" },
{ key: "Referrer-Policy", value: "no-referrer" },
{
key: "Strict-Transport-Security",
value: "max-age=63072000; includeSubDomains; preload",
},
{ key: "Permissions-Policy", value: "geolocation=(), microphone=(), camera=()" },
],
},
]
},
}
module.exports = nextConfig