TODO: * https://www.crowdsec.net/ - 알려진 악성 IP 자동 차단
This commit is contained in:
parent
e9b4c98bd7
commit
292c62f5e9
1 changed files with 30 additions and 1 deletions
|
|
@ -1,7 +1,36 @@
|
||||||
import type { NextConfig } from "next";
|
import type { NextConfig } from 'next';
|
||||||
|
|
||||||
|
const isDev = process.env.NODE_ENV === 'development';
|
||||||
|
|
||||||
|
const cspHeader = `
|
||||||
|
default-src 'self';
|
||||||
|
connect-src 'self' https://api.bitdori.org wss://api.bitdori.org;
|
||||||
|
script-src 'self' 'unsafe-inline'${isDev ? " 'unsafe-eval'" : ''};
|
||||||
|
style-src 'self' 'unsafe-inline' https://fonts.googleapis.com;
|
||||||
|
img-src 'self' blob: data:;
|
||||||
|
font-src 'self' https://fonts.gstatic.com;
|
||||||
|
object-src 'none';
|
||||||
|
base-uri 'self';
|
||||||
|
form-action 'self';
|
||||||
|
frame-ancestors 'none';
|
||||||
|
upgrade-insecure-requests;
|
||||||
|
`;
|
||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
/* config options here */
|
/* config options here */
|
||||||
|
async headers() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
source: '/(.*)',
|
||||||
|
headers: [
|
||||||
|
{
|
||||||
|
key: 'Content-Security-Policy',
|
||||||
|
value: cspHeader.replaceAll(/\n/g, ''),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue