From 35625b22f5c9dc0115e90c4b014e8e22cf6b3a9b Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 21 Oct 2022 22:05:05 +0200 Subject: [PATCH] hm --- apps/api/src/lib.ts | 1 - apps/api/src/lib/services/handlers.ts | 11 ++++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/api/src/lib.ts b/apps/api/src/lib.ts index c519197a5..7bfcfa12e 100644 --- a/apps/api/src/lib.ts +++ b/apps/api/src/lib.ts @@ -13,7 +13,6 @@ export async function migrateServicesToNewTemplate(templates: any) { } let template = templates.find(t => t.name.toLowerCase() === service.type.toLowerCase()); if (template) { - console.log(template.variables.find(v => v.name === "_APP_REDIS_HOST")) template = JSON.parse(JSON.stringify(template).replaceAll('$$id', service.id)) if (service.type === 'plausibleanalytics' && service.plausibleAnalytics) await plausibleAnalytics(service, template) if (service.type === 'fider' && service.fider) await fider(service, template) diff --git a/apps/api/src/lib/services/handlers.ts b/apps/api/src/lib/services/handlers.ts index 68092b6d7..674fd4691 100644 --- a/apps/api/src/lib/services/handlers.ts +++ b/apps/api/src/lib/services/handlers.ts @@ -700,11 +700,11 @@ export async function startService(request: FastifyRequest) { const network = destinationDockerId && destinationDocker.network; const config = {}; for (const service in template.services) { - let newEnviroments = [] + let newEnvironments = [] for (const environment of template.services[service].environment) { const [env, value] = environment.split("="); if (!value.startsWith('$$secret') && value !== '') { - newEnviroments.push(`${env}=${value}`) + newEnvironments.push(`${env}=${value}`) } } @@ -712,8 +712,8 @@ export async function startService(request: FastifyRequest) { for (const secret of secrets) { const { name, value } = secret if (value) { - if (template.services[service].environment.find(env => env.startsWith(`${name}=`)) && !newEnviroments.find(env => env.startsWith(`${name}=`))) { - newEnviroments.push(`${name}=${decrypt(value)}`) + if (template.services[service].environment.find(env => env.startsWith(`${name}=`)) && !newEnvironments.find(env => env.startsWith(`${name}=`))) { + newEnvironments.push(`${name}=${decrypt(value)}`) } } } @@ -726,7 +726,7 @@ export async function startService(request: FastifyRequest) { expose: template.services[service].ports, // ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}), volumes: template.services[service].volumes, - environment: newEnviroments, + environment: newEnvironments, depends_on: template.services[service]?.depends_on, ulimits: template.services[service]?.ulimits, cap_drop: template.services[service]?.cap_drop, @@ -766,6 +766,7 @@ export async function startService(request: FastifyRequest) { volumes: volumeMounts } const composeFileDestination = `${workdir}/docker-compose.yaml`; + console.log(composeFileDestination) await fs.writeFile(composeFileDestination, yaml.dump(composeFile)); await startServiceContainers(destinationDocker.id, composeFileDestination) return {}