mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 01:00:34 +08:00
Update Download / Reject Hosts
This commit is contained in:
parent
1f2e2a655c
commit
33030382ac
@ -4,8 +4,9 @@ import path from 'path';
|
||||
import fsp from 'fs/promises';
|
||||
import { task } from './lib/trace-runner';
|
||||
|
||||
import { exclude } from 'fast-cidr-tools';
|
||||
import { exclude, merge } from 'fast-cidr-tools';
|
||||
|
||||
// https://en.wikipedia.org/wiki/Reserved_IP_addresses
|
||||
const RESERVED_IPV4_CIDR = [
|
||||
'0.0.0.0/8',
|
||||
'10.0.0.0/8',
|
||||
@ -15,6 +16,7 @@ const RESERVED_IPV4_CIDR = [
|
||||
'172.16.0.0/12',
|
||||
'192.0.0.0/24',
|
||||
'192.0.2.0/24',
|
||||
// 192.88.99.0 // is currently being broadcast by HE and Comcast
|
||||
'192.168.0.0/16',
|
||||
'198.18.0.0/15',
|
||||
'198.51.100.0/24',
|
||||
@ -30,15 +32,16 @@ export const buildInternalReverseChnCIDR = task(import.meta.path, async () => {
|
||||
fsp.mkdir(path.resolve(import.meta.dir, '../List/internal'), { recursive: true })
|
||||
]))[0];
|
||||
|
||||
const reversedCidr = exclude(
|
||||
[
|
||||
'0.0.0.0/0',
|
||||
const reversedCidr = merge(
|
||||
exclude(
|
||||
['0.0.0.0/0'],
|
||||
RESERVED_IPV4_CIDR.concat(cidr),
|
||||
true
|
||||
).concat([
|
||||
// https://github.com/misakaio/chnroutes2/issues/25
|
||||
'223.118.0.0/15',
|
||||
'223.120.0.0/15'
|
||||
],
|
||||
RESERVED_IPV4_CIDR.concat(cidr),
|
||||
true
|
||||
])
|
||||
);
|
||||
|
||||
return Bun.write(path.resolve(import.meta.dir, '../List/internal/reversed-chn-cidr.txt'), `${reversedCidr.join('\n')}\n`);
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
|
||||
```ini
|
||||
# Non IP
|
||||
RULE-SET,https://ruleset.skk.moe/List/ip/reject-drop.conf,REJECT-DROP
|
||||
DOMAIN-SET,https://ruleset.skk.moe/List/domainset/reject.conf,REJECT-TINYGIF
|
||||
RULE-SET,https://ruleset.skk.moe/List/non_ip/reject.conf,REJECT
|
||||
# IP
|
||||
@ -37,6 +38,13 @@ RULE-SET,https://ruleset.skk.moe/List/ip/reject.conf,REJECT-DROP
|
||||
|
||||
```yaml
|
||||
rule-providers:
|
||||
reject_non_ip_drop:
|
||||
type: http
|
||||
behavior: classical
|
||||
format: text
|
||||
interval: 43200
|
||||
url: https://ruleset.skk.moe/Clash/non_ip/reject-drop.txt
|
||||
path: ./sukkaw_ruleset/reject_non_ip_drop.txt
|
||||
reject_non_ip:
|
||||
type: http
|
||||
behavior: classical
|
||||
@ -61,6 +69,7 @@ rule-providers:
|
||||
path: ./sukkaw_ruleset/reject_ip.txt
|
||||
|
||||
rules:
|
||||
- RULE-SET,reject_non_ip_drop,REJECT-DROP
|
||||
- RULE-SET,reject_non_ip,REJECT
|
||||
# WARNING! Using reject_domainset can cause Clash out of memory due to the insufficient Clash implementation.
|
||||
- RULE-SET,reject_domainset,REJECT
|
||||
|
||||
@ -170,6 +170,7 @@ mirrors.edge.kernel.org
|
||||
.mirrors.dotsrc.org
|
||||
.mirror.clarkson.edu
|
||||
.mirror.constant.com
|
||||
ftp.gnu.org
|
||||
# WhatPulse
|
||||
releases.whatpulse.org
|
||||
# GIMP
|
||||
|
||||
@ -10,8 +10,10 @@
|
||||
.sharethrough.com
|
||||
.clicktale.net
|
||||
optimus-ads.amap.com
|
||||
.flash.cn
|
||||
.geo2.adobe.com
|
||||
.2144.cn
|
||||
.2144.com
|
||||
.laomaotao.net
|
||||
.weddingeeos.com
|
||||
.rjno1.com
|
||||
|
||||
@ -1,4 +1,7 @@
|
||||
# $ meta_title Sukka's Ruleset - Mainland China Supplement CIDR
|
||||
# $ meta_description This file contains IPs broadcast inside Mainland China.
|
||||
|
||||
# cloud.tencent.com AIA
|
||||
IP-CIDR,162.14.0.0/18,no-resolve
|
||||
# aliyun.com Premium DNS
|
||||
IP-CIDR,140.205.1.0/24,no-resolve
|
||||
|
||||
4
Source/non_ip/reject-drop.conf
Normal file
4
Source/non_ip/reject-drop.conf
Normal file
@ -0,0 +1,4 @@
|
||||
# $ meta_title Sukka's Ruleset - Reject And Drop
|
||||
# $ meta_description This file This file contains rules for domain should be used with REJECT-DROP policy.
|
||||
|
||||
DOMAIN-SUFFIX,geo2.adobe.com
|
||||
Loading…
x
Reference in New Issue
Block a user