Signaliks 2021-02-18 13:46:50 +08:00 committed by GitHub
parent 03bbad6c01
commit 82bdc1b894
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 49 deletions

View File

@ -1,65 +1,65 @@
## xray 基于 Nginx 的 vless + xtls 一键安装脚本 ## xray 基于 Nginx 的 VLESS + xtls 一键安装脚本
> 感谢 JetBrains 提供的非商业开源软件开发授权 > 感谢 JetBrains 提供的非商业开源软件开发授权
> Thanks for non-commercial open source development authorization by JetBrains > Thanks for non-commercial open source development authorization by JetBrains!
### Telegram 群组 ### Telegram 群组
* telegram 交流群:https://t.me/wulabing_v2ray * Telegram 交流群:https://t.me/wulabing_v2ray
* telegram 更新公告频道https://t.me/wulabing_channel * Telegram 更新公告频道https://t.me/wulabing_channel
### 准备工作 ### 准备工作
* 准备一个域名,并将A记录添加好。 * 准备一个域名,并将 A 记录添加好;
* 安装好 wget * 安装好 wget
### 安装/更新方式xray ### 安装/更新方式xray
vless + xtls + nginx + web VLESS + xtls + nginx + Web
``` ```
wget -N --no-check-certificate -q -O install.sh "https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/xray/install.sh" && chmod +x install.sh && bash install.sh wget -N --no-check-certificate -q -O install.sh "https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/xray/install.sh" && chmod +x install.sh && bash install.sh
``` ```
### 注意事项 ### 注意事项
* 如果你不了解脚本中各项设置的具体含义,除域名外,请使用脚本提供的默认值 * 如果你不了解脚本中各项设置的具体含义,除域名外,请使用脚本提供的默认值
* 使用本脚本需要你拥有 Linux 基础及使用经验,了解计算机网络部分知识,计算机基础操作 * 使用本脚本需要你拥有 Linux 基础及使用经验,了解计算机网络部分知识,计算机基础操作
* 目前支持Debian 9+ / Ubuntu 18.04+ / Centos7+ * 目前支持 Debian 9+ / Ubuntu 18.04+ / Centos7+
* 群主仅提供极其有限的支持,如有问题可以询问群友 * 群主仅提供极其有限的支持,如有问题可以询问群友
### 鸣谢 ### 鸣谢
* 本脚本中 MTProxyTLS 基于 https://github.com/sunpma/mtp 二次修改 在此感谢 sunpma * 本脚本中 MTProxyTLS 基于 https://github.com/sunpma/mtp 二次修改 在此感谢 sunpma
* 本脚本中 锐速4合1脚本原项目引用 https://www.94ish.me/1635.html 在此感谢 * 本脚本中 锐速 4 1 脚本原项目引用 https://www.94ish.me/1635.html 在此感谢
* 本脚本中 锐速4合1脚本修改版项目引用 https://github.com/ylx2016/Linux-NetSpeed 在此感谢 ylx2016 * 本脚本中 锐速 4 1 脚本修改版项目引用 https://github.com/ylx2016/Linux-NetSpeed 在此感谢 ylx2016
* 本脚本中 配置文件及部分逻辑参考 https://github.com/jiuqi9997/xray-yes 在此感谢 玖柒 * 本脚本中 配置文件及部分逻辑参考 https://github.com/jiuqi9997/xray-yes 在此感谢 玖柒
* 本脚本中 二维码API部分参考 https://github.com/mack-a/v2ray-agent 在此感谢 mack-a * 本脚本中 二维码 API 部分参考 https://github.com/mack-a/v2ray-agent 在此感谢 mack-a
### 启动方式 ### 启动方式
启动 xraysystemctl start xray 启动 xray`systemctl start xray`
停止 xraysystemctl stop xray 停止 xray`systemctl stop xray`
启动 Nginxsystemctl start nginx 启动 Nginx`systemctl start nginx`
停止 Nginxsystemctl stop nginx 停止 Nginx`systemctl stop nginx`
### 相关目录 ### 相关目录
Web 目录:/www/xray_web Web 目录:`/www/xray_web`
xray 服务端配置:/usr/local/etc/xray/config.json xray 服务端配置:`/usr/local/etc/xray/config.json`
Nginx 目录: /etc/nginx Nginx 目录: `/etc/nginx`
证书文件: /ssl/xray.key 和 /ssl/xray.crt 证书文件 `/ssl/xray.key`(私钥)和 `/ssl/xray.crt`(证书公钥)
### 捐赠 ### 捐赠
目前支持通过 MugglePay 接受虚拟货币捐赠 目前支持通过 MugglePay 接受虚拟货币捐赠
您可以通过Telegram向我匿名捐赠发送 /pay @wulabing xxx 到 @MugglePayBot 即可 默认货币为 USDT 您可以通过 Telegram 向我匿名捐赠:发送 `/pay @wulabing xxx` 到 @MugglePayBot 即可,默认货币为 USDT。
如需要通过支付宝/微信捐赠,请Telegram私聊 @wulabing 感谢您的支持 如需要通过支付宝/微信捐赠,请在 Telegram 私聊 [@wulabing](https://t.me/wulabing),感谢您的支持!
## Stargazers over time ## Stargazers over time
[![Stargazers over time](https://starchart.cc/wulabing/V2Ray_ws-tls_bash_onekey.svg)](https://starchart.cc/wulabing/V2Ray_ws-tls_bash_onekey) [![Stargazers over time](https://starchart.cc/wulabing/V2Ray_ws-tls_bash_onekey.svg)](https://starchart.cc/wulabing/V2Ray_ws-tls_bash_onekey)

View File

@ -4,7 +4,7 @@
# System Request:Debian 9+/Ubuntu 18.04+/Centos 7+ # System Request:Debian 9+/Ubuntu 18.04+/Centos 7+
# Author: wulabing # Author: wulabing
# Dscription: xray onekey Management # Dscription: xray onekey Management
# email:admin@wulabing.com # email: admin@wulabing.com
#==================================================== #====================================================
cd "$( cd "$(
@ -46,9 +46,9 @@ function print_error() {
function is_root() { function is_root() {
if [[ 0 == "$UID" ]]; then if [[ 0 == "$UID" ]]; then
print_ok "当前用户是root用户开始安装流程" print_ok "当前用户是 root 用户,开始安装流程"
else else
print_error "当前用户不是root用户请切换到root用户后重新执行脚本" print_error "当前用户不是 root 用户,请切换到 root 用户后重新执行脚本"
exit 1 exit 1
fi fi
} }
@ -172,19 +172,19 @@ function basic_optimization() {
fi fi
} }
function domain_check() { function domain_check() {
read -rp "请输入你的域名信息(eg:www.wulabing.com):" domain read -rp "请输入你的域名信息(eg: www.wulabing.com):" domain
domain_ip=$(ping "${domain}" -c 1 | sed '1{s/[^(]*(//;s/).*//;q}') domain_ip=$(ping "${domain}" -c 1 | sed '1{s/[^(]*(//;s/).*//;q}')
print_ok "正在获取 公网ip 信息,请耐心等待" print_ok "正在获取 IP 地址信息,请耐心等待"
local_ip=$(curl https://api-ipv4.ip.sb/ip) local_ip=$(curl https://api-ipv4.ip.sb/ip)
echo -e "域名dns解析IP${domain_ip}" echo -e "域名通过 DNS 解析的 IP 地址${domain_ip}"
echo -e "本机IP: ${local_ip}" echo -e "本机公网 IP 地址: ${local_ip}"
sleep 2 sleep 2
if [[ ${domain_ip} == "${local_ip}" ]]; then if [[ ${domain_ip} == "${local_ip}" ]]; then
print_ok "域名dns解析IP 与 本机IP 匹配" print_ok "域名通过 DNS 解析的 IP 地址与 本机 IP 地址匹配"
sleep 2 sleep 2
else else
print_error "请确保域名添加了正确的 A 记录,否则将无法正常使用 xray" print_error "请确保域名添加了正确的 A 记录,否则将无法正常使用 xray"
print_error "域名dns解析IP 与 本机IP 不匹配 是否继续安装y/n" && read -r install print_error "域名通过 DNS 解析的 IP 地址与 本机 IP 地址不匹配,是否继续安装y/n" && read -r install
case $install in case $install in
[yY][eE][sS] | [yY]) [yY][eE][sS] | [yY])
print_ok "继续安装" print_ok "继续安装"
@ -264,8 +264,8 @@ function configure_nginx() {
} }
function tls_type() { function tls_type() {
echo "请选择支持的 TLS 版本(default:3:" echo "请选择支持的 TLS 版本(默认TLS1.3 only:"
echo "1: TLS1.1 TLS1.2 and TLS1.3(兼容模式)" echo "1: TLS1.1, TLS1.2 and TLS1.3(兼容模式)"
echo "2: TLS1.2 and TLS1.3 (兼容模式)" echo "2: TLS1.2 and TLS1.3 (兼容模式)"
echo "3: TLS1.3 only" echo "3: TLS1.3 only"
read -rp "请输入:" tls_version read -rp "请输入:" tls_version
@ -280,10 +280,10 @@ function tls_type() {
} }
function modify_port() { function modify_port() {
read -rp "请输入端口号(default:443)" PORT read -rp "请输入端口号(默认:443)" PORT
[ -z "$PORT" ] && PORT="443" [ -z "$PORT" ] && PORT="443"
if [[ $PORT -le 0 ]] || [[ $PORT -gt 65535 ]]; then if [[ $PORT -le 0 ]] || [[ $PORT -gt 65535 ]]; then
print_error "请输入0-65535之间的值" print_error "请输入 0-65535 之间的值"
exit 1 exit 1
fi fi
port_exist_check $PORT port_exist_check $PORT
@ -423,10 +423,10 @@ function vless_xtls-rprx-direct_link() {
FLOW=$(cat ${xray_conf_dir}/config.json | jq .inbounds[0].settings.clients[0].flow | tr -d '"') FLOW=$(cat ${xray_conf_dir}/config.json | jq .inbounds[0].settings.clients[0].flow | tr -d '"')
DOMAIN=$(cat ${domain_tmp_dir}/domain) DOMAIN=$(cat ${domain_tmp_dir}/domain)
print_ok "URL 链接(V2RayN/NG)" print_ok "URL 链接V2RayN/V2RayNG"
print_ok "vless://$UUID@$DOMAIN:$PORT?security=xtls&flow=$FLOW#wulabing-$DOMAIN" print_ok "vless://$UUID@$DOMAIN:$PORT?security=xtls&flow=$FLOW#wulabing-$DOMAIN"
print_ok "URL 二维码(V2RayN/NG)(请在浏览器中访问)" print_ok "URL 二维码V2RayN/V2RayNG请在浏览器中访问"
print_ok "https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vless://$UUID@$DOMAIN:$PORT?security=xtls%26flow=$FLOW%23wulabing-$DOMAIN" print_ok "https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vless://$UUID@$DOMAIN:$PORT?security=xtls%26flow=$FLOW%23wulabing-$DOMAIN"
} }
@ -439,7 +439,7 @@ function vless_xtls-rprx-direct_information() {
echo -e "${Red} xray 配置信息 ${Font}" echo -e "${Red} xray 配置信息 ${Font}"
echo -e "${Red} 地址address:${Font} $DOMAIN" echo -e "${Red} 地址address:${Font} $DOMAIN"
echo -e "${Red} 端口port${Font} $PORT" echo -e "${Red} 端口port${Font} $PORT"
echo -e "${Red} 用户idUUID${Font} $UUID" echo -e "${Red} 用户 IDUUID${Font} $UUID"
echo -e "${Red} 流控flow${Font} $FLOW" echo -e "${Red} 流控flow${Font} $FLOW"
echo -e "${Red} 加密方式security${Font} none " echo -e "${Red} 加密方式security${Font} none "
echo -e "${Red} 传输协议network${Font} tcp " echo -e "${Red} 传输协议network${Font} tcp "
@ -447,7 +447,7 @@ function vless_xtls-rprx-direct_information() {
echo -e "${Red} 底层传输安全:${Font} xtls " echo -e "${Red} 底层传输安全:${Font} xtls "
} }
function basic_information() { function basic_information() {
print_ok "vless+tcp+xtls+nginx 安装成功" print_ok "VLESS+tcp+xtls+nginx 安装成功"
vless_xtls-rprx-direct_information vless_xtls-rprx-direct_information
vless_xtls-rprx-direct_link vless_xtls-rprx-direct_link
} }
@ -496,7 +496,7 @@ menu() {
echo -e "—————————————— 安装向导 ——————————————""" echo -e "—————————————— 安装向导 ——————————————"""
echo -e "${Green}0.${Font} 升级 脚本" echo -e "${Green}0.${Font} 升级 脚本"
echo -e "${Green}1.${Font} 安装 xray (vless+tcp+xtls+nginx)" echo -e "${Green}1.${Font} 安装 xray (VLESS+tcp+xtls+nginx)"
echo -e "—————————————— 配置变更 ——————————————" echo -e "—————————————— 配置变更 ——————————————"
echo -e "${Green}11.${Font} 变更 UUID" echo -e "${Green}11.${Font} 变更 UUID"
echo -e "${Green}12.${Font} 变更 TLS 最低适配版本" echo -e "${Green}12.${Font} 变更 TLS 最低适配版本"
@ -507,8 +507,8 @@ menu() {
echo -e "${Green}23.${Font} 查看 xray 配置链接" echo -e "${Green}23.${Font} 查看 xray 配置链接"
# echo -e "${Green}23.${Font} 查看 V2Ray 配置信息" # echo -e "${Green}23.${Font} 查看 V2Ray 配置信息"
echo -e "—————————————— 其他选项 ——————————————" echo -e "—————————————— 其他选项 ——————————————"
echo -e "${Green}31.${Font} 安装 4合1 bbr 锐速安装脚本" echo -e "${Green}31.${Font} 安装 4 合 1 BBR、锐速安装脚本"
echo -e "${Green}32.${Font} 安装 MTproxy(支持TLS混淆)" echo -e "${Green}32.${Font} 安装 MTproxy(支持 TLS 混淆)"
echo -e "${Green}33.${Font} 卸载 xray" echo -e "${Green}33.${Font} 卸载 xray"
read -rp "请输入数字:" menu_num read -rp "请输入数字:" menu_num