From bf9e2404918314c2475030b6c1c1e983fa4f6094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Mon, 11 Nov 2024 17:24:15 +0800 Subject: [PATCH] documentation: Merge route options to route actions --- docs/configuration/dns/rule_action.md | 32 ++++++------- docs/configuration/dns/rule_action.zh.md | 31 ++++++------- docs/configuration/route/rule_action.md | 28 ++++++------ docs/configuration/route/rule_action.zh.md | 25 ++++++----- docs/deprecated.md | 8 ---- docs/deprecated.zh.md | 7 --- docs/migration.md | 52 ---------------------- docs/migration.zh.md | 52 ---------------------- 8 files changed, 55 insertions(+), 180 deletions(-) diff --git a/docs/configuration/dns/rule_action.md b/docs/configuration/dns/rule_action.md index 8943b653..cccc1396 100644 --- a/docs/configuration/dns/rule_action.md +++ b/docs/configuration/dns/rule_action.md @@ -12,8 +12,6 @@ icon: material/new-box { "action": "route", // default "server": "", - - // for compatibility "disable_cache": false, "rewrite_ttl": 0, "client_subnet": null @@ -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. @@ -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 diff --git a/docs/configuration/dns/rule_action.zh.md b/docs/configuration/dns/rule_action.zh.md index 8a9dc07e..8fad2381 100644 --- a/docs/configuration/dns/rule_action.zh.md +++ b/docs/configuration/dns/rule_action.zh.md @@ -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 在此查询中禁用缓存。 @@ -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 diff --git a/docs/configuration/route/rule_action.md b/docs/configuration/route/rule_action.md index 843d7563..7804f586 100644 --- a/docs/configuration/route/rule_action.md +++ b/docs/configuration/route/rule_action.md @@ -13,7 +13,9 @@ icon: material/new-box ```json { "action": "route", // default - "outbound": "" + "outbound": "", + "udp_disable_domain_unmapping": false, + "udp_connect": false } ``` @@ -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, @@ -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 diff --git a/docs/configuration/route/rule_action.zh.md b/docs/configuration/route/rule_action.zh.md index ae16d85f..103a04bd 100644 --- a/docs/configuration/route/rule_action.zh.md +++ b/docs/configuration/route/rule_action.zh.md @@ -14,7 +14,8 @@ icon: material/new-box { "action": "route", // 默认 "outbound": "", - "udp_disable_domain_unmapping": false + "udp_disable_domain_unmapping": false, + "udp_connect": false } ``` @@ -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 代理请求,将在响应中发送原始包地址而不是映射的域。 @@ -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 diff --git a/docs/deprecated.md b/docs/deprecated.md index f057319a..d57c93ad 100644 --- a/docs/deprecated.md +++ b/docs/deprecated.md @@ -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 diff --git a/docs/deprecated.zh.md b/docs/deprecated.zh.md index 2f7b28f7..76a426d2 100644 --- a/docs/deprecated.zh.md +++ b/docs/deprecated.zh.md @@ -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 规则项已重命名 diff --git a/docs/migration.md b/docs/migration.md index 9207db5b..8f01c4f0 100644 --- a/docs/migration.md +++ b/docs/migration.md @@ -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 diff --git a/docs/migration.zh.md b/docs/migration.zh.md index f51860f7..dc62f370 100644 --- a/docs/migration.zh.md +++ b/docs/migration.zh.md @@ -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 地址字段已合并