did some fixes

This commit is contained in:
2025-08-23 22:59:10 +02:00
parent e2aad6903f
commit ab597010fd
3 changed files with 8 additions and 6 deletions

View File

@@ -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') socketio = SocketIO(app, cors_allowed_origins="*", async_mode='eventlet')
# Security constants # Security constants
MAX_MESSAGES = 256 MAX_MESSAGES = 512
MAX_ROOM_ID_LENGTH = 32 MAX_ROOM_ID_LENGTH = 32
MAX_MESSAGE_SIZE = 8192 # 8KB max encrypted message MAX_MESSAGE_SIZE = 8192 # 8KB max encrypted message
MAX_ROOMS_PER_IP = 5 MAX_ROOMS_PER_IP = 100
MAX_USERS_PER_ROOM = 50 MAX_USERS_PER_ROOM = 1000
ROOM_CLEANUP_INTERVAL = 3600 # 1 hour ROOM_CLEANUP_INTERVAL = 3600 # 1 hour
USER_SESSION_TIMEOUT = 3600 # 1 hour USER_SESSION_TIMEOUT = 3600 # 1 hour

View File

@@ -17,11 +17,11 @@ let lastMessageTime = 0;
let messageQueue = []; let messageQueue = [];
let isConnected = false; let isConnected = false;
let reconnectAttempts = 0; let reconnectAttempts = 0;
const MAX_RECONNECT_ATTEMPTS = 5; const MAX_RECONNECT_ATTEMPTS = 10;
const MESSAGE_RATE_LIMIT = 1000; const MESSAGE_RATE_LIMIT = 1000;
const MAX_MESSAGE_LENGTH = 4000; const MAX_MESSAGE_LENGTH = 4000;
const MAX_ROOM_ID_LENGTH = 32; const MAX_ROOM_ID_LENGTH = 32;
const MAX_MESSAGES = 256; const MAX_MESSAGES = 512;
// Security utilities // Security utilities
const SecurityUtils = { const SecurityUtils = {

View File

@@ -17,7 +17,9 @@
<div class="chat-header"> <div class="chat-header">
<div class="header-content"> <div class="header-content">
<div class="logo"> <div class="logo">
<a href="/" style="text-decoration: none; font-weight: inherit; font-style: inherit; color: inherit;">
ByteChat ByteChat
</a>
</div> </div>
<div class="encryption-badge" id="encryptionBadge"> <div class="encryption-badge" id="encryptionBadge">
E2E Encrypted E2E Encrypted