mirror of
https://github.com/Nezumi-2711/cloudflare-gateway-pihole-scripts.git
synced 2026-09-22 13:38:37 +00:00
Privacy improvements for CI
This commit is contained in:
@@ -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.");
|
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({
|
const resp = await axios.request({
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
|
|||||||
+2
-2
@@ -75,7 +75,7 @@ fs.readFile('input.csv', 'utf8', async (err, data) => {
|
|||||||
await createZeroTrustList(listName, properList, (index+1), listsToCreate);
|
await createZeroTrustList(listName, properList, (index+1), listsToCreate);
|
||||||
await sleep(350); // Sleep for 350ms between list additions
|
await sleep(350); // Sleep for 350ms between list additions
|
||||||
} catch (error) {
|
} 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;
|
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) {
|
function percentage(percent, total) {
|
||||||
|
|||||||
+1
-1
@@ -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.`);
|
console.log(`Got ${lists.length} lists, ${cgps_lists.length} of which are CGPS lists that will be deleted.`);
|
||||||
|
|
||||||
for (const list of cgps_lists) {
|
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({
|
const resp = await axios.request({
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
url: `https://api.cloudflare.com/client/v4/accounts/${ACCOUNT_ID}/gateway/lists/${list.id}`,
|
url: `https://api.cloudflare.com/client/v4/accounts/${ACCOUNT_ID}/gateway/lists/${list.id}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user