From 502ced4359df5b03d051ff5759e80f59ea0b6a5f Mon Sep 17 00:00:00 2001 From: 233boy Date: Sun, 6 Jan 2019 16:31:09 +0800 Subject: [PATCH] fix dynamicPort bugs --- config/server/dynamic/http.json | 31 +------------------------ config/server/dynamic/kcp.json | 38 ++++++------------------------- config/server/dynamic/quic.json | 40 ++++++++------------------------- config/server/dynamic/tcp.json | 31 +------------------------ config/server/dynamic/ws.json | 31 +------------------------ config/server/h2.json | 31 +------------------------ config/server/http.json | 31 +------------------------ config/server/include/ban.json | 30 +++++++++++++++++++++++++ config/server/kcp.json | 31 +------------------------ config/server/quic.json | 31 +------------------------ config/server/tcp.json | 31 +------------------------ config/server/ws.json | 31 +------------------------ src/ban_xx.sh | 4 ++++ src/config.sh | 3 +++ v2ray.sh | 19 ++++------------ 15 files changed, 66 insertions(+), 347 deletions(-) create mode 100644 config/server/include/ban.json create mode 100644 src/ban_xx.sh diff --git a/config/server/dynamic/http.json b/config/server/dynamic/http.json index 43e0057..480e294 100644 --- a/config/server/dynamic/http.json +++ b/config/server/dynamic/http.json @@ -148,41 +148,12 @@ ], "outboundTag": "blocked" }, - { - "type": "field", - "domain": [ - "domain:epochtimes.com", - "domain:epochtimes.com.tw", - "domain:epochtimes.fr", - "domain:epochtimes.de", - "domain:epochtimes.jp", - "domain:epochtimes.ru", - "domain:epochtimes.co.il", - "domain:epochtimes.co.kr", - "domain:epochtimes-romania.com", - "domain:erabaru.net", - "domain:lagranepoca.com", - "domain:theepochtimes.com", - "domain:ntdtv.com", - "domain:ntd.tv", - "domain:ntdtv-dc.com", - "domain:ntdtv.com.tw", - "domain:minghui.org", - "domain:renminbao.com", - "domain:dafahao.com", - "domain:dongtaiwang.com", - "domain:falundafa.org", - "domain:wujieliulan.com", - "domain:ninecommentaries.com", - "domain:shenyun.com" - ], - "outboundTag": "blocked" - }, { "type": "field", "inboundTag": ["tg-in"], "outboundTag": "tg-out" } + //include_ban_xx //include_ban_bt //include_ban_ad //include_rules diff --git a/config/server/dynamic/kcp.json b/config/server/dynamic/kcp.json index 2dc03b5..cd78a88 100644 --- a/config/server/dynamic/kcp.json +++ b/config/server/dynamic/kcp.json @@ -21,7 +21,12 @@ } }, "streamSettings": { - "network": "kcp" + "network": "kcp", + "kcpSettings": { + "header": { + "type": "none" + } + } }, "sniffing": { "enabled": true, @@ -115,41 +120,12 @@ ], "outboundTag": "blocked" }, - { - "type": "field", - "domain": [ - "domain:epochtimes.com", - "domain:epochtimes.com.tw", - "domain:epochtimes.fr", - "domain:epochtimes.de", - "domain:epochtimes.jp", - "domain:epochtimes.ru", - "domain:epochtimes.co.il", - "domain:epochtimes.co.kr", - "domain:epochtimes-romania.com", - "domain:erabaru.net", - "domain:lagranepoca.com", - "domain:theepochtimes.com", - "domain:ntdtv.com", - "domain:ntd.tv", - "domain:ntdtv-dc.com", - "domain:ntdtv.com.tw", - "domain:minghui.org", - "domain:renminbao.com", - "domain:dafahao.com", - "domain:dongtaiwang.com", - "domain:falundafa.org", - "domain:wujieliulan.com", - "domain:ninecommentaries.com", - "domain:shenyun.com" - ], - "outboundTag": "blocked" - }, { "type": "field", "inboundTag": ["tg-in"], "outboundTag": "tg-out" } + //include_ban_xx //include_ban_bt //include_ban_ad //include_rules diff --git a/config/server/dynamic/quic.json b/config/server/dynamic/quic.json index 06b21f1..9342cf5 100644 --- a/config/server/dynamic/quic.json +++ b/config/server/dynamic/quic.json @@ -21,7 +21,14 @@ } }, "streamSettings": { - "network": "quic" + "network": "quic", + "quicSettings": { + "security": "aes-128-gcm", + "key": "", + "header": { + "type": "none" + } + } }, "sniffing": { "enabled": true, @@ -117,41 +124,12 @@ ], "outboundTag": "blocked" }, - { - "type": "field", - "domain": [ - "domain:epochtimes.com", - "domain:epochtimes.com.tw", - "domain:epochtimes.fr", - "domain:epochtimes.de", - "domain:epochtimes.jp", - "domain:epochtimes.ru", - "domain:epochtimes.co.il", - "domain:epochtimes.co.kr", - "domain:epochtimes-romania.com", - "domain:erabaru.net", - "domain:lagranepoca.com", - "domain:theepochtimes.com", - "domain:ntdtv.com", - "domain:ntd.tv", - "domain:ntdtv-dc.com", - "domain:ntdtv.com.tw", - "domain:minghui.org", - "domain:renminbao.com", - "domain:dafahao.com", - "domain:dongtaiwang.com", - "domain:falundafa.org", - "domain:wujieliulan.com", - "domain:ninecommentaries.com", - "domain:shenyun.com" - ], - "outboundTag": "blocked" - }, { "type": "field", "inboundTag": ["tg-in"], "outboundTag": "tg-out" } + //include_ban_xx //include_ban_bt //include_ban_ad //include_rules diff --git a/config/server/dynamic/tcp.json b/config/server/dynamic/tcp.json index c45843e..ad0feca 100644 --- a/config/server/dynamic/tcp.json +++ b/config/server/dynamic/tcp.json @@ -107,41 +107,12 @@ ], "outboundTag": "blocked" }, - { - "type": "field", - "domain": [ - "domain:epochtimes.com", - "domain:epochtimes.com.tw", - "domain:epochtimes.fr", - "domain:epochtimes.de", - "domain:epochtimes.jp", - "domain:epochtimes.ru", - "domain:epochtimes.co.il", - "domain:epochtimes.co.kr", - "domain:epochtimes-romania.com", - "domain:erabaru.net", - "domain:lagranepoca.com", - "domain:theepochtimes.com", - "domain:ntdtv.com", - "domain:ntd.tv", - "domain:ntdtv-dc.com", - "domain:ntdtv.com.tw", - "domain:minghui.org", - "domain:renminbao.com", - "domain:dafahao.com", - "domain:dongtaiwang.com", - "domain:falundafa.org", - "domain:wujieliulan.com", - "domain:ninecommentaries.com", - "domain:shenyun.com" - ], - "outboundTag": "blocked" - }, { "type": "field", "inboundTag": ["tg-in"], "outboundTag": "tg-out" } + //include_ban_xx //include_ban_bt //include_ban_ad //include_rules diff --git a/config/server/dynamic/ws.json b/config/server/dynamic/ws.json index 69b9310..324ce7d 100644 --- a/config/server/dynamic/ws.json +++ b/config/server/dynamic/ws.json @@ -110,41 +110,12 @@ ], "outboundTag": "blocked" }, - { - "type": "field", - "domain": [ - "domain:epochtimes.com", - "domain:epochtimes.com.tw", - "domain:epochtimes.fr", - "domain:epochtimes.de", - "domain:epochtimes.jp", - "domain:epochtimes.ru", - "domain:epochtimes.co.il", - "domain:epochtimes.co.kr", - "domain:epochtimes-romania.com", - "domain:erabaru.net", - "domain:lagranepoca.com", - "domain:theepochtimes.com", - "domain:ntdtv.com", - "domain:ntd.tv", - "domain:ntdtv-dc.com", - "domain:ntdtv.com.tw", - "domain:minghui.org", - "domain:renminbao.com", - "domain:dafahao.com", - "domain:dongtaiwang.com", - "domain:falundafa.org", - "domain:wujieliulan.com", - "domain:ninecommentaries.com", - "domain:shenyun.com" - ], - "outboundTag": "blocked" - }, { "type": "field", "inboundTag": ["tg-in"], "outboundTag": "tg-out" } + //include_ban_xx //include_ban_bt //include_ban_ad //include_rules diff --git a/config/server/h2.json b/config/server/h2.json index c3340ac..aff0ada 100644 --- a/config/server/h2.json +++ b/config/server/h2.json @@ -103,41 +103,12 @@ ], "outboundTag": "blocked" }, - { - "type": "field", - "domain": [ - "domain:epochtimes.com", - "domain:epochtimes.com.tw", - "domain:epochtimes.fr", - "domain:epochtimes.de", - "domain:epochtimes.jp", - "domain:epochtimes.ru", - "domain:epochtimes.co.il", - "domain:epochtimes.co.kr", - "domain:epochtimes-romania.com", - "domain:erabaru.net", - "domain:lagranepoca.com", - "domain:theepochtimes.com", - "domain:ntdtv.com", - "domain:ntd.tv", - "domain:ntdtv-dc.com", - "domain:ntdtv.com.tw", - "domain:minghui.org", - "domain:renminbao.com", - "domain:dafahao.com", - "domain:dongtaiwang.com", - "domain:falundafa.org", - "domain:wujieliulan.com", - "domain:ninecommentaries.com", - "domain:shenyun.com" - ], - "outboundTag": "blocked" - }, { "type": "field", "inboundTag": ["tg-in"], "outboundTag": "tg-out" } + //include_ban_xx //include_ban_bt //include_ban_ad //include_rules diff --git a/config/server/http.json b/config/server/http.json index 0aa2786..902d7c8 100644 --- a/config/server/http.json +++ b/config/server/http.json @@ -121,41 +121,12 @@ ], "outboundTag": "blocked" }, - { - "type": "field", - "domain": [ - "domain:epochtimes.com", - "domain:epochtimes.com.tw", - "domain:epochtimes.fr", - "domain:epochtimes.de", - "domain:epochtimes.jp", - "domain:epochtimes.ru", - "domain:epochtimes.co.il", - "domain:epochtimes.co.kr", - "domain:epochtimes-romania.com", - "domain:erabaru.net", - "domain:lagranepoca.com", - "domain:theepochtimes.com", - "domain:ntdtv.com", - "domain:ntd.tv", - "domain:ntdtv-dc.com", - "domain:ntdtv.com.tw", - "domain:minghui.org", - "domain:renminbao.com", - "domain:dafahao.com", - "domain:dongtaiwang.com", - "domain:falundafa.org", - "domain:wujieliulan.com", - "domain:ninecommentaries.com", - "domain:shenyun.com" - ], - "outboundTag": "blocked" - }, { "type": "field", "inboundTag": ["tg-in"], "outboundTag": "tg-out" } + //include_ban_xx //include_ban_bt //include_ban_ad //include_rules diff --git a/config/server/include/ban.json b/config/server/include/ban.json new file mode 100644 index 0000000..87cf4ea --- /dev/null +++ b/config/server/include/ban.json @@ -0,0 +1,30 @@ + { + "type": "field", + "domain": [ + "domain:epochtimes.com", + "domain:epochtimes.com.tw", + "domain:epochtimes.fr", + "domain:epochtimes.de", + "domain:epochtimes.jp", + "domain:epochtimes.ru", + "domain:epochtimes.co.il", + "domain:epochtimes.co.kr", + "domain:epochtimes-romania.com", + "domain:erabaru.net", + "domain:lagranepoca.com", + "domain:theepochtimes.com", + "domain:ntdtv.com", + "domain:ntd.tv", + "domain:ntdtv-dc.com", + "domain:ntdtv.com.tw", + "domain:minghui.org", + "domain:renminbao.com", + "domain:dafahao.com", + "domain:dongtaiwang.com", + "domain:falundafa.org", + "domain:wujieliulan.com", + "domain:ninecommentaries.com", + "domain:shenyun.com" + ], + "outboundTag": "blocked" + } \ No newline at end of file diff --git a/config/server/kcp.json b/config/server/kcp.json index 36c67bc..be66f22 100644 --- a/config/server/kcp.json +++ b/config/server/kcp.json @@ -93,41 +93,12 @@ ], "outboundTag": "blocked" }, - { - "type": "field", - "domain": [ - "domain:epochtimes.com", - "domain:epochtimes.com.tw", - "domain:epochtimes.fr", - "domain:epochtimes.de", - "domain:epochtimes.jp", - "domain:epochtimes.ru", - "domain:epochtimes.co.il", - "domain:epochtimes.co.kr", - "domain:epochtimes-romania.com", - "domain:erabaru.net", - "domain:lagranepoca.com", - "domain:theepochtimes.com", - "domain:ntdtv.com", - "domain:ntd.tv", - "domain:ntdtv-dc.com", - "domain:ntdtv.com.tw", - "domain:minghui.org", - "domain:renminbao.com", - "domain:dafahao.com", - "domain:dongtaiwang.com", - "domain:falundafa.org", - "domain:wujieliulan.com", - "domain:ninecommentaries.com", - "domain:shenyun.com" - ], - "outboundTag": "blocked" - }, { "type": "field", "inboundTag": ["tg-in"], "outboundTag": "tg-out" } + //include_ban_xx //include_ban_bt //include_ban_ad //include_rules diff --git a/config/server/quic.json b/config/server/quic.json index fcc66ba..324b848 100644 --- a/config/server/quic.json +++ b/config/server/quic.json @@ -95,41 +95,12 @@ ], "outboundTag": "blocked" }, - { - "type": "field", - "domain": [ - "domain:epochtimes.com", - "domain:epochtimes.com.tw", - "domain:epochtimes.fr", - "domain:epochtimes.de", - "domain:epochtimes.jp", - "domain:epochtimes.ru", - "domain:epochtimes.co.il", - "domain:epochtimes.co.kr", - "domain:epochtimes-romania.com", - "domain:erabaru.net", - "domain:lagranepoca.com", - "domain:theepochtimes.com", - "domain:ntdtv.com", - "domain:ntd.tv", - "domain:ntdtv-dc.com", - "domain:ntdtv.com.tw", - "domain:minghui.org", - "domain:renminbao.com", - "domain:dafahao.com", - "domain:dongtaiwang.com", - "domain:falundafa.org", - "domain:wujieliulan.com", - "domain:ninecommentaries.com", - "domain:shenyun.com" - ], - "outboundTag": "blocked" - }, { "type": "field", "inboundTag": ["tg-in"], "outboundTag": "tg-out" } + //include_ban_xx //include_ban_bt //include_ban_ad //include_rules diff --git a/config/server/tcp.json b/config/server/tcp.json index d103323..1ae18bf 100644 --- a/config/server/tcp.json +++ b/config/server/tcp.json @@ -88,41 +88,12 @@ ], "outboundTag": "blocked" }, - { - "type": "field", - "domain": [ - "domain:epochtimes.com", - "domain:epochtimes.com.tw", - "domain:epochtimes.fr", - "domain:epochtimes.de", - "domain:epochtimes.jp", - "domain:epochtimes.ru", - "domain:epochtimes.co.il", - "domain:epochtimes.co.kr", - "domain:epochtimes-romania.com", - "domain:erabaru.net", - "domain:lagranepoca.com", - "domain:theepochtimes.com", - "domain:ntdtv.com", - "domain:ntd.tv", - "domain:ntdtv-dc.com", - "domain:ntdtv.com.tw", - "domain:minghui.org", - "domain:renminbao.com", - "domain:dafahao.com", - "domain:dongtaiwang.com", - "domain:falundafa.org", - "domain:wujieliulan.com", - "domain:ninecommentaries.com", - "domain:shenyun.com" - ], - "outboundTag": "blocked" - }, { "type": "field", "inboundTag": ["tg-in"], "outboundTag": "tg-out" } + //include_ban_xx //include_ban_bt //include_ban_ad //include_rules diff --git a/config/server/ws.json b/config/server/ws.json index b1b6eec..ac416dc 100644 --- a/config/server/ws.json +++ b/config/server/ws.json @@ -88,41 +88,12 @@ ], "outboundTag": "blocked" }, - { - "type": "field", - "domain": [ - "domain:epochtimes.com", - "domain:epochtimes.com.tw", - "domain:epochtimes.fr", - "domain:epochtimes.de", - "domain:epochtimes.jp", - "domain:epochtimes.ru", - "domain:epochtimes.co.il", - "domain:epochtimes.co.kr", - "domain:epochtimes-romania.com", - "domain:erabaru.net", - "domain:lagranepoca.com", - "domain:theepochtimes.com", - "domain:ntdtv.com", - "domain:ntd.tv", - "domain:ntdtv-dc.com", - "domain:ntdtv.com.tw", - "domain:minghui.org", - "domain:renminbao.com", - "domain:dafahao.com", - "domain:dongtaiwang.com", - "domain:falundafa.org", - "domain:wujieliulan.com", - "domain:ninecommentaries.com", - "domain:shenyun.com" - ], - "outboundTag": "blocked" - }, { "type": "field", "inboundTag": ["tg-in"], "outboundTag": "tg-out" } + //include_ban_xx //include_ban_bt //include_ban_ad //include_rules diff --git a/src/ban_xx.sh b/src/ban_xx.sh new file mode 100644 index 0000000..5287859 --- /dev/null +++ b/src/ban_xx.sh @@ -0,0 +1,4 @@ +# ban domain +ban_xx_file="/etc/v2ray/233boy/v2ray/config/server/include/ban.json" +sed -i "/\/\/include_ban_xx/r $ban_xx_file" $v2ray_server_config +sed -i "s#//include_ban_xx#,#" $v2ray_server_config diff --git a/src/config.sh b/src/config.sh index 3314f1b..293cc63 100644 --- a/src/config.sh +++ b/src/config.sh @@ -2,6 +2,9 @@ # vmess _load vmess-config.sh +# ban domain +_load ban_xx.sh + # ban bt _load ban_bt.sh diff --git a/v2ray.sh b/v2ray.sh index 5fed4e3..cba0bbb 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.15-test" +_version="v3.16-test" cmd="apt-get" @@ -24,21 +24,9 @@ else echo -e " 哈哈……这个 ${red}辣鸡脚本${none} 不支持你的系统。 ${yellow}(-_-) ${none}" && exit 1 fi -# 笨笨的检测方法 -if [[ -f /usr/bin/apt-get ]] || [[ -f /usr/bin/yum && -f /bin/systemctl ]]; then +if [[ -f /usr/bin/yum ]]; then - if [[ -f /usr/bin/yum ]]; then - - cmd="yum" - - fi - if [[ -f /bin/systemctl ]]; then - systemd=true - fi - -else - - echo -e " 哈哈……这个 ${red}辣鸡脚本${none} 不支持你的系统。 ${yellow}(-_-) ${none}" && exit 1 + cmd="yum" fi @@ -76,6 +64,7 @@ caddy_pid=$(pgrep -f /usr/local/bin/caddy) _v2ray_sh="/usr/local/sbin/v2ray" v2ray_ver="$(/usr/bin/v2ray/v2ray -version | head -n 1 | cut -d " " -f2)" . /etc/v2ray/233boy/v2ray/src/init.sh +systemd=true _test=true if [[ $v2ray_ver != v* ]]; then