From 2233e49c80fe21f6e691fe60262b8308feb36b88 Mon Sep 17 00:00:00 2001 From: Paul <22284856+ProgramComputer@users.noreply.github.com> Date: Thu, 1 Jul 2021 14:55:46 -0500 Subject: [PATCH 1/9] Update hostsblock.c --- hostsblock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hostsblock.c b/hostsblock.c index edc6f4a..e45371f 100644 --- a/hostsblock.c +++ b/hostsblock.c @@ -133,7 +133,7 @@ int main(int argc, char **argv) if (c == NULL || feof(list) || ferror(list)) break; if (!get_domain(rule, domain)) { - printf("0\t%s\n", domain); + printf("0.0.0.0\t%s\n", domain); } } From dc5e557d3ab29bd7db82958ef5770bd8c18aed53 Mon Sep 17 00:00:00 2001 From: Paul <22284856+ProgramComputer@users.noreply.github.com> Date: Thu, 1 Jul 2021 18:30:07 -0500 Subject: [PATCH 2/9] Update hostsblock.c --- hostsblock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hostsblock.c b/hostsblock.c index e45371f..226b164 100644 --- a/hostsblock.c +++ b/hostsblock.c @@ -133,7 +133,7 @@ int main(int argc, char **argv) if (c == NULL || feof(list) || ferror(list)) break; if (!get_domain(rule, domain)) { - printf("0.0.0.0\t%s\n", domain); + printf("0.0.0.0 %s\n", domain); } } From 14e62caae85b770e5ed1d5e5772703fac3720799 Mon Sep 17 00:00:00 2001 From: Paul <22284856+ProgramComputer@users.noreply.github.com> Date: Fri, 2 Jul 2021 12:49:26 -0500 Subject: [PATCH 3/9] Create test.yml --- .github/workflows/test.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..541206f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +name: test +on: push +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: checkout repo content + uses: actions/checkout@v2 # checkout the repository content to github runner. + - name: setup python + uses: actions/setup-python@v2 + with: + python-version: 3.8 #install the python needed + - name: execute py script # run the run.py to get the latest data + run: | + make + mkdir -p Test + curl -s https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt | hostsblock > ./Test/hosts + sudo rm hostsblock + env: + key: ${{ secrets.key }} # if run.py requires passwords..etc, set it as secrets + - name: Commit files # transfer the new html files back into the repository + run: | + git config --local user.name "Test" + git add . + git commit -m "test" + - name: Push changes # push the output folder to your repo + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + force: true + From a9ea4e5c808347d548620b6e157e9bac5787353b Mon Sep 17 00:00:00 2001 From: Paul <22284856+ProgramComputer@users.noreply.github.com> Date: Fri, 2 Jul 2021 12:51:05 -0500 Subject: [PATCH 4/9] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 541206f..f753db3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: run: | make mkdir -p Test - curl -s https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt | hostsblock > ./Test/hosts + curl -s https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt | ./hostsblock > ./Test/hosts sudo rm hostsblock env: key: ${{ secrets.key }} # if run.py requires passwords..etc, set it as secrets From ad46cd06f8198387afc653711140ef0621600183 Mon Sep 17 00:00:00 2001 From: Test Date: Fri, 2 Jul 2021 17:51:19 +0000 Subject: [PATCH 5/9] test --- Test/hosts | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Test/hosts diff --git a/Test/hosts b/Test/hosts new file mode 100644 index 0000000..e69de29 From 670765d02fc498082cad6d80b0c551cdad7bb49b Mon Sep 17 00:00:00 2001 From: Paul <22284856+ProgramComputer@users.noreply.github.com> Date: Fri, 2 Jul 2021 12:53:48 -0500 Subject: [PATCH 6/9] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f753db3..09af481 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: run: | make mkdir -p Test - curl -s https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt | ./hostsblock > ./Test/hosts + curl -s https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt | ./hostsblock - > ./Test/hosts sudo rm hostsblock env: key: ${{ secrets.key }} # if run.py requires passwords..etc, set it as secrets From a454e2dfbdb393a35998477203a7ec1e34825507 Mon Sep 17 00:00:00 2001 From: Paul <22284856+ProgramComputer@users.noreply.github.com> Date: Fri, 2 Jul 2021 12:57:46 -0500 Subject: [PATCH 7/9] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 09af481..58ac65c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: run: | make mkdir -p Test - curl -s https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt | ./hostsblock - > ./Test/hosts + curl -s https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt | hostsblock - > ./Test/hosts sudo rm hostsblock env: key: ${{ secrets.key }} # if run.py requires passwords..etc, set it as secrets From b5c0a49d6e3df6134ff2132bf98dc4961be3f4aa Mon Sep 17 00:00:00 2001 From: Paul <22284856+ProgramComputer@users.noreply.github.com> Date: Fri, 2 Jul 2021 12:58:49 -0500 Subject: [PATCH 8/9] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 58ac65c..09af481 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: run: | make mkdir -p Test - curl -s https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt | hostsblock - > ./Test/hosts + curl -s https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt | ./hostsblock - > ./Test/hosts sudo rm hostsblock env: key: ${{ secrets.key }} # if run.py requires passwords..etc, set it as secrets From 49128472cfe80abea75c690b97422bb8d3aae2df Mon Sep 17 00:00:00 2001 From: Paul <22284856+ProgramComputer@users.noreply.github.com> Date: Mon, 30 Oct 2023 20:25:46 -0500 Subject: [PATCH 9/9] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a82037a..2314cf7 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ About hostsblock finds any domain-only blocking rules in an AdBlock Plus filter list (e.g. of the form `||some.domain.com^` or `||some.domain.com|`) and prints them -as host file entries for 127.0.0.1 (e.g. `127.0.0.1 some.domain.com`). +as host file entries for 0.0.0.0 (e.g. `0.0.0.0 some.domain.com`). Standalone ad-blocking hosts files like http://someonewhocares.org/hosts/hosts are good, but since ABP filter lists are far more common and frequently updated, @@ -37,3 +37,6 @@ file: curl -s https://www.fanboy.co.nz/r/fanboy-ultimate.txt | hostsblock | cat /etc/hosts~ - > /etc/hosts +TODO +----- +Add Option to have ::1 instead of 0.0.0.0 for ipv6