From 25810b50c10a63fd2c53f22a950d3dc06fe746a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Sun, 3 Dec 2023 14:53:22 +0800 Subject: [PATCH] Update documentation --- docs/changelog.md | 1 - docs/configuration/dns/rule.zh.md | 4 +- docs/configuration/dns/server.md | 10 +- docs/configuration/dns/server.zh.md | 10 +- .../experimental/cache-file.zh.md | 32 +++ docs/configuration/experimental/clash-api.md | 9 +- .../experimental/clash-api.zh.md | 112 ++++++++++ docs/configuration/experimental/index.zh.md | 30 +++ docs/configuration/experimental/v2ray-api.md | 6 +- .../experimental/v2ray-api.zh.md | 50 +++++ docs/configuration/inbound/hysteria.md | 4 - docs/configuration/inbound/hysteria.zh.md | 4 - docs/configuration/inbound/hysteria2.md | 4 - docs/configuration/inbound/hysteria2.zh.md | 4 - docs/configuration/inbound/naive.md | 4 - docs/configuration/inbound/naive.zh.md | 4 - docs/configuration/inbound/tuic.md | 4 - docs/configuration/inbound/tuic.zh.md | 4 - docs/configuration/inbound/tun.md | 2 +- docs/configuration/inbound/tun.zh.md | 2 +- docs/configuration/outbound/hysteria.md | 4 - docs/configuration/outbound/hysteria.zh.md | 4 - docs/configuration/outbound/hysteria2.md | 4 - docs/configuration/outbound/hysteria2.zh.md | 4 - docs/configuration/outbound/index.md | 5 +- docs/configuration/outbound/index.zh.md | 5 +- docs/configuration/outbound/shadowsocksr.md | 106 ---------- .../configuration/outbound/shadowsocksr.zh.md | 106 ---------- docs/configuration/outbound/tor.md | 2 +- docs/configuration/outbound/tor.zh.md | 2 +- docs/configuration/outbound/tuic.md | 4 - docs/configuration/outbound/tuic.zh.md | 4 - docs/configuration/outbound/wireguard.md | 8 - docs/configuration/outbound/wireguard.zh.md | 8 - docs/configuration/route/geoip.zh.md | 41 ++++ docs/configuration/route/geosite.zh.md | 41 ++++ docs/configuration/route/rule.zh.md | 6 +- docs/configuration/shared/tls.md | 20 -- docs/configuration/shared/tls.zh.md | 21 -- docs/configuration/shared/v2ray-transport.md | 6 +- .../shared/v2ray-transport.zh.md | 6 +- docs/deprecated.md | 32 ++- docs/deprecated.zh.md | 29 ++- docs/installation/build-from-source.md | 2 +- docs/installation/build-from-source.zh.md | 63 ++++++ docs/installation/docker.zh.md | 31 +++ docs/installation/package-manager.zh.md | 90 ++++++++ docs/migration.md | 8 +- docs/migration.zh.md | 193 ++++++++++++++++++ mkdocs.yml | 1 + 50 files changed, 768 insertions(+), 388 deletions(-) create mode 100644 docs/configuration/experimental/cache-file.zh.md create mode 100644 docs/configuration/experimental/clash-api.zh.md create mode 100644 docs/configuration/experimental/index.zh.md create mode 100644 docs/configuration/experimental/v2ray-api.zh.md delete mode 100644 docs/configuration/outbound/shadowsocksr.md delete mode 100644 docs/configuration/outbound/shadowsocksr.zh.md create mode 100644 docs/configuration/route/geoip.zh.md create mode 100644 docs/configuration/route/geosite.zh.md create mode 100644 docs/installation/build-from-source.zh.md create mode 100644 docs/installation/docker.zh.md create mode 100644 docs/installation/package-manager.zh.md create mode 100644 docs/migration.zh.md diff --git a/docs/changelog.md b/docs/changelog.md index b6160e49..02269b20 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,7 +2,6 @@ icon: material/alert-decagram --- -# ChangeLog #### 1.7.8 diff --git a/docs/configuration/dns/rule.zh.md b/docs/configuration/dns/rule.zh.md index e6c407dc..5b1d7501 100644 --- a/docs/configuration/dns/rule.zh.md +++ b/docs/configuration/dns/rule.zh.md @@ -183,7 +183,7 @@ DNS 查询类型。值可以为整数或者类型名称字符串。 !!! failure "已在 sing-box 1.8.0 废弃" - Geosite 已废弃且可能在不久的将来移除,参阅 [迁移指南](/migration/#migrate-geosite-to-rule-sets)。 + Geosite 已废弃且可能在不久的将来移除,参阅 [迁移指南](/zh/migration/#geosite)。 匹配 Geosite。 @@ -191,7 +191,7 @@ DNS 查询类型。值可以为整数或者类型名称字符串。 !!! failure "已在 sing-box 1.8.0 废弃" - GeoIp 已废弃且可能在不久的将来移除,参阅 [迁移指南](/migration/#migrate-geoip-to-rule-sets)。 + GeoIP 已废弃且可能在不久的将来移除,参阅 [迁移指南](/zh/migration/#geoip)。 匹配源 GeoIP。 diff --git a/docs/configuration/dns/server.md b/docs/configuration/dns/server.md index e408b804..545810bf 100644 --- a/docs/configuration/dns/server.md +++ b/docs/configuration/dns/server.md @@ -45,20 +45,12 @@ The address of the dns server. !!! warning "" - To ensure that system DNS is in effect, rather than Go's built-in default resolver, enable CGO at compile time. - -!!! warning "" - - QUIC and HTTP3 transport is not included by default, see [Installation](./#installation). + To ensure that Android system DNS is in effect, rather than Go's built-in default resolver, enable CGO at compile time. !!! info "" the RCode transport is often used to block queries. Use with rules and the `disable_cache` rule option. -!!! warning "" - - DHCP transport is not included by default, see [Installation](./#installation). - | RCode | Description | |-------------------|-----------------------| | `success` | `No error` | diff --git a/docs/configuration/dns/server.zh.md b/docs/configuration/dns/server.zh.md index 4ce8c01d..36bcde5d 100644 --- a/docs/configuration/dns/server.zh.md +++ b/docs/configuration/dns/server.zh.md @@ -45,20 +45,12 @@ DNS 服务器的地址。 !!! warning "" - 为了确保系统 DNS 生效,而不是 Go 的内置默认解析器,请在编译时启用 CGO。 - -!!! warning "" - - 默认安装不包含 QUIC 和 HTTP3 传输层,请参阅 [安装](/zh/#_2)。 + 为了确保 Android 系统 DNS 生效,而不是 Go 的内置默认解析器,请在编译时启用 CGO。 !!! info "" RCode 传输层传输层常用于屏蔽请求. 与 DNS 规则和 `disable_cache` 规则选项一起使用。 -!!! warning "" - - 默认安装不包含 DHCP 传输层,请参阅 [安装](/zh/#_2)。 - | RCode | 描述 | |-------------------|----------| | `success` | `无错误` | diff --git a/docs/configuration/experimental/cache-file.zh.md b/docs/configuration/experimental/cache-file.zh.md new file mode 100644 index 00000000..f4417ede --- /dev/null +++ b/docs/configuration/experimental/cache-file.zh.md @@ -0,0 +1,32 @@ +--- +icon: material/new-box +--- + +!!! question "自 sing-box 1.8.0 起" + +### 结构 + +```json +{ + "enabled": true, + "path": "", + "cache_id": "", + "store_fakeip": false +} +``` + +### 字段 + +#### enabled + +启用缓存文件。 + +#### path + +缓存文件路径,默认使用`cache.db`。 + +#### cache_id + +缓存文件中的标识符。 + +如果不为空,配置特定的数据将使用由其键控的单独存储。 diff --git a/docs/configuration/experimental/clash-api.md b/docs/configuration/experimental/clash-api.md index a06fe154..0525d14d 100644 --- a/docs/configuration/experimental/clash-api.md +++ b/docs/configuration/experimental/clash-api.md @@ -10,11 +10,6 @@ icon: material/alert-decagram :material-delete-alert: [cache_file](#cache_file) :material-delete-alert: [cache_id](#cache_id) - -!!! quote "" - - Clash API is not included by default, see [Installation](./#installation). - ### Structure ```json @@ -48,8 +43,6 @@ A relative path to the configuration directory or an absolute path to a directory in which you put some static web resource. sing-box will then serve it at `http://{{external-controller}}/ui`. - - #### external_ui_download_url ZIP download URL for the external UI, will be used if the specified `external_ui` directory is empty. @@ -118,4 +111,4 @@ Cache file path, `cache.db` will be used if empty. Identifier in cache file. -If not empty, configuration specified data will use a separate store keyed by it. \ No newline at end of file +If not empty, configuration specified data will use a separate store keyed by it. diff --git a/docs/configuration/experimental/clash-api.zh.md b/docs/configuration/experimental/clash-api.zh.md new file mode 100644 index 00000000..5a490e58 --- /dev/null +++ b/docs/configuration/experimental/clash-api.zh.md @@ -0,0 +1,112 @@ +--- +icon: material/alert-decagram +--- + +!!! quote "sing-box 1.8.0 中的更改" + + :material-delete-alert: [store_mode](#store_mode) + :material-delete-alert: [store_selected](#store_selected) + :material-delete-alert: [store_fakeip](#store_fakeip) + :material-delete-alert: [cache_file](#cache_file) + :material-delete-alert: [cache_id](#cache_id) + +### 结构 + +```json +{ + "external_controller": "127.0.0.1:9090", + "external_ui": "", + "external_ui_download_url": "", + "external_ui_download_detour": "", + "secret": "", + "default_mode": "", + + // Deprecated + + "store_mode": false, + "store_selected": false, + "store_fakeip": false, + "cache_file": "", + "cache_id": "" +} +``` + +### Fields + +#### external_controller + +RESTful web API 监听地址。如果为空,则禁用 Clash API。 + +#### external_ui + +到静态网页资源目录的相对路径或绝对路径。sing-box 会在 `http://{{external-controller}}/ui` 下提供它。 + +#### external_ui_download_url + +静态网页资源的 ZIP 下载 URL,如果指定的 `external_ui` 目录为空,将使用。 + +默认使用 `https://github.com/MetaCubeX/Yacd-meta/archive/gh-pages.zip`。 + +#### external_ui_download_detour + +用于下载静态网页资源的出站的标签。 + +如果为空,将使用默认出站。 + +#### secret + +RESTful API 的密钥(可选) +通过指定 HTTP 标头 `Authorization: Bearer ${secret}` 进行身份验证 +如果 RESTful API 正在监听 0.0.0.0,请始终设置一个密钥。 + +#### default_mode + +Clash 中的默认模式,默认使用 `Rule`。 + +此设置没有直接影响,但可以通过 `clash_mode` 规则项在路由和 DNS 规则中使用。 + +#### store_mode + +!!! failure "已在 sing-box 1.8.0 废弃" + + `store_mode` 已在 Clash API 中废弃,且默认启用当 `cache_file.enabled`。 + +将 Clash 模式存储在缓存文件中。 + +#### store_selected + +!!! failure "已在 sing-box 1.8.0 废弃" + + `store_selected` 已在 Clash API 中废弃,且默认启用当 `cache_file.enabled`。 + +!!! note "" + + 必须为目标出站设置标签。 + +将 `Selector` 中出站的选定的目标出站存储在缓存文件中。 + +#### store_fakeip + +!!! failure "已在 sing-box 1.8.0 废弃" + + `store_selected` 已在 Clash API 中废弃,且已迁移到 `cache_file.store_fakeip`。 + +将 fakeip 存储在缓存文件中。 + +#### cache_file + +!!! failure "已在 sing-box 1.8.0 废弃" + + `cache_file` 已在 Clash API 中废弃,且已迁移到 `cache_file.enabled` 和 `cache_file.path`。 + +缓存文件路径,默认使用`cache.db`。 + +#### cache_id + +!!! failure "已在 sing-box 1.8.0 废弃" + + `cache_id` 已在 Clash API 中废弃,且已迁移到 `cache_file.cache_id`。 + +缓存 ID。 + +如果不为空,配置特定的数据将使用由其键控的单独存储。 diff --git a/docs/configuration/experimental/index.zh.md b/docs/configuration/experimental/index.zh.md new file mode 100644 index 00000000..4be70aa7 --- /dev/null +++ b/docs/configuration/experimental/index.zh.md @@ -0,0 +1,30 @@ +--- +icon: material/alert-decagram +--- + +# 实验性 + +!!! quote "sing-box 1.8.0 中的更改" + + :material-plus: [cache_file](#cache_file) + :material-alert-decagram: [clash_api](#clash_api) + +### 结构 + +```json +{ + "experimental": { + "cache_file": {}, + "clash_api": {}, + "v2ray_api": {} + } +} +``` + +### 字段 + +| 键 | 格式 | +|--------------|--------------------------| +| `cache_file` | [缓存文件](./cache-file/) | +| `clash_api` | [Clash API](./clash-api/) | +| `v2ray_api` | [V2Ray API](./v2ray-api/) | \ No newline at end of file diff --git a/docs/configuration/experimental/v2ray-api.md b/docs/configuration/experimental/v2ray-api.md index 39888424..4e23dea9 100644 --- a/docs/configuration/experimental/v2ray-api.md +++ b/docs/configuration/experimental/v2ray-api.md @@ -1,8 +1,8 @@ -### Structure - !!! quote "" - V2Ray API is not included by default, see [Installation](./#installation). + V2Ray API is not included by default, see [Installation](/installation/build-from-source/#build-tags). + +### Structure ```json { diff --git a/docs/configuration/experimental/v2ray-api.zh.md b/docs/configuration/experimental/v2ray-api.zh.md new file mode 100644 index 00000000..81fc8427 --- /dev/null +++ b/docs/configuration/experimental/v2ray-api.zh.md @@ -0,0 +1,50 @@ +!!! quote "" + + 默认安装不包含 V2Ray API,参阅 [安装](/zh/installation/build-from-source/#_5)。 + +### 结构 + +```json +{ + "listen": "127.0.0.1:8080", + "stats": { + "enabled": true, + "inbounds": [ + "socks-in" + ], + "outbounds": [ + "proxy", + "direct" + ], + "users": [ + "sekai" + ] + } +} +``` + +### 字段 + +#### listen + +gRPC API 监听地址。如果为空,则禁用 V2Ray API。 + +#### stats + +流量统计服务设置。 + +#### stats.enabled + +启用统计服务。 + +#### stats.inbounds + +统计流量的入站列表。 + +#### stats.outbounds + +统计流量的出站列表。 + +#### stats.users + +统计流量的用户列表。 \ No newline at end of file diff --git a/docs/configuration/inbound/hysteria.md b/docs/configuration/inbound/hysteria.md index a0b24866..4725aafc 100644 --- a/docs/configuration/inbound/hysteria.md +++ b/docs/configuration/inbound/hysteria.md @@ -29,10 +29,6 @@ } ``` -!!! warning "" - - QUIC, which is required by hysteria is not included by default, see [Installation](./#installation). - ### Listen Fields See [Listen Fields](/configuration/shared/listen/) for details. diff --git a/docs/configuration/inbound/hysteria.zh.md b/docs/configuration/inbound/hysteria.zh.md index b7534058..b7566052 100644 --- a/docs/configuration/inbound/hysteria.zh.md +++ b/docs/configuration/inbound/hysteria.zh.md @@ -29,10 +29,6 @@ } ``` -!!! warning "" - - 默认安装不包含被 Hysteria 依赖的 QUIC,参阅 [安装](/zh/#_2)。 - ### 监听字段 参阅 [监听字段](/zh/configuration/shared/listen/)。 diff --git a/docs/configuration/inbound/hysteria2.md b/docs/configuration/inbound/hysteria2.md index c0ae52b7..7c611e64 100644 --- a/docs/configuration/inbound/hysteria2.md +++ b/docs/configuration/inbound/hysteria2.md @@ -26,10 +26,6 @@ } ``` -!!! warning "" - - QUIC, which is required by Hysteria2 is not included by default, see [Installation](./#installation). - !!! warning "Difference from official Hysteria2" The official program supports an authentication method called **userpass**, diff --git a/docs/configuration/inbound/hysteria2.zh.md b/docs/configuration/inbound/hysteria2.zh.md index 4d5a9415..c936aae8 100644 --- a/docs/configuration/inbound/hysteria2.zh.md +++ b/docs/configuration/inbound/hysteria2.zh.md @@ -26,10 +26,6 @@ } ``` -!!! warning "" - - 默认安装不包含被 Hysteria2 依赖的 QUIC,参阅 [安装](/zh/#_2)。 - !!! warning "与官方 Hysteria2 的区别" 官方程序支持一种名为 **userpass** 的验证方式, diff --git a/docs/configuration/inbound/naive.md b/docs/configuration/inbound/naive.md index 0e4b8cea..0b4ff4b7 100644 --- a/docs/configuration/inbound/naive.md +++ b/docs/configuration/inbound/naive.md @@ -18,10 +18,6 @@ } ``` -!!! warning "" - - HTTP3 transport is not included by default, see [Installation](./#installation). - ### Listen Fields See [Listen Fields](/configuration/shared/listen/) for details. diff --git a/docs/configuration/inbound/naive.zh.md b/docs/configuration/inbound/naive.zh.md index 083d6429..5707e653 100644 --- a/docs/configuration/inbound/naive.zh.md +++ b/docs/configuration/inbound/naive.zh.md @@ -18,10 +18,6 @@ } ``` -!!! warning "" - - 默认安装不包含 HTTP3 传输层, 参阅 [安装](/zh/#_2)。 - ### 监听字段 参阅 [监听字段](/zh/configuration/shared/listen/)。 diff --git a/docs/configuration/inbound/tuic.md b/docs/configuration/inbound/tuic.md index 4ed3dca9..8a2d8c7e 100644 --- a/docs/configuration/inbound/tuic.md +++ b/docs/configuration/inbound/tuic.md @@ -22,10 +22,6 @@ } ``` -!!! warning "" - - QUIC, which is required by TUIC is not included by default, see [Installation](./#installation). - ### Listen Fields See [Listen Fields](/configuration/shared/listen/) for details. diff --git a/docs/configuration/inbound/tuic.zh.md b/docs/configuration/inbound/tuic.zh.md index 60a7ccf6..99252056 100644 --- a/docs/configuration/inbound/tuic.zh.md +++ b/docs/configuration/inbound/tuic.zh.md @@ -22,10 +22,6 @@ } ``` -!!! warning "" - - 默认安装不包含被 TUI 依赖的 QUIC,参阅 [安装](/zh/#_2)。 - ### 监听字段 参阅 [监听字段](/zh/configuration/shared/listen/)。 diff --git a/docs/configuration/inbound/tun.md b/docs/configuration/inbound/tun.md index d954de6b..a2e4ccd8 100644 --- a/docs/configuration/inbound/tun.md +++ b/docs/configuration/inbound/tun.md @@ -172,7 +172,7 @@ TCP/IP stack. !!! warning "" - gVisor and LWIP stacks is not included by default, see [Installation](./#installation). + LWIP stacks is not included by default, see [Installation](/installation/build-from-source/#build-tags). #### include_interface diff --git a/docs/configuration/inbound/tun.zh.md b/docs/configuration/inbound/tun.zh.md index d0bef4ff..e4e19851 100644 --- a/docs/configuration/inbound/tun.zh.md +++ b/docs/configuration/inbound/tun.zh.md @@ -168,7 +168,7 @@ TCP/IP 栈。 !!! warning "" - 默认安装不包含 gVisor 和 LWIP 栈,请参阅 [安装](/zh/#_2)。 + 默认安装不包含 LWIP 栈,参阅 [安装](/zh/installation/build-from-source/#_5)。 #### include_interface diff --git a/docs/configuration/outbound/hysteria.md b/docs/configuration/outbound/hysteria.md index ab9191d7..90190e05 100644 --- a/docs/configuration/outbound/hysteria.md +++ b/docs/configuration/outbound/hysteria.md @@ -24,10 +24,6 @@ } ``` -!!! warning "" - - QUIC, which is required by hysteria is not included by default, see [Installation](./#installation). - ### Fields #### server diff --git a/docs/configuration/outbound/hysteria.zh.md b/docs/configuration/outbound/hysteria.zh.md index 8f0eb3d9..c6ee2313 100644 --- a/docs/configuration/outbound/hysteria.zh.md +++ b/docs/configuration/outbound/hysteria.zh.md @@ -24,10 +24,6 @@ } ``` -!!! warning "" - - 默认安装不包含被 Hysteria 依赖的 QUIC,参阅 [安装](/zh/#_2)。 - ### 字段 #### server diff --git a/docs/configuration/outbound/hysteria2.md b/docs/configuration/outbound/hysteria2.md index eacb284e..ae0b96ed 100644 --- a/docs/configuration/outbound/hysteria2.md +++ b/docs/configuration/outbound/hysteria2.md @@ -22,10 +22,6 @@ } ``` -!!! warning "" - - QUIC, which is required by Hysteria2 is not included by default, see [Installation](./#installation). - !!! warning "Difference from official Hysteria2" The official Hysteria2 supports an authentication method called **userpass**, diff --git a/docs/configuration/outbound/hysteria2.zh.md b/docs/configuration/outbound/hysteria2.zh.md index 5d208027..7176b9a6 100644 --- a/docs/configuration/outbound/hysteria2.zh.md +++ b/docs/configuration/outbound/hysteria2.zh.md @@ -22,10 +22,6 @@ } ``` -!!! warning "" - - 默认安装不包含被 Hysteria2 依赖的 QUIC,参阅 [安装](/zh/#_2)。 - !!! warning "与官方 Hysteria2 的区别" 官方程序支持一种名为 **userpass** 的验证方式, diff --git a/docs/configuration/outbound/index.md b/docs/configuration/outbound/index.md index 1ce5405f..c5dc2917 100644 --- a/docs/configuration/outbound/index.md +++ b/docs/configuration/outbound/index.md @@ -15,8 +15,8 @@ ### Fields -| Type | Format | -|----------------|---------------------------------| +| Type | Format | +|----------------|--------------------------------| | `direct` | [Direct](./direct/) | | `block` | [Block](./block/) | | `socks` | [SOCKS](./socks/) | @@ -26,7 +26,6 @@ | `trojan` | [Trojan](./trojan/) | | `wireguard` | [Wireguard](./wireguard/) | | `hysteria` | [Hysteria](./hysteria/) | -| `shadowsocksr` | [ShadowsocksR](./shadowsocksr/) | | `vless` | [VLESS](./vless/) | | `shadowtls` | [ShadowTLS](./shadowtls/) | | `tuic` | [TUIC](./tuic/) | diff --git a/docs/configuration/outbound/index.zh.md b/docs/configuration/outbound/index.zh.md index f1577dd4..c7ee59e9 100644 --- a/docs/configuration/outbound/index.zh.md +++ b/docs/configuration/outbound/index.zh.md @@ -15,8 +15,8 @@ ### 字段 -| 类型 | 格式 | -|----------------|---------------------------------| +| 类型 | 格式 | +|----------------|--------------------------------| | `direct` | [Direct](./direct/) | | `block` | [Block](./block/) | | `socks` | [SOCKS](./socks/) | @@ -26,7 +26,6 @@ | `trojan` | [Trojan](./trojan/) | | `wireguard` | [Wireguard](./wireguard/) | | `hysteria` | [Hysteria](./hysteria/) | -| `shadowsocksr` | [ShadowsocksR](./shadowsocksr/) | | `vless` | [VLESS](./vless/) | | `shadowtls` | [ShadowTLS](./shadowtls/) | | `tuic` | [TUIC](./tuic/) | diff --git a/docs/configuration/outbound/shadowsocksr.md b/docs/configuration/outbound/shadowsocksr.md deleted file mode 100644 index 2ac145f3..00000000 --- a/docs/configuration/outbound/shadowsocksr.md +++ /dev/null @@ -1,106 +0,0 @@ -### Structure - -```json -{ - "type": "shadowsocksr", - "tag": "ssr-out", - - "server": "127.0.0.1", - "server_port": 1080, - "method": "aes-128-cfb", - "password": "8JCsPssfgS8tiRwiMlhARg==", - "obfs": "plain", - "obfs_param": "", - "protocol": "origin", - "protocol_param": "", - "network": "udp", - - ... // Dial Fields -} -``` - -!!! warning "" - - The ShadowsocksR protocol is obsolete and unmaintained. This outbound is provided for compatibility only. - -!!! warning "" - - ShadowsocksR is not included by default, see [Installation](./#installation). - -### Fields - -#### server - -==Required== - -The server address. - -#### server_port - -==Required== - -The server port. - -#### method - -==Required== - -Encryption methods: - -* `aes-128-ctr` -* `aes-192-ctr` -* `aes-256-ctr` -* `aes-128-cfb` -* `aes-192-cfb` -* `aes-256-cfb` -* `rc4-md5` -* `chacha20-ietf` -* `xchacha20` - -#### password - -==Required== - -The shadowsocks password. - -#### obfs - -The ShadowsocksR obfuscate. - -* plain -* http_simple -* http_post -* random_head -* tls1.2_ticket_auth - -#### obfs_param - -The ShadowsocksR obfuscate parameter. - -#### protocol - -The ShadowsocksR protocol. - -* origin -* verify_sha1 -* auth_sha1_v4 -* auth_aes128_md5 -* auth_aes128_sha1 -* auth_chain_a -* auth_chain_b - -#### protocol_param - -The ShadowsocksR protocol parameter. - -#### network - -Enabled network - -One of `tcp` `udp`. - -Both is enabled by default. - -### Dial Fields - -See [Dial Fields](/configuration/shared/dial/) for details. diff --git a/docs/configuration/outbound/shadowsocksr.zh.md b/docs/configuration/outbound/shadowsocksr.zh.md deleted file mode 100644 index ced3756a..00000000 --- a/docs/configuration/outbound/shadowsocksr.zh.md +++ /dev/null @@ -1,106 +0,0 @@ -### 结构 - -```json -{ - "type": "shadowsocksr", - "tag": "ssr-out", - - "server": "127.0.0.1", - "server_port": 1080, - "method": "aes-128-cfb", - "password": "8JCsPssfgS8tiRwiMlhARg==", - "obfs": "plain", - "obfs_param": "", - "protocol": "origin", - "protocol_param": "", - "network": "udp", - - ... // 拨号字段 -} -``` - -!!! warning "" - - ShadowsocksR 协议已过时且无人维护。 提供此出站仅出于兼容性目的。 - -!!! warning "" - - 默认安装不包含被 ShadowsocksR,参阅 [安装](/zh/#_2)。 - -### 字段 - -#### server - -==必填== - -服务器地址。 - -#### server_port - -==必填== - -服务器端口。 - -#### method - -==必填== - -加密方法: - -* `aes-128-ctr` -* `aes-192-ctr` -* `aes-256-ctr` -* `aes-128-cfb` -* `aes-192-cfb` -* `aes-256-cfb` -* `rc4-md5` -* `chacha20-ietf` -* `xchacha20` - -#### password - -==必填== - -Shadowsocks 密码。 - -#### obfs - -ShadowsocksR 混淆。 - -* plain -* http_simple -* http_post -* random_head -* tls1.2_ticket_auth - -#### obfs_param - -ShadowsocksR 混淆参数。 - -#### protocol - -ShadowsocksR 协议。 - -* origin -* verify_sha1 -* auth_sha1_v4 -* auth_aes128_md5 -* auth_aes128_sha1 -* auth_chain_a -* auth_chain_b - -#### protocol_param - -ShadowsocksR 协议参数。 - -#### network - -启用的网络协议 - -`tcp` 或 `udp`。 - -默认所有。 - -### 拨号字段 - -参阅 [拨号字段](/zh/configuration/shared/dial/)。 diff --git a/docs/configuration/outbound/tor.md b/docs/configuration/outbound/tor.md index 0c1baf96..ac778335 100644 --- a/docs/configuration/outbound/tor.md +++ b/docs/configuration/outbound/tor.md @@ -18,7 +18,7 @@ !!! info "" - Embedded tor is not included by default, see [Installation](./#installation). + Embedded Tor is not included by default, see [Installation](/installation/build-from-source/#build-tags). ### Fields diff --git a/docs/configuration/outbound/tor.zh.md b/docs/configuration/outbound/tor.zh.md index 2ddf832b..be505964 100644 --- a/docs/configuration/outbound/tor.zh.md +++ b/docs/configuration/outbound/tor.zh.md @@ -18,7 +18,7 @@ !!! info "" - 默认安装不包含嵌入式 Tor, 参阅 [安装](/zh/#_2)。 + 默认安装不包含嵌入式 Tor, 参阅 [安装](/zh/installation/build-from-source/#_5)。 ### 字段 diff --git a/docs/configuration/outbound/tuic.md b/docs/configuration/outbound/tuic.md index 80baf41e..4f4ef485 100644 --- a/docs/configuration/outbound/tuic.md +++ b/docs/configuration/outbound/tuic.md @@ -21,10 +21,6 @@ } ``` -!!! warning "" - - QUIC, which is required by TUIC is not included by default, see [Installation](./#installation). - ### Fields #### server diff --git a/docs/configuration/outbound/tuic.zh.md b/docs/configuration/outbound/tuic.zh.md index b81ffb52..ee8fd15d 100644 --- a/docs/configuration/outbound/tuic.zh.md +++ b/docs/configuration/outbound/tuic.zh.md @@ -21,10 +21,6 @@ } ``` -!!! warning "" - - 默认安装不包含被 TUI 依赖的 QUIC,参阅 [安装](/zh/#_2)。 - ### 字段 #### server diff --git a/docs/configuration/outbound/wireguard.md b/docs/configuration/outbound/wireguard.md index f0d0ab83..849de8e5 100644 --- a/docs/configuration/outbound/wireguard.md +++ b/docs/configuration/outbound/wireguard.md @@ -36,14 +36,6 @@ } ``` -!!! warning "" - - WireGuard is not included by default, see [Installation](./#installation). - -!!! warning "" - - gVisor, which is required by the unprivileged WireGuard is not included by default, see [Installation](./#installation). - ### Fields #### server diff --git a/docs/configuration/outbound/wireguard.zh.md b/docs/configuration/outbound/wireguard.zh.md index 2648247b..150dda6d 100644 --- a/docs/configuration/outbound/wireguard.zh.md +++ b/docs/configuration/outbound/wireguard.zh.md @@ -24,14 +24,6 @@ } ``` -!!! warning "" - - 默认安装不包含 WireGuard, 参阅 [安装](/zh/#_2)。 - -!!! warning "" - - 默认安装不包含被非特权 WireGuard 需要的 gVisor, 参阅 [安装](/zh/#_2)。 - ### 字段 #### server diff --git a/docs/configuration/route/geoip.zh.md b/docs/configuration/route/geoip.zh.md new file mode 100644 index 00000000..fb2481e2 --- /dev/null +++ b/docs/configuration/route/geoip.zh.md @@ -0,0 +1,41 @@ +--- +icon: material/delete-clock +--- + +!!! failure "已在 sing-box 1.8.0 废弃" + + GeoIP 已废弃且可能在不久的将来移除,参阅 [迁移指南](/zh/migration/#geoip)。 + +### 结构 + +```json +{ + "route": { + "geoip": { + "path": "", + "download_url": "", + "download_detour": "" + } + } +} +``` + +### 字段 + +#### path + +指定 GeoIP 资源的路径。 + +默认 `geoip.db`。 + +#### download_url + +指定 GeoIP 资源的下载链接。 + +默认为 `https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db`。 + +#### download_detour + +用于下载 GeoIP 资源的出站的标签。 + +如果为空,将使用默认出站。 \ No newline at end of file diff --git a/docs/configuration/route/geosite.zh.md b/docs/configuration/route/geosite.zh.md new file mode 100644 index 00000000..eeee38ff --- /dev/null +++ b/docs/configuration/route/geosite.zh.md @@ -0,0 +1,41 @@ +--- +icon: material/delete-clock +--- + +!!! failure "已在 sing-box 1.8.0 废弃" + + Geosite 已废弃且可能在不久的将来移除,参阅 [迁移指南](/zh/migration/#geosite)。 + +### 结构 + +```json +{ + "route": { + "geosite": { + "path": "", + "download_url": "", + "download_detour": "" + } + } +} +``` + +### 字段 + +#### path + +指定 GeoSite 资源的路径。 + +默认 `geosite.db`。 + +#### download_url + +指定 GeoSite 资源的下载链接。 + +默认为 `https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db`。 + +#### download_detour + +用于下载 GeoSite 资源的出站的标签。 + +如果为空,将使用默认出站。 \ No newline at end of file diff --git a/docs/configuration/route/rule.zh.md b/docs/configuration/route/rule.zh.md index 1cec0a75..0e6f9896 100644 --- a/docs/configuration/route/rule.zh.md +++ b/docs/configuration/route/rule.zh.md @@ -182,7 +182,7 @@ icon: material/alert-decagram !!! failure "已在 sing-box 1.8.0 废弃" - Geosite 已废弃且可能在不久的将来移除,参阅 [迁移指南](/migration/#migrate-geosite-to-rule-sets)。 + Geosite 已废弃且可能在不久的将来移除,参阅 [迁移指南](/zh/migration/#geosite)。 匹配 Geosite。 @@ -190,7 +190,7 @@ icon: material/alert-decagram !!! failure "已在 sing-box 1.8.0 废弃" - GeoIp 已废弃且可能在不久的将来移除,参阅 [迁移指南](/migration/#migrate-geoip-to-rule-sets)。 + GeoIP 已废弃且可能在不久的将来移除,参阅 [迁移指南](/zh/migration/#geoip)。 匹配源 GeoIP。 @@ -198,7 +198,7 @@ icon: material/alert-decagram !!! failure "已在 sing-box 1.8.0 废弃" - GeoIp 已废弃且可能在不久的将来移除,参阅 [迁移指南](/migration/#migrate-geoip-to-rule-sets)。 + GeoIP 已废弃且可能在不久的将来移除,参阅 [迁移指南](/zh/migration/#geoip)。 匹配 GeoIP。 diff --git a/docs/configuration/shared/tls.md b/docs/configuration/shared/tls.md index c28314d9..bf32466c 100644 --- a/docs/configuration/shared/tls.md +++ b/docs/configuration/shared/tls.md @@ -198,10 +198,6 @@ The path to the server private key, in PEM format. ==Client only== -!!! warning "" - - uTLS is not included by default, see [Installation](./#installation). - !!! note "" uTLS is poorly maintained and the effect may be unproven, use at your own risk. @@ -225,10 +221,6 @@ Chrome fingerprint will be used if empty. ### ECH Fields -!!! warning "" - - ECH is not included by default, see [Installation](./#installation). - ECH (Encrypted Client Hello) is a TLS extension that allows a client to encrypt the first part of its ClientHello message. @@ -277,10 +269,6 @@ If empty, load from DNS will be attempted. ### ACME Fields -!!! warning "" - - ACME is not included by default, see [Installation](./#installation). - #### domain List of domain. @@ -356,14 +344,6 @@ See [DNS01 Challenge Fields](/configuration/shared/dns01_challenge/) for details ### Reality Fields -!!! warning "" - - reality server is not included by default, see [Installation](./#installation). - -!!! warning "" - - uTLS, which is required by reality client is not included by default, see [Installation](./#installation). - #### handshake ==Server only== diff --git a/docs/configuration/shared/tls.zh.md b/docs/configuration/shared/tls.zh.md index fcea5ba1..49282117 100644 --- a/docs/configuration/shared/tls.zh.md +++ b/docs/configuration/shared/tls.zh.md @@ -190,10 +190,6 @@ TLS 版本值: ==仅客户端== -!!! warning "" - - 默认安装不包含 uTLS, 参阅 [安装](/zh/#_2)。 - !!! note "" uTLS 维护不善且其效果可能未经证实,使用风险自负。 @@ -217,14 +213,9 @@ uTLS 是 "crypto/tls" 的一个分支,它提供了 ClientHello 指纹识别阻 ## ECH 字段 -!!! warning "" - - 默认安装不包含 ECH, 参阅 [安装](/zh/#_2)。 - ECH (Encrypted Client Hello) 是一个 TLS 扩展,它允许客户端加密其 ClientHello 的第一部分 信息。 - ECH 配置和密钥可以通过 `sing-box generate ech-keypair [--pq-signature-schemes-enabled]` 生成。 #### pq_signature_schemes_enabled @@ -270,10 +261,6 @@ ECH PEM 配置路径 ### ACME 字段 -!!! warning "" - - 默认安装不包含 ACME,参阅 [安装](/zh/#_2)。 - #### domain 一组域名。 @@ -345,14 +332,6 @@ ACME DNS01 验证字段。如果配置,将禁用其他验证方法。 ### Reality 字段 -!!! warning "" - - 默认安装不包含 reality 服务器,参阅 [安装](/zh/#_2)。 - -!!! warning "" - - 默认安装不包含被 reality 客户端需要的 uTLS, 参阅 [安装](/zh/#_2)。 - #### handshake ==仅服务器== diff --git a/docs/configuration/shared/v2ray-transport.md b/docs/configuration/shared/v2ray-transport.md index f8911fdb..afc33241 100644 --- a/docs/configuration/shared/v2ray-transport.md +++ b/docs/configuration/shared/v2ray-transport.md @@ -142,10 +142,6 @@ It needs to be consistent with the server. } ``` -!!! warning "" - - QUIC is not included by default, see [Installation](./#installation). - !!! warning "Difference from v2ray-core" No additional encryption support: @@ -155,7 +151,7 @@ It needs to be consistent with the server. !!! note "" - standard gRPC has good compatibility but poor performance and is not included by default, see [Installation](./#installation). + standard gRPC has good compatibility but poor performance and is not included by default, see [Installation](/installation/build-from-source/#build-tags). ```json { diff --git a/docs/configuration/shared/v2ray-transport.zh.md b/docs/configuration/shared/v2ray-transport.zh.md index 91b740fa..e5bd7de7 100644 --- a/docs/configuration/shared/v2ray-transport.zh.md +++ b/docs/configuration/shared/v2ray-transport.zh.md @@ -135,10 +135,6 @@ HTTP 请求的额外标头 } ``` -!!! warning "" - - 默认安装不包含 QUIC, 参阅 [安装](/zh/#_2)。 - !!! warning "与 v2ray-core 的区别" 没有额外的加密支持: @@ -148,7 +144,7 @@ HTTP 请求的额外标头 !!! note "" - 默认安装不包含标准 gRPC (兼容性好,但性能较差), 参阅 [安装](/zh/#_2)。 + 默认安装不包含标准 gRPC (兼容性好,但性能较差), 参阅 [安装](/zh/installation/build-from-source/#_5)。 ```json { diff --git a/docs/deprecated.md b/docs/deprecated.md index 91a3b25e..d3f38938 100644 --- a/docs/deprecated.md +++ b/docs/deprecated.md @@ -4,7 +4,37 @@ icon: material/delete-alert # Deprecated Feature List -### 1.6.0 +## 1.8.0 + +#### Cache file and related features in Clash API + +`cache_file` and related features in Clash API is migrated to independent `cache_file` options, +check [Migration](/migration/#migrate-cache-file-from-clash-api-to-independent-options). + +#### GeoIP + +GeoIP is deprecated and may be removed in the future. + +The maxmind GeoIP National Database, as an IP classification database, +is not entirely suitable for traffic bypassing, +and all existing implementations suffer from high memory usage and difficult management. + +sing-box 1.8.0 introduces [Rule Set](/configuration/rule_set/), which can completely replace GeoIP, +check [Migration](/migration/#migrate-geoip-to-rule-sets). + +#### Geosite + +Geosite is deprecated and may be removed in the future. + +Geosite, the `domain-list-community` project maintained by V2Ray as an early traffic bypassing solution, +suffers from a number of problems, including lack of maintenance, inaccurate rules, and difficult management. + +sing-box 1.8.0 introduces [Rule Set](/configuration/rule_set/), which can completely replace Geosite, +check [Migration](/migration/#migrate-geosite-to-rule-sets). + +Geosite,即由 V2Ray 维护的 domain-list-community 项目,作为早期流量绕过解决方案,存在着大量问题,包括缺少维护、规则不准确、管理困难。 + +## 1.6.0 The following features will be marked deprecated in 1.5.0 and removed entirely in 1.6.0. diff --git a/docs/deprecated.zh.md b/docs/deprecated.zh.md index f1125565..a1d6f518 100644 --- a/docs/deprecated.zh.md +++ b/docs/deprecated.zh.md @@ -4,7 +4,34 @@ icon: material/delete-alert # 废弃功能列表 -### 1.6.0 +## 1.8.0 + +#### Clash API 中的 Cache file 及相关功能 + +Clash API 中的 `cache_file` 及相关功能已废弃且已迁移到独立的 `cache_file` 设置, +参阅 [迁移指南](/zh/migration/#clash-api)。 + +#### GeoIP + +GeoIP 已废弃且可能在不久的将来移除。 + +maxmind GeoIP 国家数据库作为 IP 分类数据库,不完全适合流量绕过, +且现有的实现均存在内存使用大与管理困难的问题。 + +sing-box 1.8.0 引入了[规则集](/configuration/rule_set/), +可以完全替代 GeoIP, 参阅 [迁移指南](/zh/migration/#geoip)。 + +#### Geosite + +Geosite 已废弃且可能在不久的将来移除。 + +Geosite,即由 V2Ray 维护的 domain-list-community 项目,作为早期流量绕过解决方案, +存在着包括缺少维护、规则不准确和管理困难内的大量问题。 + +sing-box 1.8.0 引入了[规则集](/configuration/rule_set/), +可以完全替代 Geosite,参阅 [迁移指南](/zh/migration/#geosite)。 + +## 1.6.0 下列功能已在 1.5.0 中标记为已弃用,并在 1.6.0 中完全删除。 diff --git a/docs/installation/build-from-source.md b/docs/installation/build-from-source.md index 9c9f6162..04e0d029 100644 --- a/docs/installation/build-from-source.md +++ b/docs/installation/build-from-source.md @@ -23,7 +23,7 @@ You can download and install Go from: https://go.dev/doc/install, latest version make ``` -Or build and install binary to `GOBIN`: +Or build and install binary to `$GOBIN`: ```bash make install diff --git a/docs/installation/build-from-source.zh.md b/docs/installation/build-from-source.zh.md new file mode 100644 index 00000000..66eb8c66 --- /dev/null +++ b/docs/installation/build-from-source.zh.md @@ -0,0 +1,63 @@ +--- +icon: material/file-code +--- + +# 从源代码构建 + +## :material-graph: 要求 + +sing-box 1.4.0 前: + +* Go 1.18.5 - 1.20.x + +从 sing-box 1.4.0: + +* Go 1.18.5 - ~ +* Go 1.20.0 - ~ 如果启用构建标记 `with_quic` + +您可以从 https://go.dev/doc/install 下载并安装 Go,推荐使用最新版本。 + +## :material-fast-forward: 快速开始 + +```bash +make +``` + +或者构建二进制文件并将其安装到 `$GOBIN`: + +```bash +make install +``` + +## :material-cog: 自定义构建 + +```bash +TAGS="tag_a tag_b" make +``` + +or + +```bash +go build -tags "tag_a tag_b" ./cmd/sing-box +``` + +## :material-folder-settings: 构建标记 + +| 构建标记 | 默认启动 | 说明 | +|------------------------------------|------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `with_quic` | ✔ | Build with QUIC support, see [QUIC and HTTP3 DNS transports](/configuration/dns/server/), [Naive inbound](/configuration/inbound/naive/), [Hysteria Inbound](/configuration/inbound/hysteria/), [Hysteria Outbound](/configuration/outbound/hysteria/) and [V2Ray Transport#QUIC](/configuration/shared/v2ray-transport#quic). | +| `with_grpc` | ✖️ | Build with standard gRPC support, see [V2Ray Transport#gRPC](/configuration/shared/v2ray-transport#grpc). | +| `with_dhcp` | ✔ | Build with DHCP support, see [DHCP DNS transport](/configuration/dns/server/). | +| `with_wireguard` | ✔ | Build with WireGuard support, see [WireGuard outbound](/configuration/outbound/wireguard/). | +| `with_ech` | ✔ | Build with TLS ECH extension support for TLS outbound, see [TLS](/configuration/shared/tls#ech). | +| `with_utls` | ✔ | Build with [uTLS](https://github.com/refraction-networking/utls) support for TLS outbound, see [TLS](/configuration/shared/tls#utls). | +| `with_reality_server` | ✔ | Build with reality TLS server support, see [TLS](/configuration/shared/tls/). | +| `with_acme` | ✔ | Build with ACME TLS certificate issuer support, see [TLS](/configuration/shared/tls/). | +| `with_clash_api` | ✔ | Build with Clash API support, see [Experimental](/configuration/experimental#clash-api-fields). | +| `with_v2ray_api` | ✖️ | Build with V2Ray API support, see [Experimental](/configuration/experimental#v2ray-api-fields). | +| `with_gvisor` | ✔ | Build with gVisor support, see [Tun inbound](/configuration/inbound/tun#stack) and [WireGuard outbound](/configuration/outbound/wireguard#system_interface). | +| `with_embedded_tor` (CGO required) | ✖️ | Build with embedded Tor support, see [Tor outbound](/configuration/outbound/tor/). | +| `with_lwip` (CGO required) | ✖️ | Build with LWIP Tun stack support, see [Tun inbound](/configuration/inbound/tun#stack). | + + +除非您确实知道您正在启用什么,否则不建议更改默认构建标签列表。 diff --git a/docs/installation/docker.zh.md b/docs/installation/docker.zh.md new file mode 100644 index 00000000..ecc66e3a --- /dev/null +++ b/docs/installation/docker.zh.md @@ -0,0 +1,31 @@ +--- +icon: material/docker +--- + +# Docker + +## :material-console: 命令 + +```bash +docker run -d \ + -v /etc/sing-box:/etc/sing-box/ \ + --name=sing-box \ + --restart=always \ + ghcr.io/sagernet/sing-box \ + -D /var/lib/sing-box \ + -C /etc/sing-box/ run +``` + +## :material-box-shadow: Compose + +```yaml +version: "3.8" +services: + sing-box: + image: ghcr.io/sagernet/sing-box + container_name: sing-box + restart: always + volumes: + - /etc/sing-box:/etc/sing-box/ + command: -D /var/lib/sing-box -C /etc/sing-box/ run +``` diff --git a/docs/installation/package-manager.zh.md b/docs/installation/package-manager.zh.md new file mode 100644 index 00000000..3d2aee08 --- /dev/null +++ b/docs/installation/package-manager.zh.md @@ -0,0 +1,90 @@ +--- +icon: material/package +--- + +# 包管理器 + +## :material-download-box: 手动安装 + +=== ":material-debian: Debian / DEB" + + ```bash + bash <(curl -fsSL https://sing-box.app/deb-install.sh) + ``` + +=== ":material-redhat: Redhat / RPM" + + ```bash + bash <(curl -fsSL https://sing-box.app/rpm-install.sh) + ``` + +=== ":simple-archlinux: Archlinux / PKG" + + ```bash + bash <(curl -fsSL https://sing-box.app/arch-install.sh) + ``` + +## :material-book-lock-open: 托管安装 + +=== ":material-linux: Linux" + + | 类型 | 平台 | 链接 | 命令 | 活跃维护 | + |----------|--------------------|---------------------|------------------------------|------------------| + | AUR | (Linux) Arch Linux | [sing-box][aur] ᴬᵁᴿ | `? -S sing-box` | :material-check: | + | nixpkgs | (Linux) NixOS | [sing-box][nixpkgs] | `nix-env -iA nixos.sing-box` | :material-check: | + | Homebrew | macOS / Linux | [sing-box][brew] | `brew install sing-box` | :material-check: | + | Alpine | (Linux) Alpine | [sing-box][alpine] | `apk add sing-box` | :material-alert: | + +=== ":material-apple: macOS" + + | 类型 | 平台 | 链接 | 命令 | 活跃维护 | + |----------|---------------|------------------|-------------------------|------------------| + | Homebrew | macOS / Linux | [sing-box][brew] | `brew install sing-box` | :material-check: | + +=== ":material-microsoft-windows: Windows" + + | 类型 | 平台 | 链接 | 命令 | 活跃维护 | + |------------|---------|--------------------|---------------------------|------------------| + | Scoop | Windows | [sing-box][scoop] | `scoop install sing-box` | :material-check: | + | Chocolatey | Windows | [sing-box][choco] | `choco install sing-box` | :material-check: | + | winget | Windows | [sing-box][winget] | `winget install sing-box` | :material-alert: | + +=== ":material-android: Android" + + | 类型 | 平台 | 链接 | 命令 | 活跃维护 | + |--------|---------|--------------------|--------------------|------------------| + | Termux | Android | [sing-box][termux] | `pkg add sing-box` | :material-check: | + +## :material-book-multiple: 服务管理 + +对于带有 [systemd][systemd] 的 Linux 系统,通常安装已经包含 sing-box 服务, +您可以使用以下命令管理服务: + +| 行动 | 命令 | +|------|-----------------------------------------------| +| 启用 | `sudo systemctl enable sing-box` | +| 禁用 | `sudo systemctl disable sing-box` | +| 启动 | `sudo systemctl start sing-box` | +| 停止 | `sudo systemctl stop sing-box` | +| 强行停止 | `sudo systemctl kill sing-box` | +| 重新启动 | `sudo systemctl restart sing-box` | +| 查看日志 | `sudo journalctl -u sing-box --output cat -e` | +| 实时日志 | `sudo journalctl -u sing-box --output cat -f` | + +[alpine]: https://pkgs.alpinelinux.org/packages?name=sing-box + +[aur]: https://aur.archlinux.org/packages/sing-box + +[nixpkgs]: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/tools/networking/sing-box/default.nix + +[termux]: https://github.com/termux/termux-packages/tree/master/packages/sing-box + +[brew]: https://formulae.brew.sh/formula/sing-box + +[choco]: https://chocolatey.org/packages/sing-box + +[scoop]: https://github.com/ScoopInstaller/Main/blob/master/bucket/sing-box.json + +[winget]: https://github.com/microsoft/winget-pkgs/tree/master/manifests/s/SagerNet/sing-box + +[systemd]: https://systemd.io/ \ No newline at end of file diff --git a/docs/migration.md b/docs/migration.md index 3e191780..5fa1dbff 100644 --- a/docs/migration.md +++ b/docs/migration.md @@ -2,8 +2,6 @@ icon: material/arrange-bring-forward --- -# Migration - ## 1.8.0 !!! warning "Unstable" @@ -12,7 +10,7 @@ icon: material/arrange-bring-forward ### :material-close-box: Migrate cache file from Clash API to independent options -!!! info "Reference" +!!! info "References" [Clash API](/configuration/experimental/clash-api/) / [Cache File](/configuration/experimental/cache-file/) @@ -50,7 +48,7 @@ icon: material/arrange-bring-forward ### :material-checkbox-intermediate: Migrate GeoIP to rule sets -!!! info "Reference" +!!! info "References" [GeoIP](/configuration/route/geoip/) / [Route](/configuration/route/) / @@ -135,7 +133,7 @@ icon: material/arrange-bring-forward ### :material-checkbox-intermediate: Migrate Geosite to rule sets -!!! info "Reference" +!!! info "References" [Geosite](/configuration/route/geosite/) / [Route](/configuration/route/) / diff --git a/docs/migration.zh.md b/docs/migration.zh.md new file mode 100644 index 00000000..d1d78ed6 --- /dev/null +++ b/docs/migration.zh.md @@ -0,0 +1,193 @@ +--- +icon: material/arrange-bring-forward +--- + +## 1.8.0 + +!!! warning "不稳定的" + + 该版本仍在开发中,迁移指南可能将在未来更改。 + +### :material-close-box: 将缓存文件从 Clash API 迁移到独立选项 + +!!! info "参考" + + [Clash API](/zh/configuration/experimental/clash-api/) / + [Cache File](/zh/configuration/experimental/cache-file/) + +=== ":material-card-remove: 弃用的" + + ```json + { + "experimental": { + "clash_api": { + "cache_file": "cache.db", // 默认值 + "cahce_id": "my_profile2", + "store_mode": true, + "store_selected": true, + "store_fakeip": true + } + } + } + ``` + +=== ":material-card-multiple: 新的" + + ```json + { + "experimental" : { + "cache_file": { + "enabled": true, + "path": "cache.db", // 默认值 + "cache_id": "my_profile2", + "store_fakeip": true + } + } + } + ``` + +### :material-checkbox-intermediate: 迁移 GeoIP 到规则集 + +!!! info "参考" + + [GeoIP](/zh/configuration/route/geoip/) / + [路由](/zh/configuration/route/) / + [路由规则](/zh/configuration/route/rule/) / + [DNS 规则](/zh/configuration/dns/rule/) / + [规则集](/zh/configuration/rule-set/) + +!!! tip + + `sing-box geoip` 命令可以帮助您将自定义 GeoIP 转换为规则集。 + +=== ":material-card-remove: 弃用的" + + ```json + { + "route": { + "rules": [ + { + "geoip": "private", + "outbound": "direct" + }, + { + "geoip": "cn", + "outbound": "direct" + }, + { + "source_geoip": "cn", + "outbound": "block" + } + ], + "geoip": { + "download_detour": "proxy" + } + } + } + ``` + +=== ":material-card-multiple: 新的" + + ```json + { + "route": { + "rules": [ + { + "ip_is_private": true, + "outbound": "direct" + }, + { + "rule_set": "geoip-cn", + "outbound": "direct" + }, + { + "rule_set": "geoip-us", + "rule_set_ipcidr_match_source": true, + "outbound": "block" + } + ], + "rule_set": [ + { + "tag": "geoip-cn", + "type": "remote", + "format": "binary", + "url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs", + "download_detour": "proxy" + }, + { + "tag": "geoip-us", + "type": "remote", + "format": "binary", + "url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-us.srs", + "download_detour": "proxy" + } + ] + }, + "experimental": { + "cache_file": { + "enabled": true // required to save Rule Set cache + } + } + } + ``` + +### :material-checkbox-intermediate: 迁移 Geosite 到规则集 + +!!! info "参考" + + [Geosite](/zh/configuration/route/geosite/) / + [路由](/zh/configuration/route/) / + [路由规则](/zh/configuration/route/rule/) / + [DNS 规则](/zh/configuration/dns/rule/) / + [规则集](/zh/configuration/rule-set/) + +!!! tip + + `sing-box geosite` 命令可以帮助您将自定义 Geosite 转换为规则集。 + +=== ":material-card-remove: 弃用的" + + ```json + { + "route": { + "rules": [ + { + "geosite": "cn", + "outbound": "direct" + } + ], + "geosite": { + "download_detour": "proxy" + } + } + } + ``` + +=== ":material-card-multiple: 新的" + + ```json + { + "route": { + "rules": [ + { + "rule_set": "geosite-cn", + "outbound": "direct" + } + ], + "rule_set": [ + { + "tag": "geosite-cn", + "type": "remote", + "format": "binary", + "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-cn.srs", + "download_detour": "proxy" + } + ] + }, + "experimental": { + "cache_file": { + "enabled": true // required to save Rule Set cache + } + } + } + ``` \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index c5dd7df3..9547a580 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -220,6 +220,7 @@ plugins: Headless Rule: 无头规则 Experimental: 实验性 + Cache File: 缓存文件 Shared: 通用 Listen Fields: 监听字段