Sifa professional network frontend (Next.js, React, TailwindCSS)
sifa.id/
1import type { NextConfig } from 'next';
2import { withSentryConfig } from '@sentry/nextjs';
3import createNextIntlPlugin from 'next-intl/plugin';
4
5const withNextIntl = createNextIntlPlugin('./src/i18n/request.ts');
6
7const nextConfig: NextConfig = {
8 output: 'standalone',
9 staticPageGenerationTimeout: 180,
10 images: {
11 remotePatterns: [
12 {
13 protocol: 'https',
14 hostname: 'cdn.bsky.app',
15 },
16 {
17 protocol: 'https',
18 hostname: 'www.google.com',
19 pathname: '/s2/favicons**',
20 },
21 {
22 protocol: 'https',
23 hostname: 'sifa.id',
24 pathname: '/uploads/**',
25 },
26 ],
27 },
28 async rewrites() {
29 return [
30 {
31 source: '/u/script.js',
32 destination: 'https://u.a11y.nl/script.js',
33 },
34 {
35 source: '/u/api/send',
36 destination: 'https://u.a11y.nl/api/send',
37 },
38 ];
39 },
40 async redirects() {
41 return [
42 {
43 source: '/profile/:handle',
44 destination: '/p/:handle',
45 permanent: true,
46 },
47 {
48 source: '/p/:handle/edit',
49 destination: '/p/:handle',
50 permanent: true,
51 },
52 {
53 source: '/find-people',
54 destination: '/search',
55 permanent: true,
56 },
57 ];
58 },
59 async headers() {
60 const sharedSecurityHeaders = [
61 { key: 'X-Content-Type-Options', value: 'nosniff' },
62 { key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
63 { key: 'Permissions-Policy', value: 'camera=(), microphone=(), geolocation=()' },
64 {
65 key: 'Strict-Transport-Security',
66 value: 'max-age=63072000; includeSubDomains; preload',
67 },
68 ];
69
70 return [
71 {
72 source: '/embed/:handleOrDid',
73 headers: [
74 ...sharedSecurityHeaders,
75 {
76 key: 'Content-Security-Policy',
77 value:
78 "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self'; connect-src 'self' https://sifa.id https://public.api.bsky.app https://errors.sifa.id; frame-ancestors *;",
79 },
80 ],
81 },
82 {
83 source: '/((?!embed/).*)',
84 headers: [
85 ...sharedSecurityHeaders,
86 { key: 'X-Frame-Options', value: 'DENY' },
87 {
88 key: 'Content-Security-Policy',
89 value:
90 "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self'; connect-src 'self' https://sifa.id https://public.api.bsky.app https://errors.sifa.id; frame-ancestors 'none';",
91 },
92 ],
93 },
94 ];
95 },
96};
97
98export default withSentryConfig(withNextIntl(nextConfig), {
99 silent: true,
100 telemetry: false,
101 sourcemaps: { disable: true },
102});