From 888dfe76c731b003fc324bc7c14d9b2675f43256 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Thu, 24 Apr 2025 17:11:10 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(backend)=20resolve=20backchannel?= =?UTF-8?q?=20calls=20to=20LiveKit=20in=20docker-compose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix container networking issue where app-dev container couldn't resolve localhost address when calling LiveKit API. Update configuration to use proper container network addressing for backchannel communication between services. --- compose.yml | 2 ++ env.d/development/common.dist | 3 ++- src/backend/core/tests/test_utils.py | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/compose.yml b/compose.yml index 1a1115d7..5afc394d 100644 --- a/compose.yml +++ b/compose.yml @@ -72,6 +72,8 @@ services: - nginx - livekit - createbuckets + extra_hosts: + - "127.0.0.1.nip.io:host-gateway" celery-dev: user: ${DOCKER_USER:-1000} diff --git a/env.d/development/common.dist b/env.d/development/common.dist index 5b5dbd53..8393b184 100644 --- a/env.d/development/common.dist +++ b/env.d/development/common.dist @@ -48,7 +48,8 @@ OIDC_AUTH_REQUEST_EXTRA_PARAMS={"acr_values": "eidas1"} # Livekit Token settings LIVEKIT_API_SECRET=secret LIVEKIT_API_KEY=devkey -LIVEKIT_API_URL=http://localhost:7880 +LIVEKIT_API_URL=http://127.0.0.1.nip.io:7880 +LIVEKIT_VERIFY_SSL=False ALLOW_UNREGISTERED_ROOMS=False # Recording diff --git a/src/backend/core/tests/test_utils.py b/src/backend/core/tests/test_utils.py index 58ba2990..60e0e393 100644 --- a/src/backend/core/tests/test_utils.py +++ b/src/backend/core/tests/test_utils.py @@ -45,9 +45,11 @@ def test_create_livekit_client_ssl_disabled( @mock.patch("asyncio.get_running_loop") @mock.patch("core.utils.LiveKitAPI") def test_create_livekit_client_custom_configuration( - mock_livekit_api, mock_get_running_loop + mock_livekit_api, mock_get_running_loop, settings ): """Test LiveKitAPI client creation with custom configuration.""" + settings.LIVEKIT_VERIFY_SSL = True + mock_get_running_loop.return_value = mock.MagicMock() custom_configuration = { "api_key": "mock_key",