Merge branch '233boy:master' into master

pull/880/head
laozfly 3 years ago committed by GitHub
commit 3d0c07c241
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 32
      config/server/dynamic/http.json
  2. 32
      config/server/dynamic/kcp.json
  3. 32
      config/server/dynamic/quic.json
  4. 32
      config/server/dynamic/tcp.json
  5. 32
      config/server/dynamic/ws.json
  6. 41
      config/server/h2.json
  7. 32
      config/server/http.json
  8. 32
      config/server/kcp.json
  9. 32
      config/server/quic.json
  10. 32
      config/server/tcp.json
  11. 32
      config/server/vless_ws.json
  12. 32
      config/server/ws.json
  13. 37
      src/caddy-config.sh
  14. 55
      src/download-caddy.sh
  15. 7
      src/download-v2ray.sh
  16. 56
      v2ray.sh

@ -106,22 +106,15 @@
"protocol": "blackhole", "protocol": "blackhole",
"settings": {}, "settings": {},
"tag": "blocked" "tag": "blocked"
},
{
"protocol": "mtproto",
"settings": {},
"tag": "tg-out"
} }
//include_out_config //include_out_config
// //
], ],
"dns": { "dns": {
"servers": [ "servers": [
"https+local://1.1.1.1/dns-query", "https+local://dns.google/dns-query",
"1.1.1.1",
"1.0.0.1",
"8.8.8.8", "8.8.8.8",
"8.8.4.4", "1.1.1.1",
"localhost" "localhost"
] ]
}, },
@ -131,28 +124,9 @@
{ {
"type": "field", "type": "field",
"ip": [ "ip": [
"0.0.0.0/8", "geoip:private"
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
], ],
"outboundTag": "blocked" "outboundTag": "blocked"
},
{
"type": "field",
"inboundTag": ["tg-in"],
"outboundTag": "tg-out"
} }
//include_ban_xx //include_ban_xx
//include_ban_bt //include_ban_bt

@ -78,22 +78,15 @@
"protocol": "blackhole", "protocol": "blackhole",
"settings": {}, "settings": {},
"tag": "blocked" "tag": "blocked"
},
{
"protocol": "mtproto",
"settings": {},
"tag": "tg-out"
} }
//include_out_config //include_out_config
// //
], ],
"dns": { "dns": {
"servers": [ "servers": [
"https+local://1.1.1.1/dns-query", "https+local://dns.google/dns-query",
"1.1.1.1",
"1.0.0.1",
"8.8.8.8", "8.8.8.8",
"8.8.4.4", "1.1.1.1",
"localhost" "localhost"
] ]
}, },
@ -103,28 +96,9 @@
{ {
"type": "field", "type": "field",
"ip": [ "ip": [
"0.0.0.0/8", "geoip:private"
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
], ],
"outboundTag": "blocked" "outboundTag": "blocked"
},
{
"type": "field",
"inboundTag": ["tg-in"],
"outboundTag": "tg-out"
} }
//include_ban_xx //include_ban_xx
//include_ban_bt //include_ban_bt

@ -80,22 +80,15 @@
"protocol": "blackhole", "protocol": "blackhole",
"settings": {}, "settings": {},
"tag": "blocked" "tag": "blocked"
},
{
"protocol": "mtproto",
"settings": {},
"tag": "tg-out"
} }
//include_out_config //include_out_config
// //
], ],
"dns": { "dns": {
"servers": [ "servers": [
"https+local://1.1.1.1/dns-query", "https+local://dns.google/dns-query",
"1.1.1.1",
"1.0.0.1",
"8.8.8.8", "8.8.8.8",
"8.8.4.4", "1.1.1.1",
"localhost" "localhost"
] ]
}, },
@ -105,28 +98,9 @@
{ {
"type": "field", "type": "field",
"ip": [ "ip": [
"0.0.0.0/8", "geoip:private"
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
], ],
"outboundTag": "blocked" "outboundTag": "blocked"
},
{
"type": "field",
"inboundTag": ["tg-in"],
"outboundTag": "tg-out"
} }
//include_ban_xx //include_ban_xx
//include_ban_bt //include_ban_bt

@ -65,22 +65,15 @@
"protocol": "blackhole", "protocol": "blackhole",
"settings": {}, "settings": {},
"tag": "blocked" "tag": "blocked"
},
{
"protocol": "mtproto",
"settings": {},
"tag": "tg-out"
} }
//include_out_config //include_out_config
// //
], ],
"dns": { "dns": {
"servers": [ "servers": [
"https+local://1.1.1.1/dns-query", "https+local://dns.google/dns-query",
"1.1.1.1",
"1.0.0.1",
"8.8.8.8", "8.8.8.8",
"8.8.4.4", "1.1.1.1",
"localhost" "localhost"
] ]
}, },
@ -90,28 +83,9 @@
{ {
"type": "field", "type": "field",
"ip": [ "ip": [
"0.0.0.0/8", "geoip:private"
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
], ],
"outboundTag": "blocked" "outboundTag": "blocked"
},
{
"type": "field",
"inboundTag": ["tg-in"],
"outboundTag": "tg-out"
} }
//include_ban_xx //include_ban_xx
//include_ban_bt //include_ban_bt

@ -68,22 +68,15 @@
"protocol": "blackhole", "protocol": "blackhole",
"settings": {}, "settings": {},
"tag": "blocked" "tag": "blocked"
},
{
"protocol": "mtproto",
"settings": {},
"tag": "tg-out"
} }
//include_out_config //include_out_config
// //
], ],
"dns": { "dns": {
"servers": [ "servers": [
"https+local://1.1.1.1/dns-query", "https+local://dns.google/dns-query",
"1.1.1.1",
"1.0.0.1",
"8.8.8.8", "8.8.8.8",
"8.8.4.4", "1.1.1.1",
"localhost" "localhost"
] ]
}, },
@ -93,28 +86,9 @@
{ {
"type": "field", "type": "field",
"ip": [ "ip": [
"0.0.0.0/8", "geoip:private"
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
], ],
"outboundTag": "blocked" "outboundTag": "blocked"
},
{
"type": "field",
"inboundTag": ["tg-in"],
"outboundTag": "tg-out"
} }
//include_ban_xx //include_ban_xx
//include_ban_bt //include_ban_bt

@ -24,15 +24,6 @@
"233blog.com" "233blog.com"
], ],
"path": "/233blog" "path": "/233blog"
},
"security": "tls",
"tlsSettings": {
"certificates": [
{
"certificateFile": "/etc/v2ray/233boy/v2ray/config/233blog.com.cer",
"keyFile": "/etc/v2ray/233boy/v2ray/config/233blog.com.key"
}
]
} }
}, },
"sniffing": { "sniffing": {
@ -61,22 +52,15 @@
"protocol": "blackhole", "protocol": "blackhole",
"settings": {}, "settings": {},
"tag": "blocked" "tag": "blocked"
},
{
"protocol": "mtproto",
"settings": {},
"tag": "tg-out"
} }
//include_out_config //include_out_config
// //
], ],
"dns": { "dns": {
"servers": [ "servers": [
"https+local://1.1.1.1/dns-query", "https+local://dns.google/dns-query",
"1.1.1.1",
"1.0.0.1",
"8.8.8.8", "8.8.8.8",
"8.8.4.4", "1.1.1.1",
"localhost" "localhost"
] ]
}, },
@ -86,28 +70,9 @@
{ {
"type": "field", "type": "field",
"ip": [ "ip": [
"0.0.0.0/8", "geoip:private"
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
], ],
"outboundTag": "blocked" "outboundTag": "blocked"
},
{
"type": "field",
"inboundTag": ["tg-in"],
"outboundTag": "tg-out"
} }
//include_ban_xx //include_ban_xx
//include_ban_bt //include_ban_bt

@ -79,22 +79,15 @@
"protocol": "blackhole", "protocol": "blackhole",
"settings": {}, "settings": {},
"tag": "blocked" "tag": "blocked"
},
{
"protocol": "mtproto",
"settings": {},
"tag": "tg-out"
} }
//include_out_config //include_out_config
// //
], ],
"dns": { "dns": {
"servers": [ "servers": [
"https+local://1.1.1.1/dns-query", "https+local://8.8.8.8/dns-query",
"1.1.1.1",
"1.0.0.1",
"8.8.8.8", "8.8.8.8",
"8.8.4.4", "1.1.1.1",
"localhost" "localhost"
] ]
}, },
@ -104,28 +97,9 @@
{ {
"type": "field", "type": "field",
"ip": [ "ip": [
"0.0.0.0/8", "geoip:private"
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
], ],
"outboundTag": "blocked" "outboundTag": "blocked"
},
{
"type": "field",
"inboundTag": ["tg-in"],
"outboundTag": "tg-out"
} }
//include_ban_xx //include_ban_xx
//include_ban_bt //include_ban_bt

@ -51,22 +51,15 @@
"protocol": "blackhole", "protocol": "blackhole",
"settings": {}, "settings": {},
"tag": "blocked" "tag": "blocked"
},
{
"protocol": "mtproto",
"settings": {},
"tag": "tg-out"
} }
//include_out_config //include_out_config
// //
], ],
"dns": { "dns": {
"servers": [ "servers": [
"https+local://1.1.1.1/dns-query", "https+local://dns.google/dns-query",
"1.1.1.1",
"1.0.0.1",
"8.8.8.8", "8.8.8.8",
"8.8.4.4", "1.1.1.1",
"localhost" "localhost"
] ]
}, },
@ -76,28 +69,9 @@
{ {
"type": "field", "type": "field",
"ip": [ "ip": [
"0.0.0.0/8", "geoip:private"
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
], ],
"outboundTag": "blocked" "outboundTag": "blocked"
},
{
"type": "field",
"inboundTag": ["tg-in"],
"outboundTag": "tg-out"
} }
//include_ban_xx //include_ban_xx
//include_ban_bt //include_ban_bt

@ -52,22 +52,15 @@
"protocol": "blackhole", "protocol": "blackhole",
"settings": {}, "settings": {},
"tag": "blocked" "tag": "blocked"
},
{
"protocol": "mtproto",
"settings": {},
"tag": "tg-out"
} }
//include_out_config //include_out_config
// //
], ],
"dns": { "dns": {
"servers": [ "servers": [
"https+local://1.1.1.1/dns-query", "https+local://dns.google/dns-query",
"1.1.1.1",
"1.0.0.1",
"8.8.8.8", "8.8.8.8",
"8.8.4.4", "1.1.1.1",
"localhost" "localhost"
] ]
}, },
@ -77,28 +70,9 @@
{ {
"type": "field", "type": "field",
"ip": [ "ip": [
"0.0.0.0/8", "geoip:private"
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
], ],
"outboundTag": "blocked" "outboundTag": "blocked"
},
{
"type": "field",
"inboundTag": ["tg-in"],
"outboundTag": "tg-out"
} }
//include_ban_xx //include_ban_xx
//include_ban_bt //include_ban_bt

@ -46,22 +46,15 @@
"protocol": "blackhole", "protocol": "blackhole",
"settings": {}, "settings": {},
"tag": "blocked" "tag": "blocked"
},
{
"protocol": "mtproto",
"settings": {},
"tag": "tg-out"
} }
//include_out_config //include_out_config
// //
], ],
"dns": { "dns": {
"servers": [ "servers": [
"https+local://1.1.1.1/dns-query", "https+local://dns.google/dns-query",
"1.1.1.1",
"1.0.0.1",
"8.8.8.8", "8.8.8.8",
"8.8.4.4", "1.1.1.1",
"localhost" "localhost"
] ]
}, },
@ -71,28 +64,9 @@
{ {
"type": "field", "type": "field",
"ip": [ "ip": [
"0.0.0.0/8", "geoip:private"
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
], ],
"outboundTag": "blocked" "outboundTag": "blocked"
},
{
"type": "field",
"inboundTag": ["tg-in"],
"outboundTag": "tg-out"
} }
//include_ban_xx //include_ban_xx
//include_ban_bt //include_ban_bt

@ -48,22 +48,15 @@
"protocol": "blackhole", "protocol": "blackhole",
"settings": {}, "settings": {},
"tag": "blocked" "tag": "blocked"
},
{
"protocol": "mtproto",
"settings": {},
"tag": "tg-out"
} }
//include_out_config //include_out_config
// //
], ],
"dns": { "dns": {
"servers": [ "servers": [
"https+local://1.1.1.1/dns-query", "https+local://dns.google/dns-query",
"1.1.1.1",
"1.0.0.1",
"8.8.8.8", "8.8.8.8",
"8.8.4.4", "1.1.1.1",
"localhost" "localhost"
] ]
}, },
@ -73,28 +66,9 @@
{ {
"type": "field", "type": "field",
"ip": [ "ip": [
"0.0.0.0/8", "geoip:private"
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
], ],
"outboundTag": "blocked" "outboundTag": "blocked"
},
{
"type": "field",
"inboundTag": ["tg-in"],
"outboundTag": "tg-out"
} }
//include_ban_xx //include_ban_xx
//include_ban_bt //include_ban_bt

@ -46,22 +46,15 @@
"protocol": "blackhole", "protocol": "blackhole",
"settings": {}, "settings": {},
"tag": "blocked" "tag": "blocked"
},
{
"protocol": "mtproto",
"settings": {},
"tag": "tg-out"
} }
//include_out_config //include_out_config
// //
], ],
"dns": { "dns": {
"servers": [ "servers": [
"https+local://1.1.1.1/dns-query", "https+local://dns.google/dns-query",
"1.1.1.1",
"1.0.0.1",
"8.8.8.8", "8.8.8.8",
"8.8.4.4", "1.1.1.1",
"localhost" "localhost"
] ]
}, },
@ -71,28 +64,9 @@
{ {
"type": "field", "type": "field",
"ip": [ "ip": [
"0.0.0.0/8", "geoip:private"
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
], ],
"outboundTag": "blocked" "outboundTag": "blocked"
},
{
"type": "field",
"inboundTag": ["tg-in"],
"outboundTag": "tg-out"
} }
//include_ban_xx //include_ban_xx
//include_ban_bt //include_ban_bt

@ -5,14 +5,12 @@ case $v2ray_transport in
if [[ $is_path ]]; then if [[ $is_path ]]; then
cat >/etc/caddy/Caddyfile <<-EOF cat >/etc/caddy/Caddyfile <<-EOF
$domain { $domain {
gzip reverse_proxy $proxy_site {
timeouts none header_up Host {upstream_hostport}
proxy / $proxy_site { header_up X-Forwarded-Host {host}
except /${path}
} }
proxy /${path} 127.0.0.1:${v2ray_port} { handle_path /${path} {
without /${path} reverse_proxy 127.0.0.1:${v2ray_port}
websocket
} }
} }
import sites/* import sites/*
@ -20,10 +18,7 @@ import sites/*
else else
cat >/etc/caddy/Caddyfile <<-EOF cat >/etc/caddy/Caddyfile <<-EOF
$domain { $domain {
timeouts none reverse_proxy 127.0.0.1:${v2ray_port}
proxy / 127.0.0.1:${v2ray_port} {
websocket
}
} }
import sites/* import sites/*
EOF EOF
@ -33,28 +28,18 @@ import sites/*
if [[ $is_path ]]; then if [[ $is_path ]]; then
cat >/etc/caddy/Caddyfile <<-EOF cat >/etc/caddy/Caddyfile <<-EOF
$domain { $domain {
gzip reverse_proxy $proxy_site {
timeouts none header_up Host {upstream_hostport}
proxy / $proxy_site { header_up X-Forwarded-Host {host}
except /${path}
}
proxy /${path} https://127.0.0.1:${v2ray_port} {
header_upstream Host {host}
header_upstream X-Forwarded-Proto {scheme}
insecure_skip_verify
} }
reverse_proxy /${path} h2c://127.0.0.1:${v2ray_port}
} }
import sites/* import sites/*
EOF EOF
else else
cat >/etc/caddy/Caddyfile <<-EOF cat >/etc/caddy/Caddyfile <<-EOF
$domain { $domain {
timeouts none reverse_proxy h2c://127.0.0.1:${v2ray_port}
proxy / https://127.0.0.1:${v2ray_port} {
header_upstream Host {host}
header_upstream X-Forwarded-Proto {scheme}
insecure_skip_verify
}
} }
import sites/* import sites/*
EOF EOF

@ -6,7 +6,8 @@ _download_caddy_file() {
echo -e "$red 获取 Caddy 下载参数失败!$none" && exit 1 echo -e "$red 获取 Caddy 下载参数失败!$none" && exit 1
fi fi
# local caddy_download_link="https://caddyserver.com/download/linux/${caddy_arch}?license=personal" # local caddy_download_link="https://caddyserver.com/download/linux/${caddy_arch}?license=personal"
local caddy_download_link="https://github.com/caddyserver/caddy/releases/download/v1.0.4/caddy_v1.0.4_linux_${caddy_arch}.tar.gz" # local caddy_download_link="https://github.com/caddyserver/caddy/releases/download/v1.0.4/caddy_v1.0.4_linux_${caddy_arch}.tar.gz"
local caddy_download_link="https://github.com/caddyserver/caddy/releases/download/v2.5.1/caddy_2.5.1_linux_${caddy_arch}.tar.gz"
mkdir -p $caddy_tmp mkdir -p $caddy_tmp
@ -27,43 +28,45 @@ _install_caddy_service() {
# setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/caddy # setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/caddy
if [[ $systemd ]]; then if [[ $systemd ]]; then
cp -f ${caddy_tmp}init/linux-systemd/caddy.service /lib/systemd/system/ # 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 # 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 # echo -e "$red 下载 caddy.service 失败!$none" && exit 1
# fi # fi
# sed -i "s/-log-timestamps=false//g" /lib/systemd/system/caddy.service # sed -i "s/-log-timestamps=false//g" /lib/systemd/system/caddy.service
if [[ ! $(grep "ReadWriteDirectories" /lib/systemd/system/caddy.service) ]]; then # if [[ ! $(grep "ReadWriteDirectories" /lib/systemd/system/caddy.service) ]]; then
sed -i "/ReadWritePaths/a ReadWriteDirectories=/etc/ssl/caddy" /lib/systemd/system/caddy.service # sed -i "/ReadWritePaths/a ReadWriteDirectories=/etc/ssl/caddy" /lib/systemd/system/caddy.service
fi # fi
sed -i "s/www-data/root/g" /lib/systemd/system/caddy.service # 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 "/on-abnormal/a RestartSec=3" /lib/systemd/system/caddy.service
# sed -i "s/on-abnormal/always/" /lib/systemd/system/caddy.service # sed -i "s/on-abnormal/always/" /lib/systemd/system/caddy.service
#### 。。。。。 Warning.....Warning.......Warning........Warning...... #### 。。。。。 Warning.....Warning.......Warning........Warning......
#### 。。。。。 use root user run caddy... #### 。。。。。 use root user run caddy...
# cat >/lib/systemd/system/caddy.service <<-EOF cat >/lib/systemd/system/caddy.service <<-EOF
# [Unit] #https://github.com/caddyserver/dist/blob/master/init/caddy.service
# Description=Caddy HTTP/2 web server [Unit]
# Documentation=https://caddyserver.com/docs Description=Caddy
# After=network.target Documentation=https://caddyserver.com/docs/
# Wants=network.target After=network.target network-online.target
Requires=network-online.target
# [Service] [Service]
# Restart=always Type=notify
# RestartSec=3 User=root
# Environment=CADDYPATH=/root/.caddy Group=root
# ExecStart=/usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/Caddyfile -root=/var/tmp ExecStart=/usr/local/bin/caddy run --environ --config /etc/caddy/Caddyfile
# ExecReload=/bin/kill -USR1 $MAINPID ExecReload=/usr/local/bin/caddy reload --config /etc/caddy/Caddyfile
# KillMode=mixed TimeoutStopSec=5s
# KillSignal=SIGQUIT LimitNOFILE=1048576
# TimeoutStopSec=5s LimitNPROC=512
# LimitNOFILE=1048576 PrivateTmp=true
# LimitNPROC=512 ProtectSystem=full
#AmbientCapabilities=CAP_NET_BIND_SERVICE
# [Install] [Install]
# WantedBy=multi-user.target WantedBy=multi-user.target
# EOF EOF
systemctl enable caddy systemctl enable caddy
else else
cp -f ${caddy_tmp}init/linux-sysvinit/caddy /etc/init.d/caddy cp -f ${caddy_tmp}init/linux-sysvinit/caddy /etc/init.d/caddy

@ -50,10 +50,11 @@ Type=simple
# More discussion at https://github.com/v2ray/v2ray-core/issues/1011 # More discussion at https://github.com/v2ray/v2ray-core/issues/1011
User=root User=root
#User=nobody #User=nobody
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE Environment="V2RAY_VMESS_AEAD_FORCED=false"
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE #CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
#AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
NoNewPrivileges=true NoNewPrivileges=true
ExecStart=/usr/bin/v2ray/v2ray -config /etc/v2ray/config.json ExecStart=/usr/bin/env v2ray.vmess.aead.forced=false /usr/bin/v2ray/v2ray -config /etc/v2ray/config.json
#Restart=on-failure #Restart=on-failure
Restart=always Restart=always

@ -10,7 +10,7 @@ none='\e[0m'
# Root # Root
[[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 [[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1
_version="v3.45" _version="v3.55"
cmd="apt-get" cmd="apt-get"
@ -89,6 +89,30 @@ v2ray_ver="$(/usr/bin/v2ray/v2ray -version | head -n 1 | cut -d " " -f2)"
systemd=true systemd=true
# _test=true # _test=true
# fix VMessAEAD
if [[ ! $(grep 'v2ray.vmess.aead.forced=false' /lib/systemd/system/v2ray.service) ]]; then
sed -i 's|ExecStart=|ExecStart=/usr/bin/env v2ray.vmess.aead.forced=false |' /lib/systemd/system/v2ray.service
systemctl daemon-reload
systemctl restart v2ray
fi
# fix caddy2 config
if [[ $caddy ]]; then
/usr/local/bin/caddy version >/dev/null 2>&1
if [[ $? == 1 ]]; then
echo -e "\n $yellow 警告: 脚本将自动更新 Caddy 版本。 $none \n"
systemctl stop caddy
_load download-caddy.sh
_download_caddy_file
_install_caddy_service
systemctl daemon-reload
_load caddy-config.sh
systemctl restart caddy
echo -e "\n $green 更新 Caddy 版本完成, 要是出问题了你可以重装解决。 $none \n"
exit 0
fi
fi
if [[ $v2ray_ver != v* ]]; then if [[ $v2ray_ver != v* ]]; then
v2ray_ver="v$v2ray_ver" v2ray_ver="v$v2ray_ver"
fi fi
@ -1730,9 +1754,9 @@ change_proxy_site_config() {
} }
domain_check() { domain_check() {
# test_domain=$(dig $new_domain +short) # test_domain=$(dig $new_domain +short)
# test_domain=$(ping $new_domain -c 1 -4 | grep -oE -m1 "([0-9]{1,3}\.){3}[0-9]{1,3}") test_domain=$(ping $new_domain -c 1 -4 -W 2 | 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=$(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) # 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 if [[ $test_domain != $ip ]]; then
echo echo
echo -e "$red 检测域名解析错误....$none" echo -e "$red 检测域名解析错误....$none"
@ -2287,11 +2311,7 @@ other() {
echo echo
echo -e "$yellow 1. $none安装 BBR" echo -e "$yellow 1. $none安装 BBR"
echo echo
echo -e "$yellow 2. $none安装 LotServer(锐速)" read -p "$(echo -e "请选择 [${magenta}1$none]:")" _opt
echo
echo -e "$yellow 3. $none卸载 LotServer(锐速)"
echo
read -p "$(echo -e "请选择 [${magenta}1-3$none]:")" _opt
if [[ -z $_opt ]]; then if [[ -z $_opt ]]; then
error error
else else
@ -2300,14 +2320,6 @@ other() {
install_bbr install_bbr
break break
;; ;;
2)
install_lotserver
break
;;
3)
uninstall_lotserver
break
;;
*) *)
error error
;; ;;
@ -2328,18 +2340,6 @@ install_bbr() {
[[ ! $enable_bbr ]] && bash <(curl -s -L https://github.com/teddysun/across/raw/master/bbr.sh) [[ ! $enable_bbr ]] && bash <(curl -s -L https://github.com/teddysun/across/raw/master/bbr.sh)
fi fi
} }
install_lotserver() {
# https://moeclub.org/2017/03/08/14/
wget --no-check-certificate -qO /tmp/appex.sh "https://raw.githubusercontent.com/0oVicero0/serverSpeeder_Install/master/appex.sh"
bash /tmp/appex.sh 'install'
rm -rf /tmp/appex.sh
}
uninstall_lotserver() {
# https://moeclub.org/2017/03/08/14/
wget --no-check-certificate -qO /tmp/appex.sh "https://raw.githubusercontent.com/0oVicero0/serverSpeeder_Install/master/appex.sh"
bash /tmp/appex.sh 'uninstall'
rm -rf /tmp/appex.sh
}
update() { update() {
while :; do while :; do

Loading…
Cancel
Save