Files
IRC-kosmi-relay/docs/setup/QUICK_REFERENCE.md

205 lines
5.2 KiB
Markdown
Raw Normal View History

2025-10-31 16:17:04 -04:00
# Quick Reference Guide
## Running the Bridge
2025-10-31 16:17:04 -04:00
### Build and Run Locally
2025-10-31 16:17:04 -04:00
```bash
cd /Users/erikfredericks/dev-ai/HSO/irc-kosmi-relay
go build -o matterbridge .
./matterbridge -conf matterbridge.toml
```
### Run with Docker
```bash
docker-compose up -d
docker-compose logs -f
2025-10-31 16:17:04 -04:00
```
### Expected Output (Success)
```
INFO Connecting to Kosmi
INFO Extracted room ID: @yourroom
INFO No credentials provided, using anonymous access
INFO Successfully connected to Kosmi
INFO Connection succeeded (IRC)
INFO Gateway(s) started successfully. Now relaying messages
2025-10-31 16:17:04 -04:00
```
If using email/password authentication:
2025-10-31 16:17:04 -04:00
```
INFO Authenticating with email/password...
INFO ✅ Authentication successful
INFO Successfully connected to Kosmi
2025-10-31 16:17:04 -04:00
```
## Key Status Indicators
| Log Message | Meaning |
|-------------|---------|
| `Successfully connected to Kosmi` | Native WebSocket connection established |
| `Connection succeeded (IRC)` | IRC bridge is connected |
| `Gateway(s) started successfully` | All bridges up, relay is active |
| `✅ Using cached token` | Reusing saved JWT (no browser needed) |
| `✅ Authentication successful` | Browser login completed |
| `Kosmi connection lost unexpectedly` | WebSocket dropped, auto-reconnect triggered |
2025-10-31 16:17:04 -04:00
## IRC Commands
2025-10-31 16:17:04 -04:00
| Command | Action |
|---------|--------|
| `!kreconnect` | Reconnect Kosmi bridge |
| `!jreconnect` | Reconnect Jackbox WebSocket |
| `!reconnect` | Reconnect all non-IRC services |
| `!votes` | Show current game vote tally |
2025-10-31 16:17:04 -04:00
See [IRC.md](../IRC.md) for full details including vote syntax and ticker symbols.
2025-10-31 16:17:04 -04:00
## Configuration
### Minimal Configuration
2025-10-31 16:17:04 -04:00
```toml
[kosmi.myroom]
RoomURL="https://app.kosmi.io/room/@yourroom"
2025-10-31 16:17:04 -04:00
[irc.myserver]
Server="irc.libera.chat:6697"
2025-10-31 16:17:04 -04:00
Nick="kosmi-relay"
UseTLS=true
2025-10-31 16:17:04 -04:00
[[gateway]]
name="kosmi-irc"
enable=true
[[gateway.inout]]
account="kosmi.myroom"
2025-10-31 16:17:04 -04:00
channel="main"
[[gateway.inout]]
account="irc.myserver"
2025-10-31 16:17:04 -04:00
channel="#your-channel"
```
### With Authentication
2025-10-31 16:17:04 -04:00
```toml
[kosmi.myroom]
RoomURL="https://app.kosmi.io/room/@yourroom"
Email="your-email@example.com"
Password="your-password"
2025-10-31 16:17:04 -04:00
```
### With Jackbox Integration
2025-10-31 16:17:04 -04:00
```toml
[jackbox]
Enabled=true
APIURL="https://your-jackbox-api.example.com"
AdminPassword="your_password"
UseWebSocket=true
EnableRoomCodeImage=true
2025-10-31 16:17:04 -04:00
```
## Message Format
2025-10-31 16:17:04 -04:00
### Kosmi --> IRC
2025-10-31 16:17:04 -04:00
```
[kosmi] <username> message text
2025-10-31 16:17:04 -04:00
```
### IRC --> Kosmi
2025-10-31 16:17:04 -04:00
```
[irc] <username> message text
2025-10-31 16:17:04 -04:00
```
Format is controlled by `RemoteNickFormat` in each bridge's config section.
2025-10-31 16:17:04 -04:00
## File Locations
2025-10-31 16:17:04 -04:00
| File | Purpose |
|------|---------|
| `bridge/kosmi/kosmi.go` | Main Kosmi bridge |
| `bridge/kosmi/graphql_ws_client.go` | Native GraphQL WebSocket client |
| `bridge/kosmi/auth.go` | Anonymous login |
| `bridge/kosmi/browser_auth.go` | Chromedp browser login |
| `bridge/kosmi/token_cache.go` | JWT token caching |
| `bridge/irc/handlers.go` | IRC commands and vote detection |
| `bridge/jackbox/client.go` | Jackbox API client |
| `bridge/jackbox/votes.go` | Vote detection logic |
| `matterbridge.toml` | Runtime configuration |
2025-10-31 16:17:04 -04:00
## Common Issues
2025-10-31 16:17:04 -04:00
### Kosmi connection fails
2025-10-31 16:17:04 -04:00
1. Verify `RoomURL` is correct and the room exists
2. Check network connectivity: `curl -I https://app.kosmi.io`
3. Enable debug logging: `-debug` flag
4. Check logs for WebSocket handshake errors
2025-10-31 16:17:04 -04:00
### Authentication fails
2025-10-31 16:17:04 -04:00
1. Verify Chrome/Chromium is installed: `which chromium chromium-browser google-chrome`
2. Check credentials are correct
3. Delete cached token to force fresh login: `rm data/kosmi_token_cache.json`
4. Check for Kosmi UI changes that may break browser automation
2025-10-31 16:17:04 -04:00
### Messages not appearing
2025-10-31 16:17:04 -04:00
1. Confirm both bridges are connected (check logs)
2. Verify gateway config: Kosmi channel must be `"main"`, IRC channel must have `#`
3. Enable debug logging to trace message routing
4. Check for `RemoteNickFormat` issues
2025-10-31 16:17:04 -04:00
### Jackbox votes not registering
2025-10-31 16:17:04 -04:00
1. Verify Jackbox integration is enabled in config
2. Check that an active session exists with games played
3. Confirm messages don't start with `[irc]` or `[kosmi]` prefix (relayed messages skip vote detection)
2025-10-31 16:17:04 -04:00
## CLI Flags
2025-10-31 16:17:04 -04:00
```bash
./matterbridge -conf matterbridge.toml # Specify config file
./matterbridge -debug # Enable debug logging
./matterbridge -muted # Start with Jackbox announcements muted
./matterbridge -version # Show version info
2025-10-31 16:17:04 -04:00
```
## Mute Toggle
2025-10-31 16:17:04 -04:00
Toggle Jackbox announcements at runtime:
2025-10-31 16:17:04 -04:00
```bash
# Local
kill -SIGUSR1 $(pgrep matterbridge)
2025-10-31 16:17:04 -04:00
# Docker
docker kill -s SIGUSR1 kosmi-irc-relay
```
2025-10-31 16:17:04 -04:00
## Docker Commands
2025-10-31 16:17:04 -04:00
```bash
docker-compose up -d # Start
docker-compose down # Stop
docker-compose restart # Restart
docker-compose logs -f # Follow logs
docker-compose logs --tail=100 # Last 100 lines
docker-compose build --no-cache # Rebuild
```
## Further Reading
- [README.md](../../README.md) -- Project overview and architecture
- [IRC.md](../IRC.md) -- IRC command and voting reference
- [DOCKER_QUICKSTART.md](DOCKER_QUICKSTART.md) -- 5-minute Docker setup
- [JACKBOX_INTEGRATION.md](JACKBOX_INTEGRATION.md) -- Jackbox Game Picker setup
- [BROWSER_AUTH_GUIDE.md](BROWSER_AUTH_GUIDE.md) -- Email/password authentication
- [MUTE_CONTROL.md](MUTE_CONTROL.md) -- Mute toggle guide