How mrrfv/cloudflare-gateway-pihole-scripts works
CGPS downloads or accepts blocklists and allowlists, normalizes and filters their domains, then synchronizes Cloudflare Gateway lists and blocking rules. Separate scripts handle deletion and list defragmentation; optional SNI filtering and notifications extend those operations. The graph reflects calls shown in excerpts and documented capabilities; some internal API behavior is only partially sampled, so uncertain connections are omitted.
Main entry points: utils.js Retry and notifications · cf_list_create.js Clean and reconcile domains · download_lists.js Download lists · api.js Gateway API operations
Components 18
Filter inputs
- Download lists
download_lists.js - Local filter files
download_lists.js
Domain processing
- Clean and reconcile domains
cf_list_create.js
Gateway management
- Gateway lists
lib/api.js - Create blocking rules
cf_gateway_rule_create.js - Delete blocking rules
cf_gateway_rule_delete.js - Delete filter lists
cf_list_delete.js - Defragment lists
cf_defragment.js - Gateway API operations
lib/api.js
Shared runtime
- File downloads
lib/utils.js - Domain normalization
lib/helpers.js - Domain utilities
lib/utils.js - Authenticated requests
lib/helpers.js - Retry and notifications
lib/utils.js
Other components
- Operator
- List sources
- Cloudflare Gateway
- Notification webhook
Connections 28
- Operator → Download lists: runs
README.md - Operator → Clean and reconcile domains: runs
README.md - Operator → Create blocking rules: runs
README.md - Operator → Delete blocking rules: runs
README.md - Operator → Delete filter lists: runs
README.md - Operator → Defragment lists: runs
- List sources → Download lists: provides URLs
download_lists.js - Download lists → File downloads: downloads through
download_lists.js - File downloads → List sources: fetches files
lib/utils.js - Download lists → Local filter files: writes
download_lists.js - Local filter files → Clean and reconcile domains: reads
cf_list_create.js - Clean and reconcile domains → Domain normalization: normalizes with
cf_list_create.js - Clean and reconcile domains → Domain utilities: validates with
cf_list_create.js - Clean and reconcile domains → Gateway lists: synchronizes
cf_list_create.js - Create blocking rules → Gateway API operations: reads lists and upserts rules
cf_gateway_rule_create.js - Delete blocking rules → Gateway API operations: reads and deletes rules
cf_gateway_rule_delete.js - Delete filter lists → Gateway API operations: reads and deletes lists
cf_list_delete.js - Defragment lists → Gateway API operations: reorganizes lists and rules
cf_defragment.js - Gateway API operations → Authenticated requests: sends requests through
lib/api.js - Authenticated requests → Retry and notifications: retries with
lib/helpers.js - Authenticated requests → Cloudflare Gateway: calls Gateway API
lib/helpers.js - Clean and reconcile domains → Retry and notifications: notifies through
cf_list_create.js - Download lists → Retry and notifications: downloads through
lib/utils.js - Retry and notifications → Notification webhook: posts notifications
lib/utils.js - Create blocking rules → Retry and notifications: notifies through
cf_gateway_rule_create.js - Delete blocking rules → Retry and notifications: notifies through
cf_gateway_rule_delete.js - Delete filter lists → Retry and notifications: notifies through
cf_list_delete.js - Defragment lists → Retry and notifications: notifies through
cf_defragment.js