Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ nul
npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn-error.log*
.pnpm-debug.log*
*.log

# Local env files
.env
Expand Down
16 changes: 8 additions & 8 deletions packages/api/src/middleware/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ const ipTrackingStore = new Map<string, IPRecord>();

// DDoS Protection Constants
const DDOS_CONFIG = {
maxRequestsPerMinute: 120, // Max requests per minute per IP
suspiciousThreshold: 100, // Requests that trigger suspicious flag
blockDurationMs: 5 * 60 * 1000, // 5 minutes block for suspicious IPs
burstThreshold: 30, // Max requests in 5 seconds
burstWindowMs: 5 * 1000, // 5 second burst window
cleanupIntervalMs: 60 * 1000, // Cleanup every minute
maxRequestsPerMinute: 3000, // Increased for venue WiFi (100 judges @ 30rpm)
suspiciousThreshold: 2000,
blockDurationMs: 5 * 60 * 1000,
burstThreshold: 500, // Allow 100 concurrent page loads
burstWindowMs: 5 * 1000,
cleanupIntervalMs: 60 * 1000,
};

// Cleanup expired records
Expand Down Expand Up @@ -106,8 +106,8 @@ export function rateLimit(

export const RATE_LIMITS = {
public: {
maxTokens: 30,
refillRate: 0.5,
maxTokens: 1000,
refillRate: 50,
queryTokens: 1,
mutationTokens: 3,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/trpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const publicProcedure = t.procedure
});
}

const identifier = ctx.userId || `anon-${ctx.session?.user?.id || 'unknown'}`;
const identifier = ctx.userId || `ip-${ctx.clientIp}`;
const config = RATE_LIMITS.public;
const tokens = type === 'mutation' ? config.mutationTokens : config.queryTokens;

Expand Down
92 changes: 0 additions & 92 deletions sites/mainweb/components/Card/index.tsx

This file was deleted.

40 changes: 0 additions & 40 deletions sites/mainweb/components/EventCard/index.tsx

This file was deleted.

50 changes: 0 additions & 50 deletions sites/mainweb/components/InlineRadioInput/index.tsx

This file was deleted.

102 changes: 0 additions & 102 deletions sites/mainweb/components/InputField/index.tsx

This file was deleted.

38 changes: 0 additions & 38 deletions sites/mainweb/components/LearnMore/LearnMore.tsx

This file was deleted.

Loading
Loading