From ab597010fde7cafa349f6e0b4e4f6d51e68ab563 Mon Sep 17 00:00:00 2001 From: rattatwinko Date: Sat, 23 Aug 2025 22:59:10 +0200 Subject: [PATCH] did some fixes --- src/app.py | 6 +++--- src/static/script.js | 4 ++-- src/templates/chat.html | 4 +++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/app.py b/src/app.py index ebb9674..9eb99f4 100644 --- a/src/app.py +++ b/src/app.py @@ -25,11 +25,11 @@ app.config['SECRET_KEY'] = os.environ.get('SECRET_KEY', 'dev-secret-key-change-i socketio = SocketIO(app, cors_allowed_origins="*", async_mode='eventlet') # Security constants -MAX_MESSAGES = 256 +MAX_MESSAGES = 512 MAX_ROOM_ID_LENGTH = 32 MAX_MESSAGE_SIZE = 8192 # 8KB max encrypted message -MAX_ROOMS_PER_IP = 5 -MAX_USERS_PER_ROOM = 50 +MAX_ROOMS_PER_IP = 100 +MAX_USERS_PER_ROOM = 1000 ROOM_CLEANUP_INTERVAL = 3600 # 1 hour USER_SESSION_TIMEOUT = 3600 # 1 hour diff --git a/src/static/script.js b/src/static/script.js index d26f003..62a6910 100644 --- a/src/static/script.js +++ b/src/static/script.js @@ -17,11 +17,11 @@ let lastMessageTime = 0; let messageQueue = []; let isConnected = false; let reconnectAttempts = 0; -const MAX_RECONNECT_ATTEMPTS = 5; +const MAX_RECONNECT_ATTEMPTS = 10; const MESSAGE_RATE_LIMIT = 1000; const MAX_MESSAGE_LENGTH = 4000; const MAX_ROOM_ID_LENGTH = 32; -const MAX_MESSAGES = 256; +const MAX_MESSAGES = 512; // Security utilities const SecurityUtils = { diff --git a/src/templates/chat.html b/src/templates/chat.html index 5e116ad..3a7bdc4 100644 --- a/src/templates/chat.html +++ b/src/templates/chat.html @@ -17,7 +17,9 @@
E2E Encrypted