Skip to content

Commit 0f8a3ea

Browse files
committed
rate limiting increased and logs removed from git ignore
1 parent 08d1ee6 commit 0f8a3ea

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

server/.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ Thumbs.db
2828

2929
# Temporary files
3030
tmp/
31-
temp/
31+
temp/
32+
33+
# Logs
34+
*.log

server/middleware/rateLimiter.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const rateLimit = require('express-rate-limit');
33
// General API rate limiter - applies to all API routes
44
const generalLimiter = rateLimit({
55
windowMs: 15 * 60 * 1000, // 15 minutes
6-
max: 200, // Limit each IP to 100 requests per windowMs
6+
max: 300, // Limit each IP to 300 requests per windowMs
77
message: {
88
error: 'Too many requests from this IP, please try again later.',
99
retryAfter: '15 minutes'
@@ -21,7 +21,7 @@ const generalLimiter = rateLimit({
2121
// Strict rate limiter for authentication endpoints
2222
const authLimiter = rateLimit({
2323
windowMs: 15 * 60 * 1000, // 15 minutes
24-
max: 10, // Limit each IP to 5 login attempts per windowMs
24+
max: 300, // Limit each IP to 300 login attempts per windowMs
2525
message: {
2626
error: 'Too many authentication attempts, please try again later.',
2727
retryAfter: '15 minutes'
@@ -40,7 +40,7 @@ const authLimiter = rateLimit({
4040
// Strict rate limiter for user registration
4141
const registerLimiter = rateLimit({
4242
windowMs: 60 * 60 * 1000, // 1 hour
43-
max: 6, // Limit each IP to 3 registration attempts per hour
43+
max: 20, // Limit each IP to 20 registration attempts per hour
4444
message: {
4545
error: 'Too many registration attempts, please try again later.',
4646
retryAfter: '1 hour'
@@ -58,7 +58,7 @@ const registerLimiter = rateLimit({
5858
// Moderate rate limiter for user management endpoints
5959
const userManagementLimiter = rateLimit({
6060
windowMs: 15 * 60 * 1000, // 15 minutes
61-
max: 40, // Limit each IP to 20 requests per windowMs
61+
max: 300, // Limit each IP to 300 requests per windowMs
6262
message: {
6363
error: 'Too many user management requests, please try again later.',
6464
retryAfter: '15 minutes'
@@ -76,7 +76,7 @@ const userManagementLimiter = rateLimit({
7676
// Rate limiter for file uploads
7777
const uploadLimiter = rateLimit({
7878
windowMs: 15 * 60 * 1000, // 15 minutes
79-
max: 20, // Limit each IP to 10 uploads per windowMs
79+
max: 300, // Limit each IP to 300 uploads per windowMs
8080
message: {
8181
error: 'Too many file uploads, please try again later.',
8282
retryAfter: '15 minutes'
@@ -94,7 +94,7 @@ const uploadLimiter = rateLimit({
9494
// Rate limiter for search endpoints
9595
const searchLimiter = rateLimit({
9696
windowMs: 1 * 60 * 1000, // 1 minute
97-
max: 60, // Limit each IP to 30 search requests per minute
97+
max: 300, // Limit each IP to 300 search requests per minute
9898
message: {
9999
error: 'Too many search requests, please try again later.',
100100
retryAfter: '1 minute'
@@ -112,7 +112,7 @@ const searchLimiter = rateLimit({
112112
// Rate limiter for order operations
113113
const orderLimiter = rateLimit({
114114
windowMs: 15 * 60 * 1000, // 15 minutes
115-
max: 20, // Limit each IP to 15 order operations per windowMs
115+
max: 300, // Limit each IP to 300 order operations per windowMs
116116
message: {
117117
error: 'Too many order operations, please try again later.',
118118
retryAfter: '15 minutes'

0 commit comments

Comments
 (0)