diff --git a/scripts/deploy-via-docker.js b/scripts/deploy-via-docker.js index ab3fd1b..af308de 100644 --- a/scripts/deploy-via-docker.js +++ b/scripts/deploy-via-docker.js @@ -247,13 +247,21 @@ async function main() { main() .then(async () => { + // On success, keep diagnostics only briefly, then remove the debug file so + // it is not left web-served at /userbase/_debug.txt. Failures keep it for + // post-mortem (see .catch below). await flushDebug(); + try { + if (HELPER_ID) await runExec(HELPER_ID, `rm -f ${HOST_STATIC}/_debug.txt`); + } catch (e) { + console.error('cleanup debug file failed:', e.message); + } if (HELPER_ID) await dockerJson('DELETE', `/containers/${HELPER_ID}?force=true`); process.exit(0); }) .catch(async (err) => { dbg('DEPLOY FAILED: ' + err.stack); - await flushDebug(); + await flushDebug(); // keep debug file on failure for post-mortem if (HELPER_ID) await dockerJson('DELETE', `/containers/${HELPER_ID}?force=true`); console.error('DEPLOY FAILED:', err.message); process.exit(1);