Parcourir la source

Initial zh-CN document translation: examples

世界 il y a 3 ans
Parent
commit
1bc7d2237e

+ 0 - 2
docs/configuration/log.md

@@ -1,5 +1,3 @@
-# Log
-
 ### Structure
 
 ```json

+ 0 - 2
docs/configuration/route/geoip.md

@@ -1,5 +1,3 @@
-# geoip
-
 ### Structure
 
 ```json

+ 0 - 2
docs/configuration/route/geosite.md

@@ -1,5 +1,3 @@
-# geosite
-
 ### Structure
 
 ```json

+ 0 - 2
docs/examples/dns-hijack.md

@@ -1,5 +1,3 @@
-# DNS Hijack
-
 #### Sniff Mode
 
 ```json

+ 65 - 0
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
+  }
+}
+```

+ 9 - 0
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)

+ 1 - 1
docs/examples/linux-server-installation.md

@@ -1,4 +1,4 @@
-# Requirements
+#### Requirements
 
 * Linux & Systemd
 * Git

+ 38 - 0
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`                |

+ 0 - 2
docs/examples/ss-client.md

@@ -1,5 +1,3 @@
-# Shadowsocks Client
-
 ```json
 {
   "inbounds": [

+ 0 - 2
docs/examples/ss-server.md

@@ -1,5 +1,3 @@
-# Shadowsocks Server
-
 ```json
 {
   "inbounds": [