diff --git a/README.md b/README.md index 35156d8..12e1643 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ wget -N --no-check-certificate -q -O install.sh "https://raw.githubusercontent.c * 本脚本中 锐速4合1脚本修改版项目引用 https://github.com/ylx2016/Linux-NetSpeed 在此感谢 ylx2016 ### 证书 -> 如果你已经拥有了你所使用域名的证书文件,可以将 crt 和 key 文件命名为 xray.crt xray.key 放在 /data 目录下(若目录不存在请先建目录),请注意证书文件权限及证书有效期,自定义证书有效期过期后请自行续签。 +> 如果你已经拥有了你所使用域名的证书文件,可以将 crt 和 key 文件命名为 xray.crt xray.key 放在 /etc/idleleo/cert 目录下(若目录不存在请先建目录),请注意证书文件权限及证书有效期,自定义证书有效期过期后请自行续签。 脚本支持自动生成 let's encrypted 证书,有效期3个月,理论上自动生成的证书支持自动续签。 @@ -89,4 +89,4 @@ xray 客户端配置: `~/xray_info.txt` Nginx 目录: `/etc/nginx` -证书文件: `/data/xray.key 和 /data/xray.crt` 请注意证书权限设置。 +证书文件: `/etc/idleleo/cert/xray.key 和 /etc/idleleo/cert/xray.crt` 请注意证书权限设置。 diff --git a/VLESS_xtls/config.json b/VLESS_xtls/config.json index 38d33e8..42ccb15 100644 --- a/VLESS_xtls/config.json +++ b/VLESS_xtls/config.json @@ -30,8 +30,8 @@ "http/1.1" ], "certificates": [{ - "certificateFile": "/usr/bin/idleleo-xray/data/xray.crt", - "keyFile": "/usr/bin/idleleo-xray/data/xray.key" + "certificateFile": "/etc/idleleo/cert/xray.crt", + "keyFile": "/etc/idleleo/cert/xray.key" }] } } diff --git a/install.sh b/install.sh index 19260a2..6c33521 100644 --- a/install.sh +++ b/install.sh @@ -32,7 +32,7 @@ Error="${Red}[错误]${Font}" Warning="${Red}[警告]${Font}" # 版本 -shell_version="1.4.3.9" +shell_version="1.4.5.1" shell_mode="None" shell_mode_show="未安装" version_cmp="/tmp/version_cmp.tmp" @@ -40,15 +40,14 @@ xray_conf_dir="/usr/local/etc/xray" nginx_conf_dir="/etc/nginx/conf/conf.d" xray_conf="${xray_conf_dir}/config.json" nginx_conf="${nginx_conf_dir}/xray.conf" -idleleo_xray_dir="/usr/bin/idleleo-xray" +idleleo_xray_dir="/etc/idleleo" idleleo_commend_file="/usr/bin/idleleo" -ssl_chainpath="${idleleo_xray_dir}/data" +ssl_chainpath="${idleleo_xray_dir}/cert" nginx_dir="/etc/nginx" -web_dir="/home/wwwroot" nginx_openssl_src="/usr/local/src" xray_bin_dir="/usr/local/bin/xray" -xray_info_file="$HOME/xray_info.inf" -xray_qr_config_file="/usr/local/vless_qr.json" +xray_info_file="${idleleo_xray_dir}/info/xray_info.inf" +xray_qr_config_file="${idleleo_xray_dir}/info/vless_qr.json" nginx_systemd_file="/etc/systemd/system/nginx.service" xray_systemd_file="/etc/systemd/system/xray.service" xray_systemd_file2="/etc/systemd/system/xray@.service" @@ -698,8 +697,8 @@ nginx_conf_add() { server { listen 443 ssl http2; listen [::]:443 ssl http2; - ssl_certificate /usr/bin/idleleo-xray/data/xray.crt; - ssl_certificate_key /usr/bin/idleleo-xray/data/xray.key; + ssl_certificate /etc/idleleo/cert/xray.crt; + ssl_certificate_key /etc/idleleo/cert/xray.key; ssl_protocols TLSv1.3; ssl_ciphers TLS13-AES-128-GCM-SHA256:TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AES128:EECDH+aRSA+AES128:RSA+AES128:EECDH+ECDSA+AES256:EECDH+aRSA+AES256:RSA+AES256:EECDH+ECDSA+3DES:EECDH+aRSA+3DES:RSA+3DES:!MD5; server_name serveraddr.com; @@ -804,7 +803,7 @@ nginx_process_disabled() { } acme_cron_update() { - wget -N -P /usr/bin/idleleo-xray --no-check-certificate "https://raw.githubusercontent.com/paniy/Xray_bash_onekey/main/ssl_update.sh" + wget -N -P /etc/idleleo --no-check-certificate "https://raw.githubusercontent.com/paniy/Xray_bash_onekey/main/ssl_update.sh" if [[ $(crontab -l | grep -c "ssl_update.sh") -lt 1 ]]; then if [[ "${ID}" == "centos" ]]; then # sed -i "/acme.sh/c 0 3 * * 0 \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ @@ -820,6 +819,7 @@ acme_cron_update() { } vless_qr_config_tls_ws() { + mkdir -p ${idleleo_xray_dir}/info cat >$xray_qr_config_file <<-EOF { "v": "2", @@ -838,6 +838,7 @@ EOF } vless_qr_config_xtls() { + mkdir -p ${idleleo_xray_dir}/info cat >$xray_qr_config_file <<-EOF { "v": "2", @@ -1063,7 +1064,6 @@ uninstall_all() { esac fi [[ -d $xray_conf_dir ]] && rm -rf $xray_conf_dir - [[ -d $web_dir ]] && rm -rf $web_dir systemctl daemon-reload echo -e "${OK} ${GreenBG} 已卸载,SSL证书文件已保留 ${Font}" } @@ -1199,8 +1199,8 @@ idleleo_commend() { if [ -L "${idleleo_commend_file}" ]; then echo -e "${Green}可以使用${Red} idleleo ${Font}命令管理脚本\n${Font}" else - if [ -L "/usr/local/bin/idleleo" ]; then - rm -f /usr/local/bin/idleleo + if [ -L "/usr/bin/idleleo-xray" ]; then + rm -rf /usr/bin/idleleo-xray fi ln -s $( cd "$(dirname "$0")" @@ -1236,7 +1236,7 @@ menu() { echo -e "${Green}10.${Font} 查看 Xray 配置信息" echo -e "—————————————— 其他选项 ——————————————" echo -e "${Green}11.${Font} 安装 TCP 加速脚本" - echo -e "${Green}12.${Font} 安装 MTproxy (支持TLS混淆)" + echo -e "${Green}12.${Font} 安装 MTproxy (不推荐使用)" echo -e "${Green}13.${Font} 证书 有效期更新" echo -e "${Green}14.${Font} 卸载 Xray" echo -e "${Green}15.${Font} 更新 证书crontab计划任务" diff --git a/ssl_update.sh b/ssl_update.sh index b6fc72c..23fec82 100644 --- a/ssl_update.sh +++ b/ssl_update.sh @@ -2,10 +2,10 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH -xray_qr_config_file="/usr/local/vmess_qr.json" cert_group="nobody" -idleleo_xray_dir="/usr/bin/idleleo-xray" -ssl_chainpath="${idleleo_xray_dir}/data" +idleleo_xray_dir="/etc/idleleo" +ssl_chainpath="${idleleo_xray_dir}/cert" +xray_qr_config_file="${idleleo_xray_dir}/info/vmess_qr.json" domain=$(grep '\"add\"' $xray_qr_config_file | awk -F '"' '{print $4}') systemctl stop nginx &> /dev/null