const packageJson = require('./package.json') /** @type {import('next').NextConfig} */ const nextConfig = { env: { APP_VERSION: packageJson.version, }, output: 'standalone', async headers() { return [ { source: '/(.*)', headers: [ { 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=(self)', }, { key: 'Cross-Origin-Opener-Policy', value: 'same-origin', }, { key: 'Content-Security-Policy', value: [ "default-src 'self'", "script-src 'self' 'unsafe-inline' 'unsafe-eval'", "style-src 'self' 'unsafe-inline'", "img-src 'self' data: blob: https://*.tile.openstreetmap.org https://api.maptiler.com http://localhost:9000 http://minio:9000", "font-src 'self' data:", "connect-src 'self' ws: wss: https://api.maptiler.com https://*.tile.openstreetmap.org https://api.open-meteo.com", "frame-ancestors 'self'", "base-uri 'self'", "form-action 'self'", ].join('; '), }, ], }, ] }, serverExternalPackages: ['minio', 'stripe', '@react-pdf/renderer', '@react-pdf/layout', '@react-pdf/pdfkit', '@react-pdf/font'], typescript: { ignoreBuildErrors: true, }, images: { remotePatterns: [ { protocol: 'http', hostname: 'localhost', port: '9000', pathname: '/**', }, { protocol: 'http', hostname: 'minio', port: '9000', pathname: '/**', }, ], }, experimental: { serverActions: { bodySizeLimit: '16mb', }, }, } module.exports = nextConfig