From 6d2b453361e7eb0593fd945af8d2cbdafedeb87c Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 11 Aug 2022 16:34:39 +0200 Subject: [PATCH 1/3] fix schema --- apps/api/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts index 979099db1..4b71f70d8 100644 --- a/apps/api/src/index.ts +++ b/apps/api/src/index.ts @@ -16,9 +16,9 @@ declare module 'fastify' { COOLIFY_DATABASE_URL: string, COOLIFY_SENTRY_DSN: string, COOLIFY_IS_ON: string, - COOLIFY_WHITE_LABELED: boolean, + COOLIFY_WHITE_LABELED: string, COOLIFY_WHITE_LABELED_ICON: string | null, - COOLIFY_AUTO_UPDATE: boolean, + COOLIFY_AUTO_UPDATE: string, }; } } From 168eec3fe08019f023f25b5ec8783db22b599f7f Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 11 Aug 2022 16:32:37 +0000 Subject: [PATCH 2/3] fix: coolify-network on verification --- apps/api/src/lib/common.ts | 2 +- apps/api/src/routes/api/v1/destinations/handlers.ts | 4 ++++ package.json | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/api/src/lib/common.ts b/apps/api/src/lib/common.ts index 87cb6ad98..ca1caa697 100644 --- a/apps/api/src/lib/common.ts +++ b/apps/api/src/lib/common.ts @@ -17,7 +17,7 @@ import { checkContainer, removeContainer } from './docker'; import { day } from './dayjs'; import * as serviceFields from './serviceFields' -export const version = '3.2.1'; +export const version = '3.2.2'; export const isDev = process.env.NODE_ENV === 'development'; const algorithm = 'aes-256-ctr'; diff --git a/apps/api/src/routes/api/v1/destinations/handlers.ts b/apps/api/src/routes/api/v1/destinations/handlers.ts index 3966ecab9..9910a2ba7 100644 --- a/apps/api/src/routes/api/v1/destinations/handlers.ts +++ b/apps/api/src/routes/api/v1/destinations/handlers.ts @@ -218,7 +218,11 @@ export async function verifyRemoteDockerEngine(request: FastifyRequest, reply: F if (!stdout) { await asyncExecShell(`DOCKER_HOST=${host} docker network create --attachable ${network}`); } + const { stdout:coolifyNetwork } = await asyncExecShell(`DOCKER_HOST=${host} docker network ls --filter 'name=coolify-infra' --no-trunc --format "{{json .}}"`); + if (!coolifyNetwork) { + await asyncExecShell(`DOCKER_HOST=${host} docker network create --attachable coolify-infra`); + await prisma.destinationDocker.update({ where: { id }, data: { remoteVerified: true } }) return reply.code(201).send() diff --git a/package.json b/package.json index 281b919b8..6127427d4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "coolify", "description": "An open-source & self-hostable Heroku / Netlify alternative.", - "version": "3.2.1", + "version": "3.2.2", "license": "Apache-2.0", "repository": "github:coollabsio/coolify", "scripts": { From bfa5fb6f164bc26169608c8ac4ef30bb84a50fda Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 11 Aug 2022 16:35:29 +0000 Subject: [PATCH 3/3] Update handlers.ts --- apps/api/src/routes/api/v1/destinations/handlers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/api/src/routes/api/v1/destinations/handlers.ts b/apps/api/src/routes/api/v1/destinations/handlers.ts index 9910a2ba7..f310f8a61 100644 --- a/apps/api/src/routes/api/v1/destinations/handlers.ts +++ b/apps/api/src/routes/api/v1/destinations/handlers.ts @@ -60,7 +60,7 @@ export async function getDestination(request: FastifyRequest) { throw { status: 404, message: `Destination not found.` }; } const settings = await listSettings(); - let payload = { + const payload = { destination, settings }; @@ -222,7 +222,7 @@ export async function verifyRemoteDockerEngine(request: FastifyRequest, reply: F if (!coolifyNetwork) { await asyncExecShell(`DOCKER_HOST=${host} docker network create --attachable coolify-infra`); - + } await prisma.destinationDocker.update({ where: { id }, data: { remoteVerified: true } }) return reply.code(201).send()