Skip to content
 
 

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xray-installer

在 VPS 本机执行的 Go 命令行工具。

启动后会交互式询问:

  • 域名

FlClash 节点名称固定为博客长模板中的 [自建 1] 美国家宽-Reality,然后自动继续安装。

一键安装并立即执行

install.sh 会从 GitHub Releases 下载预编译二进制,因此仓库需要先发布一个 tag/release。

bash <(curl -fsSL https://raw.githubusercontent.com/manateelazycat/xray-installer/main/install.sh) install

仅安装,不立即运行:

bash <(curl -fsSL https://raw.githubusercontent.com/manateelazycat/xray-installer/main/install.sh) install --no-run

安装后以 dry-run 方式立刻启动:

bash <(curl -fsSL https://raw.githubusercontent.com/manateelazycat/xray-installer/main/install.sh) install -- --dry-run

一键卸载:

bash <(curl -fsSL https://raw.githubusercontent.com/manateelazycat/xray-installer/main/install.sh) uninstall
xray-installer

它会自动:

  • 检查运行环境(root / Linux / systemd / Debian/Ubuntu/Arch Linux)
  • 检查 443 端口占用情况并给出提示(不再前置拦截安装)
  • 安装 Xray
  • 生成 VLESS + Reality + Vision 服务端配置
  • 启动并启用 xray systemd 服务
  • 生成文章同款长版 FlClash 配置 proxy.yaml
  • 支持 uninstall
  • 支持 --dry-run
  • 支持 GitHub Release 二进制一键安装脚本 install.sh

当前边界

  • 只支持 Debian / Ubuntu / Arch Linux + systemd
  • 需要在 VPS 本机运行
  • 域名 DNS 需要提前配好
  • 如果用了 Cloudflare,需要保证是 DNS Only

构建

go build ./cmd/xray-installer

运行

sudo ./xray-installer

帮助

./xray-installer --help
./xray-installer --version

卸载

sudo ./xray-installer uninstall

Dry run

./xray-installer --dry-run

生成文件:

  • Xray 配置:/usr/local/etc/xray/config.json
  • FlClash 配置:/usr/local/etc/xray-installer/proxy.yaml
  • 安装记录:/usr/local/etc/xray-installer/install-result.json

安装完成后,可用下面命令直接获取 FlClash 配置:

sudo cat /usr/local/etc/xray-installer/proxy.yaml

验证

go test ./...
go build ./cmd/xray-installer

参考

License

GPL-3.0

About

一键自动化部署Xray VPS

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages