From f9d50732640f8b1bb4195daf20eb37db165deec1 Mon Sep 17 00:00:00 2001 From: xkww3n Date: Sun, 5 Nov 2023 15:35:48 +0800 Subject: [PATCH] Improve GeoIP db. --- .github/workflows/main.yml | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 79e720a..8202a89 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,6 +48,13 @@ jobs: path: 'tool_sing-geosite' - name: Generate rules run: python generate.py + - name: Download MaxMind GeoLite2 Country DB + env: + MAXMIND_KEY: ${{ secrets.MAXMIND_KEY }} + run: | + wget -O ./GeoLite2-Country.tar.gz "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=${MAXMIND_KEY}&suffix=tar.gz" + tar xzvf ./GeoLite2-Country.tar.gz + cp ./GeoLite2-Country_*/GeoLite2-Country.mmdb ./ - name: Generate Geosite DB run: | cd tool_geosite @@ -62,11 +69,18 @@ jobs: "action": "add" }, { - "type": "text", + "type": "maxmindMMDB", "action": "add", "args": { - "name": "telegram", - "uri": "https://core.telegram.org/resources/cidr.txt" + "uri": "./GeoLite2-Country.mmdb" + } + }, + { + "type": "cutter", + "action": "remove", + "args": { + "wantedList": ["cn"], + "onlyIPType": "ipv4" } }, { @@ -87,6 +101,14 @@ jobs: "onlyIPType": "ipv6" } }, + { + "type": "text", + "action": "add", + "args": { + "name": "telegram", + "uri": "https://core.telegram.org/resources/cidr.txt" + } + }, { "type": "clashRuleSetClassical", "action": "add",