Skip to content

Commit 15881d4

Browse files
authored
feat: add extra cn_domain_list from ClashChinaMax (#9)
* feat: add extra cn_domain_list * patch: sync upstream * fix: fix syntax error * docs: update README * fix: fix syntax error * fix: fix syntax error * fix: fix syntax error * fix: fix conflicts * fix: fix conflicts * chore(deps): bump up go version to v.1.21.x
1 parent 1e2246f commit 15881d4

3 files changed

Lines changed: 38 additions & 26 deletions

File tree

.github/workflows/cron-run.yml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Setup Go 1.x.y
1313
uses: actions/setup-go@v3
1414
with:
15-
go-version: ^1.19
15+
go-version: ^1.21
1616

1717
- name: Set variables
1818
shell: bash
@@ -25,7 +25,10 @@ jobs:
2525
echo "WIN_SPY=https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt" >> $GITHUB_ENV
2626
echo "WIN_UPDATE=https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/update.txt" >> $GITHUB_ENV
2727
echo "WIN_EXTRA=https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/extra.txt" >> $GITHUB_ENV
28-
# ads list
28+
echo "CHINA_MAX_DOMAINS_EXTRA_URL=https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/ChinaMax/ChinaMax_Domain.txt" >> $GITHUB_ENV
29+
# extra ip list
30+
echo "CHINA_MAX_IP_EXTRA_URL=https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/ChinaMax/ChinaMax_IP.txt" >> $GITHUB_ENV
31+
# extra ads list
2932
echo "PETERLOWE_REJECT_URL=https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext" >> $GITHUB_ENV
3033
echo "DANPOLLOCK_REJECT_URL=https://someonewhocares.org/hosts/hosts" >> $GITHUB_ENV
3134
echo "ANTI_AD_REJECT_URL=https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-domains.txt" >> $GITHUB_ENV
@@ -40,24 +43,24 @@ jobs:
4043
echo "NEODEVPRO_ADS_REJECT_URL=https://raw.githubusercontent.com/neodevpro/neodevhost/master/adblocker" >> $GITHUB_ENV
4144
4245
- name: Checkout the "hidden" branch of this repo
43-
uses: actions/checkout@v3
46+
uses: actions/checkout@v4
4447
with:
4548
ref: hidden
4649

4750
- name: Checkout Loyalsoldier/domain-list-custom
48-
uses: actions/checkout@v3
51+
uses: actions/checkout@v4
4952
with:
5053
repository: Loyalsoldier/domain-list-custom
5154
path: custom
5255

5356
- name: Checkout v2fly/domain-list-community
54-
uses: actions/checkout@v3
57+
uses: actions/checkout@v4
5558
with:
5659
repository: v2fly/domain-list-community
5760
path: community
5861

5962
- name: Checkout cokebar/gfwlist2dnsmasq
60-
uses: actions/checkout@v3
63+
uses: actions/checkout@v4
6164
with:
6265
repository: cokebar/gfwlist2dnsmasq
6366
path: gfwlist2dnsmasq
@@ -80,7 +83,6 @@ jobs:
8083
8184
- name: Get and add proxy domains into temp-proxy.txt file
8285
run: |
83-
cat ./gfwlist2dnsmasq/temp-gfwlist.txt | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' > temp-proxy.txt
8486
curl -sSL $GOOGLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' >> temp-proxy.txt
8587
curl -sSL $APPLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' >> temp-proxy.txt
8688
curl -sSL ${CUSTOM_PROXY} | grep -Ev ":@cn" | perl -ne '/^(domain):([^:]+)(\n$|:@.+)/ && print "$2\n"' >> temp-proxy.txt
@@ -116,6 +118,8 @@ jobs:
116118
cat temp-proxy.txt | sort --ignore-case -u > proxy-list-with-redundant
117119
cat temp-direct.txt | sort --ignore-case -u > direct-list-with-redundant
118120
cat temp-reject.txt | sort --ignore-case -u > reject-list-with-redundant
121+
# extras
122+
cat $CHINA_MAX_DOMAINS_EXTRA_URL | sort --ignore-case -u > direct-list-with-redundant
119123
120124
- name: Remove redundant domains
121125
run: |
@@ -154,8 +158,10 @@ jobs:
154158
cp ./community/data/geolocation-\!cn proxy-list.txt
155159
cp ./community/data/category-ads-all reject-list.txt
156160
157-
- name: Create google-cn, apple-cn, gfw, greatfire lists
161+
- name: Create china-list, google-cn, apple-cn, gfw, greatfire lists
158162
run: |
163+
curl -sSL $CHINA_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' > ./community/data/china-list
164+
curl -sSL $CHINA_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' > china-list.txt
159165
curl -sSL $GOOGLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "full:$1\n"' > ./community/data/google-cn
160166
curl -sSL $APPLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "full:$1\n"' > ./community/data/apple-cn
161167
cat ./gfwlist2dnsmasq/temp-gfwlist.txt | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' >> ./community/data/gfw
@@ -173,7 +179,7 @@ jobs:
173179
install -Dp ./geoip.dat ./publish/geoip.dat
174180
install -Dp ./geoip.dat.sha256sum ./publish/geoip.dat.sha256sum
175181
install -Dp ./custom/publish/geosite.dat ./publish/geosite.dat
176-
install -p {proxy,direct,reject}-list.txt ./publish/
182+
install -p {china,proxy,direct,reject}-list.txt ./publish/
177183
cd ./publish || exit 1
178184
zip rules.zip {proxy,direct,reject}-list.txt geoip.dat geosite.dat
179185
sha256sum geosite.dat > geosite.dat.sha256sum
@@ -192,10 +198,10 @@ jobs:
192198
- name: Setup Go 1.x.y
193199
uses: actions/setup-go@v3
194200
with:
195-
go-version: ^1.19
201+
go-version: ^1.21
196202

197203
- name: Checkout techprober/v2dat
198-
uses: actions/checkout@v3
204+
uses: actions/checkout@v4
199205
with:
200206
repository: techprober/v2dat
201207

@@ -260,7 +266,7 @@ jobs:
260266
echo "RELEASE_DATE=$(date +%Y-%m-%d-%H-%M)" >> $GITHUB_ENV
261267
262268
- name: Checkout the master branch of this repo
263-
uses: actions/checkout@v3
269+
uses: actions/checkout@v4
264270

265271
- name: Copy artifacts from build job to local path
266272
uses: actions/download-artifact@v3
@@ -282,7 +288,7 @@ jobs:
282288
mv geosite.zip geosite/ publish/
283289
284290
- name: Release and upload assets
285-
uses: softprops/action-gh-release@v0.1.15
291+
uses: softprops/action-gh-release@master
286292
with:
287293
name: ${{ env.RELEASE_DATE }}
288294
tag_name: ${{ env.RELEASE_DATE }}

.github/workflows/staging-run.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup Go 1.x.y
1616
uses: actions/setup-go@v3
1717
with:
18-
go-version: ^1.19
18+
go-version: ^1.21
1919

2020
- name: Set variables
2121
shell: bash
@@ -28,7 +28,9 @@ jobs:
2828
echo "WIN_SPY=https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt" >> $GITHUB_ENV
2929
echo "WIN_UPDATE=https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/update.txt" >> $GITHUB_ENV
3030
echo "WIN_EXTRA=https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/extra.txt" >> $GITHUB_ENV
31-
# ads list
31+
# extra ip list
32+
echo "CHINA_MAX_IP_EXTRA_URL=https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/ChinaMax/ChinaMax_IP.txt" >> $GITHUB_ENV
33+
# extra ads list
3234
echo "PETERLOWE_REJECT_URL=https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext" >> $GITHUB_ENV
3335
echo "DANPOLLOCK_REJECT_URL=https://someonewhocares.org/hosts/hosts" >> $GITHUB_ENV
3436
echo "ANTI_AD_REJECT_URL=https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-domains.txt" >> $GITHUB_ENV
@@ -43,24 +45,24 @@ jobs:
4345
echo "NEODEVPRO_ADS_REJECT_URL=https://raw.githubusercontent.com/neodevpro/neodevhost/master/adblocker" >> $GITHUB_ENV
4446
4547
- name: Checkout the "hidden" branch of this repo
46-
uses: actions/checkout@v3
48+
uses: actions/checkout@v4
4749
with:
4850
ref: hidden
4951

5052
- name: Checkout Loyalsoldier/domain-list-custom
51-
uses: actions/checkout@v3
53+
uses: actions/checkout@v4
5254
with:
5355
repository: Loyalsoldier/domain-list-custom
5456
path: custom
5557

5658
- name: Checkout v2fly/domain-list-community
57-
uses: actions/checkout@v3
59+
uses: actions/checkout@v4
5860
with:
5961
repository: v2fly/domain-list-community
6062
path: community
6163

6264
- name: Checkout cokebar/gfwlist2dnsmasq
63-
uses: actions/checkout@v3
65+
uses: actions/checkout@v4
6466
with:
6567
repository: cokebar/gfwlist2dnsmasq
6668
path: gfwlist2dnsmasq
@@ -83,7 +85,6 @@ jobs:
8385
8486
- name: Get and add proxy domains into temp-proxy.txt file
8587
run: |
86-
cat ./gfwlist2dnsmasq/temp-gfwlist.txt | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' > temp-proxy.txt
8788
curl -sSL $GOOGLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' >> temp-proxy.txt
8889
curl -sSL $APPLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' >> temp-proxy.txt
8990
curl -sSL ${CUSTOM_PROXY} | grep -Ev ":@cn" | perl -ne '/^(domain):([^:]+)(\n$|:@.+)/ && print "$2\n"' >> temp-proxy.txt
@@ -119,6 +120,8 @@ jobs:
119120
cat temp-proxy.txt | sort --ignore-case -u > proxy-list-with-redundant
120121
cat temp-direct.txt | sort --ignore-case -u > direct-list-with-redundant
121122
cat temp-reject.txt | sort --ignore-case -u > reject-list-with-redundant
123+
# extras
124+
cat $CHINA_MAX_DOMAINS_EXTRA_URL | sort --ignore-case -u > direct-list-with-redundant
122125
123126
- name: Remove redundant domains
124127
run: |
@@ -157,8 +160,10 @@ jobs:
157160
cp ./community/data/geolocation-\!cn proxy-list.txt
158161
cp ./community/data/category-ads-all reject-list.txt
159162
160-
- name: Create google-cn, apple-cn, gfw, greatfire lists
163+
- name: Create china-list, google-cn, apple-cn, gfw, greatfire lists
161164
run: |
165+
curl -sSL $CHINA_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' > ./community/data/china-list
166+
curl -sSL $CHINA_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' > china-list.txt
162167
curl -sSL $GOOGLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "full:$1\n"' > ./community/data/google-cn
163168
curl -sSL $APPLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "full:$1\n"' > ./community/data/apple-cn
164169
cat ./gfwlist2dnsmasq/temp-gfwlist.txt | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' >> ./community/data/gfw
@@ -176,7 +181,7 @@ jobs:
176181
install -Dp ./geoip.dat ./publish/geoip.dat
177182
install -Dp ./geoip.dat.sha256sum ./publish/geoip.dat.sha256sum
178183
install -Dp ./custom/publish/geosite.dat ./publish/geosite.dat
179-
install -p {proxy,direct,reject}-list.txt ./publish/
184+
install -p {china,proxy,direct,reject}-list.txt ./publish/
180185
cd ./publish || exit 1
181186
zip rules.zip {proxy,direct,reject}-list.txt geoip.dat geosite.dat
182187
sha256sum geosite.dat > geosite.dat.sha256sum
@@ -195,10 +200,10 @@ jobs:
195200
- name: Setup Go 1.x.y
196201
uses: actions/setup-go@v3
197202
with:
198-
go-version: ^1.19
203+
go-version: ^1.21
199204

200205
- name: Checkout techprober/v2dat
201-
uses: actions/checkout@v3
206+
uses: actions/checkout@v4
202207
with:
203208
repository: techprober/v2dat
204209

@@ -263,7 +268,7 @@ jobs:
263268
echo "RELEASE_DATE=$(date +%Y-%m-%d-%H-%M)" >> $GITHUB_ENV
264269
265270
- name: Checkout the master branch of this repo
266-
uses: actions/checkout@v3
271+
uses: actions/checkout@v4
267272

268273
- name: Copy artifacts from build job to local path
269274
uses: actions/download-artifact@v3
@@ -285,7 +290,7 @@ jobs:
285290
mv geosite.zip geosite/ publish/
286291
287292
- name: Release and upload assets
288-
uses: softprops/action-gh-release@v0.1.15
293+
uses: softprops/action-gh-release@master
289294
with:
290295
name: ${{ env.RELEASE_DATE }}
291296
tag_name: ${{ env.RELEASE_DATE }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- **加入 uBlock Origin 隱私域名**:通过 [@uBlockOrigin/uAssets](https://github.com/uBlockOrigin/uAssets/raw/master/filters/privacy.txt) 获取并加入到 `geosite:category-ads-all` 类别中
1515
- **加入 uBlock Origin 广告域名**:通过 [@uBlockOrigin/uAssets](https://github.com/uBlockOrigin/uAssets/raw/master/filters/filter.txt) 获取并加入到 `geosite:category-ads-all` 类别中
1616
- **加入 NeoDev Host 广告域名**:通过 [@neodevpro/neodevhost](https://raw.githubusercontent.com/neodevpro/neodevhost/master/adblocker) 获取并加入到 `geosite:category-ads-all` 类别中
17+
- **加入 ClashChinaMax 域名**:通过 [@blackmatrix7/ios_rule_script](https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/ChinaMax/ChinaMax_Domain.txt) 获取并加入到 `geosite:cn` 类别中
1718

1819
## 规则文件生成方式
1920

0 commit comments

Comments
 (0)