This commit is contained in:
2026-04-18 23:11:35 +02:00
commit f7cfd2a86e
196 changed files with 35538 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
# LiveKit — local dev
Self-hosted SFU for voice + video. Runs in Docker on host-network mode so
WebRTC UDP ports work natively.
## Start / Stop
```bash
# from repo root
docker compose -f infra/livekit/docker-compose.yml up -d
docker compose -f infra/livekit/docker-compose.yml logs -f livekit
docker compose -f infra/livekit/docker-compose.yml down
```
## Endpoints
| Purpose | URL / Port |
|---------------|-----------------------|
| Signaling WS | `ws://localhost:7880` |
| TCP fallback | `tcp://localhost:7881`|
| UDP RTC | `50000-50100/udp` |
| coturn | `3478/udp+tcp` |
## Dev keys
Baked into `livekit.yaml`:
- `LIVEKIT_API_KEY=devkey`
- `LIVEKIT_API_SECRET=devsecret-at-least-32-bytes-long-please`
- `LIVEKIT_URL=ws://localhost:7880`
Same values go into `apps/desktop/.env` (via `VITE_LIVEKIT_URL`) and into the
edge function's `supabase/functions/.env`.
## Prod (later)
Same image on the Hetzner VPS. Caddy terminates TLS at
`wss://livekit.netralax.cloud`. coturn exposed on `turn.netralax.cloud:5349`
(TURNS). Secrets generated via `openssl rand -hex 32` and stored in the server
env + Supabase edge secrets.
+40
View File
@@ -0,0 +1,40 @@
# Local LiveKit SFU for M2 dev.
#
# macOS + Docker Desktop: `network_mode: host` is NOT supported — falls back
# to explicit port mapping. WebRTC UDP ports are ranged small for dev.
#
# Start: docker compose -f infra/livekit/docker-compose.yml up -d
# Stop: docker compose -f infra/livekit/docker-compose.yml down
# Logs: docker compose -f infra/livekit/docker-compose.yml logs -f livekit
services:
livekit:
image: livekit/livekit-server:latest
restart: unless-stopped
command: ["--config", "/etc/livekit.yaml"]
ports:
- "7880:7880/tcp" # signaling WS
- "7881:7881/tcp" # RTC TCP fallback
- "50000-50100:50000-50100/udp" # RTC UDP range
volumes:
- ./livekit.yaml:/etc/livekit.yaml:ro
turn:
image: coturn/coturn:4.6
restart: unless-stopped
ports:
- "3478:3478/udp"
- "3478:3478/tcp"
- "50200-50300:50200-50300/udp"
command: >
-n
--log-file=stdout
--min-port=50200
--max-port=50300
--no-cli
--no-tls
--no-dtls
--realm=local.chatapp
--lt-cred-mech
--user=dev:devpassword
--no-multicast-peers
+24
View File
@@ -0,0 +1,24 @@
# LiveKit dev config. Keys must match what the `mint-livekit-token` edge
# function signs. NEVER reuse these in prod — they're shared publicly here
# only because this is a dev container on localhost.
port: 7880
log_level: info
rtc:
tcp_port: 7881
port_range_start: 50000
port_range_end: 50100
use_external_ip: false
# For dev on macOS + Docker Desktop the host-networking mode maps UDP
# directly, so announce 127.0.0.1 so the client connects back to the
# loopback interface instead of the container IP.
node_ip: 127.0.0.1
# Dev credentials.
keys:
devkey: devsecret-at-least-32-bytes-long-please
# Built-in STUN. We run coturn alongside anyway for the realistic flow.
turn:
enabled: false