diff --git a/REAMD.MD b/REAMD.MD index e69de29..129910c 100644 --- a/REAMD.MD +++ b/REAMD.MD @@ -0,0 +1,65 @@ +## xray 基于 Nginx 的 vless + xtls 一键安装脚本 +> 感谢 JetBrains 提供的非商业开源软件开发授权 + +> Thanks for non-commercial open source development authorization by JetBrains + +### Telegram 群组 +* telegram 交流群:https://t.me/wulabing_v2ray +* telegram 更新公告频道:https://t.me/wulabing_channel + +### 准备工作 +* 准备一个域名,并将A记录添加好。 +* 安装好 wget + +### 安装/更新方式(xray) +Vmess+websocket+TLS+Nginx+Website + +``` +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 基础及使用经验,了解计算机网络部分知识,计算机基础操作 +* 目前支持Debian 9+ / Ubuntu 18.04+ / Centos7+ +* 群主仅提供极其有限的支持,如有问题可以询问群友 + +### 鸣谢 + +* 本脚本中 MTProxy-go TLS 版本项目引用 https://github.com/whunt1/onekeymakemtg 在此感谢 whunt1 +* 本脚本中 锐速4合1脚本原项目引用 https://www.94ish.me/1635.html 在此感谢 +* 本脚本中 锐速4合1脚本修改版项目引用 https://github.com/ylx2016/Linux-NetSpeed 在此感谢 ylx2016 +* 本脚本中 配置文件及部分逻辑参考 https://github.com/jiuqi9997/xray-yes 在此感谢 玖柒 +* 本脚本中 二维码API部分参考 https://github.com/mack-a/v2ray-agent 在此感谢 mack-a + +### 启动方式 + +启动 xray:systemctl start xray + +停止 xray:systemctl stop xray + +启动 Nginx:systemctl start nginx + +停止 Nginx:systemctl stop nginx + +### 相关目录 + +Web 目录:/www/xray_web + +xray 服务端配置:/usr/local/etc/xray/config.json + +Nginx 目录: /etc/nginx + +证书文件: /ssl/v2ray.key 和 /ssl/v2ray.crt + +### 捐赠 + +目前支持通过 MugglePay 接受虚拟货币捐赠 + +您可以通过Telegram向我匿名捐赠:发送 /pay @wulabing xxx 到 @MugglePayBot 即可 默认货币为 USDT + +如需要通过支付宝/微信捐赠,请Telegram私聊 @wulabing 感谢您的支持 + +## 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) \ No newline at end of file diff --git a/install.sh b/install.sh index 011d4fd..d2f3c6d 100644 --- a/install.sh +++ b/install.sh @@ -23,7 +23,7 @@ OK="${Green}[OK]${Font}" ERROR="${Red}[ERROR]${Font}" # 变量 -shell_version="0.0.10" +shell_version="1.0.0" github_branch="xray" version_cmp="/tmp/version_cmp.tmp" xray_conf_dir="/usr/local/etc/xray" @@ -232,16 +232,25 @@ function update_sh() { echo -e "${OK} ${GreenBG} 当前版本为最新版本 ${Font}" fi } + +function xray_tmp_config_file_check_and_use() { + if [[ -s ${xray_conf_dir}/config_tmp.json ]]; then + mv -f ${xray_conf_dir}/config_tmp.json ${xray_conf_dir}/config.json + else + print_error "xray 配置文件修改异常" + fi +} + function modify_UUID() { [ -z "$UUID" ] && UUID=$(cat /proc/sys/kernel/random/uuid) cat ${xray_conf_dir}/config.json | jq 'setpath(["inbounds",0,"settings","clients",0,"id"];"'${UUID}'")' >${xray_conf_dir}/config_tmp.json - mv -f ${xray_conf_dir}/config_tmp.json ${xray_conf_dir}/config.json + xray_tmp_config_file_check_and_use judge "Xray UUID 修改" } function modify_tls_version() { cat ${xray_conf_dir}/config.json | jq 'setpath(["inbounds",0,"streamSettings","xtlsSettings","minVersion"];"'$1'")' >${xray_conf_dir}/config_tmp.json - mv -f ${xray_conf_dir}/config_tmp.json ${xray_conf_dir}/config.json + xray_tmp_config_file_check_and_use judge "Xray TLS_version 修改" } @@ -270,9 +279,23 @@ function tls_type() { fi } +function modify_port() { + read -rp "请输入端口号(default:443):" PORT + [ -z "$PORT" ] && PORT="443" + if [[ $PORT -le 0 ]] || [[ $PORT -gt 65535 ]]; then + print_error "请输入0-65535之间的值" + exit 1 + fi + port_exist_check $PORT + cat ${xray_conf_dir}/config.json | jq 'setpath(["inbounds",0,"port"];'${PORT}')' >${xray_conf_dir}/config_tmp.json + xray_tmp_config_file_check_and_use + judge "xray 端口 修改" +} + function configure_xray() { cd /usr/local/etc/xray && rm -f config.json && wget -O config.json https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/xray/config/xray_xtls-rprx-direct.json modify_UUID + modify_port tls_type } @@ -453,7 +476,6 @@ function install_xray() { basic_optimization domain_check port_exist_check 80 - port_exist_check 443 xray_install configure_xray nginx_install @@ -478,6 +500,7 @@ menu() { echo -e "—————————————— 配置变更 ——————————————" echo -e "${Green}11.${Font} 变更 UUID" echo -e "${Green}12.${Font} 变更 TLS 最低适配版本" + echo -e "${Green}13.${Font} 变更 连接端口" echo -e "—————————————— 查看信息 ——————————————" echo -e "${Green}21.${Font} 查看 实时访问日志" echo -e "${Green}22.${Font} 查看 实时错误日志" @@ -505,6 +528,10 @@ menu() { tls_type restart_all ;; + 13) + modify_port + restart_all + ;; 21) xray_access_log ;; @@ -524,7 +551,7 @@ menu() { xray_uninstall ;; *) - echo -e "${RedBG}请输入正确的数字${Font}" + print_error "请输入正确的数字" ;; esac }