Fix jwt-token

This commit is contained in:
2025-09-10 12:18:12 +02:00
parent bbe05b0aa4
commit 5beff6b512
3 changed files with 7 additions and 1 deletions

4
.env
View File

@@ -36,6 +36,10 @@ LOG_ALL_DETECTIONS=true
API_DEBUG=true
STORE_RAW_PAYLOAD=true
# Rate Limiting Configuration
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=1000
# Health Probe Simulator Configuration
PROBE_FAILRATE=30
PROBE_INTERVAL_SECONDS=60

View File

@@ -69,6 +69,8 @@ services:
STORE_DRONE_TYPE0: ${STORE_DRONE_TYPE0:-false}
LOG_ALL_DETECTIONS: ${LOG_ALL_DETECTIONS:-false}
STORE_RAW_PAYLOAD: ${STORE_RAW_PAYLOAD:-false}
RATE_LIMIT_WINDOW_MS: ${RATE_LIMIT_WINDOW_MS:-900000}
RATE_LIMIT_MAX_REQUESTS: ${RATE_LIMIT_MAX_REQUESTS:-1000}
ports:
- "3002:3001"
volumes:

View File

@@ -34,7 +34,7 @@ const io = new Server(server, {
// Rate limiting (exclude detections endpoint for testing)
const limiter = rateLimit({
windowMs: parseInt(process.env.RATE_LIMIT_WINDOW_MS) || 15 * 60 * 1000, // 15 minutes
max: parseInt(process.env.RATE_LIMIT_MAX_REQUESTS) || 100,
max: parseInt(process.env.RATE_LIMIT_MAX_REQUESTS) || 1000, // Increased from 100 to 1000
message: 'Too many requests from this IP, please try again later.',
skip: (req) => {
// Skip rate limiting for drone detection endpoints during testing