Browse Source

web: Added P2P_STUN_SERVERS environment variable (#1990)

Joshua Chia 4 months ago
parent
commit
82e98d2274
2 changed files with 5 additions and 0 deletions
  1. 1 0
      docker-compose.yml
  2. 4 0
      web/rootfs/defaults/settings-config.js

+ 1 - 0
docker-compose.yml

@@ -133,6 +133,7 @@ services:
             - PREFERRED_LANGUAGE
             - PUBLIC_URL
             - P2P_PREFERRED_CODEC
+            - P2P_STUN_SERVERS
             - RESOLUTION
             - RESOLUTION_MIN
             - RESOLUTION_WIDTH

+ 4 - 0
web/rootfs/defaults/settings-config.js

@@ -137,6 +137,10 @@ config.p2p = {
     mobileCodecPreferenceOrder: {{ $CODEC_ORDER_P2P_MOBILE }}
 };
 
+{{ if .Env.P2P_STUN_SERVERS -}}
+config.p2p.stunServers = '{{ .Env.P2P_STUN_SERVERS }}'.split(',').map(url => ({ urls: 'stun:' + url }));
+
+{{ end -}}
 
 // Breakout Rooms
 //