From 98ac53d621ce498273519cb84ca6877b63ad63fe Mon Sep 17 00:00:00 2001 From: runetsoldier Date: Mon, 14 Oct 2024 07:40:13 +0300 Subject: [PATCH] Initial commit --- .github/workflows/build.yml | 110 ++++++++++++++++++++++++++++++++++++ README.md | 57 ++++++++++++++++++- 2 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..9514387 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,110 @@ +name: build.yml +on: + workflow_dispatch: + schedule: + - cron: "0 3,9,15,21 * * *" + push: + branches: + - master + paths-ignore: + - "**/README.md" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Set variables + run: | + echo "RELEASE_NAME=Released on $(date +%Y%m%d%H%M)" >> $GITHUB_ENV + echo "TAG_NAME=$(date +%Y%m%d%H%M)" >> $GITHUB_ENV + + echo "ANTIFILTER_DOWNLOAD=https://antifilter.download/list/domains.lst" >> $GITHUB_ENV + echo "ANTIFILTER_DOWNLOAD_COMMUNITY=https://community.antifilter.download/list/domains.lst" >> $GITHUB_ENV + echo "REFILTER_ALL=https://raw.githubusercontent.com/1andrevich/Re-filter-lists/refs/heads/main/domains_all.lst" >> $GITHUB_ENV + + echo "PETERLOWE_REJECT_URL=https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext" >> $GITHUB_ENV + echo "ADGUARD_DNS_REJECT_URL=https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt" >> $GITHUB_ENV + echo "WIN_SPY=https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt" >> $GITHUB_ENV + echo "WIN_UPDATE=https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/update.txt" >> $GITHUB_ENV + echo "WIN_EXTRA=https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/extra.txt" >> $GITHUB_ENV + + + echo "GFW=https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/refs/heads/release/gfw.txt" >> $GITHUB_ENV + echo "GREATFIRE=https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/refs/heads/release/greatfire.txt" >> $GITHUB_ENV + shell: bash + + - name: Checkout runetfreedom/domain-list-custom + uses: actions/checkout@v4 + with: + repository: runetfreedom/domain-list-custom + path: custom + + - name: Checkout v2fly/domain-list-community + uses: actions/checkout@v4 + with: + repository: v2fly/domain-list-community + path: community + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: ./custom/go.mod + cache-dependency-path: ./custom/go.sum + + - name: Get and add domain lists + run: | + curl -sSL $ANTIFILTER_DOWNLOAD > ./antifilter-download.txt + curl -sSL $ANTIFILTER_DOWNLOAD_COMMUNITY > ./antifilter-download-community.txt + curl -sSL $REFILTER_ALL > ./refilter.txt + curl -sSL $WIN_SPY | grep "0.0.0.0" | awk '{print $2}' > ./win-spy.txt + curl -sSL $WIN_UPDATE | grep "0.0.0.0" | awk '{print $2}' > ./win-update.txt + curl -sSL $WIN_EXTRA | grep "0.0.0.0" | awk '{print $2}' > ./win-extra.txt + + curl -sSL $GFW > ./community/data/gfw.txt + curl -sSL $GREATFIRE > ./community/data/greatfire.txt + + cp {antifilter-download,antifilter-download-community,refilter,win-spy,win-update,win-extra}.txt ./community/data/ + for f in ./community/data/*.txt; do mv "$f" "${f//.txt/}"; done + + - name: Build Russia general blocked list + run: | + echo "include:antifilter-download-community" > ./community/data/ru-blocked + echo "include:refilter" >> ./community/data/ru-blocked + + echo "include:antifilter-download" > ./community/data/ru-blocked-all + echo "include:antifilter-download-community" >> ./community/data/ru-blocked-all + echo "include:refilter" >> ./community/data/ru-blocked-all + + - name: Build geosite.dat file + run: | + cd custom || exit 1 + go run ./ --exportlists=category-ads-all,google,youtube,discord,ru-blocked,ru-blocked-all,private --datapath=../community/data + + - name: Move and zip files and generate sha256 hash + run: | + install -Dp ./custom/publish/geosite.dat ./publish/geosite.dat + install -p {antifilter-download,antifilter-download-community,refilter,win-spy,win-update,win-extra}.txt ./publish/ + install -p ./custom/publish/{ru-blocked,ru-blocked-all,discord,youtube,google,private,category-ads-all}.txt ./publish/ + + sha256sum ./publish/geosite.dat > ./publish/geosite.dat.sha256sum + + - name: Release and upload assets + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + release_name: ${{ env.RELEASE_NAME }} + tag: ${{ env.TAG_NAME }} + file_glob: true + file: ./publish/* + + - name: Git push assets to "release" branch + run: | + cd publish || exit 1 + git init + git config --local user.name "github-actions[bot]" + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git checkout -b release + git add . + git commit -m "${{ env.RELEASE_NAME }}" + git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" + git push -f -u origin release \ No newline at end of file diff --git a/README.md b/README.md index ac89319..c6e3c1d 100644 --- a/README.md +++ b/README.md @@ -1 +1,56 @@ -# russia-blocked-geosite \ No newline at end of file +# Что это? + +Этот проект каждые 6 часов автоматически генерирует GeoSite файлы, в которые включены списки заблокированных Роскомнадзором доменов для различного рода маршрутизаторов трафика и Proxy/VPN приложений. + +Данные о блокировках роскомнадзора получаются из следующих источников: +- [antifilter.download](https://antifilter.download/) +- [community.antifilter.download](https://community.antifilter.download/) +- [re:filter](https://github.com/1andrevich/Re-filter-lists) + +Дополнительно используются: +- [@v2fly/domain-list-community](https://github.com/v2fly/domain-list-community/tree/master/data) - огромный список доменов, разбитых по множеству сервисов, компаний и категорий. +- [AdGuard Dns Filter](https://github.com/AdguardTeam/AdguardSDNSFilter) - список рекламных доменов +- [Peter Lowe’s list](https://pgl.yoyo.org/adservers/serverlist.php) - список рекламных доменов +- [WindowsSpyBlocker](https://github.com/crazy-max/WindowsSpyBlocker) - список доменов, используемых windows (в том числе для слежки и сбора аналитики) + + +## Доступные категории + +- Все категории из [@v2fly/domain-list-community](https://github.com/v2fly/domain-list-community/tree/master/data). Включая: google, discord, youtube, twitter, meta, openai и так далее. +- `geosite:ru-blocked` - заблокированные в россии домены (`antifilter-download-community` + `re:filter`) +- `geosite:ru-blocked-all` - **все известные** заблокированные в россии домены (`antifilter-download` + `antifilter-download-community` + `re:filter`). Список содержит не менее 700 тысяч доменов, употреблять с осторожностью. +- `geosite:antifilter-download` - все домены из `antifilter.download` (почти 700 тысяч, употреблять с осторожностью) +- `geosite:antifilter-download-community` - все домены из `community.antifilter.download` +- `geosite:refilter` - все домены из `re:filter` +- `geosite:category-ads-all` - все рекламные домены +- `geosite:win-spy` - домены, используемые windows для слежки и сбора аналитики +- `geosite:win-update` - домены, используемые windows для обновлений +- `geosite:win-extra` - прочие домены, используемые windows + +Релиз так же содержит эти категории в виде текстовых файлов со списком доменов. + +# Cкачать + +По ссылкам ниже всегда доступна последняя версия файлов. + +- **github** + - [https://raw.githubusercontent.com/runetfreedom/russia-blocked-geosite/release/geosite.dat](https://raw.githubusercontent.com/runetfreedom/russia-blocked-geosite/release/geosite.dat) + - Hashsum: [https://raw.githubusercontent.com/runetfreedom/russia-blocked-geosite/release/geosite.dat.sha256sum](https://raw.githubusercontent.com/runetfreedom/russia-blocked-geosite/release/geosite.dat.sha256sum) +- **JSDelivr** + - [https://cdn.jsdelivr.net/gh/runetfreedom/russia-blocked-geosite@release/geosite.dat](https://cdn.jsdelivr.net/gh/runetfreedom/russia-blocked-geosite@release/geosite.dat) + - Hashsum: [https://cdn.jsdelivr.net/gh/runetfreedom/russia-blocked-geosite@release/geosite.dat.sha256sum](https://cdn.jsdelivr.net/gh/runetfreedom/russia-blocked-geosite@release/geosite.dat.sha256sum) +- **Fastly + JSDelivr** + - [https://fastly.jsdelivr.net/gh/runetfreedom/russia-blocked-geosite@release/geosite.dat](https://fastly.jsdelivr.net/gh/runetfreedom/russia-blocked-geosite@release/geosite.dat) + - Hashsum: [https://fastly.jsdelivr.net/gh/runetfreedom/russia-blocked-geosite@release/geosite.dat.sha256sum](https://fastly.jsdelivr.net/gh/runetfreedom/russia-blocked-geosite@release/geosite.dat.sha256sum) + + +## Смежные проекты + +- [@runetfreedom/russia-blocked-geoip](https://github.com/runetfreedom/russia-blocked-geoip) - GeoIP файлы с заблокированными в России сетями и адресами +- [@runetfreedom/russia-v2ray-rules-dat](https://github.com/runetfreedom/russia-v2ray-rules-dat) - Правила для V2Ray, основанные на этих данных + +## Благодарности + +- [antifilter.download](https://antifilter.download/) - за предоставление данных о заблокированных доменах и комьюнити для их обновления +- [re:filter](https://github.com/1andrevich/Re-filter-lists) - за предоставление отфильтрованных данных о заблокированных доменах +- [@Loyalsoldier/v2ray-rules-dat](https://github.com/Loyalsoldier/v2ray-rules-dat) - за идею и основу этого проекта \ No newline at end of file