From b3a36514d1fabe571f589b5edfde143b929c41de Mon Sep 17 00:00:00 2001 From: Z User Date: Thu, 29 Oct 2026 11:53:08 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20Dokploy=20saveEnvironment=20=E2=80=94=20?= =?UTF-8?q?use=20.env-style=20string=20+=20required=20fields=20(buildArgs,?= =?UTF-8?q?=20buildSecrets,=20createEnvFile)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/dokploy.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lib/dokploy.ts b/src/lib/dokploy.ts index a355569..ab07812 100644 --- a/src/lib/dokploy.ts +++ b/src/lib/dokploy.ts @@ -187,11 +187,16 @@ export function createDokployClient(config: DokployConfig) { } async function saveEnvironment(applicationId: string, envVars: Record): Promise { - // Dokploy expects env as array of { key, value } objects OR a JSON string - const envArray = Object.entries(envVars).map(([key, value]) => ({ key, value })) + // Dokploy expects env as a .env-style string (KEY=value\nKEY2=value2) + const envString = Object.entries(envVars) + .map(([key, value]) => `${key}=${value}`) + .join('\n') await call('/application.saveEnvironment', { applicationId, - env: JSON.stringify(envArray), + env: envString, + buildArgs: '[]', + buildSecrets: '[]', + createEnvFile: true, }) }