From 8a35295f13177441bf6d7ba2f7e6b4a7bb9bc144 Mon Sep 17 00:00:00 2001 From: Aditya Tripathi Date: Mon, 18 Aug 2025 21:18:24 +0530 Subject: [PATCH] fix(proxy): filter host network from default proxy (#6383) --- bootstrap/helpers/proxy.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bootstrap/helpers/proxy.php b/bootstrap/helpers/proxy.php index cabdabaa7..2d479a193 100644 --- a/bootstrap/helpers/proxy.php +++ b/bootstrap/helpers/proxy.php @@ -130,10 +130,16 @@ function generate_default_proxy_configuration(Server $server) } $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] = [ 'external' => true, ]; + $filtered_networks->push($network); }); if ($proxy_type === ProxyTypes::TRAEFIK->value) { $labels = [ @@ -155,7 +161,7 @@ function generate_default_proxy_configuration(Server $server) 'extra_hosts' => [ 'host.docker.internal:host-gateway', ], - 'networks' => $networks->toArray(), + 'networks' => $filtered_networks->toArray(), 'ports' => [ '80:80', '443:443', @@ -237,7 +243,7 @@ function generate_default_proxy_configuration(Server $server) 'CADDY_DOCKER_POLLING_INTERVAL=5s', 'CADDY_DOCKER_CADDYFILE_PATH=/dynamic/Caddyfile', ], - 'networks' => $networks->toArray(), + 'networks' => $filtered_networks->toArray(), 'ports' => [ '80:80', '443:443',