diff --git a/cf_gateway_rule_delete.js b/cf_gateway_rule_delete.js index 97949e5..88fd09e 100644 --- a/cf_gateway_rule_delete.js +++ b/cf_gateway_rule_delete.js @@ -28,7 +28,7 @@ async function getZeroTrustRules() { if (!filtered_rule) return console.warn("No rule with matching name found - this is not an issue if you haven't run the create script yet. Exiting."); - console.log(`Deleting rule ${filtered_rule.name} with ID ${filtered_rule.id}`); + console.log(`Deleting rule ` + process.env.CI ? "(redacted, running in CI)" : `${filtered_rule.name} with ID ${filtered_rule.id}`); const resp = await axios.request({ method: 'DELETE', diff --git a/cf_list_create.js b/cf_list_create.js index 2e2c179..f8d71cb 100644 --- a/cf_list_create.js +++ b/cf_list_create.js @@ -75,7 +75,7 @@ fs.readFile('input.csv', 'utf8', async (err, data) => { await createZeroTrustList(listName, properList, (index+1), listsToCreate); await sleep(350); // Sleep for 350ms between list additions } catch (error) { - console.error(`Error creating list "${listName}":`, error.response.data); + console.error(`Error creating list ` + process.env.CI ? "(redacted on CI)" : `"${listName}": ${error.response.data}`); } } }); @@ -119,7 +119,7 @@ async function createZeroTrustList(name, items, currentItem, totalItems) { ); const listId = response.data.result.id; - console.log(`Created Zero Trust list "${name}" with ID ${listId} - ${totalItems - currentItem} left`); + console.log(`Created Zero Trust list ` + process.env.CI ? "(redacted on CI)" : `"${name}" with ID ${listId} - ${totalItems - currentItem} left`); } function percentage(percent, total) { diff --git a/cf_list_delete.js b/cf_list_delete.js index 111f29b..a99d7bb 100644 --- a/cf_list_delete.js +++ b/cf_list_delete.js @@ -31,7 +31,7 @@ async function getZeroTrustLists() { console.log(`Got ${lists.length} lists, ${cgps_lists.length} of which are CGPS lists that will be deleted.`); for (const list of cgps_lists) { - console.log(`Deleting list ${list.name} with ID ${list.id}`); + console.log(`Deleting list ` + process.env.CI ? "(redacted, running in CI)" : `${list.name} with ID ${list.id}`); const resp = await axios.request({ method: 'DELETE', url: `https://api.cloudflare.com/client/v4/accounts/${ACCOUNT_ID}/gateway/lists/${list.id}`,