Small script I use for merging hostfiles from different sources. Made for PiHole or Adguard Home.
This script is made to use as a Cronjob. I host this script under a subdomain on a public webhosting so that not only I but also other AdGoard Home devices I serve can use the same list and I dont need to update all manualy but on one central place.
Works with PiHole and Adguard Home.
No documentation for this method. See .github/workflows/main.yml
for the details
- Edit
Cron.php
and ad you're lists to the array. Example:$blacklists = [ __DIR__ . "/custom_blacklist.txt", "https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt", "https://adaway.org/hosts.txt", ]; $whitelist = [ __DIR__ . "/custom_whitelist.txt" ];
- run
docker-compose up -d
- Clone or download the repo to a publicly accessible place like a Apache or NGINX webserver with PHP installed.
- Edit
Cron.php
and ad you're lists to the array. Example:$blacklists = [ __DIR__ . "/custom_blacklist.txt", "https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt", "https://adaway.org/hosts.txt", ]; $whitelist = [ __DIR__ . "/custom_whitelist.txt" ];
- Custom domains can be added to the
custom_blacklist.txt
andcustom_whitelist.txt
located in the Custom directory. - Make a cron job so that the script refresh the lists for example every day or every hour.
- Enter the URL of the whitelist and blacklist in either PiHole or Adguard Home.
- In the
.github/workflows
directory there is a GitHub Actions file calledmain.yml
this file makes it posible to automatic build the files for us every day.
- Credits to the members of the PiHole community for providing a whitelist with domains. Link
- anudeepND/whitelist
- AdguardTeam/AdGuardSDNSFilter
- adaway.org
- StevenBlack/hosts
Description | Status |
---|---|
License | |
Commits | |
Language | |
Open issues | |
Closed issues | |
Pull requests | |
Closed pull requests |
This project is licensed under the MIT License. You are encouraged to embed the project into your other projects, as long as the license permits.
MIT License
Copyright (c) 2024 Bastiaan de Hart
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.