Make livekit-jwt-service communicate with livekit-server via public URLs

Communicating via container URLs works, but the URL provided to
livekit-jwt-service as `LIVEKIT_URL` is also passed to the user later
and it must be a public one at that point.

It'd be great if livekit-jwt-service can be given 2 different URLs
(e.g. `LIVEKIT_URL` and `LIVEKIT_URL_PUBLIC`) and only announce the
public one to the user, but there's no support for this yet.
This commit is contained in:
Slavi Pantaleev 2025-03-12 15:44:31 +02:00
parent 32f8c6de6e
commit 22ef579444
2 changed files with 3 additions and 7 deletions

View File

@ -6346,11 +6346,7 @@ matrix_livekit_jwt_service_container_network: "{{ matrix_addons_container_networ
matrix_livekit_jwt_service_container_additional_networks_auto: |
{{
(
([matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_livekit_jwt_service_container_labels_traefik_enabled and matrix_playbook_reverse_proxyable_services_additional_network) else [])
+
([livekit_server_container_network] if livekit_server_enabled and (matrix_livekit_jwt_service_environment_variable_livekit_url == livekit_server_websocket_container_url and livekit_server_container_network != matrix_livekit_jwt_service_container_network) else [])
) | unique
([matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_livekit_jwt_service_container_labels_traefik_enabled and matrix_playbook_reverse_proxyable_services_additional_network) else [])
}}
matrix_livekit_jwt_service_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}"
@ -6358,7 +6354,7 @@ matrix_livekit_jwt_service_container_labels_traefik_docker_network: "{{ matrix_p
matrix_livekit_jwt_service_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}"
matrix_livekit_jwt_service_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}"
matrix_livekit_jwt_service_environment_variable_livekit_url: "{{ livekit_server_websocket_container_url }}"
matrix_livekit_jwt_service_environment_variable_livekit_url: "{{ livekit_server_websocket_public_url }}"
matrix_livekit_jwt_service_environment_variable_livekit_key: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'lk.key', rounds=655555) | to_uuid }}"

View File

@ -5,4 +5,4 @@
---
livekit_server_public_url: "{{ livekit_server_scheme }}://{{ livekit_server_hostname }}{{ livekit_server_path_prefix }}"
livekit_server_websocket_container_url: "ws://{{ livekit_server_identifier }}:{{ livekit_server_config_port}}"
livekit_server_websocket_public_url: "{{ 'wss' if livekit_server_scheme == 'https' else 'ws' }}://{{ livekit_server_hostname }}{{ livekit_server_path_prefix }}"