From 5bf79b75b0dbb6cab42628301e065e0ebbe7c3d7 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 13 Apr 2022 13:10:04 +0200 Subject: [PATCH 1/2] fix: Destinations to HAProxy --- src/lib/haproxy/index.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lib/haproxy/index.ts b/src/lib/haproxy/index.ts index 473660fa1..618d410d5 100644 --- a/src/lib/haproxy/index.ts +++ b/src/lib/haproxy/index.ts @@ -236,9 +236,15 @@ export async function stopCoolifyProxy( export async function configureNetworkCoolifyProxy(engine: string): Promise { const host = getEngine(engine); const destinations = await db.prisma.destinationDocker.findMany({ where: { engine } }); + const { stdout: networks } = await asyncExecShell( + `DOCKER_HOST="${host}" docker ps -a --filter name=coolify-haproxy --format '{{json .Networks}}'` + ); + const configuredNetworks = networks.replace(/"/g, '').replace('\n', '').split(','); for (const destination of destinations) { - await asyncExecShell( - `DOCKER_HOST="${host}" docker network connect ${destination.network} coolify-haproxy` - ); + if (!configuredNetworks.includes(destination.network)) { + await asyncExecShell( + `DOCKER_HOST="${host}" docker network connect ${destination.network} coolify-haproxy` + ); + } } } From e725887a55afcbe4b769fd8fb93ff7bbca64e88b Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 13 Apr 2022 13:12:23 +0200 Subject: [PATCH 2/2] chore:version++ --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e6fc811c4..aeda4ada6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "coolify", "description": "An open-source & self-hostable Heroku / Netlify alternative.", - "version": "2.4.6", + "version": "2.4.7", "license": "AGPL-3.0", "scripts": { "dev": "docker-compose -f docker-compose-dev.yaml up -d && cross-env NODE_ENV=development & svelte-kit dev",