Skip to content

Commit 97566e9

Browse files
authored
Merge pull request #128 from mrrfv/blocklist-summer-cleaning
Blocklist summer cleaning
2 parents f105a6d + 73a7ac3 commit 97566e9

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Cloudflare Gateway Pi-hole Scripts (CGPS)
22

3-
![Cloudflare Gateway Analytics screenshot](.github/images/gateway_analytics.png)
3+
![Cloudflare Gateway Analytics screenshot showing a thousand blocked DNS requests](.github/images/gateway_analytics.png)
44

55
Cloudflare Gateway allows you to create custom rules to filter HTTP, DNS, and network traffic based on your firewall policies. This is a collection of scripts that can be used to get a similar experience as if you were using Pi-hole, but with Cloudflare Gateway - so no servers to maintain or need to buy a Raspberry Pi!
66

@@ -19,7 +19,7 @@ Cloudflare Gateway allows you to create custom rules to filter HTTP, DNS, and ne
1919
- Automatically cleans up filter lists: removes duplicates, invalid domains, comments and more
2020
- Works **fully unattended**
2121
- **Allowlist support**, allowing you to prevent false positives and breakage by forcing trusted domains to always be unblocked.
22-
- Experimental **SNI-based filtering** support that works independently of DNS settings, preventing unauthorized or malicious DNS changes from bypassing the filter.
22+
- Experimental **SNI-based filtering** that works independently of DNS settings, preventing unauthorized or malicious DNS changes from bypassing the filter.
2323
- Optional health check: Sends a ping request ensuring continuous monitoring and alerting for the workflow execution, or messages a Discord webhook with progress.
2424

2525
## Usage
@@ -39,7 +39,7 @@ Cloudflare Gateway allows you to create custom rules to filter HTTP, DNS, and ne
3939
2. Run `npm install` to install dependencies.
4040
3. Copy `.env.example` to `.env` and fill in the values.
4141
4. If this is a subsequent run, execute `node cf_gateway_rule_delete.js` and `node cf_list_delete.js` (in order) to delete old data.
42-
5. If you haven't downloaded any filters yourself, run the `node download_lists.js` command to download recommended filter lists (about 250 000 domains).
42+
5. If you haven't downloaded any filters yourself, run the `node download_lists.js` command to download recommended filter lists (about 50 000 domains).
4343
6. Run `node cf_list_create.js` to create the lists in Cloudflare Gateway. This will take a while.
4444
7. Run `node cf_gateway_rule_create.js` to create the firewall rule in Cloudflare Gateway.
4545
8. Profit!
@@ -73,6 +73,10 @@ Please note that the GitHub Action downloads the recommended blocklists and whit
7373

7474
Alternatively, you can install the Cloudflare WARP client and log in to Zero Trust. This method proxies your traffic over Cloudflare servers, meaning it works similarly to a commercial VPN. You need to do this if you want to use the SNI-based filtering feature, as it requires Cloudflare to inspect your raw traffic (HTTPS remains encrypted if "TLS decryption" is disabled).
7575

76+
### Malware blocking
77+
78+
The default filter lists are only optimized for ad & tracker blocking because Cloudflare Zero Trust itself comes with much more advanced security features. It's recommended that you create your own Cloudflare Gateway firewall policies that leverage those features on top of CGPS.
79+
7680
### Dry runs
7781

7882
To see if e.g. your filter lists are valid without actually changing anything in your Cloudflare account, you can set the `DRY_RUN` environment variable to 1, either in `.env` or the regular way. This will only print info such as the lists that would be created or the amount of duplicate domains to the console.

lib/constants.js

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -56,46 +56,42 @@ export const USER_DEFINED_BLOCKLIST_URLS = process.env.BLOCKLIST_URLS
5656

5757
// These are the default blocklists and allowlists that are used by the script if the user doesn't provide any URLs by themselves.
5858
// The files are dynamically fetched from the internet, therefore it's important to choose only the most reliable sources.
59-
// Commented out lists are subject to removal.
59+
// Commented out lists are subject to removal.
60+
61+
// You can have an unlimited number of allowlists, unlike blocklists.
6062
export const RECOMMENDED_ALLOWLIST_URLS = [
63+
// Torrent trackers
6164
"https://raw.githubusercontent.com/im-sm/Pi-hole-Torrent-Blocklist/main/all-torrent-trackres.txt",
62-
"https://raw.githubusercontent.com/AdguardTeam/HttpsExclusions/master/exclusions/banks.txt",
63-
//"https://raw.githubusercontent.com/hagezi/dns-blocklists/main/whitelist.txt",
65+
// Banks
66+
"https://raw.githubusercontent.com/AdguardTeam/HttpsExclusions/master/exclusions/banks.txt",
67+
// Official Discord domains
68+
"https://raw.githubusercontent.com/Dogino/Discord-Phishing-URLs/main/official-domains.txt",
69+
// macOS specific
70+
"https://raw.githubusercontent.com/AdguardTeam/HttpsExclusions/master/exclusions/mac.txt",
71+
// Windows specific
72+
"https://raw.githubusercontent.com/AdguardTeam/HttpsExclusions/master/exclusions/windows.txt",
73+
// URL shorteners
74+
"https://raw.githubusercontent.com/boutetnico/url-shorteners/master/list.txt",
75+
// Firefox sync, add-ons, etc.
76+
"https://raw.githubusercontent.com/AdguardTeam/HttpsExclusions/master/exclusions/firefox.txt",
77+
// Android apps
78+
"https://raw.githubusercontent.com/AdguardTeam/HttpsExclusions/master/exclusions/android.txt",
79+
80+
// General allowlists
6481
"https://raw.githubusercontent.com/TogoFire-Home/AD-Settings/main/Filters/whitelist.txt",
65-
// Older fork of an unmaintained project
66-
//"https://raw.githubusercontent.com/freekers/whitelist/master/domains/whitelist.txt",
6782
"https://raw.githubusercontent.com/DandelionSprout/AdGuard-Home-Whitelist/master/whitelist.txt",
6883
"https://raw.githubusercontent.com/AdguardTeam/AdGuardSDNSFilter/master/Filters/exclusions.txt",
69-
//"https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/optional-list.txt",
7084
"https://raw.githubusercontent.com/AdguardTeam/HttpsExclusions/master/exclusions/issues.txt",
71-
// Broken link
72-
//"https://raw.githubusercontent.com/hagezi/dns-blocklists/main/whitelist-referral.txt",
73-
"https://raw.githubusercontent.com/mawenjian/china-cdn-domain-whitelist/master/china-cdn-domain-whitelist.txt",
74-
// Whitelists doubleclick.net and googleadservices.com
75-
//"https://raw.githubusercontent.com/notracking/hosts-blocklists-scripts/master/hostnames.whitelist.txt",
76-
"https://raw.githubusercontent.com/AdguardTeam/HttpsExclusions/master/exclusions/mac.txt",
77-
"https://raw.githubusercontent.com/boutetnico/url-shorteners/master/list.txt",
78-
"https://raw.githubusercontent.com/AdguardTeam/HttpsExclusions/master/exclusions/windows.txt",
79-
"https://raw.githubusercontent.com/Dogino/Discord-Phishing-URLs/main/official-domains.txt",
80-
// This one seems okay, but may be too broad for some users. It whitelists small analytics services and domains associated with ad networks.
81-
//"https://raw.githubusercontent.com/ookangzheng/blahdns/master/hosts/whitelist.txt",
82-
"https://raw.githubusercontent.com/AdguardTeam/HttpsExclusions/master/exclusions/android.txt",
83-
"https://raw.githubusercontent.com/AdguardTeam/HttpsExclusions/master/exclusions/sensitive.txt",
84-
// Unmaintained
85-
//"https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/whitelist.txt",
86-
"https://raw.githubusercontent.com/AdguardTeam/HttpsExclusions/master/exclusions/firefox.txt",
87-
// Commented out because it whitelists sites including doubleclick.net and ad.atdmt.com
88-
// https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/referral-sites.txt,
8985
// Uncomment the line below to use OISD's most commmonly whitelisted list
9086
// https://local.oisd.nl/extract/commonly_whitelisted.php,
9187
];
9288

89+
// The default blocklist settings are optimized for performance while still blocking a lot.
90+
// Adding too many blocklists may slow down DNS response times and thus your internet speed.
91+
// If you'd like to use something larger, consider something like hagezi's Multi LIGHT:
92+
// https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/domains/light.txt
9393
export const RECOMMENDED_BLOCKLIST_URLS = [
94-
"https://raw.githubusercontent.com/mullvad/dns-blocklists/main/output/doh/doh_adblock.txt",
95-
// Commented out as it seems to cause the blocklist to exceed 300,000 domains as of Nov 9, 2023
96-
// "https://raw.githubusercontent.com/mullvad/dns-blocklists/main/output/doh/doh_gambling.txt",
97-
"https://raw.githubusercontent.com/mullvad/dns-blocklists/main/output/doh/doh_privacy.txt",
98-
"https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Risk/hosts",
94+
"https://small.oisd.nl/",
95+
// Only blocks mobile ads and analytics. Very tiny; comment the rest out and only use this one for the absolute best performance.
9996
"https://adaway.org/hosts.txt",
100-
"https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts",
10197
];

0 commit comments

Comments
 (0)