Skip to content

Commit a271b51

Browse files
committed
Update changelog, improve documentation, and refine configuration settings
1 parent fd0ca27 commit a271b51

5 files changed

Lines changed: 63 additions & 99 deletions

File tree

changelog.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog
22

3-
- 同步 AdGuard Home v0.107.74
4-
- Sync with AdGuard Home v0.107.74
5-
- 新增 WebUI 配置界面 #61 (wTNTw)
6-
- New WebUI interface #61 (wTNTw)
3+
- 同步 AdGuard Home v0.107.76
4+
- Sync with AdGuard Home v0.107.76
5+
- 重写 WebUI 配置界面
6+
- Rewrite WebUI configuration page
7+
- 更新了默认配置文件 AdGuardHome.yaml
8+
- Updated default configuration file AdGuardHome.yaml
9+
- 恢复了 version.json
10+
- Restored version.json

docs/index.md

Lines changed: 42 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,50 @@
1212

1313
## 配置 (Configuration)
1414

15-
模块默认的 AdGuardHome 后台地址为 `http://127.0.0.1:3000`,可以通过浏览器直接访问,默认账号和密码均为 `root`
15+
### 1. AdGuardHome 核心后台
16+
模块默认的 AdGuardHome 后台地址为 `http://127.0.0.1:3000`(具体取决于 `AdGuardHome.yaml` 中的 `address` 配置),可以通过浏览器直接访问,默认账号和密码均为 `root`
1617

17-
在 AdGuardHome 后台,你可以执行以下操作:
18+
在核心后台,你可以执行以下操作:
19+
- 查看详细的 DNS 查询统计与过滤图表
20+
- 修改 DNS 上游、黑名单、DNSSEC 等高级配置
21+
- 管理客户端接入与规则订阅读取
1822

19-
- 查看 DNS 查询统计信息
20-
- 修改各种 DNS 配置
21-
- 查看日志
22-
- 添加自定义规则
23+
### 2. 模块管理页面 (Web UI)
24+
如果你使用的是 **KernelSU****APatch** 或支持 WebUI 的 **Magisk** 版本,可以通过点击模块列表中的“管理”按钮进入图形化配置界面。
2325

24-
如果你更倾向于使用app管理AdGuardHome,可以尝试使用 [AdGuard Home Manager](https://github.com/JGeek00/adguard-home-manager) 应用。
26+
在管理页面中,你可以:
27+
- **图形化修改配置**:直接调整 `settings.conf` 中的参数(如 iptables 开关、IPv6 拦截、运行用户组等),无需手动编辑文件。
28+
- **状态快览**:实时查看核心运行状态、PID 以及版本号,并可一键进入核心后台。
29+
- **服务控制**:支持一键“启动”、“停止”、“重启”核心服务。
30+
- **日志查看**:内置实时高亮的“核心日志”与“模块运行历史”查看器。
31+
- **维护工具**:支持一键导出调试日志,并可直接调用系统文件查看器打开生成的 `debug.log`
32+
33+
如果你更倾向于使用独立 App 管理 AdGuardHome 核心,可以尝试使用 [AdGuard Home Manager](https://github.com/JGeek00/adguard-home-manager) 应用。
2534

2635
---
2736

2837
## 模块控制 (Module Control)
2938

30-
模块的状态会实时显示在`module.prop`文件中,在root管理器中可以看到模块的状态信息(如果没刷新请手动刷新)
31-
32-
模块实时监测`/data/adb/modules/AdGuardHome`目录下的`disable`文件,如果存在则禁用模块,不存在则启用模块
39+
### 方法一:通过模块管理页面 (推荐)
40+
进入模块 Web UI 界面,点击顶部的“启动核心”或“停止核心”按钮即可完成控制。
3341

34-
如果你想用其他方法来启停,你可以在文件管理器中手动创建和删除文件,也可以使用shell命令
42+
### 方法二:通过配置文件标识 (Shell/文件管理器)
43+
模块实时监测`/data/adb/modules/AdGuardHome`目录下的`disable`文件:
44+
- 存在该文件则禁用模块
45+
- 不存在该文件则启用模块
3546

47+
你可以使用以下命令进行灵活切换:
3648
```shell
49+
# 停用
3750
touch /data/adb/modules/AdGuardHome/disable
51+
# 启用
52+
rm /data/adb/modules/AdGuardHome/disable
3853
```
3954

55+
此外,你也可以在 Shell 中直接调用工具脚本:
4056
```shell
41-
rm /data/adb/modules/AdGuardHome/disable
57+
/data/adb/agh/scripts/tool.sh start # 启动
58+
/data/adb/agh/scripts/tool.sh stop # 停止
4259
```
4360

4461
本模块可以分为两部分,一部分是 AdGuardHome 本身,它在本地搭建了一个可自定义拦截功能的 DNS 服务器,另一部分是 iptables 转发规则,它负责将本机所有53端口出口流量重定向到 AdGuardHome
@@ -51,34 +68,28 @@ rm /data/adb/modules/AdGuardHome/disable
5168

5269
### 日志文件说明
5370

71+
你可以直接在**模块管理页面 (Web UI)** 的“查看日志”分页中实时查看,也可以手动打开物理文件:
72+
5473
1. **`/data/adb/agh/history.log` (模块运行日志)**
55-
- **内容**:记录了模块的启动、停止、iptables 规则应用等操作的结果。
5674
- **用途**:排查“为什么模块显示已启动但没效果”或“为什么模块启动失败”。
75+
- **Web UI**:对应“运行历史”选项卡。
5776

5877
2. **`/data/adb/agh/bin.log` (核心服务日志)**
59-
- **内容**:AdGuardHome 二进制程序本身的输出,包括 Web 界面启动信息、DNS 引擎运行状态、证书加载错误等。
6078
- **用途**:排查“Web 界面打不开”、“DNS 解析报错”等程序本身的问题。
79+
- **Web UI**:对应“核心日志”选项卡。
6180

62-
3. **`/data/adb/agh/bin.log.bak`**
63-
- **内容**:上一次运行时的核心服务日志备份。
64-
65-
### 使用 debug.sh 收集信息
81+
### 导出与查看调试信息
6682

67-
如果你遇到了难以解决的问题,可以运行模块自带的调试脚本:
68-
69-
```shell
70-
sh /data/adb/agh/scripts/debug.sh
71-
```
83+
如果遇到疑难问题,建议使用维护工具:
7284

73-
- 该脚本会自动收集系统版本、架构、进程状态、防火墙规则 (iptables)、网络接口信息以及上述日志的摘要。
74-
- 所有信息将汇总输出到 **`/data/adb/agh/debug.log`**
75-
- 在反馈 Issue 时,提供此文件的内容能极大地帮助开发者定位问题。
85+
- **Web UI 操作**:在“维护中心”点击“生成调试日志”,完成后点击“本地打开日志”即可直接查看。
86+
- **Shell 操作**:执行 `sh /data/adb/agh/scripts/debug.sh`,信息将汇总至 `/data/adb/agh/debug.log`
7687

7788
### 常见状态标识 (显示在 Magisk/KSU 描述中)
7889

79-
- `🥰 Started...`: 模块及防火墙规则均已成功运行
80-
- `❌ Stopped`: 模块已正常停止
81-
- `😭 Error occurred...`: 启动过程中出现问题(如 AdGuardHome 闪退或防火墙应用失败),此时请检查 `history.log` `bin.log`
90+
- `🟢 [PID: xxx] 运行中...`: 核心及防火墙规则均已成功运行
91+
- `🔴 已停止`: 模块处于停止状态
92+
- `🔴 Error occurred / 应用 iptables 出错`: 启动过程中出现关键性错误,请通过 Web UI 或查看 `history.log` 排查
8293

8394
---
8495

@@ -88,63 +99,12 @@ sh /data/adb/agh/scripts/debug.sh
8899

89100
**代理应用**:如 [NekoBox](https://github.com/MatsuriDayo/NekoBoxForAndroid)[FlClash](https://github.com/chen08209/FlClash) 等。这些应用通常具有图形化界面,便于用户配置和管理代理规则。
90101

91-
以下是我自用的 FlClash 配置文件示例:
92-
93-
```yaml
94-
proxy-providers:
95-
provider1:
96-
type: http
97-
url: ""
98-
interval: 86400
99-
100-
provider2:
101-
type: http
102-
url: ""
103-
interval: 86400
104-
105-
proxy-groups:
106-
- name: PROXY
107-
type: select
108-
include-all: true
109-
110-
rules:
111-
proxy-groups:
112-
- name: PROXY
113-
type: select
114-
include-all: true
115-
116-
rules:
117-
- GEOSITE,private,DIRECT
118-
- GEOSITE,googlefcm,DIRECT
119-
- GEOSITE,bilibili,DIRECT
120-
- GEOSITE,onedrive,PROXY
121-
- GEOSITE,twitter,PROXY
122-
- GEOSITE,youtube,PROXY
123-
- GEOSITE,telegram,PROXY
124-
- GEOSITE,google,PROXY
125-
126-
- GEOSITE,microsoft@cn,DIRECT
127-
- GEOSITE,category-scholar-!cn,PROXY
128-
- GEOSITE,steam@cn,DIRECT
129-
- GEOSITE,category-games@cn,DIRECT
130-
- GEOSITE,geolocation-!cn,PROXY
131-
- GEOSITE,cn,DIRECT
132-
133-
- GEOIP,private,DIRECT,no-resolve
134-
- GEOIP,google,DIRECT
135-
- GEOIP,telegram,PROXY
136-
- GEOIP,cn,DIRECT
137-
138-
- MATCH,DIRECT
139-
140-
```
102+
这类软件可手动配置 DNS 部分,将域名解析服务器改为 127.0.0.1:5591 即可使用本地的 adgh 作为DNS服务器
141103

142-
没有写 DNS 部分是因为 FlClash 支持 DNS 覆写,在软件内就可配置 DNS 部分,将域名解析服务器改为 127.0.0.1:5591 即可使用本地的 adgh 作为DNS服务器
104+
代理应用的 `分应用代理/访问控制` 功能非常实用。通过将国内应用设置为绕过模式,可以减少不必要的流量经过代理,同时这些绕过的应用仍然能够正常屏蔽广告。
143105

144106
**代理模块**:如 [box_for_magisk](https://github.com/taamarin/box_for_magisk)[akashaProxy](https://github.com/akashaProxy/akashaProxy) 等。这些模块通常运行在系统层级,适合需要更高权限或更深度集成的场景。
145107

146-
代理应用的 `分应用代理/访问控制` 功能非常实用。通过将国内应用设置为绕过模式,可以减少不必要的流量经过代理,同时这些绕过的应用仍然能够正常屏蔽广告。
147-
148108
如果使用代理模块,强烈建议禁用模块的 iptables 转发规则。禁用后,模块仅运行 AdGuardHome 本身。随后,将代理模块的上游 DNS 服务器配置为 `127.0.0.1:5591`,即可确保代理软件的所有 DNS 查询通过 AdGuardHome 进行广告屏蔽。
149109

150110
```yaml

src/bin/AdGuardHome.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ http:
1010
- POST /dns-query/{ClientID}
1111
insecure_enabled: false
1212
address: 127.0.0.1:3000
13-
session_ttl: 720h
13+
session_ttl: 30d
1414
users:
1515
- name: root
1616
password: $2b$12$D3zeMIBFfzcQTqGqB.k7GOkMvqx1jgsrdiRCn2kwOHl.kNmmPfMom
@@ -30,8 +30,8 @@ dns:
3030
ratelimit_whitelist: []
3131
refuse_any: true
3232
upstream_dns:
33-
- https://doh.pub/dns-query
34-
- https://dns.alidns.com/dns-query
33+
- https://223.5.5.5/dns-query
34+
- https://1.12.12.12/dns-query
3535
upstream_dns_file: ""
3636
bootstrap_dns:
3737
- 119.29.29.29
@@ -40,8 +40,8 @@ dns:
4040
- 1.1.1.1
4141
- 8.8.8.8
4242
fallback_dns:
43-
- https://dns.google/dns-query
44-
- https://cloudflare-dns.com/dns-query
43+
- https://1.1.1.1/dns-query
44+
- https://8.8.8.8/dns-query
4545
upstream_mode: load_balance
4646
fastest_timeout: 1s
4747
allowed_clients: []
@@ -101,15 +101,15 @@ tls:
101101
querylog:
102102
dir_path: ""
103103
ignored: []
104-
interval: 24h
104+
interval: 1d
105105
size_memory: 1000
106106
enabled: true
107107
ignored_enabled: false
108108
file_enabled: true
109109
statistics:
110110
dir_path: ""
111111
ignored: []
112-
interval: 24h
112+
interval: 1d
113113
enabled: true
114114
ignored_enabled: false
115115
filters:

src/scripts/tool.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ start_adguardhome() {
3838
# check if iptables is enabled
3939
if [ "$enable_iptables" = true ]; then
4040
if $SCRIPT_DIR/iptables.sh enable; then
41-
log "🟢 [PID: $adg_pid] AdGuardHome is running (iptables: enabled)" "🟢 [PID: $adg_pid] AdGuardHome 运行中 (Iptables: 已启用)"
42-
update_description "🟢 [PID: $adg_pid] Running (Iptables: ON)" "🟢 [PID: $adg_pid] 运行中 (Iptables: 开启)"
41+
log "🟢 [PID: $adg_pid] AdGuardHome is running (iptables: enabled)" "🟢 [PID: $adg_pid] AdGuardHome 运行中 (iptables: 已启用)"
42+
update_description "🟢 [PID: $adg_pid] Running (iptables: ON)" "🟢 [PID: $adg_pid] 运行中 (iptables: 开启)"
4343
else
4444
log "😭 Error occurred applying iptables" "😭 应用 iptables 规则时出错"
45-
update_description "🔴 Error applying iptables" "🔴 应用 Iptables 出错"
45+
update_description "🔴 Error applying iptables" "🔴 应用 iptables 出错"
4646
$SCRIPT_DIR/iptables.sh disable
4747
exit 1
4848
fi
4949
else
50-
log "🟢 [PID: $adg_pid] AdGuardHome is running (iptables: disabled)" "🟢 [PID: $adg_pid] AdGuardHome 运行中 (Iptables: 已禁用)"
51-
update_description "🟢 [PID: $adg_pid] Running (Iptables: OFF)" "🟢 [PID: $adg_pid] 运行中 (Iptables: 关闭)"
50+
log "🟢 [PID: $adg_pid] AdGuardHome is running (iptables: disabled)" "🟢 [PID: $adg_pid] AdGuardHome 运行中 (iptables: 已禁用)"
51+
update_description "🟢 [PID: $adg_pid] Running (iptables: OFF)" "🟢 [PID: $adg_pid] 运行中 (iptables: 关闭)"
5252
fi
5353
else
5454
log "😭 Error occurred, check logs for details" "😭 出现错误,请检查日志以获取详细信息"

src/webroot/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<h3>流量重定向</h3>
6969
<div class="setting-row" style="display:flex; justify-content: space-between; align-items: center; margin-bottom: 12px;">
7070
<div>
71-
<div style="font-weight: 600;">启用 Iptables</div>
71+
<div style="font-weight: 600;">启用 iptables</div>
7272
<div style="font-size: 0.75rem; color: var(--t3)">自动在系统层面重定向 DNS 流量</div>
7373
</div>
7474
<input type="checkbox" id="conf-enable_iptables" style="width: 20px; height: 20px; accent-color: var(--ac);">

0 commit comments

Comments
 (0)