From cb2a357b0156aa0220efa0b8de6b21d8a99a9ea6 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Thu, 17 Aug 2023 22:42:06 +0200 Subject: [PATCH] remove logging by default --- src/cli/utils/runner.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/cli/utils/runner.js b/src/cli/utils/runner.js index d74a7a5928..4869111d64 100644 --- a/src/cli/utils/runner.js +++ b/src/cli/utils/runner.js @@ -1,13 +1,20 @@ import program from './commander'; function logStartupOptions(options) { + if (!options.verbose) { + return; + } + // Keys that may include sensitive information that will be redacted in logs + const keysToRedact = [ + 'databaseURI', + 'masterKey', + 'maintenanceKey', + 'push', + ]; for (const key in options) { let value = options[key]; - if (key == 'masterKey') { - value = '***REDACTED***'; - } - if (key == 'push' && options.verbose != true) { - value = '***REDACTED***'; + if (keysToRedact.includes(key)) { + value = ''; } if (typeof value === 'object') { try {