54 lines
1.5 KiB
Markdown
54 lines
1.5 KiB
Markdown
# FuckingChat 🔒
|
|
|
|
Encrypted chat with channel support. Messages are encrypted at rest using Fernet (PBKDF2 + SHA256).
|
|
|
|
## Channels
|
|
|
|
- 💬 **General** — general discussion
|
|
- 🎮 **Games** — gaming chat
|
|
- 🎌 **Anime** — anime & manga
|
|
- ⚖️ **Politics** — politics discussion
|
|
|
|
## Setup
|
|
|
|
```bash
|
|
# Install dependencies
|
|
pip install bottle cryptography sqlalchemy
|
|
|
|
# Run (development)
|
|
python index.py
|
|
|
|
# Run (production - recommended)
|
|
CHAT_SECRET="your-strong-secret" \
|
|
CHAT_SALT="your-random-salt" \
|
|
CHAT_ADMIN_TOKEN="your-admin-token" \
|
|
CHAT_RATE_LIMIT=5 \
|
|
CHAT_HOST=0.0.0.0 \
|
|
CHAT_PORT=8080 \
|
|
python index.py
|
|
```
|
|
|
|
## Environment Variables
|
|
|
|
| Variable | Default | Description |
|
|
|---|---|---|
|
|
| `CHAT_SECRET` | `default_secret_change_me` | Encryption key |
|
|
| `CHAT_SALT` | `default_salt_change_me` | PBKDF2 salt |
|
|
| `CHAT_ADMIN_TOKEN` | (none) | Token for DELETE API |
|
|
| `CHAT_RATE_LIMIT` | `5` | Max messages per window |
|
|
| `CHAT_RATE_WINDOW` | `10` | Rate limit window (seconds) |
|
|
| `CHAT_MAX_MSG` | `2000` | Max message length |
|
|
| `CHAT_DB_PATH` | `./chat.db` | SQLite database path |
|
|
| `CHAT_HOST` | `localhost` | Listen address |
|
|
| `CHAT_PORT` | `8080` | Listen port |
|
|
| `CHAT_DEBUG` | `0` | Debug mode (set to `1` for dev) |
|
|
|
|
## Security Features
|
|
|
|
- ✅ Messages encrypted at rest (AES via Fernet)
|
|
- ✅ Rate limiting (configurable)
|
|
- ✅ IP hashing (privacy)
|
|
- ✅ XSS protection (HTML tag stripping)
|
|
- ✅ Admin token required for deletion
|
|
- ✅ No debug mode in production
|