diff --git a/config/client/h2.json b/config/client/h2.json index c11edcf..d7a0d39 100644 --- a/config/client/h2.json +++ b/config/client/h2.json @@ -54,6 +54,10 @@ "network": "tcp,udp", "timeout": 0, "followRedirect": true + }, + "sniffing": { + "enabled": true, + "destOverride": ["http", "tls"] } }, { @@ -86,17 +90,24 @@ ], "dns": { "servers": [ - "1.1.1.1", - "1.0.0.1", { "address": "119.29.29.29", "port": 53, "domains": [ - "geosite:cn" + "geosite:cn" + ], + "expectIPs": [ + "geoip:cn" + ] + }, + { + "address": "1.1.1.1", + "port": 53, + "domains": [ + "geosite:geolocation-!cn" ] }, "8.8.8.8", - "8.8.4.4", "localhost" ] }, diff --git a/config/client/http.json b/config/client/http.json index 4dd7fcc..ac87af1 100644 --- a/config/client/http.json +++ b/config/client/http.json @@ -84,6 +84,10 @@ "network": "tcp,udp", "timeout": 0, "followRedirect": true + }, + "sniffing": { + "enabled": true, + "destOverride": ["http", "tls"] } }, { @@ -116,17 +120,24 @@ ], "dns": { "servers": [ - "1.1.1.1", - "1.0.0.1", { "address": "119.29.29.29", "port": 53, "domains": [ - "geosite:cn" + "geosite:cn" + ], + "expectIPs": [ + "geoip:cn" + ] + }, + { + "address": "1.1.1.1", + "port": 53, + "domains": [ + "geosite:geolocation-!cn" ] }, "8.8.8.8", - "8.8.4.4", "localhost" ] }, diff --git a/config/client/kcp.json b/config/client/kcp.json index 4a6f583..dafda17 100644 --- a/config/client/kcp.json +++ b/config/client/kcp.json @@ -55,6 +55,10 @@ "network": "tcp,udp", "timeout": 0, "followRedirect": true + }, + "sniffing": { + "enabled": true, + "destOverride": ["http", "tls"] } }, { @@ -87,17 +91,24 @@ ], "dns": { "servers": [ - "1.1.1.1", - "1.0.0.1", { "address": "119.29.29.29", "port": 53, "domains": [ - "geosite:cn" + "geosite:cn" + ], + "expectIPs": [ + "geoip:cn" + ] + }, + { + "address": "1.1.1.1", + "port": 53, + "domains": [ + "geosite:geolocation-!cn" ] }, "8.8.8.8", - "8.8.4.4", "localhost" ] }, diff --git a/config/client/quic.json b/config/client/quic.json index 26eef04..01b2c06 100644 --- a/config/client/quic.json +++ b/config/client/quic.json @@ -54,6 +54,10 @@ "network": "tcp,udp", "timeout": 0, "followRedirect": true + }, + "sniffing": { + "enabled": true, + "destOverride": ["http", "tls"] } }, { @@ -86,17 +90,24 @@ ], "dns": { "servers": [ - "1.1.1.1", - "1.0.0.1", { "address": "119.29.29.29", "port": 53, "domains": [ - "geosite:cn" + "geosite:cn" + ], + "expectIPs": [ + "geoip:cn" + ] + }, + { + "address": "1.1.1.1", + "port": 53, + "domains": [ + "geosite:geolocation-!cn" ] }, "8.8.8.8", - "8.8.4.4", "localhost" ] }, diff --git a/config/client/tcp.json b/config/client/tcp.json index e2493a9..687d80e 100644 --- a/config/client/tcp.json +++ b/config/client/tcp.json @@ -44,6 +44,10 @@ "network": "tcp,udp", "timeout": 0, "followRedirect": true + }, + "sniffing": { + "enabled": true, + "destOverride": ["http", "tls"] } }, { @@ -76,17 +80,24 @@ ], "dns": { "servers": [ - "1.1.1.1", - "1.0.0.1", { "address": "119.29.29.29", "port": 53, "domains": [ - "geosite:cn" + "geosite:cn" + ], + "expectIPs": [ + "geoip:cn" + ] + }, + { + "address": "1.1.1.1", + "port": 53, + "domains": [ + "geosite:geolocation-!cn" ] }, "8.8.8.8", - "8.8.4.4", "localhost" ] }, diff --git a/config/client/ws.json b/config/client/ws.json index 55d842b..108bc49 100644 --- a/config/client/ws.json +++ b/config/client/ws.json @@ -47,6 +47,10 @@ "network": "tcp,udp", "timeout": 0, "followRedirect": true + }, + "sniffing": { + "enabled": true, + "destOverride": ["http", "tls"] } }, { @@ -79,17 +83,24 @@ ], "dns": { "servers": [ - "1.1.1.1", - "1.0.0.1", { "address": "119.29.29.29", "port": 53, "domains": [ - "geosite:cn" + "geosite:cn" + ], + "expectIPs": [ + "geoip:cn" + ] + }, + { + "address": "1.1.1.1", + "port": 53, + "domains": [ + "geosite:geolocation-!cn" ] }, "8.8.8.8", - "8.8.4.4", "localhost" ] }, diff --git a/config/client/ws_tls.json b/config/client/ws_tls.json index 1782dfb..85c1625 100644 --- a/config/client/ws_tls.json +++ b/config/client/ws_tls.json @@ -57,6 +57,10 @@ "network": "tcp,udp", "timeout": 0, "followRedirect": true + }, + "sniffing": { + "enabled": true, + "destOverride": ["http", "tls"] } }, { @@ -89,17 +93,24 @@ ], "dns": { "servers": [ - "1.1.1.1", - "1.0.0.1", { "address": "119.29.29.29", "port": 53, "domains": [ - "geosite:cn" + "geosite:cn" + ], + "expectIPs": [ + "geoip:cn" + ] + }, + { + "address": "1.1.1.1", + "port": 53, + "domains": [ + "geosite:geolocation-!cn" ] }, "8.8.8.8", - "8.8.4.4", "localhost" ] }, diff --git a/config/server/dynamic/http.json b/config/server/dynamic/http.json index 4661469..bf5f85d 100644 --- a/config/server/dynamic/http.json +++ b/config/server/dynamic/http.json @@ -97,18 +97,16 @@ "outbounds": [ { "protocol": "freedom", - "settings": {} + "settings": { + "domainStrategy": "UseIP" + }, + "tag": "direct" }, { "protocol": "blackhole", "settings": {}, "tag": "blocked" - }, - { - "protocol": "freedom", - "settings": {}, - "tag": "direct" - }, + }, { "protocol": "mtproto", "settings": {}, @@ -118,7 +116,8 @@ // ], "dns": { - "server": [ + "servers": [ + "https+local://1.1.1.1/dns-query", "1.1.1.1", "1.0.0.1", "8.8.8.8", @@ -167,9 +166,6 @@ "uplinkCapacity": 100, "downlinkCapacity": 100, "congestion": true - }, - "sockopt": { - "tcpFastOpen": true - } + } } } \ No newline at end of file diff --git a/config/server/dynamic/kcp.json b/config/server/dynamic/kcp.json index 48e3b8b..5e8fb16 100644 --- a/config/server/dynamic/kcp.json +++ b/config/server/dynamic/kcp.json @@ -69,18 +69,16 @@ "outbounds": [ { "protocol": "freedom", - "settings": {} + "settings": { + "domainStrategy": "UseIP" + }, + "tag": "direct" }, { "protocol": "blackhole", "settings": {}, "tag": "blocked" - }, - { - "protocol": "freedom", - "settings": {}, - "tag": "direct" - }, + }, { "protocol": "mtproto", "settings": {}, @@ -90,7 +88,8 @@ // ], "dns": { - "server": [ + "servers": [ + "https+local://1.1.1.1/dns-query", "1.1.1.1", "1.0.0.1", "8.8.8.8", @@ -139,9 +138,6 @@ "uplinkCapacity": 100, "downlinkCapacity": 100, "congestion": true - }, - "sockopt": { - "tcpFastOpen": true - } + } } } \ No newline at end of file diff --git a/config/server/dynamic/quic.json b/config/server/dynamic/quic.json index 16911b4..73dda58 100644 --- a/config/server/dynamic/quic.json +++ b/config/server/dynamic/quic.json @@ -23,7 +23,6 @@ "streamSettings": { "network": "quic", "quicSettings": { - "security": "aes-128-gcm", "key": "", "header": { "type": "none" @@ -56,7 +55,6 @@ "streamSettings": { "network": "quic", "quicSettings": { - "security": "aes-128-gcm", "key": "", "header": { "type": "none" @@ -73,18 +71,16 @@ "outbounds": [ { "protocol": "freedom", - "settings": {} + "settings": { + "domainStrategy": "UseIP" + }, + "tag": "direct" }, { "protocol": "blackhole", "settings": {}, "tag": "blocked" - }, - { - "protocol": "freedom", - "settings": {}, - "tag": "direct" - }, + }, { "protocol": "mtproto", "settings": {}, @@ -94,7 +90,8 @@ // ], "dns": { - "server": [ + "servers": [ + "https+local://1.1.1.1/dns-query", "1.1.1.1", "1.0.0.1", "8.8.8.8", @@ -143,9 +140,6 @@ "uplinkCapacity": 100, "downlinkCapacity": 100, "congestion": true - }, - "sockopt": { - "tcpFastOpen": true - } + } } } \ No newline at end of file diff --git a/config/server/dynamic/tcp.json b/config/server/dynamic/tcp.json index 7c4d90b..9a8e049 100644 --- a/config/server/dynamic/tcp.json +++ b/config/server/dynamic/tcp.json @@ -56,18 +56,16 @@ "outbounds": [ { "protocol": "freedom", - "settings": {} + "settings": { + "domainStrategy": "UseIP" + }, + "tag": "direct" }, { "protocol": "blackhole", "settings": {}, "tag": "blocked" - }, - { - "protocol": "freedom", - "settings": {}, - "tag": "direct" - }, + }, { "protocol": "mtproto", "settings": {}, @@ -77,7 +75,8 @@ // ], "dns": { - "server": [ + "servers": [ + "https+local://1.1.1.1/dns-query", "1.1.1.1", "1.0.0.1", "8.8.8.8", @@ -126,9 +125,6 @@ "uplinkCapacity": 100, "downlinkCapacity": 100, "congestion": true - }, - "sockopt": { - "tcpFastOpen": true - } + } } } \ No newline at end of file diff --git a/config/server/dynamic/ws.json b/config/server/dynamic/ws.json index 51c889a..31ecee3 100644 --- a/config/server/dynamic/ws.json +++ b/config/server/dynamic/ws.json @@ -59,18 +59,16 @@ "outbounds": [ { "protocol": "freedom", - "settings": {} + "settings": { + "domainStrategy": "UseIP" + }, + "tag": "direct" }, { "protocol": "blackhole", "settings": {}, "tag": "blocked" - }, - { - "protocol": "freedom", - "settings": {}, - "tag": "direct" - }, + }, { "protocol": "mtproto", "settings": {}, @@ -80,7 +78,8 @@ // ], "dns": { - "server": [ + "servers": [ + "https+local://1.1.1.1/dns-query", "1.1.1.1", "1.0.0.1", "8.8.8.8", @@ -129,9 +128,6 @@ "uplinkCapacity": 100, "downlinkCapacity": 100, "congestion": true - }, - "sockopt": { - "tcpFastOpen": true - } + } } } \ No newline at end of file diff --git a/config/server/h2.json b/config/server/h2.json index 6be2a38..fc52a20 100644 --- a/config/server/h2.json +++ b/config/server/h2.json @@ -52,18 +52,16 @@ "outbounds": [ { "protocol": "freedom", - "settings": {} + "settings": { + "domainStrategy": "UseIP" + }, + "tag": "direct" }, { "protocol": "blackhole", "settings": {}, "tag": "blocked" - }, - { - "protocol": "freedom", - "settings": {}, - "tag": "direct" - }, + }, { "protocol": "mtproto", "settings": {}, @@ -73,7 +71,8 @@ // ], "dns": { - "server": [ + "servers": [ + "https+local://1.1.1.1/dns-query", "1.1.1.1", "1.0.0.1", "8.8.8.8", @@ -122,9 +121,6 @@ "uplinkCapacity": 100, "downlinkCapacity": 100, "congestion": true - }, - "sockopt": { - "tcpFastOpen": true - } + } } } \ No newline at end of file diff --git a/config/server/http.json b/config/server/http.json index 77e1a8b..666d313 100644 --- a/config/server/http.json +++ b/config/server/http.json @@ -70,18 +70,16 @@ "outbounds": [ { "protocol": "freedom", - "settings": {} + "settings": { + "domainStrategy": "UseIP" + }, + "tag": "direct" }, { "protocol": "blackhole", "settings": {}, "tag": "blocked" - }, - { - "protocol": "freedom", - "settings": {}, - "tag": "direct" - }, + }, { "protocol": "mtproto", "settings": {}, @@ -91,7 +89,8 @@ // ], "dns": { - "server": [ + "servers": [ + "https+local://1.1.1.1/dns-query", "1.1.1.1", "1.0.0.1", "8.8.8.8", @@ -140,9 +139,6 @@ "uplinkCapacity": 100, "downlinkCapacity": 100, "congestion": true - }, - "sockopt": { - "tcpFastOpen": true - } + } } } \ No newline at end of file diff --git a/config/server/kcp.json b/config/server/kcp.json index bca8dad..e282d95 100644 --- a/config/server/kcp.json +++ b/config/server/kcp.json @@ -42,18 +42,16 @@ "outbounds": [ { "protocol": "freedom", - "settings": {} + "settings": { + "domainStrategy": "UseIP" + }, + "tag": "direct" }, { "protocol": "blackhole", "settings": {}, "tag": "blocked" }, - { - "protocol": "freedom", - "settings": {}, - "tag": "direct" - }, { "protocol": "mtproto", "settings": {}, @@ -63,7 +61,8 @@ // ], "dns": { - "server": [ + "servers": [ + "https+local://1.1.1.1/dns-query", "1.1.1.1", "1.0.0.1", "8.8.8.8", @@ -112,9 +111,6 @@ "uplinkCapacity": 100, "downlinkCapacity": 100, "congestion": true - }, - "sockopt": { - "tcpFastOpen": true - } + } } } \ No newline at end of file diff --git a/config/server/quic.json b/config/server/quic.json index 2379fd1..61cb30b 100644 --- a/config/server/quic.json +++ b/config/server/quic.json @@ -20,7 +20,6 @@ "streamSettings": { "network": "quic", "quicSettings": { - "security": "aes-128-gcm", "key": "", "header": { "type": "none" @@ -44,18 +43,16 @@ "outbounds": [ { "protocol": "freedom", - "settings": {} + "settings": { + "domainStrategy": "UseIP" + }, + "tag": "direct" }, { "protocol": "blackhole", "settings": {}, "tag": "blocked" }, - { - "protocol": "freedom", - "settings": {}, - "tag": "direct" - }, { "protocol": "mtproto", "settings": {}, @@ -65,7 +62,8 @@ // ], "dns": { - "server": [ + "servers": [ + "https+local://1.1.1.1/dns-query", "1.1.1.1", "1.0.0.1", "8.8.8.8", @@ -114,9 +112,6 @@ "uplinkCapacity": 100, "downlinkCapacity": 100, "congestion": true - }, - "sockopt": { - "tcpFastOpen": true - } + } } } \ No newline at end of file diff --git a/config/server/tcp.json b/config/server/tcp.json index 01819bf..bfff340 100644 --- a/config/server/tcp.json +++ b/config/server/tcp.json @@ -37,18 +37,16 @@ "outbounds": [ { "protocol": "freedom", - "settings": {} + "settings": { + "domainStrategy": "UseIP" + }, + "tag": "direct" }, { "protocol": "blackhole", "settings": {}, "tag": "blocked" - }, - { - "protocol": "freedom", - "settings": {}, - "tag": "direct" - }, + }, { "protocol": "mtproto", "settings": {}, @@ -58,7 +56,8 @@ // ], "dns": { - "server": [ + "servers": [ + "https+local://1.1.1.1/dns-query", "1.1.1.1", "1.0.0.1", "8.8.8.8", @@ -107,9 +106,6 @@ "uplinkCapacity": 100, "downlinkCapacity": 100, "congestion": true - }, - "sockopt": { - "tcpFastOpen": true - } + } } } \ No newline at end of file diff --git a/config/server/ws.json b/config/server/ws.json index 4a45f22..2fc7813 100644 --- a/config/server/ws.json +++ b/config/server/ws.json @@ -37,18 +37,16 @@ "outbounds": [ { "protocol": "freedom", - "settings": {} + "settings": { + "domainStrategy": "UseIP" + }, + "tag": "direct" }, { "protocol": "blackhole", "settings": {}, "tag": "blocked" - }, - { - "protocol": "freedom", - "settings": {}, - "tag": "direct" - }, + }, { "protocol": "mtproto", "settings": {}, @@ -58,7 +56,8 @@ // ], "dns": { - "server": [ + "servers": [ + "https+local://1.1.1.1/dns-query", "1.1.1.1", "1.0.0.1", "8.8.8.8", @@ -107,9 +106,6 @@ "uplinkCapacity": 100, "downlinkCapacity": 100, "congestion": true - }, - "sockopt": { - "tcpFastOpen": true - } + } } } \ No newline at end of file diff --git a/install.sh b/install.sh index 05e1c2c..e1974aa 100644 --- a/install.sh +++ b/install.sh @@ -745,7 +745,9 @@ domain_check() { # $cmd install dnsutils -y # fi # test_domain=$(dig $domain +short) - test_domain=$(ping $domain -c 1 | grep -oE -m1 "([0-9]{1,3}\.){3}[0-9]{1,3}") + # test_domain=$(ping $domain -c 1 -4 | grep -oE -m1 "([0-9]{1,3}\.){3}[0-9]{1,3}") + # test_domain=$(wget -qO- --header='accept: application/dns-json' "https://cloudflare-dns.com/dns-query?name=$domain&type=A" | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}" | head -1) + test_domain=$(curl -sH 'accept: application/dns-json' "https://cloudflare-dns.com/dns-query?name=$domain&type=A" | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}" | head -1) if [[ $test_domain != $ip ]]; then echo echo -e "$red 检测域名解析错误....$none" diff --git a/src/caddy-config.sh b/src/caddy-config.sh index 76c35be..b487bbb 100644 --- a/src/caddy-config.sh +++ b/src/caddy-config.sh @@ -1,10 +1,10 @@ -local email=$(((RANDOM << 22))) +# local email=$(((RANDOM << 22))) +# tls ${email}@gmail.com case $v2ray_transport in 4) if [[ $is_path ]]; then cat >/etc/caddy/Caddyfile <<-EOF $domain { - tls ${email}@gmail.com gzip timeouts none proxy / $proxy_site { @@ -20,7 +20,6 @@ import sites/* else cat >/etc/caddy/Caddyfile <<-EOF $domain { - tls ${email}@gmail.com timeouts none proxy / 127.0.0.1:${v2ray_port} { websocket @@ -34,7 +33,6 @@ import sites/* if [[ $is_path ]]; then cat >/etc/caddy/Caddyfile <<-EOF $domain { - tls ${email}@gmail.com gzip timeouts none proxy / $proxy_site { @@ -51,7 +49,6 @@ import sites/* else cat >/etc/caddy/Caddyfile <<-EOF $domain { - tls ${email}@gmail.com timeouts none proxy / https://127.0.0.1:${v2ray_port} { header_upstream Host {host} diff --git a/src/download-caddy.sh b/src/download-caddy.sh index d9ea475..56a661f 100644 --- a/src/download-caddy.sh +++ b/src/download-caddy.sh @@ -2,6 +2,9 @@ _download_caddy_file() { caddy_tmp="/tmp/install_caddy/" caddy_tmp_file="/tmp/install_caddy/caddy.tar.gz" [[ -d $caddy_tmp ]] && rm -rf $caddy_tmp + if [[ ! ${caddy_arch} ]]; then + echo -e "$red 获取 Caddy 下载参数失败!$none" && exit 1 + fi local caddy_download_link="https://caddyserver.com/download/linux/${caddy_arch}?license=personal" mkdir -p $caddy_tmp @@ -13,8 +16,10 @@ _download_caddy_file() { tar zxf $caddy_tmp_file -C $caddy_tmp cp -f ${caddy_tmp}caddy /usr/local/bin/ + # wget -qO- https://getcaddy.com | bash -s personal + if [[ ! -f /usr/local/bin/caddy ]]; then - echo -e "$red 安装 Caddy 出错!" && exit 1 + echo -e "$red 安装 Caddy 出错!$none" && exit 1 fi } _install_caddy_service() { @@ -22,9 +27,42 @@ _install_caddy_service() { if [[ $systemd ]]; then cp -f ${caddy_tmp}init/linux-systemd/caddy.service /lib/systemd/system/ - # sed -i "s/www-data/root/g" /lib/systemd/system/caddy.service - sed -i "/on-abnormal/a RestartSec=3" /lib/systemd/system/caddy.service - sed -i "s/on-abnormal/always/" /lib/systemd/system/caddy.service + # if ! wget https://raw.githubusercontent.com/caddyserver/caddy/master/dist/init/linux-systemd/caddy.service -O /lib/systemd/system/caddy.service; then + # echo -e "$red 下载 caddy.service 失败!$none" && exit 1 + # fi + # sed -i "s/-log-timestamps=false//g" /lib/systemd/system/caddy.service + if [[ ! $(grep "ReadWriteDirectories" /lib/systemd/system/caddy.service) ]]; then + sed -i "/ReadWritePaths/a ReadWriteDirectories=/etc/ssl/caddy" /lib/systemd/system/caddy.service + fi + # # sed -i "s/www-data/root/g" /lib/systemd/system/caddy.service + # sed -i "/on-abnormal/a RestartSec=3" /lib/systemd/system/caddy.service + # sed -i "s/on-abnormal/always/" /lib/systemd/system/caddy.service + + #### 。。。。。 Warning.....Warning.......Warning........Warning...... + #### 。。。。。 use root user run caddy... + + # cat >/lib/systemd/system/caddy.service <<-EOF + # [Unit] + # Description=Caddy HTTP/2 web server + # Documentation=https://caddyserver.com/docs + # After=network.target + # Wants=network.target + + # [Service] + # Restart=always + # RestartSec=3 + # Environment=CADDYPATH=/root/.caddy + # ExecStart=/usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/Caddyfile -root=/var/tmp + # ExecReload=/bin/kill -USR1 $MAINPID + # KillMode=mixed + # KillSignal=SIGQUIT + # TimeoutStopSec=5s + # LimitNOFILE=1048576 + # LimitNPROC=512 + + # [Install] + # WantedBy=multi-user.target + # EOF systemctl enable caddy else cp -f ${caddy_tmp}init/linux-sysvinit/caddy /etc/init.d/caddy @@ -33,15 +71,19 @@ _install_caddy_service() { update-rc.d -f caddy defaults fi - mkdir -p /etc/ssl/caddy - if [ -z "$(grep www-data /etc/passwd)" ]; then useradd -M -s /usr/sbin/nologin www-data fi - chown -R www-data.www-data /etc/ssl/caddy + # chown -R www-data.www-data /etc/ssl/caddy - mkdir -p /etc/caddy/ + # ref https://github.com/caddyserver/caddy/tree/master/dist/init/linux-systemd + + mkdir -p /etc/caddy + chown -R root:root /etc/caddy + mkdir -p /etc/ssl/caddy + chown -R root:www-data /etc/ssl/caddy + chmod 0770 /etc/ssl/caddy ## create sites dir mkdir -p /etc/caddy/sites -} \ No newline at end of file +} diff --git a/src/download-v2ray.sh b/src/download-v2ray.sh index 4cc285e..5a5ed5a 100644 --- a/src/download-v2ray.sh +++ b/src/download-v2ray.sh @@ -15,9 +15,7 @@ _get_latest_version() { _download_v2ray_file() { _get_latest_version - [[ -d /tmp/v2ray ]] && rm -rf /tmp/v2ray - mkdir -p /tmp/v2ray - v2ray_tmp_file="/tmp/v2ray/v2ray.zip" + v2ray_tmp_file="/tmp/v2ray.zip" v2ray_download_link="https://github.com/v2ray/v2ray-core/releases/download/$v2ray_latest_ver/v2ray-linux-${v2ray_bit}.zip" if ! wget --no-check-certificate -O "$v2ray_tmp_file" $v2ray_download_link; then @@ -26,26 +24,15 @@ _download_v2ray_file() { " && exit 1 fi - unzip $v2ray_tmp_file -d "/tmp/v2ray/" - mkdir -p /usr/bin/v2ray - cp -f "/tmp/v2ray/v2ray" "/usr/bin/v2ray/v2ray" - chmod +x "/usr/bin/v2ray/v2ray" + unzip -o $v2ray_tmp_file -d "/usr/bin/v2ray/" + chmod +x /usr/bin/v2ray/{v2ray,v2ctl} echo "alias v2ray=$_v2ray_sh" >>/root/.bashrc - cp -f "/tmp/v2ray/v2ctl" "/usr/bin/v2ray/v2ctl" - chmod +x "/usr/bin/v2ray/v2ctl" } _install_v2ray_service() { - if [[ $systemd ]]; then - cp -f "/tmp/v2ray/systemd/v2ray.service" "/lib/systemd/system/" - sed -i "s/on-failure/always/" /lib/systemd/system/v2ray.service - systemctl enable v2ray - else - apt-get install -y daemon - cp "/tmp/v2ray/systemv/v2ray" "/etc/init.d/v2ray" - chmod +x "/etc/init.d/v2ray" - update-rc.d -f v2ray defaults - fi + cp -f "/usr/bin/v2ray/systemd/v2ray.service" "/lib/systemd/system/" + sed -i "s/on-failure/always/" /lib/systemd/system/v2ray.service + systemctl enable v2ray } _update_v2ray_version() { diff --git a/src/ss-info.sh b/src/ss-info.sh index 7d37007..571091c 100644 --- a/src/ss-info.sh +++ b/src/ss-info.sh @@ -18,4 +18,6 @@ if [[ $shadowsocks ]]; then echo echo -e "提示: 输入$cyan v2ray ssqr $none可生成 Shadowsocks 二维码链接" echo + echo -e "${yellow}免被墙..推荐使用JMS: ${cyan}https://getjms.com${none}" + echo fi diff --git a/src/v2ray-info.sh b/src/v2ray-info.sh index 43c65f6..18f6c2a 100644 --- a/src/v2ray-info.sh +++ b/src/v2ray-info.sh @@ -133,4 +133,6 @@ _v2_info() { echo echo -e "提示: 输入$cyan v2ray url $none可生成 vmess URL 链接 / 输入$cyan v2ray qr $none可生成二维码链接" echo + echo -e "${yellow}免被墙..推荐使用JMS: ${cyan}https://getjms.com${none}" + echo } diff --git a/v2ray.sh b/v2ray.sh index a6eea0d..b5e6a45 100644 --- a/v2ray.sh +++ b/v2ray.sh @@ -10,7 +10,7 @@ none='\e[0m' # Root [[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 -_version="v3.13" +_version="v3.31" cmd="apt-get" @@ -1763,7 +1763,9 @@ change_proxy_site_config() { } domain_check() { # test_domain=$(dig $new_domain +short) - test_domain=$(ping $new_domain -c 1 | grep -oE -m1 "([0-9]{1,3}\.){3}[0-9]{1,3}") + # test_domain=$(ping $new_domain -c 1 -4 | grep -oE -m1 "([0-9]{1,3}\.){3}[0-9]{1,3}") + # test_domain=$(wget -qO- --header='accept: application/dns-json' "https://cloudflare-dns.com/dns-query?name=$new_domain&type=A" | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}" | head -1) + test_domain=$(curl -sH 'accept: application/dns-json' "https://cloudflare-dns.com/dns-query?name=$new_domain&type=A" | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}" | head -1) if [[ $test_domain != $ip ]]; then echo echo -e "$red 检测域名解析错误....$none" @@ -2277,6 +2279,8 @@ get_v2ray_vmess_URL_link() { echo echo -e ${cyan}$vmess${none} echo + echo -e "${yellow}免被墙..推荐使用JMS: ${cyan}https://getjms.com${none}" + echo rm -rf /etc/v2ray/vmess_qr.json } other() { @@ -2675,7 +2679,7 @@ menu() { echo echo "反馈问题: https://github.com/233boy/v2ray/issues" echo - echo "TG 群组: https://t.me/blog233" + echo "TG 频道: https://t.me/tg2333" echo echo "捐赠脚本作者: https://233v2.com/donate/" echo