日志查询界面增加操作列,修复责增加删除规则不生效的问题,修复自定义规则优先级问题

This commit is contained in:
Alex Yang
2025-12-21 21:18:17 +08:00
parent b67a0fad8e
commit 1f8bd6b97f
14 changed files with 1467 additions and 169 deletions

15
main.go
View File

@@ -37,9 +37,16 @@ func createDefaultConfig(configFile string) error {
"223.5.5.5:53",
"223.6.6.6:53"
],
"dnssecUpstreamDNS": [
"8.8.8.8:53",
"1.1.1.1:53"
],
"timeout": 5000,
"statsFile": "./data/stats.json",
"saveInterval": 300
"saveInterval": 300,
"cacheTTL": 30,
"enableDNSSEC": true,
"queryMode": "parallel"
},
"http": {
"port": 8080,
@@ -114,10 +121,10 @@ func createRequiredFiles(cfg *config.Config) error {
}
}
// 创建本地规则文件
// 创建自定义规则文件
if _, err := os.Stat(cfg.Shield.LocalRulesFile); os.IsNotExist(err) {
if err := os.WriteFile(cfg.Shield.LocalRulesFile, []byte("# 本地规则文件\n# 格式:域名\n# 例如example.com\n"), 0644); err != nil {
return fmt.Errorf("创建本地规则文件失败: %w", err)
if err := os.WriteFile(cfg.Shield.LocalRulesFile, []byte("# 自定义规则文件\n# 格式:域名\n# 例如example.com\n"), 0644); err != nil {
return fmt.Errorf("创建自定义规则文件失败: %w", err)
}
}