Initial commit: VPS tutorial complet (105 etapes)
This commit is contained in:
109
15-livekit.md
Normal file
109
15-livekit.md
Normal file
@@ -0,0 +1,109 @@
|
||||
# 15. LiveKit (Teleconsultation Video)
|
||||
|
||||
## Prerequis
|
||||
|
||||
- Docker installe
|
||||
- Sous-domaine pour LiveKit (ex: `video.<PROJET_DOMAINE>`)
|
||||
- Certificats SSL
|
||||
|
||||
## DNS et sous-domaine
|
||||
|
||||
1. DNS A `video` -> `<IP>` (dans la zone du projet)
|
||||
2. Sous-domaine ISPConfig `video.<PROJET_DOMAINE>` (SSL, LE, PHP-FPM)
|
||||
|
||||
## Ports firewall
|
||||
|
||||
ISPConfig > System > Firewall, ajouter :
|
||||
- TCP : `7880,7881,5349`
|
||||
- UDP : `7882,3478`
|
||||
|
||||
## Recuperer les certificats
|
||||
|
||||
```bash
|
||||
# Trouver les certificats generes par ISPConfig
|
||||
find /var/www/clients/ -name "video.<PROJET_DOMAINE>-le.*"
|
||||
|
||||
# Copier
|
||||
mkdir -p /chemin/projet/docker/livekit/certs
|
||||
cp /var/www/clients/clientX/webY/ssl/video.<PROJET_DOMAINE>-le.crt /chemin/projet/docker/livekit/certs/fullchain.pem
|
||||
cp /var/www/clients/clientX/webY/ssl/video.<PROJET_DOMAINE>-le.key /chemin/projet/docker/livekit/certs/privkey.pem
|
||||
chown -R <USER>:<USER> /chemin/projet/docker/livekit/certs/
|
||||
```
|
||||
|
||||
> **Piege :** Verifier que la cle privee correspond au certificat :
|
||||
> ```bash
|
||||
> openssl x509 -noout -pubkey -in certs/fullchain.pem | md5sum
|
||||
> openssl ec -pubout -in certs/privkey.pem 2>/dev/null | md5sum
|
||||
> # Les deux md5 doivent etre identiques
|
||||
> ```
|
||||
|
||||
## Configuration
|
||||
|
||||
### .env
|
||||
|
||||
```bash
|
||||
LIVEKIT_API_KEY=<generer avec: openssl rand -hex 16>
|
||||
LIVEKIT_API_SECRET=<generer avec: openssl rand -base64 32>
|
||||
TZ=Africa/Abidjan
|
||||
LIVEKIT_CPU_LIMIT=2.0
|
||||
LIVEKIT_MEM_LIMIT=2G
|
||||
```
|
||||
|
||||
### livekit-prod.yaml
|
||||
|
||||
```yaml
|
||||
port: 7880
|
||||
|
||||
redis:
|
||||
address: localhost:6380 # Port different du Redis systeme (6379)
|
||||
|
||||
rtc:
|
||||
udp_port: 7882
|
||||
tcp_port: 7881
|
||||
allow_tcp_fallback: true
|
||||
use_external_ip: false
|
||||
node_ip: <IP>
|
||||
|
||||
turn:
|
||||
enabled: true
|
||||
tls_port: 5349
|
||||
udp_port: 3478
|
||||
domain: video.<PROJET_DOMAINE>
|
||||
cert_file: /etc/livekit/tls/fullchain.pem
|
||||
key_file: /etc/livekit/tls/privkey.pem
|
||||
|
||||
room:
|
||||
auto_create: true
|
||||
empty_timeout: 300
|
||||
max_participants: 2
|
||||
|
||||
webhook:
|
||||
api_key: <LIVEKIT_API_KEY>
|
||||
urls:
|
||||
- https://<PROJET_DOMAINE>/api/v1/teleconsultation/livekit-webhook
|
||||
```
|
||||
|
||||
> **Piege :** Le Redis du container doit tourner sur un port different (6380) du Redis systeme (6379) quand on utilise `network_mode: host`.
|
||||
|
||||
## Demarrer
|
||||
|
||||
```bash
|
||||
cd /chemin/projet/docker/livekit
|
||||
docker compose -f docker-compose.prod.yml up -d
|
||||
```
|
||||
|
||||
## Verifier
|
||||
|
||||
```bash
|
||||
docker logs djeliba_livekit_server --tail 10
|
||||
# Chercher "starting LiveKit server" et "Starting TURN server"
|
||||
```
|
||||
|
||||
## Symfony .env
|
||||
|
||||
```
|
||||
TELECONSULTATION_PROVIDER=livekit
|
||||
LIVEKIT_URL=wss://video.<PROJET_DOMAINE>:7880
|
||||
LIVEKIT_API_KEY=<meme valeur>
|
||||
LIVEKIT_API_SECRET=<meme valeur>
|
||||
```
|
||||
Reference in New Issue
Block a user