28 lines
1.1 KiB
JavaScript
28 lines
1.1 KiB
JavaScript
const securityHeaders = [
|
|
{ key: 'X-Content-Type-Options', value: 'nosniff' },
|
|
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
|
|
// The dashboard is never meant to be shown inside another site
|
|
{ key: 'X-Frame-Options', value: 'DENY' },
|
|
{ key: 'Permissions-Policy', value: 'camera=(), microphone=(), geolocation=(), payment=()' },
|
|
{ key: 'Strict-Transport-Security', value: 'max-age=31536000' },
|
|
];
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
poweredByHeader: false,
|
|
// A small server with only what it needs, for the Docker image
|
|
output: 'standalone',
|
|
outputFileTracingRoot: require('path').join(__dirname, '../..'),
|
|
// The shared package is TypeScript source
|
|
transpilePackages: ['@kooltap/shared'],
|
|
async headers() {
|
|
return [
|
|
{ source: '/:path*', headers: securityHeaders },
|
|
// Private pages: also keep them out of search engines that ignore robots.txt
|
|
{ source: '/dashboard/:path*', headers: [{ key: 'X-Robots-Tag', value: 'noindex, nofollow' }] },
|
|
];
|
|
},
|
|
};
|
|
|
|
module.exports = nextConfig;
|