added stealth mode

This commit is contained in:
preeperkiller
2025-02-28 17:54:17 +01:00
parent 8f80ddcc23
commit 8c5adb2dac
5 changed files with 24 additions and 1 deletions
+12
View File
@@ -107,6 +107,9 @@ app.get('/share/:type(photo|video)/:key/:id/:size?', decodeCookie, async (req, r
// Check for valid key and ID
if (!immich.isKey(req.params.key) || !immich.isId(req.params.id)) {
log('Invalid key or ID for ' + req.path)
if (getConfigOption('ipp.stealthMode', true)) {
res.destroy();
}
res.status(404).send()
return
}
@@ -114,6 +117,9 @@ app.get('/share/:type(photo|video)/:key/:id/:size?', decodeCookie, async (req, r
// Validate the size parameter
if (req.params.size && !Object.values(ImageSize).includes(req.params.size as ImageSize)) {
log('Invalid size parameter ' + req.path)
if (getConfigOption('ipp.stealthMode', true)) {
res.destroy();
}
res.status(404).send()
return
}
@@ -135,6 +141,9 @@ app.get('/share/:type(photo|video)/:key/:id/:size?', decodeCookie, async (req, r
}
} else {
log('No asset found for ' + req.path)
if (getConfigOption('ipp.stealthMode', true)) {
res.destroy();
}
res.status(404).send()
}
})
@@ -160,6 +169,9 @@ if (getConfigOption('ipp.showHomePage', true)) {
*/
app.get('*', (req, res) => {
log('Invalid route ' + req.path)
if (getConfigOption('ipp.stealthMode', true)) {
res.destroy();
}
res.status(404).send()
})