Update README.md
This commit is contained in:
71
README.md
71
README.md
@@ -141,41 +141,74 @@ python client.py
|
||||
Edit the `.env` file to configure the server:
|
||||
|
||||
```env
|
||||
# Server Configuration
|
||||
HOST=0.0.0.0 # Bind to all interfaces
|
||||
PORT=8765 # WebSocket port
|
||||
MAX_HISTORY=100 # Messages to keep in history
|
||||
# ==============================================================================
|
||||
# Chat Server Example Configuration
|
||||
# Copy this file to .env and adjust the values for your environment
|
||||
# ==============================================================================
|
||||
|
||||
# Admin Configuration
|
||||
ADMIN_PASSWORD=admin123 # Change this!
|
||||
# -----------------
|
||||
# Server Settings
|
||||
# -----------------
|
||||
HOST=0.0.0.0
|
||||
PORT=8765
|
||||
|
||||
# SSL Configuration (optional)
|
||||
# -----------------
|
||||
# Security & Auth
|
||||
# -----------------
|
||||
# The global administrator password for top-level commands (/admin)
|
||||
ADMIN_PASSWORD=admin123
|
||||
|
||||
# (Optional) SSL/TLS Configuration
|
||||
USE_SSL=false
|
||||
SSL_CERT_PATH=/path/to/cert.pem
|
||||
SSL_KEY_PATH=/path/to/key.pem
|
||||
SSL_CERT_PATH=
|
||||
SSL_KEY_PATH=
|
||||
|
||||
# Database
|
||||
DB_PATH=chat.db
|
||||
# -----------------
|
||||
# Database & State
|
||||
# -----------------
|
||||
# Location of the server SQLite database
|
||||
DB_PATH=data/chat.db
|
||||
|
||||
# Logging
|
||||
# -----------------
|
||||
# Operations & Logs
|
||||
# -----------------
|
||||
LOG_LEVEL=INFO
|
||||
LOG_FILE=chat_server.log
|
||||
LOG_FILE=logs/chat_server.log
|
||||
|
||||
# Security
|
||||
# -----------------
|
||||
# Chat Parameters
|
||||
# -----------------
|
||||
# Maximum messages sent back to clients upon joining a room
|
||||
MAX_HISTORY=100
|
||||
MAX_MESSAGE_LENGTH=4096
|
||||
MAX_NICKNAME_LENGTH=32
|
||||
|
||||
# Anti-Spam limits
|
||||
RATE_LIMIT_MESSAGES=120
|
||||
RATE_LIMIT_WINDOW=60
|
||||
|
||||
# Session
|
||||
# -----------------
|
||||
# Maintenance
|
||||
# -----------------
|
||||
# Delete unused/empty rooms after this many hours
|
||||
ROOM_EXPIRATION_HOURS=24
|
||||
# Whether to automatically delete very old message history from the DB periodically
|
||||
AUTO_HISTORY_CLEAR=false
|
||||
|
||||
# -----------------
|
||||
# Backups
|
||||
# -----------------
|
||||
BACKUP_DIR=backups
|
||||
AUTO_BACKUP_ENABLED=false
|
||||
AUTO_BACKUP_INTERVAL=86400
|
||||
|
||||
# -----------------
|
||||
# Network & Timeout
|
||||
# -----------------
|
||||
SESSION_TIMEOUT=3600
|
||||
KEEPALIVE_INTERVAL=30
|
||||
RECONNECT_TIMEOUT=300
|
||||
|
||||
# Backups
|
||||
BACKUP_DIR=./backups
|
||||
AUTO_BACKUP_ENABLED=false
|
||||
AUTO_BACKUP_INTERVAL=86400
|
||||
```
|
||||
|
||||
## 🎮 Usage
|
||||
|
||||
Reference in New Issue
Block a user