Skip to content

Commit

Permalink
Restrict nextjs Image to processor asssets
Browse files Browse the repository at this point in the history
  • Loading branch information
kasbah committed Sep 24, 2024
1 parent 9ce1a2a commit 92a91f5
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const {
module.exports = async phase => {
let meiliSearchOnlyKey = {}
let imageDomains = []
// leaving out these steps for build and test phases
if ([PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_SERVER].includes(phase)) {
// the search-only api key gets generated by meili so we have to retrieve
// it at runtime rather than use an env variable
Expand All @@ -19,14 +20,8 @@ module.exports = async phase => {
meiliSearchOnlyKey = meiliKeys.results.find(
key => key.actions.length === 1 && key.actions[0] === 'search',
)

imageDomains = [
// TODO: use a wildcard when https://github.com/vercel/next.js/pull/27345 get merged
`gitea.${process.env.KITSPACE_DOMAIN}`,
new URL(process.env.KITSPACE_PROCESSOR_ASSET_URL).hostname,
'github.com',
'raw.githubusercontent.com',
'secure.gravatar.com',
]
}
/**
Expand Down

0 comments on commit 92a91f5

Please sign in to comment.