From 9b5e8b13ba207c3382082913214f82d366400d56 Mon Sep 17 00:00:00 2001 From: Bruno Menezes Date: Wed, 22 Jul 2026 11:22:57 +0100 Subject: [PATCH 01/11] refactor(deploy): Remove migration:apply as dependency of process:prod command. Update the description to highlight that. --- commands.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/commands.json b/commands.json index d630ea3..8267856 100644 --- a/commands.json +++ b/commands.json @@ -63,8 +63,7 @@ "cmd": ["node", "--require=dotenv/config", "lib/main.js"] }, "process:prod": { - "description": "Start the squid processor", - "deps": ["migration:apply"], + "description": "Start the squid processor. It does not apply migration or load .env", "cmd": ["node", "lib/main.js"], "hidden": true }, From e46d8e71c24d81c01e643b489861afeaa7df72ad Mon Sep 17 00:00:00 2001 From: Bruno Menezes Date: Wed, 22 Jul 2026 11:32:48 +0100 Subject: [PATCH 02/11] refactor: Refactor database_url derivation and replace shellJS with node:child_process for safer control mechanism * Replace deprecated url.parse with URL API. * Replace shell creation with child_process spawn function for better process control, security and portability. It avoid embedding credentials in a string command that may leak in logs or if misquoted may change the underline command or due to shell injection cause security issues. --- deploy/run | 98 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 76 insertions(+), 22 deletions(-) diff --git a/deploy/run b/deploy/run index 0debb79..92d0d55 100644 --- a/deploy/run +++ b/deploy/run @@ -22,44 +22,98 @@ */ const url = require('node:url'); -const shell = require('shelljs'); +const { spawn } = require('node:child_process'); const yargs = require('yargs'); const { hideBin } = require('yargs/helpers'); -const argv = yargs(hideBin(process.argv)).argv; +const argv = yargs(hideBin(process.argv)) + .usage('Usage: $0 --npmScriptName=