mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-04-14 20:58:33 +10:00
Update documentation
This commit is contained in:
@@ -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
|
||||
|
||||
63
docs/installation/build-from-source.zh.md
Normal file
63
docs/installation/build-from-source.zh.md
Normal file
@@ -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). |
|
||||
|
||||
|
||||
除非您确实知道您正在启用什么,否则不建议更改默认构建标签列表。
|
||||
31
docs/installation/docker.zh.md
Normal file
31
docs/installation/docker.zh.md
Normal file
@@ -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
|
||||
```
|
||||
90
docs/installation/package-manager.zh.md
Normal file
90
docs/installation/package-manager.zh.md
Normal file
@@ -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/
|
||||
Reference in New Issue
Block a user