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'];