From 1bc7d2237e29603f55e833b21aa91eb6ebf83c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Wed, 24 Aug 2022 13:12:21 +0800 Subject: [PATCH] Initial zh-CN document translation: examples --- docs/configuration/log.md | 2 - docs/configuration/route/geoip.md | 2 - docs/configuration/route/geosite.md | 2 - docs/examples/dns-hijack.md | 2 - docs/examples/dns-hijack.zh.md | 65 +++++++++++++++++++ docs/examples/index.zh.md | 9 +++ docs/examples/linux-server-installation.md | 2 +- docs/examples/linux-server-installation.zh.md | 38 +++++++++++ docs/examples/ss-client.md | 2 - docs/examples/ss-server.md | 2 - 10 files changed, 113 insertions(+), 13 deletions(-) create mode 100644 docs/examples/dns-hijack.zh.md create mode 100644 docs/examples/index.zh.md create mode 100644 docs/examples/linux-server-installation.zh.md diff --git a/docs/configuration/log.md b/docs/configuration/log.md index ff45e165..6e40fbbe 100644 --- a/docs/configuration/log.md +++ b/docs/configuration/log.md @@ -1,5 +1,3 @@ -# Log - ### Structure ```json diff --git a/docs/configuration/route/geoip.md b/docs/configuration/route/geoip.md index 2e8bf3db..b966a292 100644 --- a/docs/configuration/route/geoip.md +++ b/docs/configuration/route/geoip.md @@ -1,5 +1,3 @@ -# geoip - ### Structure ```json diff --git a/docs/configuration/route/geosite.md b/docs/configuration/route/geosite.md index fd15fa9c..db700c6a 100644 --- a/docs/configuration/route/geosite.md +++ b/docs/configuration/route/geosite.md @@ -1,5 +1,3 @@ -# geosite - ### Structure ```json diff --git a/docs/examples/dns-hijack.md b/docs/examples/dns-hijack.md index ea7b2783..db9e86b8 100644 --- a/docs/examples/dns-hijack.md +++ b/docs/examples/dns-hijack.md @@ -1,5 +1,3 @@ -# DNS Hijack - #### Sniff Mode ```json diff --git a/docs/examples/dns-hijack.zh.md b/docs/examples/dns-hijack.zh.md new file mode 100644 index 00000000..2e75b13a --- /dev/null +++ b/docs/examples/dns-hijack.zh.md @@ -0,0 +1,65 @@ +#### 探测模式 + +```json +{ + "inbounds": [ + { + "type": "tun", + "inet4_address": "172.19.0.1/30", + "auto_route": true, + "sniff": true // 必须 + } + ], + "outbounds": [ + { + "type": "direct" + }, + { + "type": "dns", + "tag": "dns-out" + } + ], + "route": { + "rules": [ + { + "protocol": "dns", + "outbound": "dns-out" + } + ], + "auto_detect_interface": true + } +} +``` + +#### 端口模式 + +```json +{ + "inbounds": [ + { + "type": "tun", + "inet4_address": "172.19.0.1/30", + "auto_route": true, + "sniff": true // 非必须 + } + ], + "outbounds": [ + { + "type": "direct" + }, + { + "type": "dns", + "tag": "dns-out" + } + ], + "route": { + "rules": [ + { + "port": 53, + "outbound": "dns-out" + } + ], + "auto_detect_interface": true + } +} +``` \ No newline at end of file diff --git a/docs/examples/index.zh.md b/docs/examples/index.zh.md new file mode 100644 index 00000000..b0b576b5 --- /dev/null +++ b/docs/examples/index.zh.md @@ -0,0 +1,9 @@ +# 示例 + +sing-box 的配置示例。 + +* [Linux 服务器安装](./linux-server-installation) +* [Shadowsocks 服务器](./ss-server) +* [Shadowsocks 客户端](./ss-client) +* [Shadowsocks Tun](./ss-tun) +* [DNS 劫持](./dns-hijack.md) \ No newline at end of file diff --git a/docs/examples/linux-server-installation.md b/docs/examples/linux-server-installation.md index 1d27d26b..b72a9d19 100644 --- a/docs/examples/linux-server-installation.md +++ b/docs/examples/linux-server-installation.md @@ -1,4 +1,4 @@ -# Requirements +#### Requirements * Linux & Systemd * Git diff --git a/docs/examples/linux-server-installation.zh.md b/docs/examples/linux-server-installation.zh.md new file mode 100644 index 00000000..176f589d --- /dev/null +++ b/docs/examples/linux-server-installation.zh.md @@ -0,0 +1,38 @@ +#### 依赖 + +* Linux & Systemd +* Git +* Go 1.18.5+ +* C 编译器环境 + +#### 安装 + +```shell +git clone https://github.com/SagerNet/sing-box +cd sing-box +./release/local/install.sh +``` + +Edit configuration file in `/usr/local/etc/sing-box/config.json` + +```shell +./release/local/enable.sh +``` + +#### 更新 + +```shell +./release/local/update.sh +``` + +#### 其他命令 + +| 操作 | 命令 | +|------|-----------------------------------------------| +| 启动 | `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` | +| 卸载 | `./release/local/uninstall.sh` | \ No newline at end of file diff --git a/docs/examples/ss-client.md b/docs/examples/ss-client.md index 0ca8a0c3..7856dbbb 100644 --- a/docs/examples/ss-client.md +++ b/docs/examples/ss-client.md @@ -1,5 +1,3 @@ -# Shadowsocks Client - ```json { "inbounds": [ diff --git a/docs/examples/ss-server.md b/docs/examples/ss-server.md index 862e2bf9..edbb96df 100644 --- a/docs/examples/ss-server.md +++ b/docs/examples/ss-server.md @@ -1,5 +1,3 @@ -# Shadowsocks Server - ```json { "inbounds": [