mirror of
https://github.com/itdoginfo/allow-domains.git
synced 2026-04-03 06:48:51 +03:00
Compare commits
22 Commits
2026-03-16
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5668a371c6 | ||
|
|
e57de37782 | ||
|
|
74cd5a4767 | ||
|
|
d5ff6c38dd | ||
|
|
ed91b10a8a | ||
|
|
3307c1404d | ||
|
|
bd6f07f971 | ||
|
|
315d118c17 | ||
|
|
fee4746b57 | ||
|
|
689a9ea755 | ||
|
|
1a6e1cf718 | ||
|
|
98fb1ca2df | ||
|
|
2868f4576e | ||
|
|
76f8f79434 | ||
|
|
623b97ff1b | ||
|
|
6d441b4cbf | ||
|
|
8ca8769a77 | ||
|
|
a06c1739a4 | ||
|
|
b8fe629d16 | ||
|
|
ccedd6cfac | ||
|
|
96e00053c4 | ||
|
|
b7ff4adda5 |
7
.github/ISSUE_TEMPLATE/config.yml
vendored
7
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1 +1,8 @@
|
|||||||
blank_issues_enabled: false
|
blank_issues_enabled: false
|
||||||
|
contact_links:
|
||||||
|
- name: Предложить домен или сервис
|
||||||
|
url: https://github.com/itdoginfo/allow-domains/discussions/categories/general
|
||||||
|
about: Добавление доменов и сервисов производится через Discussions, а не Issues.
|
||||||
|
- name: Вопрос по использованию
|
||||||
|
url: https://t.me/itdogchat
|
||||||
|
about: С вопросами в Telegram-чат.
|
||||||
|
|||||||
46
.github/workflows/create-lists.yml
vendored
46
.github/workflows/create-lists.yml
vendored
@@ -19,19 +19,40 @@ jobs:
|
|||||||
generate-lists:
|
generate-lists:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.3.0
|
- uses: actions/checkout@v6.0.2
|
||||||
- name: Compile ruleset srs
|
|
||||||
|
- name: Cache sing-box
|
||||||
|
uses: actions/cache@v5.0.3
|
||||||
|
id: cache-singbox
|
||||||
|
with:
|
||||||
|
path: /usr/local/bin/sing-box
|
||||||
|
key: sing-box-1.12.25
|
||||||
|
|
||||||
|
- name: Install sing-box
|
||||||
|
if: steps.cache-singbox.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
docker run --rm \
|
wget -qO- https://github.com/SagerNet/sing-box/releases/download/v1.12.25/sing-box-1.12.25-linux-amd64.tar.gz | tar xz
|
||||||
-v ${{ github.workspace }}/src:/app/src \
|
sudo mv sing-box-*/sing-box /usr/local/bin/
|
||||||
-v ${{ github.workspace }}/Subnets:/app/Subnets \
|
|
||||||
-v ${{ github.workspace }}/Russia:/app/Russia \
|
- name: Cache mihomo
|
||||||
-v ${{ github.workspace }}/Ukraine:/app/Ukraine \
|
uses: actions/cache@v5.0.3
|
||||||
-v ${{ github.workspace }}/Categories:/app/Categories \
|
id: cache-mihomo
|
||||||
-v ${{ github.workspace }}/Services:/app/Services \
|
with:
|
||||||
-v ${{ github.workspace }}/SRS:/app/SRS \
|
path: /usr/local/bin/mihomo
|
||||||
-v ${{ github.workspace }}/DAT:/app/DAT \
|
key: mihomo-1.19.8
|
||||||
itdoginfo/compilesrs:0.1.22
|
|
||||||
|
- name: Install mihomo
|
||||||
|
if: steps.cache-mihomo.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
wget -qO- https://github.com/MetaCubeX/mihomo/releases/download/v1.19.8/mihomo-linux-amd64-v1.19.8.gz | gunzip > mihomo
|
||||||
|
chmod +x mihomo
|
||||||
|
sudo mv mihomo /usr/local/bin/
|
||||||
|
|
||||||
|
- name: Install Python dependencies
|
||||||
|
run: pip install -r requirements.txt
|
||||||
|
|
||||||
|
- name: Generate lists
|
||||||
|
run: python3 convert.py
|
||||||
|
|
||||||
- name: Check Russia/inside-dnsmasq-ipset
|
- name: Check Russia/inside-dnsmasq-ipset
|
||||||
uses: itdoginfo/dnsmasq-action@0.1
|
uses: itdoginfo/dnsmasq-action@0.1
|
||||||
@@ -81,5 +102,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
${{ github.workspace }}/SRS/*.srs
|
${{ github.workspace }}/SRS/*.srs
|
||||||
|
${{ github.workspace }}/MRS/*.mrs
|
||||||
${{ github.workspace }}/DAT/*.dat
|
${{ github.workspace }}/DAT/*.dat
|
||||||
tag_name: ${{ env.TAG_NAME }}
|
tag_name: ${{ env.TAG_NAME }}
|
||||||
|
|||||||
8
.github/workflows/create-subnets.yml
vendored
8
.github/workflows/create-subnets.yml
vendored
@@ -14,13 +14,13 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
generate-subnet:
|
generate-subnet:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.7
|
- uses: actions/checkout@v6.0.2
|
||||||
- name: Generate subnets
|
- name: Generate subnets
|
||||||
uses: actions/setup-python@v5.1.0
|
uses: actions/setup-python@v6.2.0
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: '3.13'
|
||||||
- run: |
|
- run: |
|
||||||
python get-subnets.py
|
python get-subnets.py
|
||||||
- name: Push subnets
|
- name: Push subnets
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -2,6 +2,8 @@ antifilter-domains.lst
|
|||||||
uablacklist-domains.lst
|
uablacklist-domains.lst
|
||||||
zaboronahelp-domains.lst
|
zaboronahelp-domains.lst
|
||||||
SRS
|
SRS
|
||||||
|
MRS
|
||||||
JSON
|
JSON
|
||||||
DAT
|
DAT
|
||||||
geosite_data
|
geosite_data
|
||||||
|
proto/__pycache__
|
||||||
22
Dockerfile
22
Dockerfile
@@ -1,22 +0,0 @@
|
|||||||
FROM ghcr.io/sagernet/sing-box:v1.11.15 AS sing-box
|
|
||||||
|
|
||||||
FROM golang:1.25.5-alpine3.23 AS go-builder
|
|
||||||
|
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go install -ldflags="-s -w" \
|
|
||||||
github.com/v2fly/domain-list-community@20251222003838
|
|
||||||
|
|
||||||
FROM python:3.12.12-alpine3.23
|
|
||||||
|
|
||||||
COPY --from=sing-box /usr/local/bin/sing-box /bin/sing-box
|
|
||||||
|
|
||||||
COPY --from=go-builder /go/bin/domain-list-community /bin/domain-list-community
|
|
||||||
|
|
||||||
COPY requirements.txt /app/requirements.txt
|
|
||||||
|
|
||||||
RUN pip install --no-cache-dir -r /app/requirements.txt
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY convert.py /app/convert.py
|
|
||||||
|
|
||||||
CMD ["python3", "convert.py"]
|
|
||||||
45
README.md
45
README.md
@@ -7,6 +7,7 @@
|
|||||||
- Dnsmasq ipset. Для Dnsmasq в формате ipset (OpenWrt <= 21.02) `ipset=/showip.net/vpn_domains`
|
- Dnsmasq ipset. Для Dnsmasq в формате ipset (OpenWrt <= 21.02) `ipset=/showip.net/vpn_domains`
|
||||||
- Sing-box Source. Для Sing-box версии 1.11.0 и выше.
|
- Sing-box Source. Для Sing-box версии 1.11.0 и выше.
|
||||||
- Xray Dat. Общий файл geosite.dat с разбивкой по категориям.
|
- Xray Dat. Общий файл geosite.dat с разбивкой по категориям.
|
||||||
|
- Mihomo MRS. Бинарные rule-set для Mihomo (Clash Meta). Файлы с суффиксом `_domain` для доменов, `_ipcidr` для подсетей.
|
||||||
- ClashX `DOMAIN-SUFFIX,showip.net`
|
- ClashX `DOMAIN-SUFFIX,showip.net`
|
||||||
- Mikrotik FWD `/ip dns static add name=fast.com type=FWD...`
|
- Mikrotik FWD `/ip dns static add name=fast.com type=FWD...`
|
||||||
- Kvas. Для Kvas 1.1.8 и новее. Просто отсортированный список доменов.
|
- Kvas. Для Kvas 1.1.8 и новее. Просто отсортированный список доменов.
|
||||||
@@ -34,6 +35,7 @@
|
|||||||
- Tik-Tok
|
- Tik-Tok
|
||||||
- Twitter
|
- Twitter
|
||||||
- YouTube
|
- YouTube
|
||||||
|
- Google Meet
|
||||||
|
|
||||||
## Страны
|
## Страны
|
||||||
### Россия
|
### Россия
|
||||||
@@ -74,6 +76,7 @@
|
|||||||
- [Kvas](https://raw.githubusercontent.com/itdoginfo/allow-domains/main/Russia/inside-kvas.lst)
|
- [Kvas](https://raw.githubusercontent.com/itdoginfo/allow-domains/main/Russia/inside-kvas.lst)
|
||||||
- [Mikrotik](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Russia/inside-mikrotik-fwd.lst)
|
- [Mikrotik](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Russia/inside-mikrotik-fwd.lst)
|
||||||
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/russia_inside.srs)
|
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/russia_inside.srs)
|
||||||
|
- [MRS domain](https://github.com/itdoginfo/allow-domains/releases/latest/download/russia_inside_domain.mrs)
|
||||||
- geosite:russia-inside
|
- geosite:russia-inside
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
@@ -88,6 +91,7 @@
|
|||||||
- [Kvas](https://raw.githubusercontent.com/itdoginfo/allow-domains/main/Russia/outside-kvas.lst)
|
- [Kvas](https://raw.githubusercontent.com/itdoginfo/allow-domains/main/Russia/outside-kvas.lst)
|
||||||
- [Mikrotik](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Russia/outside-mikrotik-fwd.lst)
|
- [Mikrotik](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Russia/outside-mikrotik-fwd.lst)
|
||||||
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/russia_outside.srs)
|
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/russia_outside.srs)
|
||||||
|
- [MRS domain](https://github.com/itdoginfo/allow-domains/releases/latest/download/russia_outside_domain.mrs)
|
||||||
- geosite:russia-outside
|
- geosite:russia-outside
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
@@ -101,6 +105,7 @@
|
|||||||
- [Kvas](https://raw.githubusercontent.com/itdoginfo/allow-domains/main/Ukraine/inside-kvas.lst)
|
- [Kvas](https://raw.githubusercontent.com/itdoginfo/allow-domains/main/Ukraine/inside-kvas.lst)
|
||||||
- [Mikrotik](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Ukraine/inside-mikrotik-fwd.lst)
|
- [Mikrotik](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Ukraine/inside-mikrotik-fwd.lst)
|
||||||
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/ukraine_inside.srs)
|
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/ukraine_inside.srs)
|
||||||
|
- [MRS domain](https://github.com/itdoginfo/allow-domains/releases/latest/download/ukraine_inside_domain.mrs)
|
||||||
- geosite:ukraine
|
- geosite:ukraine
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
@@ -110,6 +115,7 @@
|
|||||||
|
|
||||||
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Categories/anime.lst)
|
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Categories/anime.lst)
|
||||||
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/anime.srs)
|
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/anime.srs)
|
||||||
|
- [MRS domain](https://github.com/itdoginfo/allow-domains/releases/latest/download/anime_domain.mrs)
|
||||||
- geosite:russia-inside@anime
|
- geosite:russia-inside@anime
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
@@ -119,6 +125,7 @@
|
|||||||
|
|
||||||
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Categories/block.lst)
|
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Categories/block.lst)
|
||||||
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/block.srs)
|
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/block.srs)
|
||||||
|
- [MRS domain](https://github.com/itdoginfo/allow-domains/releases/latest/download/block_domain.mrs)
|
||||||
- geosite:russia-inside@block
|
- geosite:russia-inside@block
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
@@ -128,6 +135,7 @@
|
|||||||
|
|
||||||
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Categories/geoblock.lst)
|
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Categories/geoblock.lst)
|
||||||
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/geoblock.srs)
|
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/geoblock.srs)
|
||||||
|
- [MRS domain](https://github.com/itdoginfo/allow-domains/releases/latest/download/geoblock_domain.mrs)
|
||||||
- geosite:russia-inside@geoblock
|
- geosite:russia-inside@geoblock
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
@@ -137,6 +145,7 @@
|
|||||||
|
|
||||||
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Categories/news.lst)
|
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Categories/news.lst)
|
||||||
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/news.srs)
|
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/news.srs)
|
||||||
|
- [MRS domain](https://github.com/itdoginfo/allow-domains/releases/latest/download/news_domain.mrs)
|
||||||
- geosite:russia-inside@news
|
- geosite:russia-inside@news
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
@@ -146,6 +155,7 @@
|
|||||||
|
|
||||||
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Categories/porn.lst)
|
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Categories/porn.lst)
|
||||||
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/porn.srs)
|
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/porn.srs)
|
||||||
|
- [MRS domain](https://github.com/itdoginfo/allow-domains/releases/latest/download/porn_domain.mrs)
|
||||||
- geosite:russia-inside@porn
|
- geosite:russia-inside@porn
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
@@ -155,6 +165,7 @@
|
|||||||
|
|
||||||
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Categories/hodca.lst)
|
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Categories/hodca.lst)
|
||||||
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/hodca.srs)
|
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/hodca.srs)
|
||||||
|
- [MRS domain](https://github.com/itdoginfo/allow-domains/releases/latest/download/hodca_domain.mrs)
|
||||||
- geosite:russia-inside@hodca
|
- geosite:russia-inside@hodca
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
@@ -164,6 +175,8 @@
|
|||||||
|
|
||||||
- [Subnets](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Subnets/IPv4/cloudflare.lst)
|
- [Subnets](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Subnets/IPv4/cloudflare.lst)
|
||||||
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/cloudflare.srs)
|
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/cloudflare.srs)
|
||||||
|
- [MRS domain](https://github.com/itdoginfo/allow-domains/releases/latest/download/cloudflare_domain.mrs)
|
||||||
|
- [MRS ipcidr](https://github.com/itdoginfo/allow-domains/releases/latest/download/cloudflare_ipcidr.mrs)
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
@@ -173,6 +186,8 @@
|
|||||||
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Services/discord.lst)
|
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Services/discord.lst)
|
||||||
- [Subnets](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Subnets/IPv4/discord.lst)
|
- [Subnets](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Subnets/IPv4/discord.lst)
|
||||||
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/discord.srs)
|
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/discord.srs)
|
||||||
|
- [MRS domain](https://github.com/itdoginfo/allow-domains/releases/latest/download/discord_domain.mrs)
|
||||||
|
- [MRS ipcidr](https://github.com/itdoginfo/allow-domains/releases/latest/download/discord_ipcidr.mrs)
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
@@ -181,6 +196,7 @@
|
|||||||
|
|
||||||
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Services/hdrezka.lst)
|
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Services/hdrezka.lst)
|
||||||
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/hdrezka.srs)
|
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/hdrezka.srs)
|
||||||
|
- [MRS domain](https://github.com/itdoginfo/allow-domains/releases/latest/download/hdrezka_domain.mrs)
|
||||||
- geosite:russia-inside@hdrezka
|
- geosite:russia-inside@hdrezka
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
@@ -191,6 +207,8 @@
|
|||||||
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Services/meta.lst)
|
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Services/meta.lst)
|
||||||
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/meta.srs)
|
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/meta.srs)
|
||||||
- [Subnets](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Subnets/IPv4/meta.lst)
|
- [Subnets](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Subnets/IPv4/meta.lst)
|
||||||
|
- [MRS domain](https://github.com/itdoginfo/allow-domains/releases/latest/download/meta_domain.mrs)
|
||||||
|
- [MRS ipcidr](https://github.com/itdoginfo/allow-domains/releases/latest/download/meta_ipcidr.mrs)
|
||||||
- geosite:russia-inside@meta
|
- geosite:russia-inside@meta
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
@@ -201,6 +219,8 @@
|
|||||||
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Services/telegram.lst)
|
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Services/telegram.lst)
|
||||||
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/telegram.srs)
|
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/telegram.srs)
|
||||||
- [Subnets](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Subnets/IPv4/telegram.lst)
|
- [Subnets](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Subnets/IPv4/telegram.lst)
|
||||||
|
- [MRS domain](https://github.com/itdoginfo/allow-domains/releases/latest/download/telegram_domain.mrs)
|
||||||
|
- [MRS ipcidr](https://github.com/itdoginfo/allow-domains/releases/latest/download/telegram_ipcidr.mrs)
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
@@ -209,6 +229,7 @@
|
|||||||
|
|
||||||
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Services/tiktok.lst)
|
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Services/tiktok.lst)
|
||||||
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/tiktok.srs)
|
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/tiktok.srs)
|
||||||
|
- [MRS domain](https://github.com/itdoginfo/allow-domains/releases/latest/download/tiktok_domain.mrs)
|
||||||
- geosite:russia-inside@tiktok
|
- geosite:russia-inside@tiktok
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
@@ -219,6 +240,8 @@
|
|||||||
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Services/twitter.lst)
|
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Services/twitter.lst)
|
||||||
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/twitter.srs)
|
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/twitter.srs)
|
||||||
- [Subnets](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Subnets/IPv4/twitter.lst)
|
- [Subnets](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Subnets/IPv4/twitter.lst)
|
||||||
|
- [MRS domain](https://github.com/itdoginfo/allow-domains/releases/latest/download/twitter_domain.mrs)
|
||||||
|
- [MRS ipcidr](https://github.com/itdoginfo/allow-domains/releases/latest/download/twitter_ipcidr.mrs)
|
||||||
- geosite:russia-inside@twitter
|
- geosite:russia-inside@twitter
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
@@ -228,10 +251,22 @@
|
|||||||
|
|
||||||
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Services/youtube.lst)
|
- [RAW](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Services/youtube.lst)
|
||||||
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/youtube.srs)
|
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/youtube.srs)
|
||||||
|
- [MRS domain](https://github.com/itdoginfo/allow-domains/releases/latest/download/youtube_domain.mrs)
|
||||||
- geosite:russia-inside@youtube
|
- geosite:russia-inside@youtube
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Google Meet</summary>
|
||||||
|
|
||||||
|
- [Subnets](https://raw.githubusercontent.com/itdoginfo/allow-domains/refs/heads/main/Subnets/IPv4/google_meet.lst)
|
||||||
|
- [SRS](https://github.com/itdoginfo/allow-domains/releases/latest/download/google_meet.srs)
|
||||||
|
- [MRS domain](https://github.com/itdoginfo/allow-domains/releases/latest/download/google_meet_domain.mrs)
|
||||||
|
- [MRS ipcidr](https://github.com/itdoginfo/allow-domains/releases/latest/download/google_meet_ipcidr.mrs)
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
|
||||||
# Как найти все-все домены ресурса?
|
# Как найти все-все домены ресурса?
|
||||||
https://itdog.info/analiziruem-trafik-i-opredelyaem-domeny-kotorye-ispolzuyut-sajty-i-prilozheniya/
|
https://itdog.info/analiziruem-trafik-i-opredelyaem-domeny-kotorye-ispolzuyut-sajty-i-prilozheniya/
|
||||||
|
|
||||||
@@ -292,6 +327,16 @@ service firewall restart && service dnsmasq restart
|
|||||||
|
|
||||||
*Meta признана экстремистской и террористической организацией в России
|
*Meta признана экстремистской и террористической организацией в России
|
||||||
|
|
||||||
|
# Разработка
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix-shell
|
||||||
|
|
||||||
|
python3 get-subnets.py
|
||||||
|
|
||||||
|
python3 convert.py
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
[Telegram-канал с обновлениями](https://t.me/itdoginfo)
|
[Telegram-канал с обновлениями](https://t.me/itdoginfo)
|
||||||
|
|||||||
5
Services/google_meet.lst
Normal file
5
Services/google_meet.lst
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
meetings.clients6.google.com
|
||||||
|
meetings.googleapis.com
|
||||||
|
hangouts.googleapis.com
|
||||||
|
meet.google.com
|
||||||
|
stream.meet.google.com
|
||||||
@@ -17,3 +17,4 @@ telesco.pe
|
|||||||
tg.dev
|
tg.dev
|
||||||
tx.me
|
tx.me
|
||||||
usercontent.dev
|
usercontent.dev
|
||||||
|
ton.org
|
||||||
@@ -47,6 +47,7 @@
|
|||||||
157.240.139.0/24
|
157.240.139.0/24
|
||||||
157.240.156.0/22
|
157.240.156.0/22
|
||||||
157.240.169.0/24
|
157.240.169.0/24
|
||||||
|
157.240.170.0/24
|
||||||
157.240.175.0/24
|
157.240.175.0/24
|
||||||
157.240.177.0/24
|
157.240.177.0/24
|
||||||
157.240.179.0/24
|
157.240.179.0/24
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
5.101.96.0/20
|
5.101.96.0/20
|
||||||
24.144.64.0/21
|
24.144.64.0/21
|
||||||
|
24.144.72.0/24
|
||||||
24.144.76.0/22
|
24.144.76.0/22
|
||||||
24.144.80.0/20
|
24.144.80.0/20
|
||||||
24.144.96.0/19
|
24.144.96.0/19
|
||||||
@@ -133,10 +134,11 @@
|
|||||||
165.232.32.0/19
|
165.232.32.0/19
|
||||||
165.232.64.0/18
|
165.232.64.0/18
|
||||||
165.232.128.0/18
|
165.232.128.0/18
|
||||||
165.245.128.0/20
|
165.245.128.0/18
|
||||||
165.245.144.0/21
|
165.245.192.0/21
|
||||||
165.245.152.0/22
|
165.245.200.0/22
|
||||||
165.245.160.0/19
|
165.245.208.0/20
|
||||||
|
165.245.224.0/20
|
||||||
167.71.0.0/16
|
167.71.0.0/16
|
||||||
167.99.0.0/16
|
167.99.0.0/16
|
||||||
167.172.0.0/16
|
167.172.0.0/16
|
||||||
|
|||||||
3
Subnets/IPv4/google_meet.lst
Normal file
3
Subnets/IPv4/google_meet.lst
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
74.125.247.128/32
|
||||||
|
74.125.250.0/24
|
||||||
|
142.250.82.0/24
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
5.9.0.0/16
|
5.9.0.0/16
|
||||||
5.75.128.0/17
|
5.75.128.0/17
|
||||||
23.88.0.0/17
|
23.88.0.0/17
|
||||||
|
31.58.88.0/24
|
||||||
37.27.0.0/16
|
37.27.0.0/16
|
||||||
45.15.99.0/24
|
45.15.99.0/24
|
||||||
45.145.227.0/24
|
45.145.227.0/24
|
||||||
@@ -8,6 +9,7 @@
|
|||||||
46.62.128.0/17
|
46.62.128.0/17
|
||||||
46.224.0.0/15
|
46.224.0.0/15
|
||||||
49.12.0.0/15
|
49.12.0.0/15
|
||||||
|
62.238.0.0/17
|
||||||
65.21.0.0/16
|
65.21.0.0/16
|
||||||
65.108.0.0/15
|
65.108.0.0/15
|
||||||
77.42.0.0/17
|
77.42.0.0/17
|
||||||
@@ -43,9 +45,6 @@
|
|||||||
178.63.0.0/16
|
178.63.0.0/16
|
||||||
178.104.0.0/15
|
178.104.0.0/15
|
||||||
178.212.75.0/24
|
178.212.75.0/24
|
||||||
185.0.42.0/23
|
|
||||||
185.1.160.0/23
|
|
||||||
185.1.166.0/23
|
|
||||||
185.12.65.0/24
|
185.12.65.0/24
|
||||||
185.50.120.0/23
|
185.50.120.0/23
|
||||||
185.107.52.0/22
|
185.107.52.0/22
|
||||||
@@ -67,7 +66,6 @@
|
|||||||
194.42.184.0/22
|
194.42.184.0/22
|
||||||
194.62.106.0/24
|
194.62.106.0/24
|
||||||
195.60.226.0/24
|
195.60.226.0/24
|
||||||
195.66.224.0/21
|
|
||||||
195.201.0.0/16
|
195.201.0.0/16
|
||||||
195.248.224.0/24
|
195.248.224.0/24
|
||||||
197.242.84.0/22
|
197.242.84.0/22
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
157.240.139.0/24
|
157.240.139.0/24
|
||||||
157.240.156.0/22
|
157.240.156.0/22
|
||||||
157.240.169.0/24
|
157.240.169.0/24
|
||||||
|
157.240.170.0/24
|
||||||
157.240.175.0/24
|
157.240.175.0/24
|
||||||
157.240.177.0/24
|
157.240.177.0/24
|
||||||
157.240.179.0/24
|
157.240.179.0/24
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
2.27.243.0/24
|
||||||
2.58.172.0/24
|
2.58.172.0/24
|
||||||
5.39.0.0/17
|
5.39.0.0/17
|
||||||
5.83.153.0/24
|
5.83.153.0/24
|
||||||
@@ -22,6 +23,7 @@
|
|||||||
8.33.96.0/21
|
8.33.96.0/21
|
||||||
8.33.128.0/21
|
8.33.128.0/21
|
||||||
8.33.136.0/23
|
8.33.136.0/23
|
||||||
|
14.137.226.0/24
|
||||||
15.204.0.0/16
|
15.204.0.0/16
|
||||||
15.235.0.0/16
|
15.235.0.0/16
|
||||||
23.92.224.0/19
|
23.92.224.0/19
|
||||||
@@ -58,6 +60,7 @@
|
|||||||
40.160.252.0/24
|
40.160.252.0/24
|
||||||
40.160.254.0/24
|
40.160.254.0/24
|
||||||
40.183.94.0/24
|
40.183.94.0/24
|
||||||
|
40.183.103.0/24
|
||||||
43.226.0.0/23
|
43.226.0.0/23
|
||||||
45.39.79.0/24
|
45.39.79.0/24
|
||||||
45.43.142.0/24
|
45.43.142.0/24
|
||||||
@@ -122,6 +125,7 @@
|
|||||||
66.179.22.0/24
|
66.179.22.0/24
|
||||||
66.179.218.0/23
|
66.179.218.0/23
|
||||||
67.63.54.0/24
|
67.63.54.0/24
|
||||||
|
68.65.214.0/24
|
||||||
68.232.108.0/24
|
68.232.108.0/24
|
||||||
69.17.37.0/24
|
69.17.37.0/24
|
||||||
69.72.31.0/24
|
69.72.31.0/24
|
||||||
@@ -163,6 +167,7 @@
|
|||||||
82.39.156.0/22
|
82.39.156.0/22
|
||||||
82.39.176.0/21
|
82.39.176.0/21
|
||||||
82.39.216.0/22
|
82.39.216.0/22
|
||||||
|
82.39.221.0/24
|
||||||
82.39.224.0/22
|
82.39.224.0/22
|
||||||
82.40.0.0/20
|
82.40.0.0/20
|
||||||
82.40.16.0/22
|
82.40.16.0/22
|
||||||
@@ -174,6 +179,7 @@
|
|||||||
82.41.100.0/22
|
82.41.100.0/22
|
||||||
82.41.104.0/22
|
82.41.104.0/22
|
||||||
82.41.124.0/22
|
82.41.124.0/22
|
||||||
|
82.41.134.0/24
|
||||||
82.41.148.0/22
|
82.41.148.0/22
|
||||||
82.41.152.0/22
|
82.41.152.0/22
|
||||||
82.41.160.0/21
|
82.41.160.0/21
|
||||||
@@ -202,11 +208,14 @@
|
|||||||
83.143.16.0/21
|
83.143.16.0/21
|
||||||
83.175.167.0/24
|
83.175.167.0/24
|
||||||
83.175.173.0/24
|
83.175.173.0/24
|
||||||
|
84.19.167.0/24
|
||||||
|
84.32.10.0/24
|
||||||
85.217.144.0/23
|
85.217.144.0/23
|
||||||
86.38.187.0/24
|
86.38.187.0/24
|
||||||
86.54.26.0/24
|
86.54.26.0/24
|
||||||
87.98.128.0/17
|
87.98.128.0/17
|
||||||
87.229.51.0/24
|
87.229.51.0/24
|
||||||
|
87.232.75.0/24
|
||||||
88.216.221.0/24
|
88.216.221.0/24
|
||||||
88.218.34.0/24
|
88.218.34.0/24
|
||||||
89.19.44.0/24
|
89.19.44.0/24
|
||||||
@@ -241,6 +250,7 @@
|
|||||||
103.5.12.0/22
|
103.5.12.0/22
|
||||||
103.82.16.0/22
|
103.82.16.0/22
|
||||||
103.167.178.0/23
|
103.167.178.0/23
|
||||||
|
103.170.116.0/23
|
||||||
103.189.191.0/24
|
103.189.191.0/24
|
||||||
103.199.80.0/24
|
103.199.80.0/24
|
||||||
103.206.156.0/23
|
103.206.156.0/23
|
||||||
@@ -251,6 +261,7 @@
|
|||||||
104.225.253.0/24
|
104.225.253.0/24
|
||||||
104.234.50.0/24
|
104.234.50.0/24
|
||||||
104.234.94.0/24
|
104.234.94.0/24
|
||||||
|
104.234.135.0/24
|
||||||
104.234.168.0/24
|
104.234.168.0/24
|
||||||
107.189.64.0/18
|
107.189.64.0/18
|
||||||
108.174.65.0/24
|
108.174.65.0/24
|
||||||
@@ -267,6 +278,7 @@
|
|||||||
117.18.104.0/24
|
117.18.104.0/24
|
||||||
123.100.227.0/24
|
123.100.227.0/24
|
||||||
128.0.118.0/24
|
128.0.118.0/24
|
||||||
|
132.243.197.0/24
|
||||||
135.125.0.0/16
|
135.125.0.0/16
|
||||||
135.148.0.0/16
|
135.148.0.0/16
|
||||||
136.0.95.0/24
|
136.0.95.0/24
|
||||||
@@ -276,11 +288,17 @@
|
|||||||
138.249.2.0/24
|
138.249.2.0/24
|
||||||
138.249.135.0/24
|
138.249.135.0/24
|
||||||
139.99.0.0/16
|
139.99.0.0/16
|
||||||
|
141.11.1.0/24
|
||||||
141.11.18.0/24
|
141.11.18.0/24
|
||||||
|
141.11.21.0/24
|
||||||
141.11.31.0/24
|
141.11.31.0/24
|
||||||
141.11.39.0/24
|
141.11.39.0/24
|
||||||
|
141.11.45.0/24
|
||||||
141.11.74.0/23
|
141.11.74.0/23
|
||||||
141.11.79.0/24
|
141.11.79.0/24
|
||||||
|
141.11.107.0/24
|
||||||
|
141.11.187.0/24
|
||||||
|
141.11.250.0/24
|
||||||
141.94.0.0/15
|
141.94.0.0/15
|
||||||
141.227.128.0/21
|
141.227.128.0/21
|
||||||
141.227.136.0/22
|
141.227.136.0/22
|
||||||
@@ -321,6 +339,7 @@
|
|||||||
144.225.112.0/24
|
144.225.112.0/24
|
||||||
144.225.123.0/24
|
144.225.123.0/24
|
||||||
144.225.162.0/24
|
144.225.162.0/24
|
||||||
|
144.225.178.0/24
|
||||||
145.79.151.0/24
|
145.79.151.0/24
|
||||||
145.239.0.0/16
|
145.239.0.0/16
|
||||||
146.19.38.0/24
|
146.19.38.0/24
|
||||||
@@ -330,8 +349,8 @@
|
|||||||
147.79.31.0/24
|
147.79.31.0/24
|
||||||
147.90.234.0/24
|
147.90.234.0/24
|
||||||
147.135.0.0/16
|
147.135.0.0/16
|
||||||
147.185.197.0/24
|
|
||||||
148.113.0.0/18
|
148.113.0.0/18
|
||||||
|
148.113.70.0/24
|
||||||
148.113.72.0/24
|
148.113.72.0/24
|
||||||
148.113.128.0/17
|
148.113.128.0/17
|
||||||
148.135.192.0/24
|
148.135.192.0/24
|
||||||
@@ -342,7 +361,6 @@
|
|||||||
151.80.0.0/16
|
151.80.0.0/16
|
||||||
151.240.1.0/24
|
151.240.1.0/24
|
||||||
151.240.24.0/24
|
151.240.24.0/24
|
||||||
151.241.8.0/24
|
|
||||||
151.241.68.0/24
|
151.241.68.0/24
|
||||||
151.242.103.0/24
|
151.242.103.0/24
|
||||||
151.243.6.0/24
|
151.243.6.0/24
|
||||||
@@ -360,6 +378,7 @@
|
|||||||
151.247.217.0/24
|
151.247.217.0/24
|
||||||
152.228.128.0/17
|
152.228.128.0/17
|
||||||
155.117.5.0/24
|
155.117.5.0/24
|
||||||
|
155.117.210.0/24
|
||||||
155.117.212.0/23
|
155.117.212.0/23
|
||||||
155.117.233.0/24
|
155.117.233.0/24
|
||||||
155.117.234.0/24
|
155.117.234.0/24
|
||||||
@@ -384,6 +403,7 @@
|
|||||||
167.148.193.0/24
|
167.148.193.0/24
|
||||||
167.234.38.0/24
|
167.234.38.0/24
|
||||||
167.253.62.0/24
|
167.253.62.0/24
|
||||||
|
168.222.23.0/24
|
||||||
168.222.49.0/24
|
168.222.49.0/24
|
||||||
168.222.183.0/24
|
168.222.183.0/24
|
||||||
168.222.243.0/24
|
168.222.243.0/24
|
||||||
@@ -395,6 +415,7 @@
|
|||||||
176.31.0.0/16
|
176.31.0.0/16
|
||||||
178.32.0.0/15
|
178.32.0.0/15
|
||||||
180.131.145.0/24
|
180.131.145.0/24
|
||||||
|
181.41.194.0/24
|
||||||
184.174.96.0/23
|
184.174.96.0/23
|
||||||
184.174.99.0/24
|
184.174.99.0/24
|
||||||
185.5.39.0/24
|
185.5.39.0/24
|
||||||
@@ -494,7 +515,6 @@
|
|||||||
207.166.205.0/24
|
207.166.205.0/24
|
||||||
207.166.206.0/24
|
207.166.206.0/24
|
||||||
207.180.25.0/24
|
207.180.25.0/24
|
||||||
207.180.58.0/24
|
|
||||||
207.244.209.0/24
|
207.244.209.0/24
|
||||||
209.71.36.0/24
|
209.71.36.0/24
|
||||||
209.101.164.0/24
|
209.101.164.0/24
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
91.108.56.0/22
|
|
||||||
91.108.4.0/22
|
|
||||||
91.108.8.0/22
|
|
||||||
91.108.16.0/22
|
|
||||||
91.108.12.0/22
|
|
||||||
149.154.160.0/20
|
|
||||||
91.105.192.0/23
|
91.105.192.0/23
|
||||||
91.108.20.0/22
|
91.108.4.0/22
|
||||||
|
91.108.8.0/21
|
||||||
|
91.108.16.0/21
|
||||||
|
91.108.56.0/22
|
||||||
|
95.161.64.0/20
|
||||||
|
149.154.160.0/20
|
||||||
185.76.151.0/24
|
185.76.151.0/24
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
2400:6180:100::/40
|
2400:6180:100::/40
|
||||||
2604:a880::/47
|
2604:a880::/47
|
||||||
2604:a880:2::/48
|
2604:a880:2::/48
|
||||||
2604:a880:4::/47
|
2604:a880:4::/46
|
||||||
2604:a880:6::/48
|
|
||||||
2604:a880:400::/48
|
2604:a880:400::/48
|
||||||
2604:a880:800::/48
|
2604:a880:800::/48
|
||||||
2604:a880:cad::/48
|
2604:a880:cad::/48
|
||||||
|
|||||||
3
Subnets/IPv6/google_meet.lst
Normal file
3
Subnets/IPv6/google_meet.lst
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
2001:4860:4864:4:8000::/128
|
||||||
|
2001:4860:4864:5::/64
|
||||||
|
2001:4860:4864:6::/64
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
2001:b28:f23d::/48
|
|
||||||
2001:b28:f23f::/48
|
|
||||||
2001:67c:4e8::/48
|
2001:67c:4e8::/48
|
||||||
2001:b28:f23c::/48
|
2001:b28:f23c::/47
|
||||||
|
2001:b28:f23f::/48
|
||||||
2a0a:f280::/32
|
2a0a:f280::/32
|
||||||
|
|||||||
517
convert.py
517
convert.py
@@ -6,7 +6,9 @@ import re
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
rusDomainsInsideOut='Russia/inside'
|
rusDomainsInsideOut='Russia/inside'
|
||||||
rusDomainsInsideSrcSingle='src/Russia-domains-inside-single.lst'
|
rusDomainsInsideSrcSingle='src/Russia-domains-inside-single.lst'
|
||||||
@@ -16,70 +18,49 @@ rusDomainsOutsideSrc='src/Russia-domains-outside.lst'
|
|||||||
rusDomainsOutsideOut='Russia/outside'
|
rusDomainsOutsideOut='Russia/outside'
|
||||||
uaDomainsSrc='src/Ukraine-domains-inside.lst'
|
uaDomainsSrc='src/Ukraine-domains-inside.lst'
|
||||||
uaDomainsOut='Ukraine/inside'
|
uaDomainsOut='Ukraine/inside'
|
||||||
DiscordSubnets = 'Subnets/IPv4/discord.lst'
|
SUBNET_SERVICES = [
|
||||||
MetaSubnets = 'Subnets/IPv4/meta.lst'
|
'discord', 'meta', 'twitter', 'telegram',
|
||||||
TwitterSubnets = 'Subnets/IPv4/twitter.lst'
|
'cloudflare', 'hetzner', 'ovh', 'digitalocean',
|
||||||
TelegramSubnets = 'Subnets/IPv4/telegram.lst'
|
'cloudfront', 'roblox', 'google_meet',
|
||||||
CloudflareSubnets = 'Subnets/IPv4/cloudflare.lst'
|
]
|
||||||
HetznerSubnets = 'Subnets/IPv4/hetzner.lst'
|
ExcludeServices = {"telegram.lst", "cloudflare.lst", "google_ai.lst", "google_play.lst", 'hetzner.lst', 'ovh.lst', 'digitalocean.lst', 'cloudfront.lst', 'hodca.lst', 'roblox.lst', 'google_meet.lst'}
|
||||||
OVHSubnets = 'Subnets/IPv4/ovh.lst'
|
|
||||||
DigitalOceanSubnets = 'Subnets/IPv4/digitalocean.lst'
|
def collect_files(src):
|
||||||
CloudfrontSubnets = 'Subnets/IPv4/cloudfront.lst'
|
files = []
|
||||||
RobloxSubnets = 'Subnets/IPv4/roblox.lst'
|
for dir_path in src:
|
||||||
ExcludeServices = {"telegram.lst", "cloudflare.lst", "google_ai.lst", "google_play.lst", 'hetzner.lst', 'ovh.lst', 'digitalocean.lst', 'cloudfront.lst', 'hodca.lst', 'roblox.lst'}
|
path = Path(dir_path)
|
||||||
|
if path.is_dir():
|
||||||
|
files.extend(f for f in path.glob('*') if f.name not in ExcludeServices)
|
||||||
|
elif path.is_file() and path.name not in ExcludeServices:
|
||||||
|
files.append(path)
|
||||||
|
return files
|
||||||
|
|
||||||
|
def collect_domains(src, dot_prefix=True):
|
||||||
|
domains = set()
|
||||||
|
for f in collect_files(src):
|
||||||
|
if not f.is_file():
|
||||||
|
continue
|
||||||
|
with open(f) as infile:
|
||||||
|
for line in infile:
|
||||||
|
ext = tldextract.extract(line.rstrip())
|
||||||
|
if not ext.suffix:
|
||||||
|
continue
|
||||||
|
if re.search(r'[^а-я\-]', ext.domain):
|
||||||
|
domains.add(ext.fqdn)
|
||||||
|
elif not ext.domain:
|
||||||
|
prefix = '.' if dot_prefix else ''
|
||||||
|
domains.add(prefix + ext.suffix)
|
||||||
|
return domains
|
||||||
|
|
||||||
def raw(src, out):
|
def raw(src, out):
|
||||||
domains = set()
|
domains = sorted(collect_domains(src))
|
||||||
files = []
|
|
||||||
|
|
||||||
if isinstance(src, list):
|
|
||||||
for dir_path in src:
|
|
||||||
path = Path(dir_path)
|
|
||||||
if path.is_dir():
|
|
||||||
files.extend(f for f in path.glob('*') if f.name not in ExcludeServices)
|
|
||||||
elif path.is_file() and path.name not in ExcludeServices:
|
|
||||||
files.append(path)
|
|
||||||
|
|
||||||
for f in files:
|
|
||||||
if f.is_file():
|
|
||||||
with open(f) as infile:
|
|
||||||
for line in infile:
|
|
||||||
if tldextract.extract(line).suffix:
|
|
||||||
if re.search(r'[^а-я\-]', tldextract.extract(line).domain):
|
|
||||||
domains.add(tldextract.extract(line.rstrip()).fqdn)
|
|
||||||
if not tldextract.extract(line).domain and tldextract.extract(line).suffix:
|
|
||||||
domains.add("." + tldextract.extract(line.rstrip()).suffix)
|
|
||||||
|
|
||||||
domains = sorted(domains)
|
|
||||||
|
|
||||||
with open(f'{out}-raw.lst', 'w') as file:
|
with open(f'{out}-raw.lst', 'w') as file:
|
||||||
for name in domains:
|
for name in domains:
|
||||||
file.write(f'{name}\n')
|
file.write(f'{name}\n')
|
||||||
|
|
||||||
def dnsmasq(src, out, remove={'google.com'}):
|
def dnsmasq(src, out, remove={'google.com'}):
|
||||||
domains = set()
|
domains = sorted(collect_domains(src) - remove)
|
||||||
files = []
|
|
||||||
|
|
||||||
if isinstance(src, list):
|
|
||||||
for dir_path in src:
|
|
||||||
path = Path(dir_path)
|
|
||||||
if path.is_dir():
|
|
||||||
files.extend(f for f in path.glob('*') if f.name not in ExcludeServices)
|
|
||||||
elif path.is_file() and path.name not in ExcludeServices:
|
|
||||||
files.append(path)
|
|
||||||
|
|
||||||
for f in files:
|
|
||||||
if f.is_file():
|
|
||||||
with open(f) as infile:
|
|
||||||
for line in infile:
|
|
||||||
if tldextract.extract(line).suffix:
|
|
||||||
if re.search(r'[^а-я\-]', tldextract.extract(line).domain):
|
|
||||||
domains.add(tldextract.extract(line.rstrip()).fqdn)
|
|
||||||
if not tldextract.extract(line).domain and tldextract.extract(line).suffix:
|
|
||||||
domains.add("." + tldextract.extract(line.rstrip()).suffix)
|
|
||||||
|
|
||||||
domains = domains - remove
|
|
||||||
domains = sorted(domains)
|
|
||||||
|
|
||||||
with open(f'{out}-dnsmasq-nfset.lst', 'w') as file:
|
with open(f'{out}-dnsmasq-nfset.lst', 'w') as file:
|
||||||
for name in domains:
|
for name in domains:
|
||||||
@@ -90,84 +71,21 @@ def dnsmasq(src, out, remove={'google.com'}):
|
|||||||
file.write(f'ipset=/{name}/vpn_domains\n')
|
file.write(f'ipset=/{name}/vpn_domains\n')
|
||||||
|
|
||||||
def clashx(src, out, remove={'google.com'}):
|
def clashx(src, out, remove={'google.com'}):
|
||||||
domains = set()
|
domains = sorted(collect_domains(src) - remove)
|
||||||
files = []
|
|
||||||
|
|
||||||
if isinstance(src, list):
|
|
||||||
for dir_path in src:
|
|
||||||
path = Path(dir_path)
|
|
||||||
if path.is_dir():
|
|
||||||
files.extend(f for f in path.glob('*') if f.name not in ExcludeServices)
|
|
||||||
elif path.is_file() and path.name not in ExcludeServices:
|
|
||||||
files.append(path)
|
|
||||||
|
|
||||||
for f in files:
|
|
||||||
with open(f) as infile:
|
|
||||||
for line in infile:
|
|
||||||
if tldextract.extract(line).suffix:
|
|
||||||
if re.search(r'[^а-я\-]', tldextract.extract(line).domain):
|
|
||||||
domains.add(tldextract.extract(line.rstrip()).fqdn)
|
|
||||||
if not tldextract.extract(line).domain and tldextract.extract(line).suffix:
|
|
||||||
domains.add("." + tldextract.extract(line.rstrip()).suffix)
|
|
||||||
|
|
||||||
domains = domains - remove
|
|
||||||
domains = sorted(domains)
|
|
||||||
|
|
||||||
with open(f'{out}-clashx.lst', 'w') as file:
|
with open(f'{out}-clashx.lst', 'w') as file:
|
||||||
for name in domains:
|
for name in domains:
|
||||||
file.write(f'DOMAIN-SUFFIX,{name}\n')
|
file.write(f'DOMAIN-SUFFIX,{name}\n')
|
||||||
|
|
||||||
def kvas(src, out, remove={'google.com'}):
|
def kvas(src, out, remove={'google.com'}):
|
||||||
domains = set()
|
domains = sorted(collect_domains(src, dot_prefix=False) - remove)
|
||||||
files = []
|
|
||||||
|
|
||||||
if isinstance(src, list):
|
|
||||||
for dir_path in src:
|
|
||||||
path = Path(dir_path)
|
|
||||||
if path.is_dir():
|
|
||||||
files.extend(f for f in path.glob('*') if f.name not in ExcludeServices)
|
|
||||||
elif path.is_file() and path.name not in ExcludeServices:
|
|
||||||
files.append(path)
|
|
||||||
|
|
||||||
for f in files:
|
|
||||||
with open(f) as infile:
|
|
||||||
for line in infile:
|
|
||||||
if tldextract.extract(line).suffix:
|
|
||||||
if re.search(r'[^а-я\-]', tldextract.extract(line).domain):
|
|
||||||
domains.add(tldextract.extract(line.rstrip()).fqdn)
|
|
||||||
if not tldextract.extract(line).domain and tldextract.extract(line).suffix:
|
|
||||||
domains.add(tldextract.extract(line.rstrip()).suffix)
|
|
||||||
|
|
||||||
domains = domains - remove
|
|
||||||
domains = sorted(domains)
|
|
||||||
|
|
||||||
with open(f'{out}-kvas.lst', 'w') as file:
|
with open(f'{out}-kvas.lst', 'w') as file:
|
||||||
for name in domains:
|
for name in domains:
|
||||||
file.write(f'{name}\n')
|
file.write(f'{name}\n')
|
||||||
|
|
||||||
def mikrotik_fwd(src, out, remove={'google.com'}):
|
def mikrotik_fwd(src, out, remove={'google.com'}):
|
||||||
domains = set()
|
domains = sorted(collect_domains(src) - remove)
|
||||||
files = []
|
|
||||||
|
|
||||||
if isinstance(src, list):
|
|
||||||
for dir_path in src:
|
|
||||||
path = Path(dir_path)
|
|
||||||
if path.is_dir():
|
|
||||||
files.extend(f for f in path.glob('*') if f.name not in ExcludeServices)
|
|
||||||
elif path.is_file() and path.name not in ExcludeServices:
|
|
||||||
files.append(path)
|
|
||||||
|
|
||||||
for f in files:
|
|
||||||
with open(f) as infile:
|
|
||||||
for line in infile:
|
|
||||||
if tldextract.extract(line).suffix:
|
|
||||||
if re.search(r'[^а-я\-]', tldextract.extract(line).domain):
|
|
||||||
domains.add(tldextract.extract(line.rstrip()).fqdn)
|
|
||||||
if not tldextract.extract(line).domain and tldextract.extract(line).suffix:
|
|
||||||
domains.add("." + tldextract.extract(line.rstrip()).suffix)
|
|
||||||
|
|
||||||
domains = domains - remove
|
|
||||||
domains = sorted(domains)
|
|
||||||
|
|
||||||
with open(f'{out}-mikrotik-fwd.lst', 'w') as file:
|
with open(f'{out}-mikrotik-fwd.lst', 'w') as file:
|
||||||
for name in domains:
|
for name in domains:
|
||||||
@@ -176,213 +94,75 @@ def mikrotik_fwd(src, out, remove={'google.com'}):
|
|||||||
else:
|
else:
|
||||||
file.write(f'/ip dns static add name={name} type=FWD address-list=allow-domains match-subdomain=yes forward-to=localhost\n')
|
file.write(f'/ip dns static add name={name} type=FWD address-list=allow-domains match-subdomain=yes forward-to=localhost\n')
|
||||||
|
|
||||||
def domains_from_file(filepath):
|
def lines_from_file(filepath):
|
||||||
domains = []
|
if not os.path.exists(filepath):
|
||||||
try:
|
print(f"Warning: input file not found: {filepath}", file=sys.stderr)
|
||||||
with open(filepath, 'r', encoding='utf-8') as file:
|
return []
|
||||||
for line in file:
|
with open(filepath, 'r', encoding='utf-8') as f:
|
||||||
domain = line.strip()
|
return [line.strip() for line in f if line.strip()]
|
||||||
if domain:
|
|
||||||
domains.append(domain)
|
|
||||||
except FileNotFoundError:
|
|
||||||
print(f"File not found: {filepath}")
|
|
||||||
return domains
|
|
||||||
|
|
||||||
def generate_srs_domains(domains, output_name):
|
def compile_mrs(domains, name, mrs_dir='MRS', behavior='domain'):
|
||||||
output_directory = 'JSON'
|
os.makedirs(mrs_dir, exist_ok=True)
|
||||||
compiled_output_directory = 'SRS'
|
|
||||||
|
|
||||||
os.makedirs(output_directory, exist_ok=True)
|
txt_path = os.path.join(mrs_dir, f"{name}.txt")
|
||||||
os.makedirs(compiled_output_directory, exist_ok=True)
|
mrs_path = os.path.join(mrs_dir, f"{name}.mrs")
|
||||||
|
|
||||||
data = {
|
with open(txt_path, 'w', encoding='utf-8') as f:
|
||||||
"version": 3,
|
for d in domains:
|
||||||
"rules": [
|
f.write(f"{d}\n")
|
||||||
{"domain_suffix": domains}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
json_file_path = os.path.join(output_directory, f"{output_name}.json")
|
|
||||||
srs_file_path = os.path.join(compiled_output_directory, f"{output_name}.srs")
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(json_file_path, 'w', encoding='utf-8') as json_file:
|
|
||||||
json.dump(data, json_file, indent=4)
|
|
||||||
print(f"JSON file generated: {json_file_path}")
|
|
||||||
|
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
["sing-box", "rule-set", "compile", json_file_path, "-o", srs_file_path], check=True
|
["mihomo", "convert-ruleset", behavior, "text", txt_path, mrs_path], check=True
|
||||||
)
|
)
|
||||||
print(f"Compiled .srs file: {srs_file_path}")
|
print(f"Compiled: {mrs_path}")
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
print(f"Compile error {json_file_path}: {e}")
|
print(f"Compile error {txt_path}: {e}")
|
||||||
except Exception as e:
|
sys.exit(1)
|
||||||
print(f"Error while processing {output_name}: {e}")
|
|
||||||
|
|
||||||
def generate_srs_for_categories(directories, output_json_directory='JSON', compiled_output_directory='SRS'):
|
def compile_srs(data, name, json_dir='JSON', srs_dir='SRS'):
|
||||||
os.makedirs(output_json_directory, exist_ok=True)
|
os.makedirs(json_dir, exist_ok=True)
|
||||||
os.makedirs(compiled_output_directory, exist_ok=True)
|
os.makedirs(srs_dir, exist_ok=True)
|
||||||
|
|
||||||
exclude = {"meta", "twitter", "discord", "telegram", "hetzner", "ovh", "digitalocean", "cloudfront", "roblox"}
|
json_path = os.path.join(json_dir, f"{name}.json")
|
||||||
|
srs_path = os.path.join(srs_dir, f"{name}.srs")
|
||||||
|
|
||||||
|
with open(json_path, 'w', encoding='utf-8') as f:
|
||||||
|
json.dump(data, f, indent=4)
|
||||||
|
|
||||||
|
try:
|
||||||
|
subprocess.run(
|
||||||
|
["sing-box", "rule-set", "compile", json_path, "-o", srs_path], check=True
|
||||||
|
)
|
||||||
|
print(f"Compiled: {srs_path}")
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
print(f"Compile error {json_path}: {e}")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
def srs_rule(name, rules):
|
||||||
|
compile_srs({"version": 3, "rules": rules}, name)
|
||||||
|
|
||||||
|
def generate_srs_for_categories(directories):
|
||||||
|
exclude = {"meta", "twitter", "discord", "telegram", "hetzner", "ovh", "digitalocean", "cloudfront", "roblox", "google_meet"}
|
||||||
|
|
||||||
for directory in directories:
|
for directory in directories:
|
||||||
for filename in os.listdir(directory):
|
for filename in os.listdir(directory):
|
||||||
if any(keyword in filename for keyword in exclude):
|
if any(keyword in filename for keyword in exclude):
|
||||||
continue
|
continue
|
||||||
file_path = os.path.join(directory, filename)
|
file_path = os.path.join(directory, filename)
|
||||||
|
|
||||||
if os.path.isfile(file_path):
|
if os.path.isfile(file_path):
|
||||||
domains = []
|
domains = lines_from_file(file_path)
|
||||||
with open(file_path, 'r', encoding='utf-8') as file:
|
name = os.path.splitext(filename)[0]
|
||||||
for line in file:
|
srs_rule(name, [{"domain_suffix": domains}])
|
||||||
domain = line.strip()
|
|
||||||
if domain:
|
|
||||||
domains.append(domain)
|
|
||||||
|
|
||||||
data = {
|
|
||||||
"version": 3,
|
|
||||||
"rules": [
|
|
||||||
{
|
|
||||||
"domain_suffix": domains
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
output_file_path = os.path.join(output_json_directory, f"{os.path.splitext(filename)[0]}.json")
|
|
||||||
|
|
||||||
with open(output_file_path, 'w', encoding='utf-8') as output_file:
|
|
||||||
json.dump(data, output_file, indent=4)
|
|
||||||
|
|
||||||
print(f"JSON file generated: {output_file_path}")
|
|
||||||
|
|
||||||
print("\nCompile JSON files to .srs files...")
|
|
||||||
for filename in os.listdir(output_json_directory):
|
|
||||||
if filename.endswith('.json'):
|
|
||||||
json_file_path = os.path.join(output_json_directory, filename)
|
|
||||||
srs_file_path = os.path.join(compiled_output_directory, f"{os.path.splitext(filename)[0]}.srs")
|
|
||||||
try:
|
|
||||||
subprocess.run(
|
|
||||||
["sing-box", "rule-set", "compile", json_file_path, "-o", srs_file_path], check=True
|
|
||||||
)
|
|
||||||
print(f"Compiled .srs file: {srs_file_path}")
|
|
||||||
except subprocess.CalledProcessError as e:
|
|
||||||
print(f"Compile error {json_file_path}: {e}")
|
|
||||||
|
|
||||||
def generate_srs_subnets(input_file, output_json_directory='JSON', compiled_output_directory='SRS'):
|
|
||||||
os.makedirs(output_json_directory, exist_ok=True)
|
|
||||||
os.makedirs(compiled_output_directory, exist_ok=True)
|
|
||||||
|
|
||||||
subnets = []
|
|
||||||
with open(input_file, 'r', encoding='utf-8') as file:
|
|
||||||
for line in file:
|
|
||||||
subnet = line.strip()
|
|
||||||
if subnet:
|
|
||||||
subnets.append(subnet)
|
|
||||||
data = {
|
|
||||||
"version": 3,
|
|
||||||
"rules": [
|
|
||||||
{
|
|
||||||
"ip_cidr": subnets
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
filename = os.path.splitext(os.path.basename(input_file))[0]
|
|
||||||
output_file_path = os.path.join(output_json_directory, f"{filename}.json")
|
|
||||||
|
|
||||||
with open(output_file_path, 'w', encoding='utf-8') as output_file:
|
|
||||||
json.dump(data, output_file, indent=4)
|
|
||||||
|
|
||||||
print(f"JSON file generated: {output_file_path}")
|
|
||||||
|
|
||||||
srs_file_path = os.path.join(compiled_output_directory, f"{filename}.srs")
|
|
||||||
try:
|
|
||||||
subprocess.run(
|
|
||||||
["sing-box", "rule-set", "compile", output_file_path, "-o", srs_file_path], check=True
|
|
||||||
)
|
|
||||||
print(f"Compiled .srs file: {srs_file_path}")
|
|
||||||
except subprocess.CalledProcessError as e:
|
|
||||||
print(f"Compile error {output_file_path}: {e}")
|
|
||||||
|
|
||||||
def generate_srs_combined(input_subnets_file, input_domains_file, output_json_directory='JSON', compiled_output_directory='SRS'):
|
|
||||||
os.makedirs(output_json_directory, exist_ok=True)
|
|
||||||
os.makedirs(compiled_output_directory, exist_ok=True)
|
|
||||||
|
|
||||||
domains = []
|
|
||||||
if os.path.exists(input_domains_file):
|
|
||||||
with open(input_domains_file, 'r', encoding='utf-8') as file:
|
|
||||||
domains = [line.strip() for line in file if line.strip()]
|
|
||||||
|
|
||||||
subnets = []
|
|
||||||
if os.path.exists(input_subnets_file):
|
|
||||||
with open(input_subnets_file, 'r', encoding='utf-8') as file:
|
|
||||||
subnets = [line.strip() for line in file if line.strip()]
|
|
||||||
|
|
||||||
if input_subnets_file == "Subnets/IPv4/discord.lst":
|
|
||||||
data = {
|
|
||||||
"version": 3,
|
|
||||||
"rules": [
|
|
||||||
{
|
|
||||||
"domain_suffix": domains
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"network": ["udp"],
|
|
||||||
"ip_cidr": subnets,
|
|
||||||
"port_range": ["50000:65535"]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
elif input_subnets_file == "Subnets/IPv4/telegram.lst" and input_domains_file == "voice_messengers":
|
|
||||||
data = {
|
|
||||||
"version": 3,
|
|
||||||
"rules": [
|
|
||||||
{
|
|
||||||
"network": ["udp"],
|
|
||||||
"ip_cidr": subnets,
|
|
||||||
"port": [1400],
|
|
||||||
"port_range": ["596:599"]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
else:
|
|
||||||
data = {
|
|
||||||
"version": 3,
|
|
||||||
"rules": [
|
|
||||||
{
|
|
||||||
"domain_suffix": domains,
|
|
||||||
"ip_cidr": subnets
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
if input_domains_file == "voice_messengers":
|
|
||||||
filename = "voice_messengers"
|
|
||||||
else:
|
|
||||||
filename = os.path.splitext(os.path.basename(input_subnets_file))[0]
|
|
||||||
output_file_path = os.path.join(output_json_directory, f"{filename}.json")
|
|
||||||
|
|
||||||
with open(output_file_path, 'w', encoding='utf-8') as output_file:
|
|
||||||
json.dump(data, output_file, indent=4)
|
|
||||||
|
|
||||||
print(f"JSON file generated: {output_file_path}")
|
|
||||||
|
|
||||||
srs_file_path = os.path.join(compiled_output_directory, f"{filename}.srs")
|
|
||||||
try:
|
|
||||||
subprocess.run(
|
|
||||||
["sing-box", "rule-set", "compile", output_file_path, "-o", srs_file_path], check=True
|
|
||||||
)
|
|
||||||
print(f"Compiled .srs file: {srs_file_path}")
|
|
||||||
except subprocess.CalledProcessError as e:
|
|
||||||
print(f"Compile error {output_file_path}: {e}")
|
|
||||||
|
|
||||||
|
|
||||||
def prepare_dat_domains(domains, output_name, dirs=[]):
|
def prepare_dat_domains(domains, output_name, dirs=None):
|
||||||
output_lists_directory = 'geosite_data'
|
output_lists_directory = 'geosite_data'
|
||||||
os.makedirs(output_lists_directory, exist_ok=True)
|
os.makedirs(output_lists_directory, exist_ok=True)
|
||||||
|
|
||||||
domain_attrs = {domain: [] for domain in domains}
|
domain_attrs = {domain: [] for domain in domains}
|
||||||
|
|
||||||
for directory in dirs:
|
for directory in (dirs or []):
|
||||||
if not os.path.isdir(directory):
|
if not os.path.isdir(directory):
|
||||||
continue
|
continue
|
||||||
for filename in os.listdir(directory):
|
for filename in os.listdir(directory):
|
||||||
@@ -407,8 +187,6 @@ def prepare_dat_domains(domains, output_name, dirs=[]):
|
|||||||
out_f.write(f"{line}\n")
|
out_f.write(f"{line}\n")
|
||||||
|
|
||||||
def prepare_dat_combined(dirs):
|
def prepare_dat_combined(dirs):
|
||||||
import shutil
|
|
||||||
|
|
||||||
output_lists_directory = 'geosite_data'
|
output_lists_directory = 'geosite_data'
|
||||||
os.makedirs(output_lists_directory, exist_ok=True)
|
os.makedirs(output_lists_directory, exist_ok=True)
|
||||||
|
|
||||||
@@ -426,18 +204,65 @@ def prepare_dat_combined(dirs):
|
|||||||
|
|
||||||
shutil.copyfile(source_path, destination_path)
|
shutil.copyfile(source_path, destination_path)
|
||||||
|
|
||||||
|
def parse_geosite_line(line):
|
||||||
|
from proto import geosite_pb2
|
||||||
|
|
||||||
|
parts = line.split()
|
||||||
|
raw_domain = parts[0]
|
||||||
|
attrs = [p.lstrip('@') for p in parts[1:] if p.startswith('@')]
|
||||||
|
|
||||||
|
if raw_domain.startswith('full:'):
|
||||||
|
domain_type = geosite_pb2.Domain.Full
|
||||||
|
value = raw_domain[5:]
|
||||||
|
elif raw_domain.startswith('regexp:'):
|
||||||
|
domain_type = geosite_pb2.Domain.Regex
|
||||||
|
value = raw_domain[7:]
|
||||||
|
elif raw_domain.startswith('keyword:'):
|
||||||
|
domain_type = geosite_pb2.Domain.Plain
|
||||||
|
value = raw_domain[8:]
|
||||||
|
else:
|
||||||
|
domain_type = geosite_pb2.Domain.RootDomain
|
||||||
|
value = raw_domain.lstrip('.')
|
||||||
|
|
||||||
|
return domain_type, value, attrs
|
||||||
|
|
||||||
def generate_dat_domains(data_path='geosite_data', output_name='geosite.dat', output_directory='DAT'):
|
def generate_dat_domains(data_path='geosite_data', output_name='geosite.dat', output_directory='DAT'):
|
||||||
|
from proto import geosite_pb2
|
||||||
|
|
||||||
os.makedirs(output_directory, exist_ok=True)
|
os.makedirs(output_directory, exist_ok=True)
|
||||||
|
|
||||||
try:
|
geo_site_list = geosite_pb2.GeoSiteList()
|
||||||
subprocess.run(
|
|
||||||
["domain-list-community", f"-datapath={data_path}", f"-outputname={output_name}", f"-outputdir={output_directory}"],
|
for filename in sorted(os.listdir(data_path)):
|
||||||
check=True,
|
file_path = os.path.join(data_path, filename)
|
||||||
stdout=subprocess.DEVNULL
|
if not os.path.isfile(file_path):
|
||||||
)
|
continue
|
||||||
print(f"Compiled .dat file: {output_directory}/{output_name}")
|
|
||||||
except subprocess.CalledProcessError as e:
|
geo_site = geo_site_list.entry.add()
|
||||||
print(f"Compile error {data_path}: {e}")
|
geo_site.country_code = filename.upper()
|
||||||
|
|
||||||
|
with open(file_path, 'r', encoding='utf-8') as f:
|
||||||
|
for line in f:
|
||||||
|
line = line.strip()
|
||||||
|
if not line or line.startswith('#'):
|
||||||
|
continue
|
||||||
|
|
||||||
|
domain_type, value, attrs = parse_geosite_line(line)
|
||||||
|
|
||||||
|
domain = geo_site.domain.add()
|
||||||
|
domain.type = domain_type
|
||||||
|
domain.value = value
|
||||||
|
|
||||||
|
for attr in attrs:
|
||||||
|
attribute = domain.attribute.add()
|
||||||
|
attribute.key = attr
|
||||||
|
attribute.bool_value = True
|
||||||
|
|
||||||
|
output_path = os.path.join(output_directory, output_name)
|
||||||
|
with open(output_path, 'wb') as f:
|
||||||
|
f.write(geo_site_list.SerializeToString())
|
||||||
|
|
||||||
|
print(f"Compiled .dat file: {output_path}")
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# Russia inside
|
# Russia inside
|
||||||
@@ -482,31 +307,55 @@ if __name__ == '__main__':
|
|||||||
Path(temp_file).unlink()
|
Path(temp_file).unlink()
|
||||||
|
|
||||||
# Sing-box ruleset main
|
# Sing-box ruleset main
|
||||||
russia_inside = domains_from_file('Russia/inside-raw.lst')
|
russia_inside = lines_from_file('Russia/inside-raw.lst')
|
||||||
russia_outside = domains_from_file('Russia/outside-raw.lst')
|
russia_outside = lines_from_file('Russia/outside-raw.lst')
|
||||||
ukraine_inside = domains_from_file('Ukraine/inside-raw.lst')
|
ukraine_inside = lines_from_file('Ukraine/inside-raw.lst')
|
||||||
generate_srs_domains(russia_inside, 'russia_inside')
|
srs_rule('russia_inside', [{"domain_suffix": russia_inside}])
|
||||||
generate_srs_domains(russia_outside, 'russia_outside')
|
srs_rule('russia_outside', [{"domain_suffix": russia_outside}])
|
||||||
generate_srs_domains(ukraine_inside, 'ukraine_inside')
|
srs_rule('ukraine_inside', [{"domain_suffix": ukraine_inside}])
|
||||||
|
|
||||||
# Sing-box categories
|
# Sing-box categories
|
||||||
directories = ['Categories', 'Services']
|
directories = ['Categories', 'Services']
|
||||||
generate_srs_for_categories(directories)
|
generate_srs_for_categories(directories)
|
||||||
|
|
||||||
# Sing-box subnets + domains
|
# Sing-box subnets + domains
|
||||||
generate_srs_combined(DiscordSubnets, "Services/discord.lst")
|
for service in SUBNET_SERVICES:
|
||||||
generate_srs_combined(TwitterSubnets, "Services/twitter.lst")
|
if service == 'discord':
|
||||||
generate_srs_combined(MetaSubnets, "Services/meta.lst")
|
continue
|
||||||
generate_srs_combined(TelegramSubnets, "Services/telegram.lst")
|
subnets = lines_from_file(f'Subnets/IPv4/{service}.lst')
|
||||||
generate_srs_combined(CloudflareSubnets, "Services/cloudflare.lst")
|
domains = lines_from_file(f'Services/{service}.lst')
|
||||||
generate_srs_combined(HetznerSubnets, "Services/hetzner.lst")
|
srs_rule(service, [{"domain_suffix": domains, "ip_cidr": subnets}])
|
||||||
generate_srs_combined(OVHSubnets, "Services/ovh.lst")
|
|
||||||
generate_srs_combined(DigitalOceanSubnets, "Services/digitalocean.lst")
|
|
||||||
generate_srs_combined(CloudfrontSubnets, "Services/cloudfront.lst")
|
|
||||||
generate_srs_combined(RobloxSubnets, "Services/roblox.lst")
|
|
||||||
|
|
||||||
# Sing-box voice for messengers
|
# Discord (domains + UDP subnets on high ports)
|
||||||
generate_srs_combined(TelegramSubnets, "voice_messengers")
|
discord_subnets = lines_from_file('Subnets/IPv4/discord.lst')
|
||||||
|
discord_domains = lines_from_file('Services/discord.lst')
|
||||||
|
srs_rule('discord', [
|
||||||
|
{"domain_suffix": discord_domains},
|
||||||
|
{"network": ["udp"], "ip_cidr": discord_subnets, "port_range": ["50000:65535"]},
|
||||||
|
])
|
||||||
|
|
||||||
|
# Mihomo main
|
||||||
|
to_mrs = lambda domains: [f'+.{d.lstrip(".")}' for d in domains]
|
||||||
|
mrs_russia_inside = to_mrs(russia_inside)
|
||||||
|
mrs_russia_outside = to_mrs(russia_outside)
|
||||||
|
mrs_ukraine_inside = to_mrs(ukraine_inside)
|
||||||
|
compile_mrs(mrs_russia_inside, 'russia_inside_domain')
|
||||||
|
compile_mrs(mrs_russia_outside, 'russia_outside_domain')
|
||||||
|
compile_mrs(mrs_ukraine_inside, 'ukraine_inside_domain')
|
||||||
|
|
||||||
|
# Mihomo categories
|
||||||
|
for directory in ['Categories', 'Services']:
|
||||||
|
for filename in os.listdir(directory):
|
||||||
|
file_path = os.path.join(directory, filename)
|
||||||
|
if os.path.isfile(file_path):
|
||||||
|
domains = to_mrs(lines_from_file(file_path))
|
||||||
|
name = os.path.splitext(filename)[0]
|
||||||
|
compile_mrs(domains, f'{name}_domain')
|
||||||
|
|
||||||
|
# Mihomo subnets
|
||||||
|
for service in SUBNET_SERVICES:
|
||||||
|
subnets = lines_from_file(f'Subnets/IPv4/{service}.lst')
|
||||||
|
compile_mrs(subnets, f'{service}_ipcidr', behavior='ipcidr')
|
||||||
|
|
||||||
# Xray domains
|
# Xray domains
|
||||||
prepare_dat_domains(russia_inside, 'russia-inside', directories)
|
prepare_dat_domains(russia_inside, 'russia-inside', directories)
|
||||||
|
|||||||
222
get-subnets.py
222
get-subnets.py
@@ -1,30 +1,28 @@
|
|||||||
#!/usr/bin/python3.10
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import ipaddress
|
import ipaddress
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import json
|
import json
|
||||||
|
import sys
|
||||||
|
|
||||||
BGP_TOOLS_URL = 'https://bgp.tools/table.txt'
|
RIPE_STAT_URL = 'https://stat.ripe.net/data/announced-prefixes/data.json?resource=AS{}'
|
||||||
HEADERS = { 'User-Agent': 'itdog.info - hi@itdog.info' }
|
USER_AGENT = 'allow-domains/1.0'
|
||||||
AS_FILE = 'AS.lst'
|
|
||||||
IPv4_DIR = 'Subnets/IPv4'
|
IPv4_DIR = 'Subnets/IPv4'
|
||||||
IPv6_DIR = 'Subnets/IPv6'
|
IPv6_DIR = 'Subnets/IPv6'
|
||||||
|
|
||||||
AS_META = ['32934','63293','54115','149642']
|
ASN_SERVICES = {
|
||||||
AS_TWITTER = ['13414']
|
'meta.lst': ['32934', '63293', '54115', '149642'],
|
||||||
AS_HETZNER = ['24940']
|
'twitter.lst': ['13414'],
|
||||||
AS_OVH = ['16276']
|
'hetzner.lst': ['24940'],
|
||||||
AS_DIGITALOCEAN = ['14061']
|
'ovh.lst': ['16276'],
|
||||||
|
'digitalocean.lst': ['14061'],
|
||||||
|
}
|
||||||
|
|
||||||
META = 'meta.lst'
|
ASN_TELEGRAM = ['44907', '59930', '62014', '62041', '211157']
|
||||||
TWITTER = 'twitter.lst'
|
|
||||||
TELEGRAM = 'telegram.lst'
|
TELEGRAM = 'telegram.lst'
|
||||||
CLOUDFLARE = 'cloudflare.lst'
|
CLOUDFLARE = 'cloudflare.lst'
|
||||||
HETZNER = 'hetzner.lst'
|
|
||||||
OVH = 'ovh.lst'
|
|
||||||
DIGITALOCEAN = 'digitalocean.lst'
|
|
||||||
CLOUDFRONT = 'cloudfront.lst'
|
CLOUDFRONT = 'cloudfront.lst'
|
||||||
|
|
||||||
# From https://iplist.opencck.org/
|
# From https://iplist.opencck.org/
|
||||||
@@ -38,69 +36,79 @@ TELEGRAM_CIDR_URL = 'https://core.telegram.org/resources/cidr.txt'
|
|||||||
CLOUDFLARE_V4='https://www.cloudflare.com/ips-v4'
|
CLOUDFLARE_V4='https://www.cloudflare.com/ips-v4'
|
||||||
CLOUDFLARE_V6='https://www.cloudflare.com/ips-v6'
|
CLOUDFLARE_V6='https://www.cloudflare.com/ips-v6'
|
||||||
|
|
||||||
AWS_IP_RANGES_URL='https://ip-ranges.amazonaws.com/ip-ranges.json'
|
# https://support.google.com/a/answer/1279090
|
||||||
|
GOOGLE_MEET = 'google_meet.lst'
|
||||||
|
GOOGLE_MEET_V4 = [
|
||||||
|
'74.125.247.128/32',
|
||||||
|
'74.125.250.0/24',
|
||||||
|
'142.250.82.0/24',
|
||||||
|
]
|
||||||
|
GOOGLE_MEET_V6 = [
|
||||||
|
'2001:4860:4864:4:8000::/128',
|
||||||
|
'2001:4860:4864:5::/64',
|
||||||
|
'2001:4860:4864:6::/64',
|
||||||
|
]
|
||||||
|
|
||||||
subnet_list = []
|
AWS_CIDR_URL='https://ip-ranges.amazonaws.com/ip-ranges.json'
|
||||||
|
|
||||||
|
def make_request(url):
|
||||||
|
req = urllib.request.Request(url)
|
||||||
|
req.add_header('User-Agent', USER_AGENT)
|
||||||
|
return req
|
||||||
|
|
||||||
def subnet_summarization(subnet_list):
|
def subnet_summarization(subnet_list):
|
||||||
subnets = [ipaddress.ip_network(subnet) for subnet in subnet_list]
|
subnets = [ipaddress.ip_network(subnet, strict=False) for subnet in subnet_list]
|
||||||
return list(ipaddress.collapse_addresses(subnets))
|
return list(ipaddress.collapse_addresses(subnets))
|
||||||
|
|
||||||
def process_subnets(subnet_list, target_as):
|
def fetch_asn_prefixes(asn_list):
|
||||||
ipv4_subnets = []
|
ipv4_subnets = []
|
||||||
ipv6_subnets = []
|
ipv6_subnets = []
|
||||||
|
|
||||||
for subnet_str, as_number in subnet_list:
|
for asn in asn_list:
|
||||||
|
url = RIPE_STAT_URL.format(asn)
|
||||||
|
req = make_request(url)
|
||||||
try:
|
try:
|
||||||
subnet = ipaddress.ip_network(subnet_str)
|
with urllib.request.urlopen(req, timeout=30) as response:
|
||||||
if as_number in target_as:
|
data = json.loads(response.read().decode('utf-8'))
|
||||||
if subnet.version == 4:
|
for entry in data['data']['prefixes']:
|
||||||
ipv4_subnets.append(subnet_str)
|
prefix = entry['prefix']
|
||||||
elif subnet.version == 6:
|
try:
|
||||||
ipv6_subnets.append(subnet_str)
|
network = ipaddress.ip_network(prefix)
|
||||||
except ValueError:
|
if network.version == 4:
|
||||||
print(f"Invalid subnet: {subnet_str}")
|
ipv4_subnets.append(prefix)
|
||||||
sys.exit(1)
|
else:
|
||||||
|
ipv6_subnets.append(prefix)
|
||||||
ipv4_merged = subnet_summarization(ipv4_subnets)
|
except ValueError:
|
||||||
ipv6_merged = subnet_summarization(ipv6_subnets)
|
print(f"Invalid subnet: {prefix}")
|
||||||
|
sys.exit(1)
|
||||||
return ipv4_merged, ipv6_merged
|
|
||||||
|
|
||||||
def download_ready_subnets(url_v4, url_v6):
|
|
||||||
ipv4_subnets = []
|
|
||||||
ipv6_subnets = []
|
|
||||||
|
|
||||||
urls = [(url_v4, 4), (url_v6, 6)]
|
|
||||||
|
|
||||||
for url, version in urls:
|
|
||||||
req = urllib.request.Request(url, headers=HEADERS)
|
|
||||||
try:
|
|
||||||
with urllib.request.urlopen(req) as response:
|
|
||||||
if response.status == 200:
|
|
||||||
subnets = response.read().decode('utf-8').splitlines()
|
|
||||||
for subnet_str in subnets:
|
|
||||||
try:
|
|
||||||
subnet = ipaddress.ip_network(subnet_str)
|
|
||||||
if subnet.version == 4:
|
|
||||||
ipv4_subnets.append(subnet_str)
|
|
||||||
elif subnet.version == 6:
|
|
||||||
ipv6_subnets.append(subnet_str)
|
|
||||||
except ValueError:
|
|
||||||
print(f"Invalid subnet: {subnet_str}")
|
|
||||||
sys.exit(1)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Query error: {e}")
|
print(f"Error fetching AS{asn}: {e}")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
return ipv4_subnets, ipv6_subnets
|
return ipv4_subnets, ipv6_subnets
|
||||||
|
|
||||||
def download_ready_split_subnets(url):
|
def download_subnets(*urls):
|
||||||
req = urllib.request.Request(url)
|
ipv4_subnets = []
|
||||||
with urllib.request.urlopen(req) as response:
|
ipv6_subnets = []
|
||||||
subnets = response.read().decode('utf-8').splitlines()
|
|
||||||
|
|
||||||
ipv4_subnets = [cidr for cidr in subnets if isinstance(ipaddress.ip_network(cidr, strict=False), ipaddress.IPv4Network)]
|
for url in urls:
|
||||||
ipv6_subnets = [cidr for cidr in subnets if isinstance(ipaddress.ip_network(cidr, strict=False), ipaddress.IPv6Network)]
|
req = make_request(url)
|
||||||
|
try:
|
||||||
|
with urllib.request.urlopen(req, timeout=30) as response:
|
||||||
|
subnets = response.read().decode('utf-8').splitlines()
|
||||||
|
for subnet_str in subnets:
|
||||||
|
try:
|
||||||
|
network = ipaddress.ip_network(subnet_str, strict=False)
|
||||||
|
if network.version == 4:
|
||||||
|
ipv4_subnets.append(subnet_str)
|
||||||
|
else:
|
||||||
|
ipv6_subnets.append(subnet_str)
|
||||||
|
except ValueError:
|
||||||
|
print(f"Invalid subnet: {subnet_str}")
|
||||||
|
sys.exit(1)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Query error {url}: {e}")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
return ipv4_subnets, ipv6_subnets
|
return ipv4_subnets, ipv6_subnets
|
||||||
|
|
||||||
@@ -108,22 +116,22 @@ def download_aws_cloudfront_subnets():
|
|||||||
ipv4_subnets = []
|
ipv4_subnets = []
|
||||||
ipv6_subnets = []
|
ipv6_subnets = []
|
||||||
|
|
||||||
req = urllib.request.Request(AWS_IP_RANGES_URL, headers=HEADERS)
|
req = make_request(AWS_CIDR_URL)
|
||||||
try:
|
try:
|
||||||
with urllib.request.urlopen(req) as response:
|
with urllib.request.urlopen(req, timeout=30) as response:
|
||||||
if response.status == 200:
|
data = json.loads(response.read().decode('utf-8'))
|
||||||
data = json.loads(response.read().decode('utf-8'))
|
|
||||||
|
|
||||||
for prefix in data.get('prefixes', []):
|
for prefix in data.get('prefixes', []):
|
||||||
if prefix.get('service') == 'CLOUDFRONT':
|
if prefix.get('service') == 'CLOUDFRONT':
|
||||||
ipv4_subnets.append(prefix['ip_prefix'])
|
ipv4_subnets.append(prefix['ip_prefix'])
|
||||||
|
|
||||||
for prefix in data.get('ipv6_prefixes', []):
|
for prefix in data.get('ipv6_prefixes', []):
|
||||||
if prefix.get('service') == 'CLOUDFRONT':
|
if prefix.get('service') == 'CLOUDFRONT':
|
||||||
ipv6_subnets.append(prefix['ipv6_prefix'])
|
ipv6_subnets.append(prefix['ipv6_prefix'])
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error downloading AWS CloudFront ranges: {e}")
|
print(f"Error downloading AWS CloudFront ranges: {e}")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
return ipv4_subnets, ipv6_subnets
|
return ipv4_subnets, ipv6_subnets
|
||||||
|
|
||||||
@@ -138,63 +146,47 @@ def copy_file_legacy(src_filename):
|
|||||||
shutil.copy(src_filename, os.path.join(os.path.dirname(src_filename), new_filename))
|
shutil.copy(src_filename, os.path.join(os.path.dirname(src_filename), new_filename))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
request = urllib.request.Request(BGP_TOOLS_URL, headers=HEADERS)
|
# Services from ASN (meta, twitter, hetzner, ovh, digitalocean)
|
||||||
|
for filename, asn_list in ASN_SERVICES.items():
|
||||||
with urllib.request.urlopen(request) as response:
|
print(f'Fetching {filename}...')
|
||||||
for line in response:
|
ipv4, ipv6 = fetch_asn_prefixes(asn_list)
|
||||||
decoded_line = line.decode('utf-8').strip()
|
write_subnets_to_file(subnet_summarization(ipv4), f'{IPv4_DIR}/{filename}')
|
||||||
subnet, as_number = decoded_line.split()
|
write_subnets_to_file(subnet_summarization(ipv6), f'{IPv6_DIR}/{filename}')
|
||||||
subnet_list.append((subnet, as_number))
|
|
||||||
|
|
||||||
# Meta
|
|
||||||
ipv4_merged_meta, ipv6_merged_meta = process_subnets(subnet_list, AS_META)
|
|
||||||
write_subnets_to_file(ipv4_merged_meta, f'{IPv4_DIR}/{META}')
|
|
||||||
write_subnets_to_file(ipv6_merged_meta, f'{IPv6_DIR}/{META}')
|
|
||||||
|
|
||||||
# Twitter
|
|
||||||
ipv4_merged_twitter, ipv6_merged_twitter = process_subnets(subnet_list, AS_TWITTER)
|
|
||||||
write_subnets_to_file(ipv4_merged_twitter, f'{IPv4_DIR}/{TWITTER}')
|
|
||||||
write_subnets_to_file(ipv6_merged_twitter, f'{IPv6_DIR}/{TWITTER}')
|
|
||||||
|
|
||||||
# Hetzner
|
|
||||||
ipv4_merged_hetzner, ipv6_merged_hetzner = process_subnets(subnet_list, AS_HETZNER)
|
|
||||||
write_subnets_to_file(ipv4_merged_hetzner, f'{IPv4_DIR}/{HETZNER}')
|
|
||||||
write_subnets_to_file(ipv6_merged_hetzner, f'{IPv6_DIR}/{HETZNER}')
|
|
||||||
|
|
||||||
# OVH
|
|
||||||
ipv4_merged_ovh, ipv6_merged_ovh = process_subnets(subnet_list, AS_OVH)
|
|
||||||
write_subnets_to_file(ipv4_merged_ovh, f'{IPv4_DIR}/{OVH}')
|
|
||||||
write_subnets_to_file(ipv6_merged_ovh, f'{IPv6_DIR}/{OVH}')
|
|
||||||
|
|
||||||
# Digital Ocean
|
|
||||||
ipv4_merged_digitalocean, ipv6_merged_digitalocean = process_subnets(subnet_list, AS_DIGITALOCEAN)
|
|
||||||
write_subnets_to_file(ipv4_merged_digitalocean, f'{IPv4_DIR}/{DIGITALOCEAN}')
|
|
||||||
write_subnets_to_file(ipv6_merged_digitalocean, f'{IPv6_DIR}/{DIGITALOCEAN}')
|
|
||||||
|
|
||||||
# Discord voice
|
# Discord voice
|
||||||
ipv4_discord, ipv6_discord = download_ready_subnets(DISCORD_VOICE_V4, DISCORD_VOICE_V6)
|
print(f'Fetching {DISCORD}...')
|
||||||
|
ipv4_discord, ipv6_discord = download_subnets(DISCORD_VOICE_V4, DISCORD_VOICE_V6)
|
||||||
write_subnets_to_file(ipv4_discord, f'{IPv4_DIR}/{DISCORD}')
|
write_subnets_to_file(ipv4_discord, f'{IPv4_DIR}/{DISCORD}')
|
||||||
write_subnets_to_file(ipv6_discord, f'{IPv6_DIR}/{DISCORD}')
|
write_subnets_to_file(ipv6_discord, f'{IPv6_DIR}/{DISCORD}')
|
||||||
|
|
||||||
# Telegram
|
# Telegram
|
||||||
ipv4_telegram, ipv6_telegram = download_ready_split_subnets(TELEGRAM_CIDR_URL)
|
print(f'Fetching {TELEGRAM}...')
|
||||||
|
ipv4_telegram_file, ipv6_telegram_file = download_subnets(TELEGRAM_CIDR_URL)
|
||||||
|
ipv4_telegram_asn, ipv6_telegram_asn = fetch_asn_prefixes(ASN_TELEGRAM)
|
||||||
|
ipv4_telegram = subnet_summarization(ipv4_telegram_file + ipv4_telegram_asn)
|
||||||
|
ipv6_telegram = subnet_summarization(ipv6_telegram_file + ipv6_telegram_asn)
|
||||||
write_subnets_to_file(ipv4_telegram, f'{IPv4_DIR}/{TELEGRAM}')
|
write_subnets_to_file(ipv4_telegram, f'{IPv4_DIR}/{TELEGRAM}')
|
||||||
write_subnets_to_file(ipv6_telegram, f'{IPv6_DIR}/{TELEGRAM}')
|
write_subnets_to_file(ipv6_telegram, f'{IPv6_DIR}/{TELEGRAM}')
|
||||||
|
|
||||||
# Cloudflare
|
# Cloudflare
|
||||||
ipv4_cloudflare, ipv6_cloudflare = download_ready_subnets(CLOUDFLARE_V4, CLOUDFLARE_V6)
|
print(f'Fetching {CLOUDFLARE}...')
|
||||||
|
ipv4_cloudflare, ipv6_cloudflare = download_subnets(CLOUDFLARE_V4, CLOUDFLARE_V6)
|
||||||
write_subnets_to_file(ipv4_cloudflare, f'{IPv4_DIR}/{CLOUDFLARE}')
|
write_subnets_to_file(ipv4_cloudflare, f'{IPv4_DIR}/{CLOUDFLARE}')
|
||||||
write_subnets_to_file(ipv6_cloudflare, f'{IPv6_DIR}/{CLOUDFLARE}')
|
write_subnets_to_file(ipv6_cloudflare, f'{IPv6_DIR}/{CLOUDFLARE}')
|
||||||
|
|
||||||
|
# Google Meet
|
||||||
|
print(f'Writing {GOOGLE_MEET}...')
|
||||||
|
write_subnets_to_file(GOOGLE_MEET_V4, f'{IPv4_DIR}/{GOOGLE_MEET}')
|
||||||
|
write_subnets_to_file(GOOGLE_MEET_V6, f'{IPv6_DIR}/{GOOGLE_MEET}')
|
||||||
|
|
||||||
# AWS CloudFront
|
# AWS CloudFront
|
||||||
|
print(f'Fetching {CLOUDFRONT}...')
|
||||||
ipv4_cloudfront, ipv6_cloudfront = download_aws_cloudfront_subnets()
|
ipv4_cloudfront, ipv6_cloudfront = download_aws_cloudfront_subnets()
|
||||||
write_subnets_to_file(ipv4_cloudfront, f'{IPv4_DIR}/{CLOUDFRONT}')
|
write_subnets_to_file(ipv4_cloudfront, f'{IPv4_DIR}/{CLOUDFRONT}')
|
||||||
write_subnets_to_file(ipv6_cloudfront, f'{IPv6_DIR}/{CLOUDFRONT}')
|
write_subnets_to_file(ipv6_cloudfront, f'{IPv6_DIR}/{CLOUDFRONT}')
|
||||||
|
|
||||||
# Legacy name
|
# Legacy copies with capitalized names (e.g. meta.lst -> Meta.lst)
|
||||||
copy_file_legacy(f'{IPv4_DIR}/{META}')
|
LEGACY_FILES = ['meta.lst', 'twitter.lst', 'discord.lst']
|
||||||
copy_file_legacy(f'{IPv6_DIR}/{META}')
|
for legacy_file in LEGACY_FILES:
|
||||||
copy_file_legacy(f'{IPv4_DIR}/{TWITTER}')
|
copy_file_legacy(f'{IPv4_DIR}/{legacy_file}')
|
||||||
copy_file_legacy(f'{IPv6_DIR}/{TWITTER}')
|
copy_file_legacy(f'{IPv6_DIR}/{legacy_file}')
|
||||||
copy_file_legacy(f'{IPv4_DIR}/{DISCORD}')
|
|
||||||
copy_file_legacy(f'{IPv6_DIR}/{DISCORD}')
|
|
||||||
0
proto/__init__.py
Normal file
0
proto/__init__.py
Normal file
37
proto/geosite.proto
Normal file
37
proto/geosite.proto
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
// Source: github.com/v2fly/v2ray-core/app/router/routercommon/common.proto
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package geosite;
|
||||||
|
|
||||||
|
option go_package = "geosite";
|
||||||
|
|
||||||
|
message Domain {
|
||||||
|
enum Type {
|
||||||
|
Plain = 0;
|
||||||
|
Regex = 1;
|
||||||
|
RootDomain = 2;
|
||||||
|
Full = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
Type type = 1;
|
||||||
|
string value = 2;
|
||||||
|
|
||||||
|
message Attribute {
|
||||||
|
string key = 1;
|
||||||
|
oneof typed_value {
|
||||||
|
bool bool_value = 2;
|
||||||
|
int64 int_value = 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repeated Attribute attribute = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GeoSite {
|
||||||
|
string country_code = 1;
|
||||||
|
repeated Domain domain = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GeoSiteList {
|
||||||
|
repeated GeoSite entry = 1;
|
||||||
|
}
|
||||||
45
proto/geosite_pb2.py
Normal file
45
proto/geosite_pb2.py
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
# NO CHECKED-IN PROTOBUF GENCODE
|
||||||
|
# source: proto/geosite.proto
|
||||||
|
# Protobuf Python Version: 6.32.1
|
||||||
|
"""Generated protocol buffer code."""
|
||||||
|
from google.protobuf import descriptor as _descriptor
|
||||||
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||||
|
from google.protobuf import runtime_version as _runtime_version
|
||||||
|
from google.protobuf import symbol_database as _symbol_database
|
||||||
|
from google.protobuf.internal import builder as _builder
|
||||||
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
||||||
|
_runtime_version.Domain.PUBLIC,
|
||||||
|
6,
|
||||||
|
32,
|
||||||
|
1,
|
||||||
|
'',
|
||||||
|
'proto/geosite.proto'
|
||||||
|
)
|
||||||
|
# @@protoc_insertion_point(imports)
|
||||||
|
|
||||||
|
_sym_db = _symbol_database.Default()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13proto/geosite.proto\x12\x07geosite\"\xf5\x01\n\x06\x44omain\x12\"\n\x04type\x18\x01 \x01(\x0e\x32\x14.geosite.Domain.Type\x12\r\n\x05value\x18\x02 \x01(\t\x12,\n\tattribute\x18\x03 \x03(\x0b\x32\x19.geosite.Domain.Attribute\x1aR\n\tAttribute\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x14\n\nbool_value\x18\x02 \x01(\x08H\x00\x12\x13\n\tint_value\x18\x03 \x01(\x03H\x00\x42\r\n\x0btyped_value\"6\n\x04Type\x12\t\n\x05Plain\x10\x00\x12\t\n\x05Regex\x10\x01\x12\x0e\n\nRootDomain\x10\x02\x12\x08\n\x04\x46ull\x10\x03\"@\n\x07GeoSite\x12\x14\n\x0c\x63ountry_code\x18\x01 \x01(\t\x12\x1f\n\x06\x64omain\x18\x02 \x03(\x0b\x32\x0f.geosite.Domain\".\n\x0bGeoSiteList\x12\x1f\n\x05\x65ntry\x18\x01 \x03(\x0b\x32\x10.geosite.GeoSiteB\tZ\x07geositeb\x06proto3')
|
||||||
|
|
||||||
|
_globals = globals()
|
||||||
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
||||||
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'proto.geosite_pb2', _globals)
|
||||||
|
if not _descriptor._USE_C_DESCRIPTORS:
|
||||||
|
_globals['DESCRIPTOR']._loaded_options = None
|
||||||
|
_globals['DESCRIPTOR']._serialized_options = b'Z\007geosite'
|
||||||
|
_globals['_DOMAIN']._serialized_start=33
|
||||||
|
_globals['_DOMAIN']._serialized_end=278
|
||||||
|
_globals['_DOMAIN_ATTRIBUTE']._serialized_start=140
|
||||||
|
_globals['_DOMAIN_ATTRIBUTE']._serialized_end=222
|
||||||
|
_globals['_DOMAIN_TYPE']._serialized_start=224
|
||||||
|
_globals['_DOMAIN_TYPE']._serialized_end=278
|
||||||
|
_globals['_GEOSITE']._serialized_start=280
|
||||||
|
_globals['_GEOSITE']._serialized_end=344
|
||||||
|
_globals['_GEOSITELIST']._serialized_start=346
|
||||||
|
_globals['_GEOSITELIST']._serialized_end=392
|
||||||
|
# @@protoc_insertion_point(module_scope)
|
||||||
@@ -1 +1,2 @@
|
|||||||
tldextract
|
tldextract
|
||||||
|
protobuf>=6.32.1
|
||||||
|
|||||||
@@ -4,12 +4,15 @@ pkgs.mkShell {
|
|||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
python312
|
python312
|
||||||
python312Packages.tldextract
|
python312Packages.tldextract
|
||||||
|
python312Packages.protobuf
|
||||||
sing-box
|
sing-box
|
||||||
|
mihomo
|
||||||
];
|
];
|
||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
echo "Environment ready!"
|
echo "Environment ready!"
|
||||||
echo "Python version: $(python --version)"
|
echo "Python version: $(python --version)"
|
||||||
echo "sing-box version: $(sing-box version 2>/dev/null || echo 'not available')"
|
echo "sing-box version: $(sing-box version 2>/dev/null || echo 'not available')"
|
||||||
|
echo "mihomo version: $(mihomo -v 2>/dev/null || echo 'not available')"
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user