From c3457a4c8aa4e6f0d2f60a9d83ce23f5ded4608d Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 17 Aug 2022 13:30:53 +0200 Subject: [PATCH 1/3] fix: revert docker compose version to 2.6.1 --- Dockerfile | 3 ++- apps/api/src/jobs/deployApplication.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 778d46764..fea6b8624 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,8 @@ RUN mkdir -p ~/.docker/cli-plugins/ # https://download.docker.com/linux/static/stable/ RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-20.10.9 -o /usr/bin/docker # https://github.com/docker/compose/releases -RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-compose-linux-2.7.0 -o ~/.docker/cli-plugins/docker-compose +# Reverted to 2.6.1 because of this https://github.com/docker/compose/issues/9704. 2.9.0 still has a bug. +RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-compose-linux-2.6.1 -o ~/.docker/cli-plugins/docker-compose RUN chmod +x ~/.docker/cli-plugins/docker-compose /usr/bin/docker RUN (curl -sSL "https://github.com/buildpacks/pack/releases/download/v0.27.0/pack-v0.27.0-linux.tgz" | tar -C /usr/local/bin/ --no-same-owner -xzv pack) diff --git a/apps/api/src/jobs/deployApplication.ts b/apps/api/src/jobs/deployApplication.ts index a8c46d594..e258edfb9 100644 --- a/apps/api/src/jobs/deployApplication.ts +++ b/apps/api/src/jobs/deployApplication.ts @@ -255,11 +255,11 @@ import * as buildpacks from '../lib/buildPacks'; secrets.forEach((secret) => { if (pullmergeRequestId) { if (secret.isPRMRSecret) { - envs.push(`${secret.name}='${secret.value}'`); + envs.push(`${secret.name}=${secret.value}`); } } else { if (!secret.isPRMRSecret) { - envs.push(`${secret.name}='${secret.value}'`); + envs.push(`${secret.name}=${secret.value}`); } } }); From 883bdc2879a79468ba2ac112ab8d4fd87ed5d2d8 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 17 Aug 2022 13:31:06 +0200 Subject: [PATCH 2/3] fix: trim secrets --- apps/api/src/routes/api/v1/applications/handlers.ts | 5 +++-- apps/api/src/routes/api/v1/services/handlers.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/api/src/routes/api/v1/applications/handlers.ts b/apps/api/src/routes/api/v1/applications/handlers.ts index ce03c6e7c..5f0f2aa2d 100644 --- a/apps/api/src/routes/api/v1/applications/handlers.ts +++ b/apps/api/src/routes/api/v1/applications/handlers.ts @@ -657,13 +657,14 @@ export async function saveSecret(request: FastifyRequest, reply: Fas if (found) { throw { status: 500, message: `Secret ${name} already exists.` } } else { - value = encrypt(value); + value = encrypt(value.trim()); + console.log({value}) await prisma.secret.create({ data: { name, value, isBuildSecret, isPRMRSecret, application: { connect: { id } } } }); } } else { - value = encrypt(value); + value = encrypt(value.trim()); const found = await prisma.secret.findFirst({ where: { applicationId: id, name, isPRMRSecret } }); if (found) { diff --git a/apps/api/src/routes/api/v1/services/handlers.ts b/apps/api/src/routes/api/v1/services/handlers.ts index bfd8a9352..ae147cc4c 100644 --- a/apps/api/src/routes/api/v1/services/handlers.ts +++ b/apps/api/src/routes/api/v1/services/handlers.ts @@ -458,13 +458,13 @@ export async function saveServiceSecret(request: FastifyRequest Date: Wed, 17 Aug 2022 13:31:27 +0200 Subject: [PATCH 3/3] chore: version++ --- apps/api/src/lib/common.ts | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/api/src/lib/common.ts b/apps/api/src/lib/common.ts index 96921d82a..548492c4d 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.5.0'; +export const version = '3.5.1'; export const isDev = process.env.NODE_ENV === 'development'; const algorithm = 'aes-256-ctr'; diff --git a/package.json b/package.json index d05dd37b7..9f9423615 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "coolify", "description": "An open-source & self-hostable Heroku / Netlify alternative.", - "version": "3.5.0", + "version": "3.5.1", "license": "Apache-2.0", "repository": "github:coollabsio/coolify", "scripts": {