fix(proxy): filter host network from default proxy (#6383)

This commit is contained in:
Aditya Tripathi
2025-08-18 21:18:24 +05:30
committed by GitHub
parent e2fd1f4507
commit 8a35295f13

View File

@@ -130,10 +130,16 @@ function generate_default_proxy_configuration(Server $server)
} }
$array_of_networks = collect([]); $array_of_networks = collect([]);
$networks->map(function ($network) use ($array_of_networks) { $filtered_networks = collect([]);
$networks->map(function ($network) use ($array_of_networks, $filtered_networks) {
if ($network === 'host') {
return; // network-scoped alias is supported only for containers in user defined networks
}
$array_of_networks[$network] = [ $array_of_networks[$network] = [
'external' => true, 'external' => true,
]; ];
$filtered_networks->push($network);
}); });
if ($proxy_type === ProxyTypes::TRAEFIK->value) { if ($proxy_type === ProxyTypes::TRAEFIK->value) {
$labels = [ $labels = [
@@ -155,7 +161,7 @@ function generate_default_proxy_configuration(Server $server)
'extra_hosts' => [ 'extra_hosts' => [
'host.docker.internal:host-gateway', 'host.docker.internal:host-gateway',
], ],
'networks' => $networks->toArray(), 'networks' => $filtered_networks->toArray(),
'ports' => [ 'ports' => [
'80:80', '80:80',
'443:443', '443:443',
@@ -237,7 +243,7 @@ function generate_default_proxy_configuration(Server $server)
'CADDY_DOCKER_POLLING_INTERVAL=5s', 'CADDY_DOCKER_POLLING_INTERVAL=5s',
'CADDY_DOCKER_CADDYFILE_PATH=/dynamic/Caddyfile', 'CADDY_DOCKER_CADDYFILE_PATH=/dynamic/Caddyfile',
], ],
'networks' => $networks->toArray(), 'networks' => $filtered_networks->toArray(),
'ports' => [ 'ports' => [
'80:80', '80:80',
'443:443', '443:443',