Update v1.1.1-beta1
This commit is contained in:
@@ -32,9 +32,42 @@ function sendDiscordWebhook(url, req, statusCode) {
|
||||
const allowedIps = setupData[0].allowedIps || [];
|
||||
const ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
|
||||
|
||||
// Skip monitoring for localhost/local IPs
|
||||
const localIps = ['127.0.0.1', '::1', 'localhost', '::ffff:127.0.0.1'];
|
||||
if (localIps.includes(ip)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Skip monitoring for Chrome DevTools requests
|
||||
if (req.originalUrl.includes('.well-known/appspecific/com.chrome.devtools.json')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Skip monitoring for legitimate API endpoints
|
||||
const legitimateEndpoints = [
|
||||
'/api/dpanel/dashboard/profilpicture',
|
||||
'/api/dpanel/dashboard/backgroundcustom',
|
||||
'/api/dpanel/collaboration',
|
||||
'/api/dpanel/users/search',
|
||||
'/dpanel/dashboard/profil',
|
||||
'/build-metadata',
|
||||
'/api/dpanel/collaboration/add',
|
||||
'/api/dpanel/collaboration/remove',
|
||||
'/api/dpanel/collaboration/users'
|
||||
];
|
||||
|
||||
if (legitimateEndpoints.some(endpoint => req.originalUrl.includes(endpoint))) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Skip monitoring if IP is allowed
|
||||
if (isIpAllowed(ip, allowedIps)) {
|
||||
return;
|
||||
} else {
|
||||
}
|
||||
|
||||
// Skip monitoring for authenticated users on dashboard routes
|
||||
if (req.user && req.originalUrl.startsWith('/dpanel/dashboard')) {
|
||||
return;
|
||||
}
|
||||
|
||||
const fullUrl = `${req.protocol}://${req.get('host')}${req.originalUrl}`;
|
||||
|
||||
Reference in New Issue
Block a user