diff --git a/config/client/h2.json b/config/client/h2.json index c11edcf..277d286 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"] } }, { diff --git a/config/client/http.json b/config/client/http.json index 4dd7fcc..f33004a 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"] } }, { diff --git a/config/client/kcp.json b/config/client/kcp.json index 4a6f583..04247d0 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"] } }, { diff --git a/config/client/quic.json b/config/client/quic.json index 26eef04..9877e79 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"] } }, { diff --git a/config/client/tcp.json b/config/client/tcp.json index e2493a9..6e7756a 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"] } }, { diff --git a/config/client/ws.json b/config/client/ws.json index 55d842b..38d2e3c 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"] } }, { diff --git a/config/client/ws_tls.json b/config/client/ws_tls.json index 1782dfb..f53ab58 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"] } }, { diff --git a/config/server/dynamic/quic.json b/config/server/dynamic/quic.json index 16911b4..dad9718 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" diff --git a/config/server/quic.json b/config/server/quic.json index 2379fd1..4da010a 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" 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 36f9b5e..56a661f 100644 --- a/src/download-caddy.sh +++ b/src/download-caddy.sh @@ -26,9 +26,13 @@ _install_caddy_service() { setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/caddy if [[ $systemd ]]; then - # cp -f ${caddy_tmp}init/linux-systemd/caddy.service /lib/systemd/system/ - 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 + cp -f ${caddy_tmp}init/linux-systemd/caddy.service /lib/systemd/system/ + # 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 diff --git a/v2ray.sh b/v2ray.sh index a9ddfbe..1420c13 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.17" +_version="v3.26" 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"