From 42533ec0aa2cae3cf67ab91577afac2524c3a34c Mon Sep 17 00:00:00 2001 From: Do Siki Date: Wed, 19 Aug 2026 17:13:45 +0200 Subject: [PATCH] =?UTF-8?q?fix(cms):=20deploy=20exec=20was=20missing=20cwd?= =?UTF-8?q?=20=E2=80=94=20landed=20on=20/=20and=20never=20ran?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause of publishes not rebuilding the site: the deploy exec child started in the process working directory (repo root), so 'cd ../../../' resolved to the filesystem root, where creating deploy.log failed with Permission denied. The git publish command already used cwd: CONTENT_DIR; the deploy child now does too (caught via live cwd/touch diagnostics in the service context). Closes MITHOME-74 --- content-editor.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/content-editor.js b/content-editor.js index 6ffb1aa..d292c4a 100644 --- a/content-editor.js +++ b/content-editor.js @@ -314,7 +314,11 @@ const server = http.createServer(async (req, res) => { const deployCmd = process.env.CONTENT_EDITOR_DEPLOY_CMD || `cd ../../../ && ./deploy.sh ${CMS_DEPLOY_ENV} > deploy.log 2>&1`; writeAudit('deploy_spawned', { clientAddress, user: CMS_USER, env: CMS_DEPLOY_ENV }); - exec(deployCmd, { maxBuffer: 8 * 1024 * 1024 }, deployError => { + // WHY cwd: without it the child starts in the process working directory + // (repo root), where `cd ../../../` lands on "/" — no write access, so + // deploy.log creation failed with Permission denied and the deploy never + // ran. CONTENT_DIR is the same base the git publish command uses. + exec(deployCmd, { cwd: CONTENT_DIR, maxBuffer: 8 * 1024 * 1024 }, deployError => { writeAudit('deploy_exec_exit', { clientAddress, user: CMS_USER,