Skip to content

Commit

Permalink
documentation: Add new rule item types
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Nov 11, 2024
1 parent c59f282 commit d8e66b9
Show file tree
Hide file tree
Showing 11 changed files with 753 additions and 36 deletions.
43 changes: 42 additions & 1 deletion docs/configuration/dns/rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ icon: material/new-box
:material-alert: [server](#server)
:material-alert: [disable_cache](#disable_cache)
:material-alert: [rewrite_ttl](#rewrite_ttl)
:material-alert: [client_subnet](#client_subnet)
:material-alert: [client_subnet](#client_subnet)
:material-plus: [network_type](#network_type)
:material-plus: [network_is_expensive](#network_is_expensive)
:material-plus: [network_is_constrained](#network_is_constrained)

!!! quote "Changes in sing-box 1.10.0"

Expand Down Expand Up @@ -125,6 +128,11 @@ icon: material/new-box
1000
],
"clash_mode": "direct",
"network_type": [
"wifi"
],
"network_is_expensive": false,
"network_is_constrained": false,
"wifi_ssid": [
"My WIFI"
],
Expand Down Expand Up @@ -310,6 +318,39 @@ Match user id.

Match Clash mode.

#### network_type

!!! question "Since sing-box 1.11.0"

!!! quote ""

Only supported in graphical clients on Android and Apple platforms.

Match network type.

Available values: `wifi`, `cellular`, `ethernet` and `other`.

#### network_is_expensive

!!! question "Since sing-box 1.11.0"

!!! quote ""

Only supported in graphical clients on Android and Apple platforms.

Match if network is considered Metered (on Android) or considered expensive,
such as Cellular or a Personal Hotspot (on Apple platforms).

#### network_is_constrained

!!! question "Since sing-box 1.11.0"

!!! quote ""

Only supported in graphical clients on Apple platforms.

Match if network is in Low Data Mode.

#### wifi_ssid

!!! quote ""
Expand Down
91 changes: 74 additions & 17 deletions docs/configuration/dns/rule.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
icon: material/new-box
---

!!! quote "sing-box 1.11.0 中的更改"

:material-plus: [action](#action)
:material-alert: [server](#server)
:material-alert: [disable_cache](#disable_cache)
:material-alert: [rewrite_ttl](#rewrite_ttl)
:material-alert: [client_subnet](#client_subnet)
:material-plus: [network_type](#network_type)
:material-plus: [network_is_expensive](#network_is_expensive)
:material-plus: [network_is_constrained](#network_is_constrained)

!!! quote "sing-box 1.10.0 中的更改"

:material-delete-clock: [rule_set_ipcidr_match_source](#rule_set_ipcidr_match_source)
Expand Down Expand Up @@ -117,6 +128,11 @@ icon: material/new-box
1000
],
"clash_mode": "direct",
"network_type": [
"wifi"
],
"network_is_expensive": false,
"network_is_constrained": false,
"wifi_ssid": [
"My WIFI"
],
Expand All @@ -135,17 +151,15 @@ icon: material/new-box
"outbound": [
"direct"
],
"server": "local",
"disable_cache": false,
"client_subnet": "127.0.0.1/24"
"action": "route",
"server": "local"
},
{
"type": "logical",
"mode": "and",
"rules": [],
"server": "local",
"disable_cache": false,
"client_subnet": "127.0.0.1/24"
"action": "route",
"server": "local"
}
]
}
Expand Down Expand Up @@ -304,6 +318,39 @@ DNS 查询类型。值可以为整数或者类型名称字符串。

匹配 Clash 模式。

#### network_type

!!! question "自 sing-box 1.11.0 起"

!!! quote ""

仅在 Android 与 Apple 平台图形客户端中支持。

匹配网络类型。

Available values: `wifi`, `cellular`, `ethernet` and `other`.

#### network_is_expensive

!!! question "自 sing-box 1.11.0 起"

!!! quote ""

仅在 Android 与 Apple 平台图形客户端中支持。

匹配如果网络被视为计费 (在 Android) 或被视为昂贵,
像蜂窝网络或个人热点 (在 Apple 平台)。

#### network_is_constrained

!!! question "自 sing-box 1.11.0 起"

!!! quote ""

仅在 Apple 平台图形客户端中支持。

匹配如果网络在低数据模式下。

#### wifi_ssid

!!! quote ""
Expand Down Expand Up @@ -352,29 +399,35 @@ DNS 查询类型。值可以为整数或者类型名称字符串。

`any` 可作为值用于匹配任意出站。

#### server
#### action

==必填==

目标 DNS 服务器的标签。
参阅 [规则动作](../rule_action/)

#### server

!!! failure "已在 sing-box 1.11.0 废弃"

已移动到 [DNS 规则动作](../rule_action#route).

#### disable_cache

在此查询中禁用缓存。
!!! failure "已在 sing-box 1.11.0 废弃"

已移动到 [DNS 规则动作](../rule_action#route).

#### rewrite_ttl

重写 DNS 回应中的 TTL。
!!! failure "已在 sing-box 1.11.0 废弃"

#### client_subnet
已移动到 [DNS 规则动作](../rule_action#route).

!!! question "自 sing-box 1.9.0 起"

默认情况下,将带有指定 IP 前缀的 `edns0-subnet` OPT 附加记录附加到每个查询。
#### client_subnet

如果值是 IP 地址而不是前缀,则会自动附加 `/32``/128`
!!! failure "已在 sing-box 1.11.0 废弃"

将覆盖 `dns.client_subnet``servers.[].client_subnet`
已移动到 [DNS 规则动作](../rule_action#route).

### 地址筛选字段

Expand Down Expand Up @@ -420,8 +473,12 @@ DNS 查询类型。值可以为整数或者类型名称字符串。

#### mode

==必填==

`and``or`

#### rules

包括的规则。
==必填==

包括的规则。
43 changes: 42 additions & 1 deletion docs/configuration/route/rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ icon: material/new-box
!!! quote "Changes in sing-box 1.11.0"

:material-plus: [action](#action)
:material-alert: [outbound](#outbound)
:material-alert: [outbound](#outbound)
:material-plus: [network_type](#network_type)
:material-plus: [network_is_expensive](#network_is_expensive)
:material-plus: [network_is_constrained](#network_is_constrained)

!!! quote "Changes in sing-box 1.10.0"

Expand Down Expand Up @@ -120,6 +123,11 @@ icon: material/new-box
1000
],
"clash_mode": "direct",
"network_type": [
"wifi"
],
"network_is_expensive": false,
"network_is_constrained": false,
"wifi_ssid": [
"My WIFI"
],
Expand Down Expand Up @@ -322,6 +330,39 @@ Match user id.

Match Clash mode.

#### network_type

!!! question "Since sing-box 1.11.0"

!!! quote ""

Only supported in graphical clients on Android and Apple platforms.

Match network type.

Available values: `wifi`, `cellular`, `ethernet` and `other`.

#### network_is_expensive

!!! question "Since sing-box 1.11.0"

!!! quote ""

Only supported in graphical clients on Android and Apple platforms.

Match if network is considered Metered (on Android) or considered expensive,
such as Cellular or a Personal Hotspot (on Apple platforms).

#### network_is_constrained

!!! question "Since sing-box 1.11.0"

!!! quote ""

Only supported in graphical clients on Apple platforms.

Match if network is in Low Data Mode.

#### wifi_ssid

!!! quote ""
Expand Down
50 changes: 45 additions & 5 deletions docs/configuration/route/rule.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ icon: material/new-box
!!! quote "sing-box 1.11.0 中的更改"

:material-plus: [action](#action)
:material-alert: [outbound](#outbound)
:material-alert: [outbound](#outbound)
:material-plus: [network_type](#network_type)
:material-plus: [network_is_expensive](#network_is_expensive)
:material-plus: [network_is_constrained](#network_is_constrained)

!!! quote "sing-box 1.10.0 中的更改"

:material-plus: [client](#client)
:material-delete-clock: [rule_set_ipcidr_match_source](#rule_set_ipcidr_match_source)
:material-plus: [process_path_regex](#process_path_regex)


!!! quote "sing-box 1.8.0 中的更改"

:material-plus: [rule_set](#rule_set)
Expand Down Expand Up @@ -118,6 +120,11 @@ icon: material/new-box
1000
],
"clash_mode": "direct",
"network_type": [
"wifi"
],
"network_is_expensive": false,
"network_is_constrained": false,
"wifi_ssid": [
"My WIFI"
],
Expand Down Expand Up @@ -153,7 +160,7 @@ icon: material/new-box

当内容只有一项时,可以忽略 JSON 数组 [] 标签。

### Default Fields
### 默认字段

!!! note ""

Expand Down Expand Up @@ -320,6 +327,39 @@ icon: material/new-box

匹配 Clash 模式。

#### network_type

!!! question "自 sing-box 1.11.0 起"

!!! quote ""

仅在 Android 与 Apple 平台图形客户端中支持。

匹配网络类型。

Available values: `wifi`, `cellular`, `ethernet` and `other`.

#### network_is_expensive

!!! question "自 sing-box 1.11.0 起"

!!! quote ""

仅在 Android 与 Apple 平台图形客户端中支持。

匹配如果网络被视为计费 (在 Android) 或被视为昂贵,
像蜂窝网络或个人热点 (在 Apple 平台)。

#### network_is_constrained

!!! question "自 sing-box 1.11.0 起"

!!! quote ""

仅在 Apple 平台图形客户端中支持。

匹配如果网络在低数据模式下。

#### wifi_ssid

!!! quote ""
Expand Down Expand Up @@ -366,13 +406,13 @@ icon: material/new-box

==必填==

参阅 [规则行动](../rule_action/)
参阅 [规则动作](../rule_action/)

#### outbound

!!! failure "已在 sing-box 1.11.0 废弃"

已移动到 [规则行动](../rule_action#route).
已移动到 [规则动作](../rule_action#route).

### 逻辑字段

Expand Down
Loading

0 comments on commit d8e66b9

Please sign in to comment.