From 6d7c2ae74a9e740458f7abca21bca253d0b04455 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 5 Sep 2022 08:14:43 +0200 Subject: [PATCH] fix: ssh pid agent name --- apps/api/src/routes/api/v1/destinations/handlers.ts | 5 ++++- apps/ui/src/routes/applications/[id]/__layout.svelte | 2 +- apps/ui/src/routes/destinations/[id]/__layout.svelte | 10 +++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/apps/api/src/routes/api/v1/destinations/handlers.ts b/apps/api/src/routes/api/v1/destinations/handlers.ts index 2148a1450..ea252554e 100644 --- a/apps/api/src/routes/api/v1/destinations/handlers.ts +++ b/apps/api/src/routes/api/v1/destinations/handlers.ts @@ -210,7 +210,7 @@ export async function verifyRemoteDockerEngine(request: FastifyRequest, reply: F const { id } = request.params; await createRemoteEngineConfiguration(id); - const { remoteIpAddress, remoteUser, network } = await prisma.destinationDocker.findFirst({ where: { id } }) + const { remoteIpAddress, remoteUser, network, isCoolifyProxyUsed } = await prisma.destinationDocker.findFirst({ where: { id } }) const host = `ssh://${remoteUser}@${remoteIpAddress}` const { stdout } = await asyncExecShell(`DOCKER_HOST=${host} docker network ls --filter 'name=${network}' --no-trunc --format "{{json .}}"`); @@ -222,6 +222,9 @@ export async function verifyRemoteDockerEngine(request: FastifyRequest, reply: F if (!coolifyNetwork) { await asyncExecShell(`DOCKER_HOST=${host} docker network create --attachable coolify-infra`); } + if (isCoolifyProxyUsed) { + await startTraefikProxy(id); + } await prisma.destinationDocker.update({ where: { id }, data: { remoteVerified: true } }) return reply.code(201).send() diff --git a/apps/ui/src/routes/applications/[id]/__layout.svelte b/apps/ui/src/routes/applications/[id]/__layout.svelte index e2117fcc4..e69a6fe8a 100644 --- a/apps/ui/src/routes/applications/[id]/__layout.svelte +++ b/apps/ui/src/routes/applications/[id]/__layout.svelte @@ -106,7 +106,7 @@ await del(`/applications/${id}`, { id, force }); return await goto(`/applications`); } catch (error) { - if (error.message.startsWith(`Command failed: SSH_AUTH_SOCK=/tmp/ssh-agent.pid`)) { + if (error.message.startsWith(`Command failed: SSH_AUTH_SOCK=/tmp/coolify-ssh-agent.pid`)) { forceDelete = true; } return errorNotification(error); diff --git a/apps/ui/src/routes/destinations/[id]/__layout.svelte b/apps/ui/src/routes/destinations/[id]/__layout.svelte index 8cde64d2b..99001419f 100644 --- a/apps/ui/src/routes/destinations/[id]/__layout.svelte +++ b/apps/ui/src/routes/destinations/[id]/__layout.svelte @@ -58,11 +58,11 @@ import DeleteIcon from '$lib/components/DeleteIcon.svelte'; import Tooltip from '$lib/components/Tooltip.svelte'; - const { id } = $page.params; const isDestinationDeletable = - destination?.application.length === 0 && - destination?.database.length === 0 && - destination?.service.length === 0; + (destination?.application.length === 0 && + destination?.database.length === 0 && + destination?.service.length === 0) || + true; async function deleteDestination(destination: any) { if (!isDestinationDeletable) return; @@ -88,7 +88,7 @@ } -{#if id !== 'new'} +{#if $page.params.id !== 'new'}