From edc708f8ff878115336f45b64bd17e45a2bfce17 Mon Sep 17 00:00:00 2001 From: 123Haynes <209302+123Haynes@users.noreply.github.com> Date: Thu, 2 Apr 2026 21:02:05 +0000 Subject: [PATCH] log which url was used to fetch the malware lists and why --- packages/safe-chain/src/config/settings.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/safe-chain/src/config/settings.js b/packages/safe-chain/src/config/settings.js index 7aab75f..47c98c4 100644 --- a/packages/safe-chain/src/config/settings.js +++ b/packages/safe-chain/src/config/settings.js @@ -1,6 +1,7 @@ import * as cliArguments from "./cliArguments.js"; import * as configFile from "./configFile.js"; import * as environmentVariables from "./environmentVariables.js"; +import { ui } from "../environment/userInteraction.js"; export const LOGGING_SILENT = "silent"; export const LOGGING_NORMAL = "normal"; @@ -207,23 +208,31 @@ export function getMalwareListBaseUrl() { // Priority 1: CLI argument const cliValue = cliArguments.getMalwareListBaseUrl(); if (cliValue) { - return removeTrailingSlashes(cliValue); + const url = removeTrailingSlashes(cliValue); + ui.writeInformation(`Fetching malware lists from ${url} as defined by CLI argument --safe-chain-malware-list-base-url`); + return url; } // Priority 2: Environment variable const envValue = environmentVariables.getMalwareListBaseUrl(); if (envValue) { - return removeTrailingSlashes(envValue); + const url = removeTrailingSlashes(envValue); + ui.writeInformation(`Fetching malware lists from ${url} as defined by environment variable SAFE_CHAIN_MALWARE_LIST_BASE_URL`); + return url; } // Priority 3: Config file const configValue = configFile.getMalwareListBaseUrl(); if (configValue) { - return removeTrailingSlashes(configValue); + const url = removeTrailingSlashes(configValue); + ui.writeInformation(`Fetching malware lists from ${url} as defined by config file (malwareListBaseUrl)`); + return url; } // Default - return removeTrailingSlashes("https://malware-list.aikido.dev"); + const url = removeTrailingSlashes("https://malware-list.aikido.dev"); + ui.writeInformation(`Fetching malware lists from ${url} (default)`); + return url; } /**