# 15. LiveKit (Teleconsultation Video) ## Prerequis - Docker installe - Sous-domaine pour LiveKit (ex: `video.`) - Certificats SSL ## DNS et sous-domaine 1. DNS A `video` -> `` (dans la zone du projet) 2. Sous-domaine ISPConfig `video.` (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.-le.*" # Copier mkdir -p /chemin/projet/docker/livekit/certs cp /var/www/clients/clientX/webY/ssl/video.-le.crt /chemin/projet/docker/livekit/certs/fullchain.pem cp /var/www/clients/clientX/webY/ssl/video.-le.key /chemin/projet/docker/livekit/certs/privkey.pem chown -R : /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= LIVEKIT_API_SECRET= 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: turn: enabled: true tls_port: 5349 udp_port: 3478 domain: video. 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: urls: - https:///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.:7880 LIVEKIT_API_KEY= LIVEKIT_API_SECRET= ```