From f734154da89db7c49e70fdff4b8c1b6067f77a21 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 12 Oct 2022 11:17:02 +0200 Subject: [PATCH] fix: check compose domains in general --- apps/api/src/lib/common.ts | 6 ++++-- .../src/routes/applications/[id]/index.svelte | 17 ++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/apps/api/src/lib/common.ts b/apps/api/src/lib/common.ts index bb52979ec..d4d2e5d53 100644 --- a/apps/api/src/lib/common.ts +++ b/apps/api/src/lib/common.ts @@ -264,7 +264,9 @@ export async function isDomainConfigured({ where: { OR: [ { fqdn: { endsWith: `//${nakedDomain}` } }, - { fqdn: { endsWith: `//www.${nakedDomain}` } } + { fqdn: { endsWith: `//www.${nakedDomain}` } }, + { dockerComposeConfiguration: { contains: `//${nakedDomain}` } }, + { dockerComposeConfiguration: { contains: `//www.${nakedDomain}` } } ], id: { not: id }, destinationDocker: { @@ -598,7 +600,7 @@ export async function executeDockerCmd({ debug, buildId, applicationId, dockerId command = command.replace(/docker compose/gi, 'docker-compose'); } } - if (command.startsWith(`docker build`) || command.startsWith(`pack build`)|| command.startsWith(`docker compose build`)) { + if (command.startsWith(`docker build`) || command.startsWith(`pack build`) || command.startsWith(`docker compose build`)) { return await asyncExecShellStream({ debug, buildId, applicationId, command, engine }); } return await execaCommand(command, { env: { DOCKER_BUILDKIT: "1", DOCKER_HOST: engine }, shell: true }) diff --git a/apps/ui/src/routes/applications/[id]/index.svelte b/apps/ui/src/routes/applications/[id]/index.svelte index 869c1488a..2679f4418 100644 --- a/apps/ui/src/routes/applications/[id]/index.svelte +++ b/apps/ui/src/routes/applications/[id]/index.svelte @@ -243,13 +243,24 @@ nonWWWDomain = application.fqdn && getDomain(application.fqdn).replace(/^www\./, ''); if (application.deploymentType) application.deploymentType = application.deploymentType.toLowerCase(); - !isBot && - (await post(`/applications/${id}/check`, { + if (!isBot) { + await post(`/applications/${id}/check`, { fqdn: application.fqdn, forceSave, dualCerts, exposePort: application.exposePort - })); + }); + for (const service of dockerComposeServices) { + if (dockerComposeConfiguration[service.name].fqdn) { + await post(`/applications/${id}/check`, { + fqdn: dockerComposeConfiguration[service.name].fqdn, + forceSave, + dualCerts, + exposePort: application.exposePort + }); + } + } + } await post(`/applications/${id}`, { ...application, baseDatabaseBranch,