Skip to content

Commit

Permalink
documentation: Merge route options to route actions
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Nov 11, 2024
1 parent 4638d3c commit 0fa3b46
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 180 deletions.
32 changes: 13 additions & 19 deletions docs/configuration/dns/rule_action.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ icon: material/new-box
{
"action": "route", // default
"server": "",

// for compatibility
"disable_cache": false,
"rewrite_ttl": 0,
"client_subnet": null
Expand All @@ -28,23 +26,6 @@ icon: material/new-box

Tag of target server.

#### disable_cache/rewrite_ttl/client_subnet

!!! failure "Deprecated in sing-box 1.11.0"

Legacy route options is deprecated and will be removed in sing-box 1.12.0, check [Migration](/migration/#migrate-legacy-dns-route-options-to-rule-actions).

### route-options

```json
{
"action": "route-options",
"disable_cache": false,
"rewrite_ttl": null,
"client_subnet": null
}
```

#### disable_cache

Disable cache and save cache in this query.
Expand All @@ -61,6 +42,19 @@ If value is an IP address instead of prefix, `/32` or `/128` will be appended au

Will overrides `dns.client_subnet` and `servers.[].client_subnet`.

### route-options

```json
{
"action": "route-options",
"disable_cache": false,
"rewrite_ttl": null,
"client_subnet": null
}
```

`route-options` set options for routing.

### reject

```json
Expand Down
31 changes: 13 additions & 18 deletions docs/configuration/dns/rule_action.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,6 @@ icon: material/new-box

目标 DNS 服务器的标签。

#### disable_cache/rewrite_ttl/client_subnet

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

旧的路由选项已弃用,且将在 sing-box 1.12.0 中移除,参阅 [迁移指南](/migration/#migrate-legacy-dns-route-options-to-rule-actions).

### route-options

```json
{
"action": "route-options",
"disable_cache": false,
"rewrite_ttl": null,
"client_subnet": null
}
```


#### disable_cache

在此查询中禁用缓存。
Expand All @@ -62,6 +44,19 @@ icon: material/new-box

将覆盖 `dns.client_subnet``servers.[].client_subnet`

### route-options

```json
{
"action": "route-options",
"disable_cache": false,
"rewrite_ttl": null,
"client_subnet": null
}
```

`route-options` 为路由设置选项。

### reject

```json
Expand Down
28 changes: 15 additions & 13 deletions docs/configuration/route/rule_action.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ icon: material/new-box
```json
{
"action": "route", // default
"outbound": ""
"outbound": "",
"udp_disable_domain_unmapping": false,
"udp_connect": false
}
```

Expand All @@ -25,18 +27,6 @@ icon: material/new-box

Tag of target outbound.

### route-options

```json
{
"action": "route-options",
"udp_disable_domain_unmapping": false,
"udp_connect": false
}
```

`route-options` set options for routing.

#### udp_disable_domain_unmapping

If enabled, for UDP proxy requests addressed to a domain,
Expand All @@ -49,6 +39,18 @@ do not support receiving UDP packets with domain addresses, such as Surge.

If enabled, attempts to connect UDP connection to the destination instead of listen.

### route-options

```json
{
"action": "route-options",
"udp_disable_domain_unmapping": false,
"udp_connect": false
}
```

`route-options` set options for routing.

### reject

```json
Expand Down
25 changes: 14 additions & 11 deletions docs/configuration/route/rule_action.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ icon: material/new-box
{
"action": "route", // 默认
"outbound": "",
"udp_disable_domain_unmapping": false
"udp_disable_domain_unmapping": false,
"udp_connect": false
}
```

Expand All @@ -26,16 +27,6 @@ icon: material/new-box

目标出站的标签。

### route-options

```json
{
"action": "route-options",
"udp_disable_domain_unmapping": false,
"udp_connect": false
}
```

#### udp_disable_domain_unmapping

如果启用,对于地址为域的 UDP 代理请求,将在响应中发送原始包地址而不是映射的域。
Expand All @@ -46,6 +37,18 @@ icon: material/new-box

如果启用,将尝试将 UDP 连接 connect 到目标而不是 listen。

### route-options

```json
{
"action": "route-options",
"udp_disable_domain_unmapping": false,
"udp_connect": false
}
```

`route-options` 为路由设置选项。

### reject

```json
Expand Down
8 changes: 0 additions & 8 deletions docs/deprecated.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ check [Migration](../migration/#migrate-legacy-inbound-fields-to-rule-actions).

Old fields will be removed in sing-box 1.13.0.

#### Legacy DNS route options

Legacy DNS route options (`disable_cache`, `rewrite_ttl`, `client_subnet`) are deprecated
and can be replaced by rule actions,
check [Migration](../migration/#migrate-legacy-dns-route-options-to-rule-actions).

Old fields will be removed in sing-box 1.12.0.

## 1.10.0

#### TUN address fields are merged
Expand Down
7 changes: 0 additions & 7 deletions docs/deprecated.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ icon: material/delete-alert

旧字段将在 sing-box 1.13.0 中被移除。

#### 旧的 DNS 路由参数

旧的 DNS 路由参数(`disable_cache``rewrite_ttl``client_subnet`)已废弃且可以通过规则动作替代,
参阅 [迁移指南](/migration/#migrate-legacy-dns-route-options-to-rule-actions)

旧字段将在 sing-box 1.12.0 中被移除。

## 1.10.0

#### Match source 规则项已重命名
Expand Down
52 changes: 0 additions & 52 deletions docs/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,58 +156,6 @@ Inbound fields are deprecated and can be replaced by rule actions.
}
```

### Migrate legacy DNS route options to rule actions

Legacy DNS route options are deprecated and can be replaced by rule actions.

!!! info "References"

[DNS Rule](/configuration/dns/rule/) /
[DNS Rule Action](/configuration/dns/rule_action/)

=== ":material-card-remove: Deprecated"

```json
{
"dns": {
"rules": [
{
...,
"server": "local",
"disable_cache": true,
"rewrite_ttl": 600,
"client_subnet": "1.1.1.1/24"
}
]
}
}
```

=== ":material-card-multiple: New"

```json
{
"dns": {
"rules": [
{
...,
"action": "route-options",
"disable_cache": true,
"rewrite_ttl": 600,
"client_subnet": "1.1.1.1/24"
},
{
...,
"server": "local"
}
]
}
}
```

## 1.10.0

### TUN address fields are merged
Expand Down
52 changes: 0 additions & 52 deletions docs/migration.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,58 +156,6 @@ icon: material/arrange-bring-forward
}
```

### 迁移旧的 DNS 路由选项到规则动作

旧的 DNS 路由选项已被弃用,且可以被规则动作替代。

!!! info "参考"

[DNS 规则](/zh/configuration/dns/rule/) /
[DNS 规则动作](/zh/configuration/dns/rule_action/)

=== ":material-card-remove: 弃用的"

```json
{
"dns": {
"rules": [
{
...,
"server": "local",
"disable_cache": true,
"rewrite_ttl": 600,
"client_subnet": "1.1.1.1/24"
}
]
}
}
```

=== ":material-card-multiple: 新的"

```json
{
"dns": {
"rules": [
{
...,
"action": "route-options",
"disable_cache": true,
"rewrite_ttl": 600,
"client_subnet": "1.1.1.1/24"
},
{
...,
"server": "local"
}
]
}
}
```

## 1.10.0

### TUN 地址字段已合并
Expand Down

0 comments on commit 0fa3b46

Please sign in to comment.