Enhance README with CLI room checking instructions and implement room name resolution in command handling. Updated handle_init_command and handle_join_command to use resolved room names, improving room access validation. Added CLI command handling in main.rs to list available rooms from the database or fallback configuration.

This commit is contained in:
Torsten Schulz (local)
2026-03-04 17:55:53 +01:00
parent aca290f1d0
commit 9478e6a91a
4 changed files with 105 additions and 23 deletions

View File

@@ -108,6 +108,24 @@ In `YourPart3/backend/config/chatBridge.json` sollte stehen:
Dann verbindet sich die bestehende Bridge (`chatTcpBridge.js`) direkt mit `yourchat2`.
## Raeume per CLI pruefen
Die Raumdefinitionen kommen aus `chat.room` (bei gesetztem `CHAT_DB_URL`).
Ohne DB-Verbindung gibt es einen Fallback mit `lobby`.
Pruefen auf Kommandozeile:
```bash
cd /home/tsschulz/Programs/yourchat2
CHAT_DB_URL='postgres://user:pass@host:5432/dbname' ./target/release/yourchat2 --list-rooms
```
Wenn der Service ueber systemd laeuft und die Variablen in `/etc/yourchat2/yourchat2.env` stehen:
```bash
sudo -u tsschulz bash -lc 'set -a; source /etc/yourchat2/yourchat2.env; set +a; /usr/local/bin/yourchat2 --list-rooms'
```
## Systemd (optional)
Es liegt eine Produktions-nahe Unit-Datei `yourchat2.service` im Projekt.