From d0b0bde4c89faec2fb35b90f020490133fbff799 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Apr 2026 14:46:10 +0000 Subject: [PATCH] jellyfin: allow Jellyfin to resolve lldap hostname while running in host network mode Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/3bd90eb7-e6f2-4647-9e78-4f9349300a29 fix: use gethostbyname for lldap IP and fix community-container depends_on skip logic Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/67d6ed5f-8bdc-4b9b-a33c-9ff73305c799 fix: ensure lldap starts before jellyfin via depends_on Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/448ec7d3-f71e-4499-a4a4-67314434a77c Update ContainerDefinitionFetcher.php Signed-off-by: Simon L. fix: protect standard container dependencies from being skipped for community containers Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/cdd6a51b-75a3-4f43-9d00-85b1df2f880f Co-Authored-By: szaimen <42591237+szaimen@users.noreply.github.com> --- community-containers/jellyfin/jellyfin.json | 3 +++ php/src/ContainerDefinitionFetcher.php | 12 ++++++++++++ php/src/Docker/DockerActionManager.php | 7 +++++++ 3 files changed, 22 insertions(+) diff --git a/community-containers/jellyfin/jellyfin.json b/community-containers/jellyfin/jellyfin.json index f0840913..21571f5d 100644 --- a/community-containers/jellyfin/jellyfin.json +++ b/community-containers/jellyfin/jellyfin.json @@ -34,6 +34,9 @@ "enable_nvidia_gpu": true, "backup_volumes": [ "nextcloud_aio_jellyfin" + ], + "depends_on": [ + "nextcloud-aio-lldap" ] } ] diff --git a/php/src/ContainerDefinitionFetcher.php b/php/src/ContainerDefinitionFetcher.php index e4050f5d..44b1a4f9 100644 --- a/php/src/ContainerDefinitionFetcher.php +++ b/php/src/ContainerDefinitionFetcher.php @@ -41,6 +41,9 @@ readonly class ContainerDefinitionFetcher { { $data = json_decode((string)file_get_contents(DataConst::GetContainersDefinitionPath()), true, 512, JSON_THROW_ON_ERROR); + // We store this information for later because we need to use it to distinct between community containers and default containers. + $standardContainerNames = array_column($data['aio_services_v1'], 'container_name'); + $additionalContainerNames = []; foreach ($this->configurationManager->aioCommunityContainers as $communityContainer) { if ($communityContainer !== '') { @@ -212,6 +215,15 @@ readonly class ContainerDefinitionFetcher { if (!$this->configurationManager->isWhiteboardEnabled) { continue; } + } else { + // Skip dependencies on community containers that are not currently enabled. + // Only apply this when the current entry is itself a community container, + // and the dependency is not an enabled community container or a standard built-in container. + if (in_array($entry['container_name'], $additionalContainerNames, true) + && !in_array($value, $additionalContainerNames, true) + && !in_array($value, $standardContainerNames, true)) { + continue; + } } $dependsOn[] = $value; } diff --git a/php/src/Docker/DockerActionManager.php b/php/src/Docker/DockerActionManager.php index d5afef81..80a6b785 100644 --- a/php/src/Docker/DockerActionManager.php +++ b/php/src/Docker/DockerActionManager.php @@ -425,6 +425,13 @@ readonly class DockerActionManager { // $mounts[] = ["Type" => "bind", "Source" => $volume->name, "Target" => $volume->mountPoint, "ReadOnly" => !$volume->isWritable, "BindOptions" => [ "Propagation" => "rshared"]]; // } + // Special things for the jellyfin community container + } elseif ($container->identifier === 'nextcloud-aio-jellyfin') { + $lldapIp = gethostbyname('nextcloud-aio-lldap'); + if ($lldapIp !== 'nextcloud-aio-lldap') { + $requestBody['HostConfig']['ExtraHosts'] = ['nextcloud-aio-lldap:' . $lldapIp]; + } + // Special things for the caddy community container } elseif ($container->identifier === 'nextcloud-aio-caddy') { $requestBody['HostConfig']['ExtraHosts'] = ['host.docker.internal:host-gateway'];