-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.mjs
120 lines (117 loc) · 3.1 KB
/
next.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import nextra from 'nextra'
import {withPlausibleProxy} from "next-plausible";
const withNextra = nextra({
theme: 'nextra-theme-docs',
themeConfig: './theme.config.tsx',
staticImage: true,
latex: true,
defaultShowCopyCode: true
})
const securityHeaders = [
{
key: 'X-DNS-Prefetch-Control',
value: 'on'
},
{
key: 'X-XSS-Protection',
value: '1; mode=block'
},
{
key: 'X-Frame-Options',
value: 'SAMEORIGIN'
},
{
key: 'X-Content-Type-Options',
value: 'nosniff'
},
{
key: 'Content-Security-Policy',
value: "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; object-src 'none'; base-uri 'self'; connect-src 'self' https://discord.com https://api.mineskin.org; font-src 'self'; frame-src 'self' https://www.youtube.com; img-src 'self' data: blob: https://avatars.githubusercontent.com https://img.shields.io https://github.com; manifest-src 'self'; media-src 'self'; worker-src 'self';"
}
]
export default withPlausibleProxy({
customDomain: process.env.PLAUSIBLE_URL
})(withNextra({
reactStrictMode: true,
images: {
remotePatterns: [{
hostname: 'avatars.githubusercontent.com',
protocol: 'https',
}, {
hostname: 'github.com',
protocol: 'https',
}]
},
redirects: async () => {
return [
{
source: '/discord',
destination: process.env.NEXT_PUBLIC_DISCORD_LINK ?? "",
permanent: false,
},
{
source: '/github',
destination: process.env.NEXT_PUBLIC_GITHUB_LINK ?? "",
permanent: false,
},
{
source: '/spigot',
destination: process.env.NEXT_PUBLIC_SPIGOT_LINK ?? "",
permanent: false,
},
{
source: '/donate',
destination: process.env.NEXT_PUBLIC_DONATE_LINK ?? "",
permanent: false,
},
{
source: '/bstats',
destination: process.env.NEXT_PUBLIC_BSTATS_LINK ?? "",
permanent: false,
},
{
source: '/perms',
destination: "/docs/configuration/commands-permissions",
permanent: false,
},
{
source: '/skinurl',
destination: "/docs/features/skin-url",
permanent: false,
},
{
source: '/unicode',
destination: "https://www.mobilefish.com/services/unicode_escape_sequence_converter/unicode_escape_sequence_converter.php",
permanent: false,
},
{
source: '/firewall',
destination: "/docs/troubleshooting",
permanent: false,
},
{
source: '/install',
destination: "/docs/installation",
permanent: false,
},
{
source: '/contributors',
destination: `${process.env.NEXT_PUBLIC_GITHUB_LINK ?? ""}/graphs/contributors`,
permanent: false,
},
{
source: '/docs/troubleshooting/cannot-fetch-new-skins',
destination: "/docs/troubleshooting/firewall",
permanent: false,
}
]
},
async headers() {
return [
{
source: '/:path*',
headers: securityHeaders
}
]
}
}))