Merge remote-tracking branch 'origin/next' into audit-policies
This commit is contained in:
commit
84a52006f4
2 changed files with 11 additions and 49 deletions
|
|
@ -57,7 +57,9 @@ ## Donations
|
|||
|
||||
### Huge Sponsors
|
||||
|
||||
* [MVPS](https://www.mvps.net?ref=coolify.io) - Cheap VPS servers at the highest possible quality
|
||||
* [SerpAPI](https://serpapi.com?ref=coolify.io) - Google Search API — Scrape Google and other search engines from our fast, easy, and complete API
|
||||
*
|
||||
|
||||
### Big Sponsors
|
||||
|
||||
|
|
@ -85,7 +87,6 @@ ### Big Sponsors
|
|||
* [LiquidWeb](https://liquidweb.com?ref=coolify.io) - Premium managed hosting solutions
|
||||
* [Logto](https://logto.io?ref=coolify.io) - The better identity infrastructure for developers
|
||||
* [Macarne](https://macarne.com?ref=coolify.io) - Best IP Transit & Carrier Ethernet Solutions for Simplified Network Connectivity
|
||||
* [MVPS](https://www.mvps.net?ref=coolify.io) - Cheap VPS servers at the highest possible quality
|
||||
* [Mobb](https://vibe.mobb.ai/?ref=coolify.io) - Secure Your AI-Generated Code to Unlock Dev Productivity
|
||||
* [PFGLabs](https://pfglabs.com?ref=coolify.io) - Build Real Projects with Golang
|
||||
* [Ramnode](https://ramnode.com/?ref=coolify.io) - High Performance Cloud VPS Hosting
|
||||
|
|
@ -96,6 +97,7 @@ ### Big Sponsors
|
|||
* [Tigris](https://www.tigrisdata.com?ref=coolify.io) - Modern developer data platform
|
||||
* [Tolgee](https://tolgee.io?ref=coolify.io) - The open source localization platform
|
||||
* [Ubicloud](https://www.ubicloud.com?ref=coolify.io) - Open source cloud infrastructure platform
|
||||
* [VPSDime](https://vpsdime.com?ref=coolify.io) - Affordable high-performance VPS hosting solutions
|
||||
|
||||
|
||||
### Small Sponsors
|
||||
|
|
|
|||
|
|
@ -127,44 +127,10 @@ function connectProxyToNetworks(Server $server)
|
|||
return $commands->flatten();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate shell commands to fix a Docker network that has an IPv6 gateway with CIDR notation.
|
||||
*
|
||||
* Docker 25+ may store IPv6 gateways with CIDR (e.g. fd7d:f7d2:7e77::1/64), which causes
|
||||
* ParseAddr errors in Docker Compose. This detects the issue and recreates the network.
|
||||
*
|
||||
* @see https://github.com/coollabsio/coolify/issues/8649
|
||||
*
|
||||
* @param string $network Network name to check and fix
|
||||
* @return array Shell commands to execute on the remote server
|
||||
*/
|
||||
function fixNetworkIpv6CidrGateway(string $network): array
|
||||
{
|
||||
return [
|
||||
"if docker network inspect {$network} >/dev/null 2>&1; then",
|
||||
" IPV6_GW=\$(docker network inspect {$network} --format '{{range .IPAM.Config}}{{.Gateway}} {{end}}' 2>/dev/null | tr ' ' '\n' | grep '/' || true)",
|
||||
' if [ -n "$IPV6_GW" ]; then',
|
||||
" echo \"Fixing network {$network}: IPv6 gateway has CIDR notation (\$IPV6_GW)\"",
|
||||
" CONTAINERS=\$(docker network inspect {$network} --format '{{range .Containers}}{{.Name}} {{end}}' 2>/dev/null)",
|
||||
' for c in $CONTAINERS; do',
|
||||
" [ -n \"\$c\" ] && docker network disconnect {$network} \"\$c\" 2>/dev/null || true",
|
||||
' done',
|
||||
" docker network rm {$network} 2>/dev/null || true",
|
||||
" docker network create --attachable {$network} 2>/dev/null || true",
|
||||
' for c in $CONTAINERS; do',
|
||||
" [ -n \"\$c\" ] && [ \"\$c\" != \"coolify-proxy\" ] && docker network connect {$network} \"\$c\" 2>/dev/null || true",
|
||||
' done',
|
||||
' fi',
|
||||
'fi',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures all required networks exist before docker compose up.
|
||||
* This must be called BEFORE docker compose up since the compose file declares networks as external.
|
||||
*
|
||||
* Also detects and fixes networks with IPv6 CIDR gateway notation that causes ParseAddr errors.
|
||||
*
|
||||
* @param Server $server The server to ensure networks on
|
||||
* @return \Illuminate\Support\Collection Commands to create networks if they don't exist
|
||||
*/
|
||||
|
|
@ -174,23 +140,17 @@ function ensureProxyNetworksExist(Server $server)
|
|||
|
||||
if ($server->isSwarm()) {
|
||||
$commands = $networks->map(function ($network) {
|
||||
return array_merge(
|
||||
fixNetworkIpv6CidrGateway($network),
|
||||
[
|
||||
"echo 'Ensuring network $network exists...'",
|
||||
"docker network ls --format '{{.Name}}' | grep -q '^{$network}$' || docker network create --driver overlay --attachable $network",
|
||||
]
|
||||
);
|
||||
return [
|
||||
"echo 'Ensuring network $network exists...'",
|
||||
"docker network ls --format '{{.Name}}' | grep -q '^{$network}$' || docker network create --driver overlay --attachable $network",
|
||||
];
|
||||
});
|
||||
} else {
|
||||
$commands = $networks->map(function ($network) {
|
||||
return array_merge(
|
||||
fixNetworkIpv6CidrGateway($network),
|
||||
[
|
||||
"echo 'Ensuring network $network exists...'",
|
||||
"docker network ls --format '{{.Name}}' | grep -q '^{$network}$' || docker network create --attachable $network",
|
||||
]
|
||||
);
|
||||
return [
|
||||
"echo 'Ensuring network $network exists...'",
|
||||
"docker network ls --format '{{.Name}}' | grep -q '^{$network}$' || docker network create --attachable $network",
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue