fix(proxy): filter host network from default proxy (#6383)
This commit is contained in:
@@ -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',
|
||||||
|
Reference in New Issue
Block a user