-
If you receive an email saying that the Github Action will be disabled, When it is disabled, you go to the Github Action and turn it on and it will work forever.
-
Major update, you can run cron every hour, no need to worry about losing blocking effect, no damage to Cloudflare Gateway server
-
You must delete the lists of other scripts.
-
Don't worry about the number of listings on Cloudflare Gateway, for example there are 132k domains but the number of listings can be 140
-
To add a separate white list inviting visit Cloudflare-Gateway-Allow
For Devs, Ops, and everyone who hates Ads.
Create your ad blocklist using Cloudflare Gateway.
Thanks a lot to @nhubaotruong for his contributions.
Readme by @minlaxz.
Added dynamic domain filter (whitelist and blacklist) idea (please check
inifiles, as you may also need to modify those).Added dynamic domain filter (whitelist and blacklist) to Actions variables (please check dynamic_blacklist.txt and dynamic_whitelist.txt. to know examples to add
Value*).UseDYNAMIC_BLACKLISTandDYNAMIC_WHITELISTforName*in Actions variables
- Two kinds of lists in ini files: white list whitelist.ini and block list adlist.ini.
https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txtor
[Ad-Urls]
Adguard = https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt-
Add to file:
White list whitelist.ini and block list adlist.ini.
-
Add to GitHub Action variables:
Name*ADLIST_URLSorWHITELIST_URLS.Value*URLs listExample:
https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt https://raw.githubusercontent.com/hagezi/dns-blocklists/main/wildcard/light-onlydomains.txt -
You should add your ad list and whitelist to Action variables. If you update your fork, your custom list will not be lost.
-
Fork this repository to your account.
-
Grab your Cloudflare Account ID (found after
https://dash.cloudflare.com/) from ➞ https://dash.cloudflare.com/?to=/:account/workers. -
Create your API Token from ➞ https://dash.cloudflare.com/profile/api-tokens with 3 permissions:
Account.Zero Trust : EditAccount.Account Firewall Access Rules : EditAccount.Access: Apps and Policies : Edit
-
Add Repository Secrets to your forked repository:
➞ https://github.com/<username>/<forked-repository>/settings/secrets/actions- Set Cloudflare Account ID to
CF_IDENTIFIER. - Set API Token to
CF_API_TOKEN.
- Set Cloudflare Account ID to
To use this tool on the GOAT Termux, follow the steps below. If you are already familiar with setting up Python and the basics, you can skip this section.
- Open Termux and run the following commands one by one:
yes | pkg upgrade
yes | pkg install python-pip
yes | pkg install git
# Clone your forked repo #
git clone https://github.com/<username>/<repo-name>.git- Navigate to the cloned repository folder:
cd <repo-name>- Edit the
.envfile (required):
nano .envAfter editing, press CTRL + X, then Y, and ENTER to save the file.
- Run the command to upload (update) your DNS list:
python -m src run- Run the command to delete your DNS list:
python -m src leave -
Download the ZIP file of the repository from the 'Code' button on the GitHub page and select 'Download ZIP'.
-
Unzip the downloaded file.
-
Edit the values in
.envandadlist.inietc... -
Open Termux and enter the following commands to set up Python and necessary tools:
yes | pkg upgrade
yes | pkg install python-pip
termux-setup-storage-
Allow Termux to access storage.
-
Navigate to the folder containing the unzipped source code:
cd storage/downloads/Cloudflare-Gateway-Pihole-main- Run the command to upload (update) your DNS list:
python -m src run- Run the command to delete your DNS list:
python -m src leaveIf you encounter issues during setup, you can refer to termux-change-repo for changing Termux repositories.
-
The limit of
Cloudflare Gateway Zero Trustfree is 300k domains, so remember to pay attention to the workflow logs. If it is exceeded, the script will stop. -
If you have uploaded lists using another script, you should delete them using the delete feature of the uploaded script or delete them manually.
-
I have updated the feature to delete lists when you no longer need to use the script. Go to main.yml as follows:
- name: Cloudflare Gateway Zero Trust
run: python -m src leaveNote from @minlaxz:
- Domain list style: I personally preferred the second one in blacklist styles, which is more readable and concise.
- Dynamic domain list: You can also update your dynamic (fluid) whitelist and blacklist using dynamic_blacklist.txt and dynamic_whitelist.txt.
- Deprecated using
.env: Setting sensitive information inside a public repository is considered too dangerous, since any unwanted person could easily steal your Cloudflare credentials from that.envfile.