From 7bb7a56339121aa4c283eff5d8b1cca7dd6579b2 Mon Sep 17 00:00:00 2001 From: Fabian Date: Tue, 23 Sep 2025 06:22:52 +0200 Subject: [PATCH] feat(jvb): add ports to advertised ips (#2050) * feat(jvb): add ports to advertised ips * feat(jvb): add support for advertised ports with ipv6 and ipv4 * feat: split ip and port with # delimiter * docs: add advertising port to env.example --- env.example | 4 ++-- jvb/rootfs/defaults/jvb.conf | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/env.example b/env.example index 07eae6a..0e21606 100644 --- a/env.example +++ b/env.example @@ -31,11 +31,11 @@ TZ=UTC # Keep in mind that if you use a non-standard HTTPS port, it has to appear in the public URL #PUBLIC_URL=https://meet.example.com:${HTTPS_PORT} -# Media IP addresses to advertise by the JVB +# Media IP addresses and ports to advertise by the JVB # This setting deprecates DOCKER_HOST_ADDRESS, and supports a comma separated list of IPs # See the "Running behind NAT or on a LAN environment" section in the Handbook: # https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-docker#running-behind-nat-or-on-a-lan-environment -#JVB_ADVERTISE_IPS=192.168.1.1,1.2.3.4 +#JVB_ADVERTISE_IPS=192.168.1.1,1.2.3.4,192.168.178.1#12000,fe80::1#12000 # # Memory limits for Java components diff --git a/jvb/rootfs/defaults/jvb.conf b/jvb/rootfs/defaults/jvb.conf index e49fd5e..8d227d9 100644 --- a/jvb/rootfs/defaults/jvb.conf +++ b/jvb/rootfs/defaults/jvb.conf @@ -150,11 +150,22 @@ ice4j { } static-mappings = [ {{ range $index, $element := $JVB_IPS -}} +{{ if contains "#" $element -}} +{{ $element_ip_port := splitn "#" 2 $element -}} + { + local-address = "{{ $ENV.LOCAL_ADDRESS }}" + public-address = "{{ $element_ip_port._0 }}" + local-port = {{ $ENV.JVB_PORT | default 10000 }} + public-port = {{ $element_ip_port._1 }} + name = "ip-{{ $index }}" + }, +{{ else -}} { local-address = "{{ $ENV.LOCAL_ADDRESS }}" public-address = "{{ $element }}" name = "ip-{{ $index }}" }, +{{ end -}} {{ end -}} ] }