Skip to content

Cloudflare Gateway Pi-hole Scripts

Active
mrrfv/cloudflare-gateway-pihole-scripts

Get a Pi-hole-style, network-wide ad, malware and tracker blocker with Cloudflare Gateway DNS — no server or Raspberry Pi to maintain.

View on GitHub
Stars
849
Forks
1.5k
Watchers
849
Open issues
21

Overview

Cloudflare Gateway Pi-hole Scripts (CGPS) give you a Pi-hole-like experience using Cloudflare Gateway: Gateway’s custom DNS rules block ads, malware and tracking domains, so there is no server to maintain and no Raspberry Pi to buy.

The scripts

  • cf_list_create.js — turns a blocklist.txt of domains into lists in Cloudflare Gateway
  • cf_gateway_rule_create.js — creates a Gateway rule that blocks traffic matching those lists
  • cf_list_delete.js and cf_gateway_rule_delete.js — remove everything CGPS created, useful before a fresh run

Keeping blocklists up to date

Run the scripts locally, or schedule them with GitHub Actions in a private repository so your filters update automatically. The workflow downloads the recommended blocklists and allowlist by default, reads your Cloudflare credentials from Actions secrets, and can ping a monitoring URL after each successful update. The README recommends local runs where possible.

Similar open-source projects, ranked by shared categories and tags.

All Network projects →