-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
181 lines (175 loc) · 5.83 KB
/
next.config.js
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
/* eslint-disable @typescript-eslint/no-var-requires */
const bundleAnalyzer = require("@next/bundle-analyzer")
const transpiler = require("next-transpile-modules")
const { createSecureHeaders } = require("next-secure-headers")
const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE === "true",
})
const withTranspiler = transpiler(["@roninnetwork/walletgo"])
const cspSecurityHeaders = createSecureHeaders({
xssProtection: "block-rendering",
contentSecurityPolicy: {
directives: {
baseURI: `'self'`,
defaultSrc: [
`'self'`,
// `'unsafe-inline'`,
`'unsafe-eval'`,
"*.walletconnect.com",
"*.walletconnect.org",
"*.axieinfinity.com",
"cdn.axieinfinity.com",
"*.googletagmanager.com",
"*.google-analytics.com",
],
scriptSrc: [
`'self'`,
// `'unsafe-inline'`,
`'unsafe-eval'`,
`'nonce-0242ab120002'`,
"*.walletconnect.com",
"*.walletconnect.org",
"*.axieinfinity.com",
"cdn.axieinfinity.com",
"*.googletagmanager.com",
"*.google-analytics.com",
"*.geevisit.com",
"*.geetest.com",
],
styleSrc: [
`'self'`,
`'unsafe-inline'`,
"*.walletconnect.com",
"*.walletconnect.org",
"*.axieinfinity.com",
"cdn.axieinfinity.com",
"fonts.googleapis.com",
"*.geetest.com",
],
styleSrcAttr: [
`'self'`,
`'unsafe-inline'`,
"*.walletconnect.com",
"*.axieinfinity.com",
"cdn.axieinfinity.com",
"*.walletconnect.org",
"fonts.googleapis.com",
"*.geetest.com",
],
styleSrcElem: [
`'self'`,
`'unsafe-inline'`,
"*.walletconnect.com",
"cdn.axieinfinity.com",
"*.axieinfinity.com",
"*.walletconnect.org",
"fonts.googleapis.com",
"*.geetest.com",
],
objectSrc: ["cdn.axieinfinity.com/marketplace-website/accessories"],
imgSrc: [
`'self'`,
" data:",
"cdn.axieinfinity.com",
"*.axieinfinity.com",
"*.walletconnect.com",
"*.walletconnect.org",
"*.google-analytics.com",
"*.analytics.google.com",
"*.googletagmanager.com",
"*.g.doubleclick.net",
"*.google.com",
"storage.googleapis.com",
"cdn.skymavis.com",
"axiecdn.axieinfinity.com",
"assets.axieinfinity.com",
"ipfs.io/ipfs/bafybeiam4m5mjsyxqx74cpkxb3x3em2rye4ghsgruoxiemzr6lkxvzlypa/",
"ipfs.io/ipfs/bafybeibkxkfzqj7yyfs2bwlef47n2f3l7kk2xiux445avhxlbfgnfi4oze/",
"https://bafybeifikbw5ng7hvkd6dewqbofybowqqa6hd2ol7ctxwodkkcqryyldby.ipfs.nftstorage.link/MetaLend%20NFT%20-%20TOP%2010.gif",
"https://bafybeifikbw5ng7hvkd6dewqbofybowqqa6hd2ol7ctxwodkkcqryyldby.ipfs.nftstorage.link/MetaLend%20NFT%20-%2010-25.gif",
"https://bafybeifikbw5ng7hvkd6dewqbofybowqqa6hd2ol7ctxwodkkcqryyldby.ipfs.nftstorage.link/MetaLend%20NFT%20-%2025%2B.gif",
"https://cdn-marketplace.skymavis.com/axiechat/NFTImage2023.jpeg",
"*.geetest.com",
],
frameSrc: [`'self'`, "verify.walletconnect.com"],
frameAncestors: ["multisig.roninchain.com"],
fontSrc: [`'self'`, "fonts.gstatic.com", "*.axieinfinity.com", "cdn.axieinfinity.com"],
connectSrc: [
`'self'`,
"*.walletconnect.com",
"ws://*.walletconnect.org",
"*.walletconnect.org",
"wss://*.walletconnect.org",
"wss://*.walletconnect.com",
"*.axieinfinity.com",
"cdn.axieinfinity.com",
"*.google-analytics.com",
"*.analytics.google.com",
"*.googletagmanager.com",
"*.g.doubleclick.net",
"*.google.com",
"api.roninchain.com",
"explorer-api.roninchain.com",
"explorer-api-pre.roninchain.com",
"testnet-explorer-api.skymavis.one",
"thegraph.roninchain.com",
"thegraph.axieinfinity.co",
"testnet.skymavis.one",
"exchange-rate.skymavis.one",
"exchange-rate.axieinfinity.com",
"decoder-mainnet.skymavis.one",
"decoder-mainnet.roninchain.com",
"decoder-testnet.roninchain.com",
"decoder-testnet.skymavis.one",
"origin-dev.skymavis.one",
"game-api-origin.skymavis.com",
"explorer-kintsugi.skymavis.one",
"explorer-kintsugi.roninchain.com",
"testnet-explorer-api-v3.skymavis.one",
"explorer-api-v3.skymavis.one",
"explorerv3-api.roninchain.com",
"explorer-api.default.svc.cluster.local:8999",
"storage.googleapis.com",
"cdn.axieinfinity.com",
"saigon-thegraph.roninchain.com",
"hcm-devnet.skymavis.one",
"hcm-explorer-api.skymavis.one",
"supply-api.roninchain.com",
"api.thegraph.com",
"thegraph-v2.roninchain.com",
"indexer.roninchain.com",
"ronstakingcalculator.vercel.app",
"saigon-testnet.roninchain.com",
"saigon-indexer.roninchain.com",
"captcha-stag.skymavis.one",
"captcha.axieinfinity.com",
"*.geevisit.com",
"*.geetest.com",
],
mediaSrc: [`'self'`, " data:", "cdn.axieinfinity.com", "*.axieinfinity.com"],
prefetchSrc: [
`'self'`,
"*.walletconnect.com",
"*.walletconnect.org",
"*.geetest.com",
"*.walletconnect.org",
"cdn.axieinfinity.com",
"*.axieinfinity.com",
"fonts.googleapis.com",
"fonts.gstatic.com",
"*.geetest.com",
],
},
},
})
module.exports = withBundleAnalyzer(
withTranspiler({
images: {
dangerouslyAllowSVG: false,
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox; style-src 'none",
},
async headers() {
return [{ source: "/(.*)", headers: cspSecurityHeaders }]
},
}),
)