fhs-install-v2ray/README.md

119 lines
3.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# fhs-install-v2ray
> 欲查阅以简体中文撰写的介绍,请访问:[README.zh-sc.md](README.zh-sc.md)
> Bash script for installing V2Ray in operating systems such as Debian / CentOS / Fedora / openSUSE that support systemd
該腳本安裝的文件符合 Filesystem Hierarchy StandardFHS
https://wiki.linuxfoundation.org/lsb/fhs
```
installed: /usr/local/bin/v2ray
installed: /usr/local/bin/v2ctl
installed: /usr/local/share/v2ray/geoip.dat
installed: /usr/local/share/v2ray/geosite.dat
installed: /usr/local/etc/v2ray/00_log.json
installed: /usr/local/etc/v2ray/01_api.json
installed: /usr/local/etc/v2ray/02_dns.json
installed: /usr/local/etc/v2ray/03_routing.json
installed: /usr/local/etc/v2ray/04_policy.json
installed: /usr/local/etc/v2ray/05_inbounds.json
installed: /usr/local/etc/v2ray/06_outbounds.json
installed: /usr/local/etc/v2ray/07_transport.json
installed: /usr/local/etc/v2ray/08_stats.json
installed: /usr/local/etc/v2ray/09_reverse.json
installed: /var/log/v2ray/
installed: /var/log/v2ray/access.log
installed: /var/log/v2ray/error.log
installed: /etc/systemd/system/v2ray.service
installed: /etc/systemd/system/v2ray@.service
```
## 依賴軟體
### 安裝 cURL
```
# apt update
# apt install curl
```
or
```
# yum makecache
# yum install curl
```
or
```
# dnf makecache
# dnf install curl
```
or
```
# zypper refresh
# zypper install curl
```
## 下載
```
# curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh
# curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-dat-release.sh
```
## 使用
* 該腳本在執行時會提供 `info``error` 等信息,請仔細閱讀。
### 安裝和更新 V2Ray
```
# bash install-release.sh
```
### 安裝最新發行的 geoip.dat 和 geosite.dat
```
# bash install-dat-release.sh
```
### 移除 V2Ray
```
# bash install-release.sh --remove
```
### 解決問題
* 「[不安裝或更新 geoip.dat 和 geosite.dat](https://github.com/v2fly/fhs-install-v2ray/wiki/Do-not-install-or-update-geoip.dat-and-geosite.dat)」。
* 「[使用證書時權限不足](https://github.com/v2fly/fhs-install-v2ray/wiki/Insufficient-permissions-when-using-certificates)」。
* 「[從舊腳本遷移至此](https://github.com/v2fly/fhs-install-v2ray/wiki/Migrate-from-the-old-script-to-this)」。
* 「[將 .dat 文檔由 lib 目錄移動到 share 目錄](https://github.com/v2fly/fhs-install-v2ray/wiki/Move-.dat-files-from-lib-directory-to-share-directory)」。
* 「[使用 VLESS 協議](https://github.com/v2fly/fhs-install-v2ray/wiki/To-use-the-VLESS-protocol)」。
## 參數
```
usage: install-release.sh [--remove | --version number | -c | -f | -h | -l | -p]
[-p address] [--version number | -c | -f]
--remove Remove V2Ray
--version Install the specified version of V2Ray, e.g., --version v4.18.0
-c, --check Check if V2Ray can be updated
-f, --force Force installation of the latest version of V2Ray
-h, --help Show help
-l, --local Install V2Ray from a local file
-p, --proxy Download through a proxy server, e.g., -p http://127.0.0.1:8118 or -p socks5://127.0.0.1:1080
```
## 維護
請於 [develop](https://github.com/v2fly/fhs-install-v2ray/tree/develop) 分支進行,以避免對主分支造成破壞。
待確定無誤後,兩分支將進行合併。