远程列表web
This commit is contained in:
81
ReadMe.md
Normal file
81
ReadMe.md
Normal file
@@ -0,0 +1,81 @@
|
||||
# DNS服务器项目介绍
|
||||
## 项目概述
|
||||
这是一个基于Go语言开发的高性能DNS服务器,具备域名屏蔽、Hosts管理、统计分析和远程规则管理等功能。服务器支持通过Web界面进行管理配置,同时能够自动更新和缓存远程规则列表。
|
||||
|
||||
## 技术架构
|
||||
### 核心组件
|
||||
1. DNS服务模块 ( `server.go` )
|
||||
- 基于 github.com/miekg/dns 库实现高性能DNS查询处理
|
||||
- 支持配置上游DNS服务器进行递归查询
|
||||
- 实现域名屏蔽、统计数据收集等核心功能
|
||||
|
||||
2. 屏蔽管理系统 ( `manager.go` )
|
||||
- 管理本地和远程屏蔽规则
|
||||
- 支持规则缓存、自动更新和统计
|
||||
- 实现域名和正则表达式规则的解析和匹配
|
||||
|
||||
3. HTTP控制台 ( `server.go` )
|
||||
- 提供Web管理界面
|
||||
- 实现REST API用于配置管理和数据查询
|
||||
|
||||
4. 配置管理 ( `config.go` )
|
||||
- 定义配置结构和加载功能
|
||||
- 支持JSON格式配置文件
|
||||
|
||||
## 主要功能特性
|
||||
### 1. 域名屏蔽系统
|
||||
- 支持本地规则文件和远程规则URL
|
||||
- 多种屏蔽方式:NXDOMAIN、refused、emptyIP、customIP
|
||||
- 支持域名精确匹配和正则表达式匹配
|
||||
- 远程规则自动缓存和更新机制
|
||||
### 2. Hosts管理
|
||||
- 支持自定义Hosts映射
|
||||
- 提供Web界面管理Hosts条目
|
||||
- 自动保存Hosts配置
|
||||
### 3. 统计分析功能
|
||||
- 记录屏蔽域名统计信息
|
||||
- 记录解析域名统计信息
|
||||
- 提供按小时统计的屏蔽数据
|
||||
- 支持查询最常屏蔽和解析的域名
|
||||
### 4. 远程规则管理
|
||||
- 支持添加多个远程规则URL
|
||||
- 自动定期更新远程规则
|
||||
- 本地缓存机制确保规则可用性
|
||||
- Web界面可视化管理
|
||||
### 5. 管理界面
|
||||
- 提供直观的Web控制台
|
||||
- 支持查看服务器状态和统计信息
|
||||
- 规则管理和配置修改
|
||||
- DNS查询测试工具
|
||||
## 项目结构
|
||||
```
|
||||
/root/dns/
|
||||
├── config/ # 配置管理
|
||||
├── data/ # 数据目录(包含缓存和统计)
|
||||
│ └── remote_rules/ # 远程规则缓存
|
||||
├── dns/ # DNS服务器核心
|
||||
├── http/ # HTTP控制台
|
||||
├── logger/ # 日志系统
|
||||
├── shield/ # 屏蔽规则管理
|
||||
├── static/ # 静态Web文件
|
||||
├── main.go # 程序入口
|
||||
└── config.json # 配置文件
|
||||
```
|
||||
## 配置项说明
|
||||
主要配置文件 `config.json` 包含以下部分:
|
||||
|
||||
- DNS配置 :端口、上游DNS服务器、超时设置等
|
||||
- HTTP配置 :控制台端口、主机绑定等
|
||||
- 屏蔽配置 :规则文件路径、远程规则URL、更新间隔等
|
||||
- 日志配置 :日志文件路径、级别设置等
|
||||
## 使用场景
|
||||
1. 网络内容过滤(广告、恶意网站屏蔽)
|
||||
2. 本地DNS缓存加速
|
||||
3. 企业/家庭网络DNS管理
|
||||
4. 开发测试环境DNS重定向
|
||||
## 技术栈
|
||||
- 语言 :Go
|
||||
- DNS库 :github.com/miekg/dns
|
||||
- 日志库 :github.com/sirupsen/logrus
|
||||
- Web前端 :HTML/CSS/JavaScript
|
||||
该DNS服务器具有高性能、功能全面、易于配置等特点,适用于需要精确控制DNS查询结果的各种网络环境。
|
||||
19
config.json
19
config.json
@@ -1,8 +1,13 @@
|
||||
{
|
||||
"dns": {
|
||||
"port": 53,
|
||||
"upstreamDNS": ["223.5.5.5:53", "223.6.6.6:53"],
|
||||
"timeout": 5000
|
||||
"upstreamDNS": [
|
||||
"223.5.5.5:53",
|
||||
"223.6.6.6:53"
|
||||
],
|
||||
"timeout": 5000,
|
||||
"statsFile": "./data/stats.json",
|
||||
"saveInterval": 300
|
||||
},
|
||||
"http": {
|
||||
"port": 8080,
|
||||
@@ -12,10 +17,16 @@
|
||||
"shield": {
|
||||
"localRulesFile": "data/rules.txt",
|
||||
"remoteRules": [
|
||||
"https://example.com/rules.txt"
|
||||
"https://example.com/rules.txt",
|
||||
"https://gitea.amazehome.xyz/AMAZEHOME/hosts-and-filters/raw/branch/main/rules/costomize.txt"
|
||||
],
|
||||
"updateInterval": 60,
|
||||
"hostsFile": "data/hosts.txt"
|
||||
"hostsFile": "data/hosts.txt",
|
||||
"blockMethod": "NXDOMAIN",
|
||||
"customBlockIP": "",
|
||||
"statsFile": "./data/shield_stats.json",
|
||||
"statsSaveInterval": 60,
|
||||
"remoteRulesCacheDir": "./data/remote_rules"
|
||||
},
|
||||
"log": {
|
||||
"file": "dns-server.log",
|
||||
|
||||
@@ -21,17 +21,26 @@ type HTTPConfig struct {
|
||||
EnableAPI bool `json:"enableAPI"`
|
||||
}
|
||||
|
||||
// BlacklistEntry 黑名单条目
|
||||
type BlacklistEntry struct {
|
||||
Name string `json:"name"`
|
||||
URL string `json:"url"`
|
||||
Enabled bool `json:"enabled"`
|
||||
RuleCount int `json:"ruleCount,omitempty"`
|
||||
LastUpdateTime string `json:"lastUpdateTime,omitempty"`
|
||||
}
|
||||
|
||||
// ShieldConfig 屏蔽规则配置
|
||||
type ShieldConfig struct {
|
||||
LocalRulesFile string `json:"localRulesFile"`
|
||||
RemoteRules []string `json:"remoteRules"`
|
||||
UpdateInterval int `json:"updateInterval"`
|
||||
HostsFile string `json:"hostsFile"`
|
||||
BlockMethod string `json:"blockMethod"` // 屏蔽方法: "NXDOMAIN", "refused", "emptyIP", "customIP"
|
||||
CustomBlockIP string `json:"customBlockIP"` // 自定义屏蔽IP,当BlockMethod为"customIP"时使用
|
||||
StatsFile string `json:"statsFile"` // 计数数据持久化文件
|
||||
StatsSaveInterval int `json:"statsSaveInterval"` // 计数数据保存间隔(秒)
|
||||
RemoteRulesCacheDir string `json:"remoteRulesCacheDir"` // 远程规则缓存目录
|
||||
LocalRulesFile string `json:"localRulesFile"`
|
||||
Blacklists []BlacklistEntry `json:"blacklists"`
|
||||
UpdateInterval int `json:"updateInterval"`
|
||||
HostsFile string `json:"hostsFile"`
|
||||
BlockMethod string `json:"blockMethod"` // 屏蔽方法: "NXDOMAIN", "refused", "emptyIP", "customIP"
|
||||
CustomBlockIP string `json:"customBlockIP"` // 自定义屏蔽IP,当BlockMethod为"customIP"时使用
|
||||
StatsFile string `json:"statsFile"` // 计数数据持久化文件
|
||||
StatsSaveInterval int `json:"statsSaveInterval"` // 计数数据保存间隔(秒)
|
||||
RemoteRulesCacheDir string `json:"remoteRulesCacheDir"` // 远程规则缓存目录
|
||||
}
|
||||
|
||||
// LogConfig 日志配置
|
||||
@@ -98,6 +107,16 @@ func LoadConfig(path string) (*Config, error) {
|
||||
if config.Shield.RemoteRulesCacheDir == "" {
|
||||
config.Shield.RemoteRulesCacheDir = "./data/remote_rules" // 默认远程规则缓存目录
|
||||
}
|
||||
|
||||
// 如果黑名单列表为空,添加一些默认的黑名单
|
||||
if len(config.Shield.Blacklists) == 0 {
|
||||
config.Shield.Blacklists = []BlacklistEntry{
|
||||
{Name: "AdGuard DNS filter", URL: "https://gitea.amazehome.xyz/AMAZEHOME/hosts-and-filters/raw/branch/main/filter.txt", Enabled: true},
|
||||
{Name: "Adaway Default Blocklist", URL: "https://gitea.amazehome.xyz/AMAZEHOME/hosts-and-Filters/raw/branch/main/hosts/adaway.txt", Enabled: true},
|
||||
{Name: "CHN-anti-AD", URL: "hhttps://gitea.amazehome.xyz/AMAZEHOME/hosts-and-Filters/raw/branch/main/list/easylist.txt", Enabled: true},
|
||||
{Name: "My GitHub Rules", URL: "https://gitea.amazehome.xyz/AMAZEHOME/hosts-and-filters/raw/branch/main/rules/costomize.txt", Enabled: true},
|
||||
}
|
||||
}
|
||||
if config.Log.Level == "" {
|
||||
config.Log.Level = "info"
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,994 @@
|
||||
@@||/amazehome.xyz/
|
||||
@@||union.amazehome.xyz
|
||||
@@||www.bing.com^$important
|
||||
@@||ip.taobao.com^$important
|
||||
@@||www.youtube.com^$important
|
||||
@@||tools.3g.qq.com^$important
|
||||
@@||pdc.micloud.xiaomi.net^$important
|
||||
@@||security.browser.miui.com^$important
|
||||
@@||proxy.sec.miui.com^$important
|
||||
@@||up.cm.ksmobile.com^$important
|
||||
@@||data.mistat.xiaomi.com^$important
|
||||
@@||api.ad.xiaomi.com^$important
|
||||
@@||nav.browser.miui.com^$important
|
||||
||hub5btmain.sandai.net
|
||||
||hub5u.v6.phub.sandai.net
|
||||
/hub5u/
|
||||
@@||exp.sug.browser.miui.com^$important
|
||||
@@||dldir1.qq.com^$important
|
||||
@@||qurl.f.360.cn^$important
|
||||
||ludashi.com
|
||||
||/ludashi/
|
||||
/bizhi.360.cn/
|
||||
/huabao.360.cn/
|
||||
/sedl.360tpcdn.com/
|
||||
||rq.upgrade.cmpc.cmcm.com
|
||||
/cmcm/
|
||||
||munion.baidu.com
|
||||
/mss0/
|
||||
||pos.baidu.com
|
||||
||s3m6.nzwgs.com^$important
|
||||
@@||jspassport.ssl.qhimg.com^$important
|
||||
@@||bj.ke.com^$important
|
||||
@@||tj.ke.com^$important
|
||||
@@||www.ke.com^$important
|
||||
@@||ke.com^$important
|
||||
@@||api.browser.miui.com^$important
|
||||
@@||ssl-cdn.static.browser.mi-img.com^$important
|
||||
@@||u.api.look.360.cn^$important
|
||||
@@||papi.look.360.cn^$important
|
||||
@@||info.pinyin.sogou.com^$important
|
||||
@@||thirdwx.qlogo.cn^$important
|
||||
@@||click.mz.simba.taobao.com^$important
|
||||
@@||sdkconfig.ad.xiaomi.com^$important
|
||||
@@||control.preload.xiaomi.com
|
||||
@@||sf1-ttcdn-tos.pstatp.com^$important
|
||||
@@||cnbj1.fds.api.xiaomi.com^$important
|
||||
@@||news.qhstatic.com^$important
|
||||
@@||res.qhupdate.com^$important
|
||||
@@||s.360.cn^$important
|
||||
@@||i.snssdk.com^$important
|
||||
/caohang/
|
||||
@@||f11.baidu.com^$important
|
||||
@@||otheve.beacon.qq.com^$important
|
||||
@@||ini.update.360safe.com^$important
|
||||
@@||update.360safe.com^$important
|
||||
@@||cdn.cnbj1.fds.api.mi-img.com^$important
|
||||
@@||safe.track.uc.360.cn^$important
|
||||
@@||openbox.mobilem.360.cn^$important
|
||||
||fclog.baidu.com^$important
|
||||
@@||a.hl.mi.com^$client='222.94.45.162'
|
||||
@@||a.hl.mi.com^$important
|
||||
@@||144.dragonparking.com^$important
|
||||
@@||msg.qy.net^$important
|
||||
@@||zconfig.alibabausercontent.com^$important
|
||||
@@||appdownload.alicdn.com^$important
|
||||
@@||mini.eastday.com^$important
|
||||
@@||ttpcstatic.dftoutiao.com^$important
|
||||
||xmtransfer.dpqct.com^$important
|
||||
/xmtransfer/
|
||||
||MgP6ChGz.retjidc.cn^$important
|
||||
/retjidc/
|
||||
@@||admin.online.360.cn^$important
|
||||
@@||feed.browser.miui.com^$important
|
||||
@@||profile3.se.360.cn^$important
|
||||
@@||profile2.se.360.cn^$important
|
||||
@@||profile1.se.360.cn^$important
|
||||
@@||profile.se.360.cn^$important
|
||||
@@||www.so.com^$important
|
||||
@@||so.com^$important
|
||||
@@||smart.sug.so.com^$important
|
||||
@@||policy.jd.com^$important
|
||||
@@||mars.jd.com^$important
|
||||
@@||bdsp.x.jd.com^$important
|
||||
@@||wq.360buyimg.com^$important
|
||||
||99.95chuanqi.vip:99^$important
|
||||
||99.95chuanqi.vip^$important
|
||||
||95chuanqi.vip^$important
|
||||
||95chuanqi^$important
|
||||
/95chuanqi/
|
||||
/duosf/
|
||||
/zsf.com/
|
||||
||cq.chuanqi3366.vip^$important
|
||||
/chuanqi3366/
|
||||
||www.fbwat.ch^$important
|
||||
||drive.app.goo.gl^$important
|
||||
||luandinh.s3.amazonaws.com^$important
|
||||
||xz.chinavipsoft.com^$important
|
||||
||ymjqn.bijiatu.com^$important
|
||||
||hectorstatic.baidu.com^$important
|
||||
||dss3.baidu.com^$important
|
||||
||sp2.baidu.com^$important
|
||||
||sta.xsfaya.com^$important
|
||||
||softdown.panshixk.com^$important
|
||||
||down.leisurelypanda.com^$important
|
||||
||d.wn51.com^$important
|
||||
||rq.drcct.cloud.duba.net^$important
|
||||
||jcxyt.cangyakeji.cn^$important
|
||||
||duba-defend.zhhainiao.com^$important
|
||||
||wsid.liangxiekeji.cn^$important
|
||||
||jgztg.binghuokeji.cn^$important
|
||||
||mgfkm.binghuokeji.cn^$important
|
||||
||gqwmz.chengsi.cn^$important
|
||||
||sta2.xsfaya.com^$important
|
||||
||down.wdmuz.com^$important
|
||||
||myqnj.xsfaya.com^$important
|
||||
||dhztq.leisurelypanda.com^$important
|
||||
||update.wn51.com^$important
|
||||
||download.xsfaya.com^$important
|
||||
||g.jyapi.yebankeji.cn^$important
|
||||
||rq.r9t1.com^$important
|
||||
||p.jyapi.yebankeji.cn^$important
|
||||
||mmtkm.zsincer.com^$important
|
||||
||zmiwn.bijiatu.com^$important
|
||||
||down.znshuru.com^$important
|
||||
||mgyzt.zycultura.com^$important
|
||||
||tjtv3.wn51.com^$important
|
||||
||infoc2.duba.net^$important
|
||||
||ebqhwz.gdpoly.cn^$important
|
||||
||down1.nanjingchenxi.com^$important
|
||||
||08imgmini.eastday.com^$important
|
||||
@@||dl.360safe.com^$important
|
||||
@@||src.dl.360safe.com^$important
|
||||
/ieeod0/
|
||||
/liangxiekeji/
|
||||
/5887979/
|
||||
@@||pdown.stat.360safe.com^$important
|
||||
@@||inst.360safe.com^$important
|
||||
@@||down.360safe.com^$important
|
||||
@@||dl2.360safe.com^$important
|
||||
@@||vconf.f.360.cn^$important
|
||||
@@||updateh.360safe.com^$important
|
||||
@@||api.driver.360safe.com^$important
|
||||
@@||dlb.driver.360safe.com^$important
|
||||
@@||sdl.360safe.com^$important
|
||||
/tanwan/
|
||||
/17tanwan/
|
||||
/mediav/
|
||||
@@||diagnosis.ad.xiaomi.com^$important
|
||||
@@||loc.map.baidu.com^$important
|
||||
@@||www.msftconnecttest.com^$client='117.132.198.177'
|
||||
@@||api-shoulei-ssl.xunlei.com^$important
|
||||
@@||api.miui.security.xiaomi.com^$important
|
||||
@@||appsupport.qq.com^$important
|
||||
@@||api-mcp.adsp.xunlei.com^$important
|
||||
@@||api.sec.miui.com^$important
|
||||
@@||qsb.browser.miui.com^$important
|
||||
@@||tracking.miui.com^$important
|
||||
@@||pass.cainiao.com^$important
|
||||
@@||static.iask.cn^$important
|
||||
@@||pic.iask.com.cn^$important
|
||||
@@||pic.iask.cn^$important
|
||||
@@||watson.telemetry.microsoft.com^$important
|
||||
@@||self.events.data.microsoft.com^$important
|
||||
@@||ic3.events.data.microsoft.com^$important
|
||||
@@||u.qurl.f.360.cn^$important
|
||||
/lieqinews/
|
||||
||nk2.ytyvn.com^$important
|
||||
||ytyvn^$important
|
||||
||8zrct4vf.ucframe.csnxqht.cn^$important
|
||||
/8zrct4vf/
|
||||
/ucframe/
|
||||
/csnxqht/
|
||||
/5jfglnr6/
|
||||
/k0jbvgE1/
|
||||
/yAu8SZgH/
|
||||
/eastday/
|
||||
@@||bkimg.cdn.bcebos.com^$important
|
||||
@@||resolver.msg.xiaomi.net^$important
|
||||
@@||policy.video.iqiyi.com^$important
|
||||
@@||ag.qq.com^$important
|
||||
@@||v20.events.data.microsoft.com^$important
|
||||
@@||edge.activity.windows.com^$important
|
||||
@@||nexus.officeapps.live.com^$important
|
||||
@@||seupdate.360safe.com^$important
|
||||
@@||stat.360safe.com^$important
|
||||
@@||updatem.360safe.com^$important
|
||||
@@||big.softdl.360tpcdn.com^$important
|
||||
@@||agd2.p.360.cn^$important
|
||||
||pp4.gndh444.top^$important
|
||||
/pp4/
|
||||
/gndh444/
|
||||
||cdn-file-ssl-bizhi.ludashi.com^$important
|
||||
@@||stat.sd.360.cn^$important
|
||||
/hg127/
|
||||
/dwnvrevnwejijvirjb/
|
||||
/398xy/
|
||||
@@||soa-vip-ssl.xunlei.com^$important
|
||||
||wangjianbing.hao.360.cn^$important
|
||||
@@||se.360.cn^$important
|
||||
@@||hd.browser.miui.com^$important
|
||||
@@||e.weather.com.cn^$important
|
||||
@@||mb.yidianzixun.com^$important
|
||||
||dy.dun.ornglad.com^$important
|
||||
/ornglad/
|
||||
||www.ahsbk.cn^$important
|
||||
/ahsbk/
|
||||
@@||ozone.10jqka.com.cn^$important
|
||||
@@||stat.10jqka.com.cn^$important
|
||||
@@||data.sec.miui.com^$important
|
||||
@@||adv.sec.miui.com^$important
|
||||
@@||metok.sys.miui.com^$important
|
||||
@@||auth.be.sec.miui.com^$important
|
||||
@@||activity.tuifish.com^$important
|
||||
@@||dlswbr.baidu.com^$important
|
||||
@@||confluence.hypers.com^$important
|
||||
@@||cmshow.gtimg.cn^$important
|
||||
@@||www.laomaotao.net^$important
|
||||
@@||smartad.10010.com^$important
|
||||
@@||pay.wsds.cn^$important
|
||||
@@||etl-xlmc-ssl.sandai.net^important
|
||||
@@||optimus-ads.amap.com^$important
|
||||
||tgb.z6rfbg.cn^$important
|
||||
/z6rfbg/
|
||||
||mm.cgbsc9.cn^$important
|
||||
/cgbsc9/
|
||||
@@||your-domain.com^
|
||||
@@||ads.privacy.qq.com^$important
|
||||
@@||gstaticadssl.l.google.com^$important
|
||||
@@||ib11.go2yd.com^$important
|
||||
@@||c121.1017.cn^$important
|
||||
@@||c5.1017.cn^$important
|
||||
@@||c9.1017.cn^$important
|
||||
/chinafoodtv/
|
||||
/1810100099/
|
||||
/cnlive/
|
||||
/cnliveimg/
|
||||
@@||wwwdrv5.pp8.com^$important
|
||||
||backstagewww.wnwb.com^$important
|
||||
/uugtv/
|
||||
/baidu.code.jjyx.com/
|
||||
||z.xrccp.com^$important
|
||||
/xrccp/
|
||||
||cube.3600.com^$important
|
||||
||cube.dhrest.com^$important
|
||||
/cube./
|
||||
/dhrest/
|
||||
||/mediav.com/
|
||||
||/mediav./
|
||||
/5gcloudshop/
|
||||
||5gcloudshop.com^
|
||||
||rqaiot.com^
|
||||
/ooxx14.rqaiot.com/
|
||||
/ooxx14/
|
||||
/rqaiot/
|
||||
s.hao.360.com
|
||||
@@||www.jiankongbao.com^$important
|
||||
@@||wgo.mmstat.com^$important
|
||||
@@||gm.gds.mmstat.com^$important
|
||||
||h5vv.video.qq.com^$important
|
||||
||info.zb.video.qq.com^$important
|
||||
/fastest.qq.com/
|
||||
||msitepp-fm.jd.com^$important
|
||||
||jin.baidu.com^$important
|
||||
||jr.e.shifen.com^$important
|
||||
@@||gm.mmstat.com^$important
|
||||
@@||app.contact.nxp.com^$important
|
||||
@@||s1764.t.eloqua.com^$important
|
||||
@@||assets.huoyinetwork.cn^$important
|
||||
@@||sf3-ttcdn-tos.pstatp.com^$important
|
||||
@@||tr.p.360.cn^$important
|
||||
@@||pcbrowser.dd.qq.com^$important
|
||||
/fkw/
|
||||
||mini.browser.360.cn^$important
|
||||
||puv.tt.browser.360.cn^$important
|
||||
||mini.360.cn^$important
|
||||
@@||wxa.wxs.qq.com^$important
|
||||
||tt-04-09-18-42_dza3vlumeb.owmhrcc.cn^$important
|
||||
||dx-t.oss-cn-guangzhou.aliyuncs.com^$important
|
||||
@@||sdk.look.360.cn^$important
|
||||
@@||query.rec.360.cn^$important
|
||||
/2088997/
|
||||
@@||mclean.f.360.cn^$important
|
||||
||client.aplus.pptv.com^$important
|
||||
||bit-images.bj.bcebos.com^$important
|
||||
||api.adguard.com^$important
|
||||
||api-b.adguard.com
|
||||
||api-c.adguard.com
|
||||
||api-d.adguard.com
|
||||
@@||web.vortex.data.microsoft.com^$important
|
||||
@@||cpu.baidu.com^$important
|
||||
||shortv.cdp.qq.com.cdn.dcloudstc.com^$important
|
||||
||shortv.svideo.tc.qq.com^$important
|
||||
/shortv.cdp.qq.com/
|
||||
||szminorshort.weixin.qq.com^$important
|
||||
@@||telemetry-in.battle.net^$important
|
||||
@@||szsupport.weixin.qq.com^$important
|
||||
@@||wwcdn.weixin.qq.com^$important
|
||||
/d7b.cn/
|
||||
@@||bbs.360safe.com^$important
|
||||
@@||static3.iask.cn^$important
|
||||
@@||login-ishare.iask.com.cn^$important
|
||||
@@||wechat.ishare.iask.com.cn^$important
|
||||
@@||dw.iask.com.cn^$important
|
||||
@@||settings-win.data.microsoft.com^$important
|
||||
@@||settingsfd-geo.trafficmanager.net^$important
|
||||
@@||vortex.data.microsoft.com^$important
|
||||
@@||self-events-data.trafficmanager.net^$important
|
||||
@@||activity.windows.com^$important
|
||||
@@||cube.meituan.net^$important
|
||||
@@||cube.meituan.net.amazehome.xyz^$important
|
||||
@@||js.cache.openplatform.wpscdn.cn^$important
|
||||
@@||cube.lenovo.com.cn^$important
|
||||
@@||cube.lenovo.com.cn.amazehome.xyz^$important
|
||||
//ffcell/
|
||||
@@||v6z.cupid.iqiyi.com^$important
|
||||
@@||tc.cupid.iqiyi.com^$important
|
||||
@@||cm.passport.iqiyi.com^$important
|
||||
@@||baikebcs.bdimg.com^$important
|
||||
||pizzaseo.com^$important
|
||||
||download.caidie.com^$important
|
||||
@@||360safe.com^$important
|
||||
||te4.gndh777.top^$important
|
||||
@@||www.121down.com
|
||||
@@||wan.slb01.zhuanzhuan.com^$important
|
||||
@@||dlweb.sogoucdn.com^$important
|
||||
@@||img02.sogoucdn.com^$important
|
||||
@@||i01picsos.sogoucdn.com^$important
|
||||
@@||i04picsos.sogoucdn.com^$important
|
||||
@@||img03.sogoucdn.com^$important
|
||||
@@||img04.sogoucdn.com^$important
|
||||
@@||img01.sogoucdn.com^$important
|
||||
@@||img05.sogoucdn.com^$important
|
||||
@@||img06.sogoucdn.com^$important
|
||||
@@||img07.sogoucdn.com^$important
|
||||
@@||sogoucdn.com^
|
||||
@@||lf1-ttcdn-tos.pstatp.com^$important
|
||||
@@||cpucdn.baidu.com^$important
|
||||
@@||mcs.snssdk.com^$important
|
||||
@@||ib.snssdk.com^$important
|
||||
@@||publish-pic-cpu.baidu.com^$important
|
||||
/pc.qq.com/
|
||||
/tbs.qq/
|
||||
@@||x0.ifengimg.com^$important
|
||||
@@||img.ssl.msdk.qq.com^$important
|
||||
@@||aegis.qq.com^$important
|
||||
@@||wspeed.qq.com^$important
|
||||
@@||report.huatuo.qq.com^$important
|
||||
@@||/gov.cn/
|
||||
/iythf.com/
|
||||
@@||/shortv.cdp.qq.com/
|
||||
@@||dig.bdurl.net^$important
|
||||
/joowp/
|
||||
||ad.mi.com^$important
|
||||
||ad1.xiaomi.com^$important
|
||||
||tat.pandora.xiaomi.com^$important
|
||||
||50025.xc.zhongguohao123.com^$important
|
||||
/zhongguohao123.com/
|
||||
@@||shortv.cdp.qq.com^$important
|
||||
||qb-v6.sparta.mig.tencent-cloud.net^$important
|
||||
||guanjia.qq.com^$important
|
||||
||/guanjia/^$important
|
||||
||qb-v6.sparta.mig.tencent-cloud.net^$important
|
||||
||sparta.qb.mig.tencent-cloud.net^$important
|
||||
/dldir2/
|
||||
||cw.yyb.tc.qq.com^$important
|
||||
||cw.yyb.sched.dcloudstc.com^$important
|
||||
||dlied6.qq.com^$important
|
||||
||registeronce.autodesk.com^$important
|
||||
@@||market.aliyun.com^$important
|
||||
@@||ping.huatuo.qq.com^$important
|
||||
@@||get-loader.ioncube.com^$important
|
||||
@@||ioncube.com^$important
|
||||
@@||www.winbaicai.com^$important
|
||||
@@||track.wikimirror.org^$important
|
||||
/open365aa.com/
|
||||
@@||www.secube.com.tr^$important
|
||||
@@||www.laomaotao.com^$important
|
||||
||crypto.htxreceive.top^$important
|
||||
/htxreceive.top/
|
||||
@@||adm.amazehome.xyz^$important
|
||||
@@||adm.amazehome.xyz.amazehome.xyz^$important
|
||||
@@||passport.threatbook.cn^$important
|
||||
@@||m.duote.com^$important
|
||||
#以下为挖矿病毒 Start
|
||||
/adkuai8.com/
|
||||
/f2pool.com/
|
||||
/f3pool.com/
|
||||
/htpool.com/
|
||||
/ltc1btc.com/
|
||||
/coinotron.com/
|
||||
/give-me-ltc.com/
|
||||
/litecoinpool.org/
|
||||
/pool-x.eu/
|
||||
/netcodepool.org/
|
||||
/litebonk.com/
|
||||
/szbpool.net/
|
||||
/szbpool.com/
|
||||
/cryptonotepool.org.uk/
|
||||
/extremepool.org/
|
||||
/cryptograben.com/
|
||||
/pool.cryptoescrow.eu/
|
||||
/moneropool.com.br/
|
||||
/xmr.prohash.net/
|
||||
/miningpoolhub.com/
|
||||
/antpool.com/
|
||||
/globalpool.cc/
|
||||
/vultr.com/
|
||||
/uupool.cn/
|
||||
/warfpool.com/
|
||||
/nanopool.org/
|
||||
/ethermine.org/
|
||||
/flypool.org/
|
||||
/51szzc.com/
|
||||
/get.bi-chi.com/
|
||||
/asia.zcoin.miningpoolhub.com/
|
||||
/hcash-shanghai.globalpool.cc/
|
||||
/ash-shanghai.globalpool.cc/
|
||||
/antpool.com/
|
||||
/beepool.org/
|
||||
/bitclubnetwork.com/
|
||||
/bitfury.com/
|
||||
/btc.com/
|
||||
/btc.top/
|
||||
/btcc.com/
|
||||
/bw.com/
|
||||
/canoepool.com/
|
||||
/dmpools.com/
|
||||
/dpool.com/
|
||||
/dpool.top/
|
||||
/dwarfpool.com/
|
||||
/easy2mine.com/
|
||||
/flypool.org/
|
||||
/haopool.com/
|
||||
/kano.is/
|
||||
/poolhb.com/
|
||||
/slushpool.com/
|
||||
/sparkpool.com/
|
||||
/viabtc.com/
|
||||
/huobipool.com/
|
||||
/rhy.com/
|
||||
/ravenminer.com/
|
||||
/supportxmr.com/
|
||||
/hpool.com/
|
||||
/aapool.cn/
|
||||
/cybtc.info/
|
||||
/666pool.cn/
|
||||
/xnpool.cn/
|
||||
/xdag.org/
|
||||
/fkpool.cn/
|
||||
/ethfans.org/
|
||||
/batpool.com/
|
||||
/anomp.com/
|
||||
/btcguild.com/
|
||||
/webchain.network/
|
||||
/poolin.com/
|
||||
/pandaminer.com/
|
||||
/bwpool.net/
|
||||
/bixin.com/
|
||||
/pandabtc.cn/
|
||||
/pandaop.com/
|
||||
/qy6.com/
|
||||
/zhizhu.top/
|
||||
/vvpool.com/
|
||||
/xzrm.com/
|
||||
/waterhole.io/
|
||||
/hashvault.pro/
|
||||
/bohemianpool.com/
|
||||
/poolgpu.com/
|
||||
/vspool.com/
|
||||
/matpool.io/
|
||||
/2miners.com/
|
||||
/dxpool.com/
|
||||
/bi-chi.com/
|
||||
/h-pool.com/
|
||||
/baimin.com/
|
||||
/kuangjiwan.com/
|
||||
/fir.im/
|
||||
/kc.com/
|
||||
/xdagpool.com/
|
||||
/hdpool.com/
|
||||
/iccob.com/
|
||||
/szzpool.com/
|
||||
/kanpool.com/
|
||||
/sinocpool.info/
|
||||
/hummerpool.com/
|
||||
/bginpool.com/
|
||||
/x-i-tech.com/
|
||||
/bhdpool.cn/
|
||||
/otherpool.com/
|
||||
/pocpool.com/
|
||||
/dashcoinpool.org/
|
||||
/bitcoin.com/
|
||||
/rawpool.com/
|
||||
/wayi.cn/
|
||||
/luxor.tech/
|
||||
/multipool.us/
|
||||
/ethpool.org/
|
||||
/connectbtc.com/
|
||||
/hashrabbit.co/
|
||||
/bitminter.com/
|
||||
/gbminers.com/
|
||||
/smartpool.io/
|
||||
/netninjas.io/
|
||||
/grinmint.com/
|
||||
/hashquark.io/
|
||||
/chainpool.io/
|
||||
/unminer.com/
|
||||
/91pool.com/
|
||||
/pool.coin-miners.info/
|
||||
/simplepospool.com/
|
||||
/minerall.io/
|
||||
/svpool.com/
|
||||
/btchd.org/
|
||||
/rocketpool.net/
|
||||
/epool.io/
|
||||
/sigmapool.com/
|
||||
/miningpoolhub.com/
|
||||
/firepool.com/
|
||||
/blockmasters.co/
|
||||
/suprnova.cc/
|
||||
/p2pool.info/
|
||||
/litecoinpool.org/
|
||||
/poolofstake.io/
|
||||
/blackpool.pro/
|
||||
/atticpool.com/
|
||||
/ubiqpool.io/
|
||||
/grin-pool.org/
|
||||
/siamining.com/
|
||||
/honestmining.com/
|
||||
/honeyminer.com/
|
||||
/gath3r.io/
|
||||
/infpool.com/
|
||||
/gridcash.net/
|
||||
/omgpool.org/
|
||||
/coinhive.com/
|
||||
/ocryptopool.co/
|
||||
/everstake.one/
|
||||
/mintpond.com/
|
||||
/nodenetworks.org/
|
||||
/winminer.com/
|
||||
#挖矿病毒列表结束 End
|
||||
@@||report.meituan.com^$important
|
||||
@@||www.threatbook.cn^$important
|
||||
@@||threatbook.cn^$important
|
||||
@@||static-img.threatbook.cn^$important
|
||||
@@||x.threatbook.cn^$important
|
||||
@@||ww1.brsbox.com^$important
|
||||
@@||analytics.zhihuiya.com^$important
|
||||
@@||analytics.zhihuiya.com.amazehome.xyz^$important
|
||||
||creatives-1301677708.file.myqcloud.com^$important
|
||||
/caohua.com/
|
||||
@@||fourier.taobao.com
|
||||
@@||ynuf.aliapp.org
|
||||
/mediav/
|
||||
||ssxd.mediav.com
|
||||
||vbhi3.iynad.com
|
||||
/iynad.com/
|
||||
@@||jifen.wan.360.cn
|
||||
@@||events.wan.360.cn
|
||||
@@||pay.wan.360.cn
|
||||
/2217.com/
|
||||
/2144.cn/
|
||||
/2144.com/
|
||||
@@||dst.metrics.klei.com
|
||||
/imguf.com/
|
||||
/2345/
|
||||
||b97ds.oss-cn-shanghai.aliyuncs.com
|
||||
||/zhongguohao123.com/
|
||||
/zhongguohao123.com/
|
||||
/trafficfactory/
|
||||
/trafficfactory.biz/
|
||||
||bdn-c1.oss-cn-shenzhen.aliyuncs.com^$important
|
||||
||ass777.oss-cn-hangzhou.aliyuncs.com^$important
|
||||
@@||wxapp.tc.qq.com
|
||||
@@||dig.bdurl.net^
|
||||
@@||mdn.alipayobjects.com^$app=com.eg.android.AlipayGphone
|
||||
@@||tmapp.qq.com^$domain=m.ke.qq.com
|
||||
@@||open.e.189.cn^
|
||||
@@||wjw.njga.gov.cn^
|
||||
@@||mcs.snssdk.com^
|
||||
@@||img1.doubanio.com^$domain=m.douban.com
|
||||
@@||res.res.res.res:80^
|
||||
@@||112.25.105.37:443^$app=com.tencent.mm
|
||||
@@||v6-p.toutiaovod.com^
|
||||
@@||mlol.qt.qq.com^$domain=lolm.qq.com
|
||||
@@||i1.wp.com^
|
||||
@@||pinuc.oss-cn-beijing.aliyuncs.com^
|
||||
@@||fp-it.fengkongcloud.com^
|
||||
@@||v11.douyinvod.com^
|
||||
@@||home.amazehome.xyz:8082^$important
|
||||
@@||v5-f.douyinvod.com^
|
||||
@@||lf9-geckocdn-tos.pstatp.com^
|
||||
@@||lf3-douyin-ckv-tos.pstatp.com^
|
||||
@@||/szlanyou/
|
||||
@@||baijiahao.baidu.com^$domain=m.baidu.com
|
||||
@@||apimobile.meituan.com
|
||||
@@||=utm_campaign=utm_medium=utm_term$app=com.sankuai.meituan
|
||||
@@||apimobile.meituan.com
|
||||
@@||sf3-ttcdn-tos.pstatp.com^
|
||||
@@||data6.video.iqiyi.com^
|
||||
@@||ns1.amazehome.xyz^$domain=ns1.amazehome.xyz
|
||||
@@||v29.douyinvod.com^
|
||||
@@||bkssl.bdimg.com^
|
||||
@@||baike.baidu.com^$domain=baike.baidu.com
|
||||
@@||filter.onedns.net^
|
||||
@@||shortv.cdp.qq.com^
|
||||
@@||mp.weixin.qq.com^$app=com.tencent.mm
|
||||
@@||www.ihss.pku.edu.cn^$domain=ihss.pku.edu.cn
|
||||
@@||filter.onedns.net^$app=com.qiyi.video
|
||||
@@||m.sohu.com^$domain=m.baidu.com
|
||||
@@||js.sohu.com^
|
||||
@@||222.188.8.243:443^
|
||||
@@||ns1.amazehome.xyz:3000^
|
||||
@@||pgdt.gtimg.cn^
|
||||
@@||click.suning.cn^
|
||||
@@||static.cebbank.com^
|
||||
@@||cloud.amazehome.xyz^
|
||||
@@||defaultts.tc.qq.com^
|
||||
@@||203.208.41.98:443^
|
||||
@@||www.baidu.com^
|
||||
@@||216.58.200.238:443^
|
||||
@@||p9.toutiaoimg.com^$app=com.android.quicksearchbox
|
||||
@@||m.toutiao.com^
|
||||
@@||assets.huoyinetwork.cn^
|
||||
@@||gm.mmstat.com^
|
||||
@@||47.93.28.103:3000^
|
||||
@@||39.97.238.21:3000^
|
||||
@@||wxsnsdy.wxs.qq.com^
|
||||
@@||wgo.mmstat.com^
|
||||
@@||v.qq.com^
|
||||
@@||open.toutiao.com^
|
||||
@@||v26.douyinvod.com/3b45e8d6264abe4034e8f0580f9de3cd/60268d64/video/tos/cn/tos-cn-ve-15/f366910e67de4e1391784182e95bbc2e/?a=1128&br=1945&bt=389&cd=0%7C0%7C0&ch=0&cr=2&cs=&cv=1&dr=0&ds=6&eid=260&er=&l=202102102215000102121991320105187B&lr=&mime_type=video_mp4&pl=0&qs=11&rc=ajV0bHB3ZTx1MzMzOmkzM0ApNjRoNDlkNTxnNzU6OWQ0O2cpaGRqbGRoaGRmMDI2Li5kc3NkYC0tYS0wc3NiYDJgMV5eX14xYTAzLTRgOmNwb2wrbStqdDo%3D&vl=&vr=
|
||||
@@||down-update.qq.com^
|
||||
@@||down-update.qq.com/sgame/1212338883/2400279/res/3.1.1.23/1212338883_2400279_3.1.1.23_20210206031151_1758607945_sub.json$important
|
||||
@@||ads.privacy.qq.com^$app=com.tencent.mm
|
||||
@@||weixin110.qq.com^$important
|
||||
@@||smartad.10010.com/msupport/count/businessLogPoint
|
||||
@@/zwfw.gov.cn/
|
||||
/googlesyndication/
|
||||
/doubleclick/
|
||||
/shwswl/
|
||||
/37see/
|
||||
/doumobhaia/
|
||||
/syerjit.cn/
|
||||
/syerjit/
|
||||
||qtj.gzxszf.com
|
||||
/gzxszf.com/
|
||||
/gzxszf/
|
||||
/csmaofa/
|
||||
@@||www.googletagmanager.com
|
||||
||data-collector.soulapp.cn^$important
|
||||
||photon-open-api.soulapp.cn^$important
|
||||
||sugar.zhihu.com^$important
|
||||
||open.smzdm.com^$important
|
||||
@@||s.ssl.qhres2.com
|
||||
@@||s1.ssl.qhres2.com
|
||||
@@||s0.ssl.qhres2.com
|
||||
@@||s4.ssl.qhres2.com
|
||||
@@||s*.ssl.qhres2.com
|
||||
#@@||s3.ssl.qhres2.com
|
||||
@@||luna-imgcache.qq.com.tcdn.qq.com
|
||||
@@||imgcache.qq.com.sched.px-dk.tdnsv6.com
|
||||
@@||imgcache.qq.com.sched.px-dk.tdnsv6.com.tpic.krcdn.idatacube.com
|
||||
/sl18.cc/
|
||||
/sl18/
|
||||
/papatv/
|
||||
/680.com/
|
||||
@@||mo.m.taobao.com
|
||||
||cdn-2gmtjtff.slt.sched.tdnsv8.com
|
||||
||static.cj0001.cn.cdn.dnsv1.com.cn
|
||||
||static.cj0001.cn
|
||||
/static.cj0001.cn/
|
||||
||sb.adtidy.org
|
||||
/adtidy.org/
|
||||
@@||v9-mllqv.onewsvod.com
|
||||
@@||p.37see.com
|
||||
@@||ss2.a.he2d.com
|
||||
/max-dr.mdvdns.qihucdn.cn/
|
||||
@@||miao.baidu.com
|
||||
||pcapp-data-collect.youku.com
|
||||
@@||playlog.youku.com
|
||||
@@||browser.events.data.microsoft.com
|
||||
@@||browser.pipe.aria.microsoft.com
|
||||
@@||www.kokojia.com
|
||||
/zb196/
|
||||
/sszonsm/
|
||||
/sctjaheepy/
|
||||
/gj2016/
|
||||
/gnfsnz/
|
||||
/jcxgfhssdff.space/
|
||||
@@||123.sogou.com
|
||||
||pb.sogou.com
|
||||
||itoutiao.sogou.com^$important
|
||||
/bangongsoft/
|
||||
#屏蔽彩虹游戏和51游戏
|
||||
/caihong.com/
|
||||
/51img/
|
||||
||51.com^
|
||||
#屏蔽Admamax广告
|
||||
/admamax/
|
||||
/jckjgs/
|
||||
/dnvp/
|
||||
/xsvncxh/
|
||||
/lupic/
|
||||
@@||click.ali213.net
|
||||
@@||assets.msn.cn
|
||||
@@||img-s-msn-com.akamaized.net
|
||||
@@||wan.baidu.com
|
||||
#放行夸克网盘
|
||||
@@||pan.quark.cn
|
||||
#屏蔽风灵软件管家(WindSoul)
|
||||
/digclay/
|
||||
/flmgr/
|
||||
#新浪地址接口
|
||||
@@||pv.sohu.com
|
||||
||/51xiasheji/
|
||||
/44ky.vip/
|
||||
||61.147.221.1$all
|
||||
/gifshow.com/
|
||||
/8ziben.com/
|
||||
/cl2009.com/
|
||||
/rzjingyouaa/
|
||||
/api-e189.21cn.com/
|
||||
#屏蔽小鸟壁纸
|
||||
/birdpaper/
|
||||
#结束
|
||||
#屏蔽星环公司一切内容
|
||||
/transwarp/
|
||||
#end
|
||||
#屏蔽算法网相关内容
|
||||
/ddrv.cn/
|
||||
#end
|
||||
/u3y8v8u4.aucdn.net/
|
||||
#屏蔽恶意收费等网站
|
||||
/soft.aijiaer11.cn/
|
||||
/aijiaer11/
|
||||
/onfix.cn/
|
||||
#end
|
||||
||ads.us.criteo.com
|
||||
/googleads/
|
||||
/yanlutong/
|
||||
/adnxs/
|
||||
#屏蔽bandisoft广告
|
||||
/bandi.so/
|
||||
/rendimportinaugurate/
|
||||
#屏蔽迅雷游戏
|
||||
||act-youxi.xunlei.com
|
||||
/act-youxi/
|
||||
@@||www.iconfont.cn
|
||||
#屏蔽百度/必应推广广告
|
||||
||hnsoft.yunibn.com
|
||||
/yunibn/
|
||||
/hnsoft/
|
||||
||3rd.softeasy.xyz
|
||||
/softeasy/
|
||||
/beizi.biz/
|
||||
/ad-scope/
|
||||
||api.htp.ad-scope.com.cn
|
||||
/hubcloud.com/
|
||||
@@||wecourt01.susong51.com
|
||||
/fbi.gov/
|
||||
@@||count.ddooo.com
|
||||
@@||list.live.xunlei.com
|
||||
@@||short-video.kakamobi.cn
|
||||
@@|teams.events.data.microsoft.com
|
||||
/civicscience.com/
|
||||
/fbi/
|
||||
/dui88/
|
||||
/6lugq4fy.com/
|
||||
#屏蔽万能高速下载器
|
||||
||down.51bigbig.com
|
||||
/iwakaka/
|
||||
/iwakaka.net.wsglb0.com/
|
||||
/iwakaka.net/
|
||||
@@||s3-us-east-1.ossfiles.com
|
||||
/hmlvnjj/
|
||||
/promote.hm-itc.com/
|
||||
/hm-itc/
|
||||
/promote/
|
||||
/bnmer/
|
||||
/jmnoioilkams/
|
||||
/kmef/
|
||||
/ikjwmfeds/
|
||||
/gbnwe/
|
||||
/woirfegbbjk/
|
||||
/koprtgh/
|
||||
/omhoa/
|
||||
/mwsxc/
|
||||
/mwsxc/
|
||||
/finzfin/
|
||||
/tepoch/
|
||||
/ok-320.xyz/
|
||||
/ok-320/
|
||||
/zgbxxffww/
|
||||
/jtyzvkt/
|
||||
/zgbxxffww/
|
||||
||repository.certum.pl^$important
|
||||
@@||o4504196236836864.ingest.sentry.io
|
||||
#放行下载站正常链接
|
||||
@@||down1.lwgzc.com
|
||||
@@||softdown01.rbread04.cn
|
||||
@@||*.onewsvod.com
|
||||
#屏蔽钓鱼
|
||||
/lzlso.space/
|
||||
/nordelaergne.com/
|
||||
/nordelaergne/
|
||||
/edtgi.xyz/
|
||||
/edtgi/
|
||||
/jumafuwu.com/
|
||||
/jumafuwu/
|
||||
/orangutansystems/
|
||||
@@||msdesigns.site
|
||||
/msdesigns/
|
||||
@@||qq168168.3322.org
|
||||
/qq168168/
|
||||
@@||nordelaergne.com
|
||||
/nordelaergne/
|
||||
@@||handle.pamphler.com
|
||||
/pamphler/
|
||||
@@||mail-xxcig-com.000webhostapp.com
|
||||
/xxcig/
|
||||
@@||msdesigns.site
|
||||
/msdesigns/
|
||||
@@||mydownload-202001.c1.biz
|
||||
/mydownload/
|
||||
@@||cc1.cctvjfa.com
|
||||
/cc1/
|
||||
/cctvjfa/
|
||||
/adtianshi/
|
||||
/lxpmgjy/
|
||||
/rjxz1/
|
||||
#屏蔽腾讯视频广告
|
||||
/v.smtcdns.com/
|
||||
/vd6.l.qq.com/
|
||||
/vd6.l/
|
||||
/vi.l.qq.com/
|
||||
/vi.l/
|
||||
#放行小米应用商店资源
|
||||
@@||a.market.xiaomi.com
|
||||
#屏蔽赌博网站
|
||||
/wmd9v/
|
||||
||blog.hotfixcdn.com
|
||||
#屏蔽虚假游戏广告
|
||||
/sxplywl.cn/
|
||||
softdown01.rbread04.cn
|
||||
#屏蔽抖音广告
|
||||
/ad-sign/
|
||||
#钉钉相关域名
|
||||
@@||app4860.eapps.dingtalkcloud.com
|
||||
@@||app4290.eapps.dingtalkcloud.com
|
||||
@@||app4298.eapps.dingtalkcloud.com
|
||||
#屏蔽广告链接
|
||||
/gslb.borui.yunfancdn.net/
|
||||
/soft991.cn/
|
||||
/wshtgame/
|
||||
/mssdk-bu/
|
||||
/bytedance.com.queniuum.com/
|
||||
/k128-mzstatic.gslb.ksyuncdn.com/
|
||||
/k128-mzstatic/
|
||||
/mzstatic/
|
||||
/shark-tracer.netease.com/
|
||||
/shark-tracer/
|
||||
/fp2e7a.wpc.phicdn.net/
|
||||
/imp-toutiao-data.37.com.cn/
|
||||
/37.com.cn/
|
||||
/37.com/
|
||||
/fp2e7a/
|
||||
/imp-toutiao/
|
||||
/cddp-track/
|
||||
/tnc3-alisc1.zijieapi.com.queniuyk.com/
|
||||
/alisc1/
|
||||
/tnc3/
|
||||
/tnc3-alisc1.zijieapi.com/
|
||||
#屏蔽网络分析
|
||||
/analytics/
|
||||
/analyze/
|
||||
/analytik/
|
||||
@@||support.apple.com^$important
|
||||
@@||ssl.qhimg.com^
|
||||
@@||market.xiaomi.com^
|
||||
#阻止优酷数据收集
|
||||
/pcapp-data-collect/
|
||||
#屏蔽黑群晖升级
|
||||
@@||update.synology.com
|
||||
@@||update7.synology.com
|
||||
@@||autoupdate7.synology.com
|
||||
@@||autoupdate7.synology.cn
|
||||
#屏蔽假冒Steam网站
|
||||
/berrygm/
|
||||
@@||events.gfe.nvidia.com^$important
|
||||
@@||appleid.cdn-apple.com
|
||||
#添加放行规则
|
||||
@@||jd.moxigame.cn
|
||||
@@||c631cc1b.c.cdnhwc1.com^
|
||||
/ssxd/
|
||||
||tg.602.com
|
||||
/602.com/
|
||||
/geo2.adobe.com/
|
||||
/get3.adobe.com/
|
||||
@@||down10.zol.com.cn
|
||||
||keepalive.softether.org
|
||||
/ad-sign.byteimg.com/
|
||||
@@||cube.meituan.com
|
||||
/eoffcn/
|
||||
#屏蔽flash
|
||||
/flash.cn/
|
||||
@@||api.flash.cn
|
||||
/g996cgxr.sched.d1p.tdnsdl1.cn/
|
||||
/g996cgxr/
|
||||
#End屏蔽flash
|
||||
@@||page.xiaojukeji.com
|
||||
@@||tnc3-aliec2.bytedance.com
|
||||
@@||tnc3-alisc1.bytedance.com
|
||||
@@||tnc3-bjlgy.bytedance.com
|
||||
@@||zcmcm.v.bsclink.cn
|
||||
@@||cdn.staticfile.org
|
||||
#屏蔽FF推荐
|
||||
/flash.cn/
|
||||
/ffzww/
|
||||
/iobit/
|
||||
@@||dwangshuo.jb51.net
|
||||
#屏蔽恶意收费资源网址Start
|
||||
/pan.isharepc.com/
|
||||
/isharepc/
|
||||
#屏蔽恶意收费资源网址End
|
||||
@@||multi-az-incu.gifshow.com
|
||||
@@||saveu5-normal-lq.zijieapi.com
|
||||
@@||mini.browser.360.cn
|
||||
/yX8668.com/
|
||||
@@||t7z.cupid.iqiyi.com
|
||||
/danweigame/
|
||||
/oo.nkmthw/
|
||||
/wlfzejw/
|
||||
#鲁大师AINAS
|
||||
@@||www.ludashi.com
|
||||
@@||cdn-img.ludashi.com
|
||||
@@||cdn-file.ludashi.com
|
||||
@@||cdn-ali-img.ludashi.com
|
||||
@@||ainas.ludashi.com
|
||||
#360安全云放行
|
||||
@@||www.360.cn
|
||||
@@||admin.online.360.cn
|
||||
@@||api.online.360.cn
|
||||
@@||s.360.cn
|
||||
@@||sdup.360.cn
|
||||
@@||pinst.360.cn
|
||||
@@||wsus.f.360.cn
|
||||
@@||vconf.f.360.cn
|
||||
@@||vcheck.f.360.cn
|
||||
@@||msgsrv.f.360.cn
|
||||
@@||dl.360safe.com
|
||||
@@||sdl.360safe.com
|
||||
@@||src.dl.360safe.com
|
||||
@@||dlleak.360safe.com
|
||||
@@||update.360safe.com
|
||||
@@||ini.update.360safe.com
|
||||
@@||softm.update.360safe.com
|
||||
@@||sdupm.qihucdn.com
|
||||
@@||inisdupm.qihucdn.com
|
||||
@@||s.ssl.qhres2.com
|
||||
@@||app.sc.360.net
|
||||
@@||rd1.online.360.cn
|
||||
@@||rd2.online.360.cn
|
||||
@@||rd3.online.360.cn
|
||||
@@||admin.saas.360.cn
|
||||
@@||saas.360.cn
|
||||
@@||ent.online.360.cn
|
||||
@@||client.saas.360.cn
|
||||
@@||store.saas.360.cn
|
||||
@@||dataviz.esc.360.cn
|
||||
@@||microapp.esc.360.cn
|
||||
@@||es.f.360.cn
|
||||
@@||tconf.f.360.cn
|
||||
@@||captcha.bpd.360.cn
|
||||
@@||gedl.360safe.com
|
||||
@@||gedlv5.360safe.com
|
||||
#360安全云放行end
|
||||
#误杀Start
|
||||
@@||/12345/
|
||||
@@||app4.i4.cn
|
||||
#误杀End
|
||||
#广告Start#
|
||||
/668wan/
|
||||
#广告End#
|
||||
#跟踪器开始#
|
||||
||ctrace.sogaha.cn
|
||||
||one-track-app.10046.mi.com
|
||||
||lx-upload-log.go2yd.com
|
||||
#跟踪器结束#
|
||||
#其他Start#
|
||||
||9qq9.3044.com^$important
|
||||
||2kjw.by6.app^$important
|
||||
##其他End
|
||||
@@||www.cuppaso.com
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"blockedDomainsCount": {},
|
||||
"resolvedDomainsCount": {},
|
||||
"lastSaved": "2025-11-23T19:30:41.791142096+08:00"
|
||||
"lastSaved": "2025-11-23T23:49:00.869596178+08:00"
|
||||
}
|
||||
321
data/stats.json
321
data/stats.json
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"stats": {
|
||||
"Queries": 34,
|
||||
"Blocked": 24,
|
||||
"Allowed": 20,
|
||||
"Queries": 179,
|
||||
"Blocked": 32,
|
||||
"Allowed": 154,
|
||||
"Errors": 2,
|
||||
"LastQuery": "2025-11-23T19:28:57.615407202+08:00"
|
||||
"LastQuery": "2025-11-23T23:13:38.043808406+08:00"
|
||||
},
|
||||
"blockedDomains": {
|
||||
"ad.qq.com": {
|
||||
@@ -16,32 +16,329 @@
|
||||
"Domain": "ad.qq.com.amazehome.xyz",
|
||||
"Count": 6,
|
||||
"LastSeen": "2025-11-23T19:06:10.691565251+08:00"
|
||||
},
|
||||
"app.adjust.com": {
|
||||
"Domain": "app.adjust.com",
|
||||
"Count": 2,
|
||||
"LastSeen": "2025-11-23T23:17:04.016821752+08:00"
|
||||
},
|
||||
"f00b1b869deb32d2ad60ba514bb876ea.b.hon.cc.cdnhwc8.com": {
|
||||
"Domain": "f00b1b869deb32d2ad60ba514bb876ea.b.hon.cc.cdnhwc8.com",
|
||||
"Count": 2,
|
||||
"LastSeen": "2025-11-23T22:47:46.908863828+08:00"
|
||||
}
|
||||
},
|
||||
"resolvedDomains": {
|
||||
"abt-drcn.platform.dbankcloud.com": {
|
||||
"Domain": "abt-drcn.platform.dbankcloud.com",
|
||||
"Count": 2,
|
||||
"LastSeen": "2025-11-23T23:19:06.743594947+08:00"
|
||||
},
|
||||
"acd.op.hicloud.com": {
|
||||
"Domain": "acd.op.hicloud.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:10:23.460077803+08:00"
|
||||
},
|
||||
"ad.qq.com": {
|
||||
"Domain": "ad.qq.com",
|
||||
"Count": 10,
|
||||
"LastSeen": "2025-11-23T19:05:54.429002187+08:00"
|
||||
"Count": 16,
|
||||
"LastSeen": "2025-11-23T19:46:16.276753315+08:00"
|
||||
},
|
||||
"ad.qq.com.amazehome.xyz": {
|
||||
"Domain": "ad.qq.com.amazehome.xyz",
|
||||
"Count": 14,
|
||||
"LastSeen": "2025-11-23T19:46:16.262416896+08:00"
|
||||
},
|
||||
"aeventlog.beacon.qq.com": {
|
||||
"Domain": "aeventlog.beacon.qq.com",
|
||||
"Count": 8,
|
||||
"LastSeen": "2025-11-23T19:05:54.356216418+08:00"
|
||||
"LastSeen": "2025-11-23T22:34:20.283819586+08:00"
|
||||
},
|
||||
"agpicnsp-drcn.dbankcdn.com": {
|
||||
"Domain": "agpicnsp-drcn.dbankcdn.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T22:47:46.931131113+08:00"
|
||||
},
|
||||
"apd-pcdnwxlogin.teg.tencent-cloud.net": {
|
||||
"Domain": "apd-pcdnwxlogin.teg.tencent-cloud.net",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T19:28:57.621471084+08:00"
|
||||
"Count": 5,
|
||||
"LastSeen": "2025-11-23T23:04:59.893242445+08:00"
|
||||
},
|
||||
"apd-pcdnwxnat.teg.tencent-cloud.net": {
|
||||
"Domain": "apd-pcdnwxnat.teg.tencent-cloud.net",
|
||||
"Count": 5,
|
||||
"LastSeen": "2025-11-23T23:07:25.857208001+08:00"
|
||||
},
|
||||
"apd-pcdnwxstat.teg.tencent-cloud.net": {
|
||||
"Domain": "apd-pcdnwxstat.teg.tencent-cloud.net",
|
||||
"Count": 5,
|
||||
"LastSeen": "2025-11-23T23:13:02.238884999+08:00"
|
||||
},
|
||||
"api-drcn.theme.dbankcloud.cn": {
|
||||
"Domain": "api-drcn.theme.dbankcloud.cn",
|
||||
"Count": 2,
|
||||
"LastSeen": "2025-11-23T23:10:21.736058066+08:00"
|
||||
},
|
||||
"api.cloud.huawei.com": {
|
||||
"Domain": "api.cloud.huawei.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T19:05:56.842653777+08:00"
|
||||
"LastSeen": "2025-11-23T23:10:23.481955189+08:00"
|
||||
},
|
||||
"appdl-1-drcn.dbankcdn.com": {
|
||||
"Domain": "appdl-1-drcn.dbankcdn.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T22:47:46.81255402+08:00"
|
||||
},
|
||||
"appdl-2-drcn.dbankcdn.com": {
|
||||
"Domain": "appdl-2-drcn.dbankcdn.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T22:47:46.906268202+08:00"
|
||||
},
|
||||
"appdl-drcn.dbankcdn.com": {
|
||||
"Domain": "appdl-drcn.dbankcdn.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T22:47:46.812354767+08:00"
|
||||
},
|
||||
"appimg-drcn.dbankcdn.com": {
|
||||
"Domain": "appimg-drcn.dbankcdn.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T22:47:46.831666388+08:00"
|
||||
},
|
||||
"appimg.dbankcdn.com": {
|
||||
"Domain": "appimg.dbankcdn.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T22:47:46.90998003+08:00"
|
||||
},
|
||||
"appoptimize-drcn.dbankcdn.cn": {
|
||||
"Domain": "appoptimize-drcn.dbankcdn.cn",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T22:47:46.813033121+08:00"
|
||||
},
|
||||
"aps.amap.com": {
|
||||
"Domain": "aps.amap.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:19:05.784149347+08:00"
|
||||
},
|
||||
"celiakeyboard-drcn.emui.dbankcloud.cn": {
|
||||
"Domain": "celiakeyboard-drcn.emui.dbankcloud.cn",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:10:16.389237831+08:00"
|
||||
},
|
||||
"cgicol.amap.com": {
|
||||
"Domain": "cgicol.amap.com",
|
||||
"Count": 2,
|
||||
"LastSeen": "2025-11-23T22:45:57.572113974+08:00"
|
||||
},
|
||||
"cloudphoto-drcn.cloud.dbankcloud.cn": {
|
||||
"Domain": "cloudphoto-drcn.cloud.dbankcloud.cn",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T22:40:41.570164717+08:00"
|
||||
},
|
||||
"cn.bing.com": {
|
||||
"Domain": "cn.bing.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:15:03.334152533+08:00"
|
||||
},
|
||||
"conf-drcn.cloud.dbankcloud.cn": {
|
||||
"Domain": "conf-drcn.cloud.dbankcloud.cn",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T22:40:35.993667038+08:00"
|
||||
},
|
||||
"config.edge.skype.com": {
|
||||
"Domain": "config.edge.skype.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:03:06.882056791+08:00"
|
||||
},
|
||||
"connect-drcn.dbankcloud.cn": {
|
||||
"Domain": "connect-drcn.dbankcloud.cn",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:10:16.553602032+08:00"
|
||||
},
|
||||
"connectivitycheck.platform.hicloud.com": {
|
||||
"Domain": "connectivitycheck.platform.hicloud.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:17:04.022763594+08:00"
|
||||
},
|
||||
"contentcenter-drcn.dbankcdn.cn": {
|
||||
"Domain": "contentcenter-drcn.dbankcdn.cn",
|
||||
"Count": 3,
|
||||
"LastSeen": "2025-11-23T23:13:02.241498472+08:00"
|
||||
},
|
||||
"contentcenter-drcn.dbankcdn.com": {
|
||||
"Domain": "contentcenter-drcn.dbankcdn.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:15:03.344243422+08:00"
|
||||
},
|
||||
"datacollabo-drcn.platform.dbankcloud.cn": {
|
||||
"Domain": "datacollabo-drcn.platform.dbankcloud.cn",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:15:03.334346849+08:00"
|
||||
},
|
||||
"dldir1v6.qq.com": {
|
||||
"Domain": "dldir1v6.qq.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:01:22.498948749+08:00"
|
||||
},
|
||||
"dns.weixin.qq.com.cn": {
|
||||
"Domain": "dns.weixin.qq.com.cn",
|
||||
"Count": 2,
|
||||
"LastSeen": "2025-11-23T23:11:18.20935382+08:00"
|
||||
},
|
||||
"events-drcn.op.dbankcloud.cn": {
|
||||
"Domain": "events-drcn.op.dbankcloud.cn",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:10:18.516405447+08:00"
|
||||
},
|
||||
"events.op.hicloud.com": {
|
||||
"Domain": "events.op.hicloud.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:10:11.304956407+08:00"
|
||||
},
|
||||
"grs.dbankcloud.cn": {
|
||||
"Domain": "grs.dbankcloud.cn",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:15:03.333862815+08:00"
|
||||
},
|
||||
"grs.dbankcloud.com": {
|
||||
"Domain": "grs.dbankcloud.com",
|
||||
"Count": 3,
|
||||
"LastSeen": "2025-11-23T23:10:27.400734999+08:00"
|
||||
},
|
||||
"h5hosting.dbankcdn.com": {
|
||||
"Domain": "h5hosting.dbankcdn.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:13:02.242649757+08:00"
|
||||
},
|
||||
"hag-drcn.op.dbankcloud.com": {
|
||||
"Domain": "hag-drcn.op.dbankcloud.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:13:02.239280117+08:00"
|
||||
},
|
||||
"hisuggestion-drcn.ai.dbankcloud.cn": {
|
||||
"Domain": "hisuggestion-drcn.ai.dbankcloud.cn",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:17:04.022631737+08:00"
|
||||
},
|
||||
"hivoice-hiai-drcn.emui.dbankcloud.cn": {
|
||||
"Domain": "hivoice-hiai-drcn.emui.dbankcloud.cn",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T22:37:50.440320165+08:00"
|
||||
},
|
||||
"hwid-drcn.platform.hicloud.com": {
|
||||
"Domain": "hwid-drcn.platform.hicloud.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T22:42:50.188626235+08:00"
|
||||
},
|
||||
"in.appcenter.ms": {
|
||||
"Domain": "in.appcenter.ms",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:17:04.022296878+08:00"
|
||||
},
|
||||
"loc.map.baidu.com": {
|
||||
"Domain": "loc.map.baidu.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:15:03.334689426+08:00"
|
||||
},
|
||||
"login.microsoftonline.com": {
|
||||
"Domain": "login.microsoftonline.com",
|
||||
"Count": 3,
|
||||
"LastSeen": "2025-11-23T22:56:20.769863606+08:00"
|
||||
},
|
||||
"magazine-drcn.theme.dbankcloud.cn": {
|
||||
"Domain": "magazine-drcn.theme.dbankcloud.cn",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:10:10.17963466+08:00"
|
||||
},
|
||||
"metrics1-drcn.dt.dbankcloud.cn": {
|
||||
"Domain": "metrics1-drcn.dt.dbankcloud.cn",
|
||||
"Count": 7,
|
||||
"LastSeen": "2025-11-23T23:13:02.241935855+08:00"
|
||||
},
|
||||
"metrics1.data.hicloud.com": {
|
||||
"Domain": "metrics1.data.hicloud.com",
|
||||
"Count": 2,
|
||||
"LastSeen": "2025-11-23T23:13:02.239212484+08:00"
|
||||
},
|
||||
"mmgame.qpic.cn": {
|
||||
"Domain": "mmgame.qpic.cn",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T22:16:08.36064421+08:00"
|
||||
},
|
||||
"mobile.pipe.aria.microsoft.com": {
|
||||
"Domain": "mobile.pipe.aria.microsoft.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:03:05.111651691+08:00"
|
||||
},
|
||||
"nearby-drcn.platform.dbankcloud.com": {
|
||||
"Domain": "nearby-drcn.platform.dbankcloud.com",
|
||||
"Count": 2,
|
||||
"LastSeen": "2025-11-23T23:10:16.258393639+08:00"
|
||||
},
|
||||
"nsp-hicloud-cloudbackupnorth9-p06-drcn.obs.dualstack.cn-north-9.myhuaweicloud.cn": {
|
||||
"Domain": "nsp-hicloud-cloudbackupnorth9-p06-drcn.obs.dualstack.cn-north-9.myhuaweicloud.cn",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T22:40:35.993489552+08:00"
|
||||
},
|
||||
"nsp-hicloud-cloudbackupnorth9-p21-drcn.obs.dualstack.cn-north-9.myhuaweicloud.cn": {
|
||||
"Domain": "nsp-hicloud-cloudbackupnorth9-p21-drcn.obs.dualstack.cn-north-9.myhuaweicloud.cn",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T22:40:35.98874341+08:00"
|
||||
},
|
||||
"rcm-cus-drcn.platform.dbankcloud.cn": {
|
||||
"Domain": "rcm-cus-drcn.platform.dbankcloud.cn",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:13:02.24284424+08:00"
|
||||
},
|
||||
"sdkserver-drcn.op.dbankcloud.cn": {
|
||||
"Domain": "sdkserver-drcn.op.dbankcloud.cn",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:15:03.334283186+08:00"
|
||||
},
|
||||
"sdkserver.op.hicloud.com": {
|
||||
"Domain": "sdkserver.op.hicloud.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T23:10:23.264896983+08:00"
|
||||
},
|
||||
"self.events.data.microsoft.com": {
|
||||
"Domain": "self.events.data.microsoft.com",
|
||||
"Count": 20,
|
||||
"LastSeen": "2025-11-23T22:40:52.10504145+08:00"
|
||||
},
|
||||
"so.com": {
|
||||
"Domain": "so.com",
|
||||
"Count": 4,
|
||||
"LastSeen": "2025-11-23T19:46:12.9386693+08:00"
|
||||
},
|
||||
"so.com.amazehome.xyz": {
|
||||
"Domain": "so.com.amazehome.xyz",
|
||||
"Count": 4,
|
||||
"LastSeen": "2025-11-23T19:46:12.850932678+08:00"
|
||||
},
|
||||
"store-drcn.hispace.dbankcloud.com": {
|
||||
"Domain": "store-drcn.hispace.dbankcloud.com",
|
||||
"Count": 1,
|
||||
"LastSeen": "2025-11-23T22:47:46.81272288+08:00"
|
||||
},
|
||||
"tracking.ad.qq.com": {
|
||||
"Domain": "tracking.ad.qq.com",
|
||||
"Count": 2,
|
||||
"LastSeen": "2025-11-23T19:44:37.901264799+08:00"
|
||||
},
|
||||
"tracking.ad.qq.com.amazehome.xyz": {
|
||||
"Domain": "tracking.ad.qq.com.amazehome.xyz",
|
||||
"Count": 2,
|
||||
"LastSeen": "2025-11-23T19:44:39.223583991+08:00"
|
||||
},
|
||||
"tsms-drcn.security.dbankcloud.cn": {
|
||||
"Domain": "tsms-drcn.security.dbankcloud.cn",
|
||||
"Count": 2,
|
||||
"LastSeen": "2025-11-23T23:13:02.239393357+08:00"
|
||||
}
|
||||
},
|
||||
"hourlyStats": {
|
||||
"2025-11-23-19": 12
|
||||
"2025-11-23-19": 12,
|
||||
"2025-11-23-22": 2,
|
||||
"2025-11-23-23": 2
|
||||
},
|
||||
"lastSaved": "2025-11-23T19:30:24.828634638+08:00"
|
||||
"lastSaved": "2025-11-23T23:35:51.696690359+08:00"
|
||||
}
|
||||
BIN
dns-server
BIN
dns-server
Binary file not shown.
22549
dns-server.log
22549
dns-server.log
File diff suppressed because it is too large
Load Diff
12
go.mod
12
go.mod
@@ -13,9 +13,11 @@ require (
|
||||
// 之前的go.sum可能包含lumberjack的记录,但现在已经不再使用
|
||||
|
||||
require (
|
||||
golang.org/x/mod v0.24.0 // indirect
|
||||
golang.org/x/net v0.40.0 // indirect
|
||||
golang.org/x/sync v0.14.0 // indirect
|
||||
golang.org/x/sys v0.33.0 // indirect
|
||||
golang.org/x/tools v0.33.0 // indirect
|
||||
github.com/google/go-cmp v0.7.0 // indirect
|
||||
github.com/stretchr/testify v1.10.0 // indirect
|
||||
golang.org/x/mod v0.25.0 // indirect
|
||||
golang.org/x/net v0.42.0 // indirect
|
||||
golang.org/x/sync v0.16.0 // indirect
|
||||
golang.org/x/sys v0.35.0 // indirect
|
||||
golang.org/x/tools v0.34.0 // indirect
|
||||
)
|
||||
|
||||
30
go.sum
30
go.sum
@@ -1,8 +1,8 @@
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/miekg/dns v1.1.68 h1:jsSRkNozw7G/mnmXULynzMNIsgY2dHC8LO6U6Ij2JEA=
|
||||
github.com/miekg/dns v1.1.68/go.mod h1:fujopn7TB3Pu3JM69XaawiU0wqjpL9/8xGop5UrTPps=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
@@ -10,19 +10,21 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
|
||||
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
|
||||
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
|
||||
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
|
||||
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
|
||||
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
|
||||
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
|
||||
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w=
|
||||
golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
|
||||
golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
|
||||
golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
|
||||
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
|
||||
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
|
||||
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc=
|
||||
golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI=
|
||||
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
|
||||
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=
|
||||
golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
||||
134
http/server.go
134
http/server.go
@@ -3,6 +3,7 @@ package http
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -37,19 +38,19 @@ func (s *Server) Start() error {
|
||||
mux := http.NewServeMux()
|
||||
|
||||
// API路由
|
||||
if s.config.EnableAPI {
|
||||
mux.HandleFunc("/api/stats", s.handleStats)
|
||||
mux.HandleFunc("/api/shield", s.handleShield)
|
||||
mux.HandleFunc("/api/shield/hosts", s.handleShieldHosts)
|
||||
mux.HandleFunc("/api/query", s.handleQuery)
|
||||
mux.HandleFunc("/api/status", s.handleStatus)
|
||||
mux.HandleFunc("/api/config", s.handleConfig)
|
||||
// 添加统计相关接口
|
||||
mux.HandleFunc("/api/top-blocked", s.handleTopBlockedDomains)
|
||||
mux.HandleFunc("/api/top-resolved", s.handleTopResolvedDomains)
|
||||
mux.HandleFunc("/api/recent-blocked", s.handleRecentBlockedDomains)
|
||||
mux.HandleFunc("/api/hourly-stats", s.handleHourlyStats)
|
||||
}
|
||||
if s.config.EnableAPI {
|
||||
mux.HandleFunc("/api/stats", s.handleStats)
|
||||
mux.HandleFunc("/api/shield", s.handleShield)
|
||||
mux.HandleFunc("/api/shield/hosts", s.handleShieldHosts)
|
||||
mux.HandleFunc("/api/query", s.handleQuery)
|
||||
mux.HandleFunc("/api/status", s.handleStatus)
|
||||
mux.HandleFunc("/api/config", s.handleConfig)
|
||||
// 添加统计相关接口
|
||||
mux.HandleFunc("/api/top-blocked", s.handleTopBlockedDomains)
|
||||
mux.HandleFunc("/api/top-resolved", s.handleTopResolvedDomains)
|
||||
mux.HandleFunc("/api/recent-blocked", s.handleRecentBlockedDomains)
|
||||
mux.HandleFunc("/api/hourly-stats", s.handleHourlyStats)
|
||||
}
|
||||
|
||||
// 静态文件服务(可后续添加前端界面)
|
||||
mux.Handle("/", http.FileServer(http.Dir("./static")))
|
||||
@@ -99,9 +100,9 @@ func (s *Server) handleTopBlockedDomains(w http.ResponseWriter, r *http.Request)
|
||||
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
domains := s.dnsServer.GetTopBlockedDomains(10)
|
||||
|
||||
|
||||
// 转换为前端需要的格式
|
||||
result := make([]map[string]interface{}, len(domains))
|
||||
for i, domain := range domains {
|
||||
@@ -110,7 +111,7 @@ func (s *Server) handleTopBlockedDomains(w http.ResponseWriter, r *http.Request)
|
||||
"count": domain.Count,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(result)
|
||||
}
|
||||
@@ -121,9 +122,9 @@ func (s *Server) handleTopResolvedDomains(w http.ResponseWriter, r *http.Request
|
||||
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
domains := s.dnsServer.GetTopResolvedDomains(10)
|
||||
|
||||
|
||||
// 转换为前端需要的格式
|
||||
result := make([]map[string]interface{}, len(domains))
|
||||
for i, domain := range domains {
|
||||
@@ -132,7 +133,7 @@ func (s *Server) handleTopResolvedDomains(w http.ResponseWriter, r *http.Request
|
||||
"count": domain.Count,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(result)
|
||||
}
|
||||
@@ -143,9 +144,9 @@ func (s *Server) handleRecentBlockedDomains(w http.ResponseWriter, r *http.Reque
|
||||
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
domains := s.dnsServer.GetRecentBlockedDomains(10)
|
||||
|
||||
|
||||
// 转换为前端需要的格式
|
||||
result := make([]map[string]interface{}, len(domains))
|
||||
for i, domain := range domains {
|
||||
@@ -154,7 +155,7 @@ func (s *Server) handleRecentBlockedDomains(w http.ResponseWriter, r *http.Reque
|
||||
"time": domain.LastSeen.Format("15:04:05"),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(result)
|
||||
}
|
||||
@@ -165,26 +166,26 @@ func (s *Server) handleHourlyStats(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
hourlyStats := s.dnsServer.GetHourlyStats()
|
||||
|
||||
|
||||
// 生成最近24小时的数据
|
||||
now := time.Now()
|
||||
labels := make([]string, 24)
|
||||
data := make([]int64, 24)
|
||||
|
||||
|
||||
for i := 23; i >= 0; i-- {
|
||||
hour := now.Add(time.Duration(-i) * time.Hour)
|
||||
hourKey := hour.Format("2006-01-02-15")
|
||||
labels[23-i] = hour.Format("15:00")
|
||||
data[23-i] = hourlyStats[hourKey]
|
||||
}
|
||||
|
||||
|
||||
result := map[string]interface{}{
|
||||
"labels": labels,
|
||||
"data": data,
|
||||
}
|
||||
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(result)
|
||||
}
|
||||
@@ -367,56 +368,65 @@ func (s *Server) handleStatus(w http.ResponseWriter, r *http.Request) {
|
||||
json.NewEncoder(w).Encode(status)
|
||||
}
|
||||
|
||||
// saveConfigToFile 保存配置到文件
|
||||
func saveConfigToFile(config *config.Config, filePath string) error {
|
||||
data, err := json.MarshalIndent(config, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return ioutil.WriteFile(filePath, data, 0644)
|
||||
}
|
||||
|
||||
// handleConfig 处理配置请求
|
||||
func (s *Server) handleConfig(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
|
||||
switch r.Method {
|
||||
case http.MethodGet:
|
||||
// 返回当前配置(包括远程规则相关配置)
|
||||
// 返回当前配置(包括黑名单配置)
|
||||
config := map[string]interface{}{
|
||||
"shield": map[string]interface{}{
|
||||
"blockMethod": s.globalConfig.Shield.BlockMethod,
|
||||
"customBlockIP": s.globalConfig.Shield.CustomBlockIP,
|
||||
"remoteRules": s.globalConfig.Shield.RemoteRules,
|
||||
"blockMethod": s.globalConfig.Shield.BlockMethod,
|
||||
"customBlockIP": s.globalConfig.Shield.CustomBlockIP,
|
||||
"blacklists": s.globalConfig.Shield.Blacklists,
|
||||
"updateInterval": s.globalConfig.Shield.UpdateInterval,
|
||||
},
|
||||
}
|
||||
json.NewEncoder(w).Encode(config)
|
||||
|
||||
|
||||
case http.MethodPost:
|
||||
// 更新配置
|
||||
var req struct {
|
||||
Shield struct {
|
||||
BlockMethod string `json:"blockMethod"`
|
||||
CustomBlockIP string `json:"customBlockIP"`
|
||||
RemoteRules []string `json:"remoteRules"`
|
||||
UpdateInterval int `json:"updateInterval"`
|
||||
BlockMethod string `json:"blockMethod"`
|
||||
CustomBlockIP string `json:"customBlockIP"`
|
||||
Blacklists []config.BlacklistEntry `json:"blacklists"`
|
||||
UpdateInterval int `json:"updateInterval"`
|
||||
} `json:"shield"`
|
||||
}
|
||||
|
||||
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
http.Error(w, "无效的请求体", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
// 更新屏蔽配置
|
||||
if req.Shield.BlockMethod != "" {
|
||||
// 验证屏蔽方法是否有效
|
||||
validMethods := map[string]bool{
|
||||
"NXDOMAIN": true,
|
||||
"refused": true,
|
||||
"emptyIP": true,
|
||||
"refused": true,
|
||||
"emptyIP": true,
|
||||
"customIP": true,
|
||||
}
|
||||
|
||||
|
||||
if !validMethods[req.Shield.BlockMethod] {
|
||||
http.Error(w, "无效的屏蔽方法", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
s.globalConfig.Shield.BlockMethod = req.Shield.BlockMethod
|
||||
|
||||
|
||||
// 如果选择了customIP,验证IP地址
|
||||
if req.Shield.BlockMethod == "customIP" {
|
||||
if req.Shield.CustomBlockIP == "" {
|
||||
@@ -430,20 +440,32 @@ func (s *Server) handleConfig(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if req.Shield.CustomBlockIP != "" {
|
||||
s.globalConfig.Shield.CustomBlockIP = req.Shield.CustomBlockIP
|
||||
}
|
||||
|
||||
// 更新远程规则列表
|
||||
if req.Shield.RemoteRules != nil {
|
||||
s.globalConfig.Shield.RemoteRules = req.Shield.RemoteRules
|
||||
|
||||
// 更新黑名单配置
|
||||
if req.Shield.Blacklists != nil {
|
||||
// 验证黑名单配置
|
||||
for i, bl := range req.Shield.Blacklists {
|
||||
if bl.URL == "" {
|
||||
http.Error(w, fmt.Sprintf("黑名单URL不能为空,索引: %d", i), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
if !strings.HasPrefix(bl.URL, "http://") && !strings.HasPrefix(bl.URL, "https://") {
|
||||
http.Error(w, fmt.Sprintf("黑名单URL必须以http://或https://开头,索引: %d", i), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
}
|
||||
s.globalConfig.Shield.Blacklists = req.Shield.Blacklists
|
||||
s.shieldManager.UpdateBlacklist(req.Shield.Blacklists)
|
||||
// 重新加载规则
|
||||
if err := s.shieldManager.LoadRules(); err != nil {
|
||||
logger.Error("重新加载规则失败", "error", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 更新更新间隔
|
||||
if req.Shield.UpdateInterval > 0 {
|
||||
s.globalConfig.Shield.UpdateInterval = req.Shield.UpdateInterval
|
||||
@@ -451,13 +473,19 @@ func (s *Server) handleConfig(w http.ResponseWriter, r *http.Request) {
|
||||
s.shieldManager.StopAutoUpdate()
|
||||
s.shieldManager.StartAutoUpdate()
|
||||
}
|
||||
|
||||
|
||||
// 保存配置到文件
|
||||
if err := saveConfigToFile(s.globalConfig, "./config.json"); err != nil {
|
||||
logger.Error("保存配置到文件失败", "error", err)
|
||||
// 不返回错误,只记录日志,因为配置已经在内存中更新成功
|
||||
}
|
||||
|
||||
// 返回成功响应
|
||||
json.NewEncoder(w).Encode(map[string]interface{}{
|
||||
"success": true,
|
||||
"message": "配置已更新",
|
||||
})
|
||||
|
||||
|
||||
default:
|
||||
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
|
||||
}
|
||||
@@ -470,7 +498,7 @@ func isValidIP(ip string) bool {
|
||||
if len(parts) != 4 {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
for _, part := range parts {
|
||||
// 检查是否为数字
|
||||
for _, char := range part {
|
||||
|
||||
@@ -132,10 +132,12 @@ func (m *ShieldManager) loadLocalRules() error {
|
||||
|
||||
// loadRemoteRules 加载远程规则
|
||||
func (m *ShieldManager) loadRemoteRules() error {
|
||||
for _, url := range m.config.RemoteRules {
|
||||
if err := m.fetchRemoteRules(url); err != nil {
|
||||
logger.Error("获取远程规则失败", "url", url, "error", err)
|
||||
continue
|
||||
for _, blacklist := range m.config.Blacklists {
|
||||
if blacklist.Enabled {
|
||||
if err := m.fetchRemoteRules(blacklist.URL); err != nil {
|
||||
logger.Error("获取远程规则失败", "url", blacklist.URL, "error", err)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
@@ -1007,6 +1009,16 @@ func (m *ShieldManager) startAutoSaveStats() {
|
||||
}
|
||||
}
|
||||
|
||||
// GetBlacklists 获取所有黑名单配置
|
||||
func (m *ShieldManager) GetBlacklists() []config.BlacklistEntry {
|
||||
return m.config.Blacklists
|
||||
}
|
||||
|
||||
// UpdateBlacklist 更新黑名单配置
|
||||
func (m *ShieldManager) UpdateBlacklist(blacklists []config.BlacklistEntry) {
|
||||
m.config.Blacklists = blacklists
|
||||
}
|
||||
|
||||
// GetRules 获取所有规则
|
||||
func (m *ShieldManager) GetRules() map[string]interface{} {
|
||||
m.rulesMutex.RLock()
|
||||
@@ -1047,5 +1059,6 @@ func (m *ShieldManager) GetRules() map[string]interface{} {
|
||||
"regexRules": regexRulesList,
|
||||
"regexExceptions": regexExceptionsList,
|
||||
"hostsRules": hostsRulesList,
|
||||
"blacklists": m.config.Blacklists,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -478,6 +478,45 @@
|
||||
font-size: 0.875rem;
|
||||
border-radius: var(--border-radius-sm);
|
||||
}
|
||||
|
||||
.btn-edit {
|
||||
background-color: var(--info-color);
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn-edit:hover {
|
||||
background-color: #2980b9;
|
||||
}
|
||||
|
||||
.checkbox-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.checkbox-label input[type="checkbox"] {
|
||||
cursor: pointer;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
.list-meta {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
font-size: 0.75rem;
|
||||
color: var(--gray-500);
|
||||
}
|
||||
|
||||
.list-meta span {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
@@ -816,33 +855,36 @@
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fas fa-globe"></i> 远程规则管理</h3>
|
||||
<h3 class="card-title"><i class="fas fa-ban"></i> 黑名单管理</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<label for="update-interval" class="form-label">更新间隔 (秒)</label>
|
||||
<input type="number" id="update-interval" min="60" max="86400" placeholder="3600">
|
||||
<small class="form-text">远程规则自动更新的时间间隔,建议至少60秒</small>
|
||||
<small class="form-text">黑名单自动更新的时间间隔,建议至少60秒</small>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="input-group">
|
||||
<input type="text" id="remote-rule-url" placeholder="输入远程规则URL">
|
||||
<button id="add-remote-rule" class="btn-secondary">
|
||||
<i class="fas fa-plus"></i> 添加规则
|
||||
<h4>添加新黑名单</h4>
|
||||
<div style="display: flex; gap: 0.5rem; flex-wrap: wrap;">
|
||||
<input type="text" id="blacklist-name" placeholder="黑名单名称">
|
||||
<input type="text" id="blacklist-url" placeholder="黑名单URL">
|
||||
<button id="add-blacklist" class="btn-secondary">
|
||||
<i class="fas fa-plus"></i> 添加
|
||||
</button>
|
||||
</div>
|
||||
<small class="form-text">添加远程黑名单源,支持HTTP/HTTPS链接</small>
|
||||
</div>
|
||||
|
||||
<div class="list-container" id="remote-rules-list">
|
||||
<div class="list-container" id="blacklists-list">
|
||||
<div class="empty-state">
|
||||
<i class="fas fa-info-circle"></i>
|
||||
<p>加载中...</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button id="save-remote-settings" class="btn-primary mt-3">
|
||||
<i class="fas fa-save"></i> 保存远程设置
|
||||
<button id="save-blacklists-settings" class="btn-primary mt-3">
|
||||
<i class="fas fa-save"></i> 保存设置
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1426,7 +1468,7 @@ function loadRules() {
|
||||
typeText = '正则';
|
||||
}
|
||||
|
||||
// 转义规则中的特殊字符,确保在HTML和JavaScript中正确处理
|
||||
// 转义规则中的特殊字符并确保在HTML和JavaScript中正确处理
|
||||
const escapedRule = item.rule.replace(/'/g, "\\'");
|
||||
|
||||
ruleItem.innerHTML = `
|
||||
@@ -1504,7 +1546,19 @@ function loadRules() {
|
||||
},
|
||||
body: JSON.stringify({ rule: fullRule })
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('保存失败');
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then(data => {
|
||||
showNotification('success', '黑名单设置已保存');
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('保存黑名单设置失败:', error);
|
||||
showNotification('danger', '保存失败: ' + error.message);
|
||||
});
|
||||
.then(data => {
|
||||
// 重置按钮状态
|
||||
btn.innerHTML = originalText;
|
||||
@@ -1537,7 +1591,7 @@ function loadRules() {
|
||||
fetch('/api/shield/hosts')
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
// 注意:这需要在shieldManager中添加一个获取所有hosts条目的方法
|
||||
// 注意这需要在shieldManager中添加一个获取所有hosts条目的方法
|
||||
// 暂时返回统计信息
|
||||
const hostsCount = data.hostsCount || 0;
|
||||
|
||||
@@ -1766,12 +1820,12 @@ function loadRules() {
|
||||
// 加载当前屏蔽设置
|
||||
loadBlockSettings();
|
||||
|
||||
// 远程规则相关事件监听
|
||||
document.getElementById('add-remote-rule').addEventListener('click', addRemoteRule);
|
||||
document.getElementById('save-remote-settings').addEventListener('click', saveRemoteSettings);
|
||||
// 黑名单相关事件监听
|
||||
document.getElementById('add-blacklist').addEventListener('click', addBlacklist);
|
||||
document.getElementById('save-blacklists-settings').addEventListener('click', saveBlacklistsSettings);
|
||||
|
||||
// 加载远程规则设置
|
||||
loadRemoteSettings();
|
||||
// 加载黑名单设置
|
||||
loadBlacklistsSettings();
|
||||
};
|
||||
|
||||
// 加载当前屏蔽设置
|
||||
@@ -1835,82 +1889,104 @@ function loadRules() {
|
||||
});
|
||||
}
|
||||
|
||||
// 加载远程规则设置
|
||||
function loadRemoteSettings() {
|
||||
fetch('/api/config', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
// 加载黑名单设置
|
||||
function loadBlacklistsSettings() {
|
||||
fetch('/api/config')
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.shield) {
|
||||
// 设置更新间隔
|
||||
document.getElementById('update-interval').value = data.shield.updateInterval || 3600;
|
||||
|
||||
// 加载远程规则列表
|
||||
renderRemoteRulesList(data.shield.remoteRules || []);
|
||||
// 加载黑名单列表
|
||||
renderBlacklistsList(data.shield.blacklists || []);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('加载远程规则设置失败:', error);
|
||||
showNotification('danger', '加载远程规则设置失败');
|
||||
renderRemoteRulesList([]);
|
||||
console.error('加载黑名单设置失败:', error);
|
||||
showNotification('danger', '加载黑名单设置失败');
|
||||
renderBlacklistsList([]);
|
||||
});
|
||||
}
|
||||
|
||||
// 渲染远程规则列表
|
||||
function renderRemoteRulesList(rules) {
|
||||
const listContainer = document.getElementById('remote-rules-list');
|
||||
// 渲染黑名单列表
|
||||
function renderBlacklistsList(blacklists) {
|
||||
const listContainer = document.getElementById('blacklists-list');
|
||||
|
||||
if (rules.length === 0) {
|
||||
if (!blacklists || blacklists.length === 0) {
|
||||
listContainer.innerHTML = `
|
||||
<div class="empty-state">
|
||||
<i class="fas fa-info-circle"></i>
|
||||
<p>暂无远程规则</p>
|
||||
<p>暂无黑名单</p>
|
||||
</div>
|
||||
`;
|
||||
return;
|
||||
}
|
||||
|
||||
let html = '<div class="list-container">';
|
||||
rules.forEach((rule, index) => {
|
||||
// 确保我们处理的是数组
|
||||
const blacklistItems = Array.isArray(blacklists) ? blacklists : [];
|
||||
|
||||
let html = '';
|
||||
blacklistItems.forEach((item, index) => {
|
||||
html += `
|
||||
<div class="list-item">
|
||||
<div class="list-content">
|
||||
<div class="list-title">远程规则 ${index + 1}</div>
|
||||
<div class="list-description">${rule}</div>
|
||||
<div class="list-title">
|
||||
<label class="checkbox-label">
|
||||
<input type="checkbox" ${item.enabled ? 'checked' : ''} class="blacklist-enabled" data-index="${index}">
|
||||
<span>${item.name || '未命名黑名单'}</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="list-description">${item.URL}</div>
|
||||
<div class="list-meta">
|
||||
<span>${item.ruleCount ? `规则数: ${item.ruleCount}` : '未加载规则'}</span>
|
||||
${item.lastUpdateTime ? `<span>更新时间: ${item.lastUpdateTime}</span>` : ''}
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-actions">
|
||||
<span class="badge badge-primary">远程</span>
|
||||
<button class="btn-danger btn-sm delete-rule" data-index="${index}">
|
||||
<button class="btn-edit btn-sm" data-index="${index}">
|
||||
<i class="fas fa-edit"></i>
|
||||
</button>
|
||||
<button class="btn-danger btn-sm delete-blacklist" data-index="${index}">
|
||||
<i class="fas fa-trash-alt"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
html += '</div>';
|
||||
|
||||
listContainer.innerHTML = html;
|
||||
|
||||
// 添加删除按钮事件监听
|
||||
document.querySelectorAll('.delete-rule').forEach(btn => {
|
||||
// 添加事件监听
|
||||
document.querySelectorAll('.blacklist-enabled').forEach(checkbox => {
|
||||
checkbox.addEventListener('change', function() {
|
||||
const index = parseInt(this.getAttribute('data-index'));
|
||||
toggleBlacklistStatus(index, this.checked);
|
||||
});
|
||||
});
|
||||
|
||||
document.querySelectorAll('.delete-blacklist').forEach(btn => {
|
||||
btn.addEventListener('click', function() {
|
||||
const index = parseInt(this.getAttribute('data-index'));
|
||||
deleteRemoteRule(index);
|
||||
deleteBlacklist(index);
|
||||
});
|
||||
});
|
||||
|
||||
document.querySelectorAll('.btn-edit').forEach(btn => {
|
||||
btn.addEventListener('click', function() {
|
||||
const index = parseInt(this.getAttribute('data-index'));
|
||||
editBlacklist(index);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 添加远程规则
|
||||
function addRemoteRule() {
|
||||
const urlInput = document.getElementById('remote-rule-url');
|
||||
const url = urlInput.value.trim();
|
||||
// 添加黑名单
|
||||
function addBlacklist() {
|
||||
const name = document.getElementById('blacklist-name').value.trim();
|
||||
const url = document.getElementById('blacklist-url').value.trim();
|
||||
|
||||
if (!url) {
|
||||
showNotification('warning', '请输入有效的URL');
|
||||
if (!name || !url) {
|
||||
showNotification('warning', '请输入黑名单名称和URL');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1922,42 +1998,110 @@ function loadRules() {
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取当前列表中的规则
|
||||
const ruleItems = document.querySelectorAll('.list-item');
|
||||
const rules = Array.from(ruleItems).map(item =>
|
||||
item.querySelector('.list-description').textContent
|
||||
);
|
||||
// 获取当前黑名单列表
|
||||
const listItems = document.querySelectorAll('#blacklists-list .list-item');
|
||||
let blacklists = [];
|
||||
|
||||
// 检查是否已存在
|
||||
if (rules.includes(url)) {
|
||||
showNotification('warning', '该规则已存在');
|
||||
listItems.forEach((item, index) => {
|
||||
const enabled = item.querySelector('.blacklist-enabled').checked;
|
||||
const name = item.querySelector('.list-title span').textContent;
|
||||
const url = item.querySelector('.list-description').textContent;
|
||||
blacklists.push({ name, URL: url, enabled });
|
||||
});
|
||||
|
||||
// 检查URL是否已存在
|
||||
if (blacklists.some(item => item.URL === url)) {
|
||||
showNotification('warning', '该URL已存在');
|
||||
return;
|
||||
}
|
||||
|
||||
// 添加新规则
|
||||
rules.push(url);
|
||||
renderRemoteRulesList(rules);
|
||||
urlInput.value = '';
|
||||
// 添加新黑名单
|
||||
blacklists.push({ name, URL: url, enabled: true });
|
||||
renderBlacklistsList(blacklists);
|
||||
|
||||
showNotification('success', '规则已添加');
|
||||
// 清空输入框
|
||||
document.getElementById('blacklist-name').value = '';
|
||||
document.getElementById('blacklist-url').value = '';
|
||||
|
||||
showNotification('success', '黑名单已添加');
|
||||
}
|
||||
|
||||
// 删除远程规则
|
||||
function deleteRemoteRule(index) {
|
||||
const ruleItems = document.querySelectorAll('.list-item');
|
||||
const rules = Array.from(ruleItems).map(item =>
|
||||
item.querySelector('.list-description').textContent
|
||||
);
|
||||
// 编辑黑名单
|
||||
function editBlacklist(index) {
|
||||
const listItems = document.querySelectorAll('#blacklists-list .list-item');
|
||||
const item = listItems[index];
|
||||
|
||||
// 移除指定索引的规则
|
||||
rules.splice(index, 1);
|
||||
renderRemoteRulesList(rules);
|
||||
const currentName = item.querySelector('.list-title span').textContent;
|
||||
const currentUrl = item.querySelector('.list-description').textContent;
|
||||
|
||||
showNotification('success', '规则已删除');
|
||||
const newName = prompt('请输入黑名单名称:', currentName);
|
||||
if (newName === null) return;
|
||||
|
||||
const newUrl = prompt('请输入黑名单URL:', currentUrl);
|
||||
if (newUrl === null) return;
|
||||
|
||||
if (!newName.trim() || !newUrl.trim()) {
|
||||
showNotification('warning', '名称和URL不能为空');
|
||||
return;
|
||||
}
|
||||
|
||||
// URL验证
|
||||
try {
|
||||
new URL(newUrl);
|
||||
} catch (e) {
|
||||
showNotification('warning', '请输入有效的URL格式');
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取所有黑名单
|
||||
let blacklists = [];
|
||||
listItems.forEach((item, idx) => {
|
||||
const enabled = item.querySelector('.blacklist-enabled').checked;
|
||||
let name = item.querySelector('.list-title span').textContent;
|
||||
let url = item.querySelector('.list-description').textContent;
|
||||
|
||||
if (idx === index) {
|
||||
name = newName.trim();
|
||||
url = newUrl.trim();
|
||||
}
|
||||
|
||||
blacklists.push({ name, URL: url, enabled });
|
||||
});
|
||||
|
||||
renderBlacklistsList(blacklists);
|
||||
showNotification('success', '黑名单已更新');
|
||||
}
|
||||
|
||||
// 保存远程规则设置
|
||||
function saveRemoteSettings() {
|
||||
// 切换黑名单状态
|
||||
function toggleBlacklistStatus(index, enabled) {
|
||||
showNotification('info', enabled ? '黑名单已启用' : '黑名单已禁用');
|
||||
}
|
||||
|
||||
// 删除黑名单
|
||||
function deleteBlacklist(index) {
|
||||
if (!confirm('确定要删除这条黑名单吗?')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取所有黑名单
|
||||
const listItems = document.querySelectorAll('#blacklists-list .list-item');
|
||||
let blacklists = [];
|
||||
|
||||
listItems.forEach((item, idx) => {
|
||||
if (idx !== index) {
|
||||
const enabled = item.querySelector('.blacklist-enabled').checked;
|
||||
const name = item.querySelector('.list-title span').textContent;
|
||||
const url = item.querySelector('.list-description').textContent;
|
||||
blacklists.push({ name, URL: url, enabled });
|
||||
}
|
||||
});
|
||||
|
||||
renderBlacklistsList(blacklists);
|
||||
showNotification('success', '黑名单已删除');
|
||||
}
|
||||
|
||||
// 保存黑名单设置
|
||||
function saveBlacklistsSettings() {
|
||||
const updateInterval = parseInt(document.getElementById('update-interval').value);
|
||||
|
||||
// 验证更新间隔
|
||||
@@ -1966,11 +2110,16 @@ function loadRules() {
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取当前列表中的规则
|
||||
const ruleItems = document.querySelectorAll('.list-item');
|
||||
const remoteRules = Array.from(ruleItems).map(item =>
|
||||
item.querySelector('.list-description').textContent
|
||||
);
|
||||
// 获取当前黑名单列表
|
||||
const listItems = document.querySelectorAll('#blacklists-list .list-item');
|
||||
let blacklists = [];
|
||||
|
||||
listItems.forEach(item => {
|
||||
const enabled = item.querySelector('.blacklist-enabled').checked;
|
||||
const name = item.querySelector('.list-title span').textContent;
|
||||
const url = item.querySelector('.list-description').textContent;
|
||||
blacklists.push({ name, URL: url, enabled });
|
||||
});
|
||||
|
||||
fetch('/api/config', {
|
||||
method: 'POST',
|
||||
@@ -1979,7 +2128,7 @@ function loadRules() {
|
||||
},
|
||||
body: JSON.stringify({
|
||||
shield: {
|
||||
remoteRules: remoteRules,
|
||||
blacklists: blacklists,
|
||||
updateInterval: updateInterval
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user