Update Self-Hosting: add bot and webhook instructions, update env vars
+54
-10
@@ -21,28 +21,33 @@ This starts:
|
|||||||
Copy `.env.example` to `.env` and set:
|
Copy `.env.example` to `.env` and set:
|
||||||
|
|
||||||
```env
|
```env
|
||||||
|
# App
|
||||||
DUMPSTER_HOST=chat.your.domain
|
DUMPSTER_HOST=chat.your.domain
|
||||||
DUMPSTER_PORT=8080
|
DUMPSTER_PORT=8080
|
||||||
DUMPSTER_SECRET=change-me
|
DUMPSTER_SECRET=<random-secret>
|
||||||
|
|
||||||
|
# Database
|
||||||
POSTGRES_HOST=postgres
|
POSTGRES_HOST=postgres
|
||||||
POSTGRES_PORT=5432
|
POSTGRES_PORT=5432
|
||||||
POSTGRES_USER=dumpster
|
POSTGRES_USER=dumpster
|
||||||
POSTGRES_PASSWORD=change-me
|
POSTGRES_PASSWORD=<random-password>
|
||||||
|
POSTGRES_DB=dumpster
|
||||||
|
|
||||||
|
# Cache
|
||||||
VALKEY_URL=redis://valkey:6379
|
VALKEY_URL=redis://valkey:6379
|
||||||
|
|
||||||
|
# File storage (optional)
|
||||||
MINIO_ENDPOINT=minio:9000
|
MINIO_ENDPOINT=minio:9000
|
||||||
MINIO_ACCESS_KEY=dumpster
|
MINIO_ACCESS_KEY=<random>
|
||||||
MINIO_SECRET_KEY=change-me
|
MINIO_SECRET_KEY=<random>
|
||||||
MINIO_BUCKET=dumpster-files
|
MINIO_BUCKET=dumpster-files
|
||||||
|
|
||||||
LIVEKIT_API_KEY=devkey
|
# Voice/video (optional)
|
||||||
LIVEKIT_API_SECRET=change-me
|
LIVEKIT_API_KEY=<random>
|
||||||
|
LIVEKIT_API_SECRET=<random>
|
||||||
|
|
||||||
VAPID_PUBLIC_KEY=...
|
# Giphy (optional)
|
||||||
VAPID_PRIVATE_KEY=...
|
GIPHY_API_KEY=<your-key>
|
||||||
VAPID_SUBJECT=mailto:admin@your.domain
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Ports required
|
## Ports required
|
||||||
@@ -56,6 +61,22 @@ VAPID_SUBJECT=mailto:admin@your.domain
|
|||||||
| 50000-50100/udp | LiveKit relay |
|
| 50000-50100/udp | LiveKit relay |
|
||||||
| 10000-20000/udp | coturn media relay |
|
| 10000-20000/udp | coturn media relay |
|
||||||
|
|
||||||
|
## First run
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Start services
|
||||||
|
docker compose -f docker/compose.yml up -d
|
||||||
|
|
||||||
|
# Run migrations (creates tables)
|
||||||
|
go run ./cmd/migrate up
|
||||||
|
|
||||||
|
# Start the server
|
||||||
|
go run ./cmd/server
|
||||||
|
|
||||||
|
# In dev, start the web frontend separately
|
||||||
|
cd web && npm install && npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
## Production TLS
|
## Production TLS
|
||||||
|
|
||||||
For production, update `docker/Caddyfile`:
|
For production, update `docker/Caddyfile`:
|
||||||
@@ -64,10 +85,33 @@ For production, update `docker/Caddyfile`:
|
|||||||
chat.your.domain {
|
chat.your.domain {
|
||||||
reverse_proxy /api/* app:8080
|
reverse_proxy /api/* app:8080
|
||||||
reverse_proxy /ws app:8080
|
reverse_proxy /ws app:8080
|
||||||
reverse_proxy /livekit/* livekit:7880
|
reverse_proxy /ws/bot app:8080
|
||||||
|
reverse_proxy /webhooks/* app:8080
|
||||||
|
reverse_proxy /files/* app:8080
|
||||||
root * /srv/web
|
root * /srv/web
|
||||||
file_server
|
file_server
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Remove `auto_https off` and Caddy will fetch Let's Encrypt certificates.
|
Remove `auto_https off` and Caddy will fetch Let's Encrypt certificates.
|
||||||
|
|
||||||
|
## Adding bots
|
||||||
|
|
||||||
|
1. Create a bot via the web UI (`/bots` page)
|
||||||
|
2. Copy the bot token (shown once)
|
||||||
|
3. Add the bot to a server
|
||||||
|
4. Run the bot:
|
||||||
|
```bash
|
||||||
|
BOT_TOKEN=<token> go run ./examples/modbot/main.go
|
||||||
|
```
|
||||||
|
|
||||||
|
## Webhooks
|
||||||
|
|
||||||
|
1. Create a webhook via the API or web UI
|
||||||
|
2. Copy the webhook URL (includes token)
|
||||||
|
3. POST to the URL:
|
||||||
|
```bash
|
||||||
|
curl -X POST https://chat.your.domain/webhooks/<id>/<token> \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"content": "Hello from webhook!", "username": "GitHub"}'
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user