Skip to content

Commit

Permalink
auto update
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed May 21, 2024
0 parents commit 065df81
Show file tree
Hide file tree
Showing 11 changed files with 2,545,574 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: btblocklist

on:
push:
branches:
- master
schedule:
- cron: "0 0 * * *"

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: initialize
run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: remove binary files from history (reduce the repo size)
run: |
git filter-branch --force --index-filter "git rm --cached --ignore-unmatch bt_blocklists.gz" --prune-empty --tag-name-filter cat -- --all
rm -rf .git/refs/original/
git reflog expire --expire=now --all
git gc --prune=now
git gc --aggressive --prune=now
# - name: download from mirror.codebucket.de
# run: |
# wget https://mirror.codebucket.de/transmission/blocklist.p2p.gz -O bt_blocklists.gz

- name: Run build script
run: |
chmod +x ./update.sh
./update.sh
shell: bash

- name: Push
run: |
git add .
git commit -m "auto update"
git push origin --force --all
du -sh .git
- name: Delete the old release
uses: dev-drprasad/delete-tag-and-release@master
with:
delete_release: true
tag_name: master
repo: Naunter/BT_BlockLists
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Push the new release
uses: softprops/action-gh-release@v1
with:
name: bt_blocklists
tag_name: v.1
files: bt_blocklists.gz



117 changes: 117 additions & 0 deletions .github/workflows/main.yml.iblocklist
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- master
schedule:
- cron: "0 0 * * *"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: initialize
run: |
git config user.name github-actions
git config user.email github-actions@github.com

- name: check repo size
run: |
du -h

- name: remove binary files from history (reduce the repo size)
run: |
git filter-branch --force --index-filter "git rm --cached --ignore-unmatch bt_blocklists.gz" --prune-empty --tag-name-filter cat -- --all
rm -rf .git/refs/original/
git reflog expire --expire=now --all
git gc --prune=now
git gc --aggressive --prune=now

- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y wget curl grep gzip findutils git

- name: download from iblocklist
run: |
curl -A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0" -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*\)'.*/\1/p" \
| sed "s/\&/\&/g" \
| sed "s/http/\"http/g" \
| sed "s/gz/gz\"/g" \
| xargs curl -s -L \
| gunzip \
| egrep -v '^#' \
| sed "/^$/d" > bt_blocklists

# Their ssl cert expired at march 1st 2022 (they renewed
- name: download from mirror.codebucket.de
run: |
curl -A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0" -s https://mirror.codebucket.de/transmission/blocklist.p2p >> bt_blocklists

# The author moved to github, format changed
#- name: download from www.wael.name
# run: |
# curl -A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0" -s https://raw.githubusercontent.com/waelisa/Best-blocklist/main/wael.list.txt | sed "/^#.*/d" | grep -Ev "^[0-9][0-9][0-9]\.[0-9][0-9][0-9].*" >> bt_blocklists

- name: remove duplicates
run: |
sort --unique bt_blocklists > bt_blocklists_deduplicated
mv bt_blocklists_deduplicated bt_blocklists

- name: combine all files
run: |
gzip -c bt_blocklists > bt_blocklists.gz

- name: check the file size
run: |
check=`du -s bt_blocklists.gz | awk '{print $1}'`

if [ "$check" -lt 1000 ]
then
exit 2
fi

- name: Push
run: |
git add .
git commit -m "auto update"
git push origin --force --all
du -sh .git

- name: check repo size
run: |
du -h

- name: Delete the old release
uses: dev-drprasad/delete-tag-and-release@v0.2.0
with:
delete_release: true
tag_name: master
repo: Naunter/BT_BlockLists
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Push the new release
uses: softprops/action-gh-release@v1
with:
name: bt_blocklists
tag_name: v.1
files: bt_blocklists.gz

- name: check repo size
run: |
du -h
24 changes: 24 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

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 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.

For more information, please refer to <https://unlicense.org>
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# BT_BlockLists
Transmission block list

# Usage
1. You can either copy https://github.com/Naunter/BT_BlockLists/raw/master/bt_blocklists.gz **OR** https://github.com/Naunter/BT_BlockLists/releases/download/v.1/bt_blocklists.gz

2. Depending on your version, paste the link to `Transmission > Settings > Peers > Blocklist`
**OR**
paste the link to `Transmission > Edit > Preferences > Privacy > Enable blocklist`
3. Click `Update` to update the blocklist.

![Screenshot_2021-10-27_21-08-32](https://user-images.githubusercontent.com/17890335/139168982-26b8ff86-d6e4-493a-bcb1-f1aa40593276.png)

# Update
## 20230201
- Because Node.js 12 actions are deprecated, update `dev-drprasad/delete-tag-and-release@v0.2.0` to `dev-drprasad/delete-tag-and-release@master`.
- Blocklist now create by `update.sh`.

## 20230117
- [#10](https://github.com/Naunter/BT_BlockLists/issues/10). No long use source from iblocklist.com, but you still can find it at [update_iblocklist.sh](https://github.com/Naunter/BT_BlockLists/blob/master/update_iblocklist.sh) and [main.yml.iblocklist](https://github.com/Naunter/BT_BlockLists/blob/master/.github/workflows/main.yml.iblocklist).
- New source is from [mirror.codebucket.de](https://mirror.codebucket.de/transmission/). The author has done a great job and it's all packed. What I did just copy paste, because many people are still using the old download link from my repo. If possible, please support the original author.
- I also created a [new script](https://github.com/Naunter/BT_BlockLists/blob/master/update.sh), it uses some the sources from this issue [#10](https://github.com/Naunter/BT_BlockLists/issues/10).
- Feel free to fork and host your own blocklist.

# Reference
- [Transmission official website](https://transmissionbt.com/)
- [Transmission source code](https://github.com/transmission/transmission)
- [mirror.codebucket.de](https://mirror.codebucket.de/transmission/)
- [Some more sources ... #10](https://github.com/Naunter/BT_BlockLists/issues/10)
- [https://gist.github.com/johntyree/3331662](https://gist.github.com/johntyree/3331662)
- [https://gist.github.com/shmup/29566c5268569069c256](https://gist.github.com/shmup/29566c5268569069c256)
- [GitHub Action for GitHub Push](https://github.com/ad-m/github-push-action)
- [What blocklist does Transmission Use?](https://github.com/transmission/transmission/blob/main/docs/Blocklists.md)
- [iblocklist](https://www.iblocklist.com/lists.php)
- [Wael Best blocklist](https://www.wael.name/other/best-blocklist/)
- [Wael Best blocklist on Github](https://github.com/waelisa/Best-blocklist)
- [Transmission 3.0 Blocklists](https://forum.transmissionbt.com/viewtopic.php?t=20466)
Loading

0 comments on commit 065df81

Please sign in to comment.