diff --git a/config/server/dynamic/http.json b/config/server/dynamic/http.json index 480e294..4661469 100644 --- a/config/server/dynamic/http.json +++ b/config/server/dynamic/http.json @@ -91,7 +91,7 @@ //include_ss //include_socks //include_mtproto - //include_config + //include_in_config // ], "outbounds": [ @@ -114,13 +114,15 @@ "settings": {}, "tag": "tg-out" } + //include_out_config + // ], "dns": { "server": [ - "8.8.8.8", - "8.8.4.4", "1.1.1.1", "1.0.0.1", + "8.8.8.8", + "8.8.4.4", "localhost" ] }, diff --git a/config/server/dynamic/kcp.json b/config/server/dynamic/kcp.json index cd78a88..48e3b8b 100644 --- a/config/server/dynamic/kcp.json +++ b/config/server/dynamic/kcp.json @@ -63,7 +63,7 @@ //include_ss //include_socks //include_mtproto - //include_config + //include_in_config // ], "outbounds": [ @@ -86,13 +86,15 @@ "settings": {}, "tag": "tg-out" } + //include_out_config + // ], "dns": { "server": [ - "8.8.8.8", - "8.8.4.4", "1.1.1.1", "1.0.0.1", + "8.8.8.8", + "8.8.4.4", "localhost" ] }, diff --git a/config/server/dynamic/quic.json b/config/server/dynamic/quic.json index 9342cf5..16911b4 100644 --- a/config/server/dynamic/quic.json +++ b/config/server/dynamic/quic.json @@ -67,7 +67,7 @@ //include_ss //include_socks //include_mtproto - //include_config + //include_in_config // ], "outbounds": [ @@ -90,13 +90,15 @@ "settings": {}, "tag": "tg-out" } + //include_out_config + // ], "dns": { "server": [ - "8.8.8.8", - "8.8.4.4", "1.1.1.1", "1.0.0.1", + "8.8.8.8", + "8.8.4.4", "localhost" ] }, diff --git a/config/server/dynamic/tcp.json b/config/server/dynamic/tcp.json index ad0feca..7c4d90b 100644 --- a/config/server/dynamic/tcp.json +++ b/config/server/dynamic/tcp.json @@ -50,7 +50,7 @@ //include_ss //include_socks //include_mtproto - //include_config + //include_in_config // ], "outbounds": [ @@ -73,13 +73,15 @@ "settings": {}, "tag": "tg-out" } + //include_out_config + // ], "dns": { "server": [ - "8.8.8.8", - "8.8.4.4", "1.1.1.1", "1.0.0.1", + "8.8.8.8", + "8.8.4.4", "localhost" ] }, diff --git a/config/server/dynamic/ws.json b/config/server/dynamic/ws.json index 324ce7d..51c889a 100644 --- a/config/server/dynamic/ws.json +++ b/config/server/dynamic/ws.json @@ -53,7 +53,7 @@ //include_ss //include_socks //include_mtproto - //include_config + //include_in_config // ], "outbounds": [ @@ -76,13 +76,15 @@ "settings": {}, "tag": "tg-out" } + //include_out_config + // ], "dns": { "server": [ - "8.8.8.8", - "8.8.4.4", "1.1.1.1", "1.0.0.1", + "8.8.8.8", + "8.8.4.4", "localhost" ] }, diff --git a/config/server/h2.json b/config/server/h2.json index aff0ada..6be2a38 100644 --- a/config/server/h2.json +++ b/config/server/h2.json @@ -46,7 +46,7 @@ //include_ss //include_socks //include_mtproto - //include_config + //include_in_config // ], "outbounds": [ @@ -69,13 +69,15 @@ "settings": {}, "tag": "tg-out" } + //include_out_config + // ], "dns": { "server": [ - "8.8.8.8", - "8.8.4.4", "1.1.1.1", "1.0.0.1", + "8.8.8.8", + "8.8.4.4", "localhost" ] }, diff --git a/config/server/http.json b/config/server/http.json index 902d7c8..77e1a8b 100644 --- a/config/server/http.json +++ b/config/server/http.json @@ -64,7 +64,7 @@ //include_ss //include_socks //include_mtproto - //include_config + //include_in_config // ], "outbounds": [ @@ -87,13 +87,15 @@ "settings": {}, "tag": "tg-out" } + //include_out_config + // ], "dns": { "server": [ - "8.8.8.8", - "8.8.4.4", "1.1.1.1", "1.0.0.1", + "8.8.8.8", + "8.8.4.4", "localhost" ] }, diff --git a/config/server/kcp.json b/config/server/kcp.json index be66f22..bca8dad 100644 --- a/config/server/kcp.json +++ b/config/server/kcp.json @@ -36,7 +36,7 @@ //include_ss //include_socks //include_mtproto - //include_config + //include_in_config // ], "outbounds": [ @@ -59,13 +59,15 @@ "settings": {}, "tag": "tg-out" } + //include_out_config + // ], "dns": { "server": [ - "8.8.8.8", - "8.8.4.4", "1.1.1.1", "1.0.0.1", + "8.8.8.8", + "8.8.4.4", "localhost" ] }, diff --git a/config/server/quic.json b/config/server/quic.json index 324b848..2379fd1 100644 --- a/config/server/quic.json +++ b/config/server/quic.json @@ -38,7 +38,7 @@ //include_ss //include_socks //include_mtproto - //include_config + //include_in_config // ], "outbounds": [ @@ -61,13 +61,15 @@ "settings": {}, "tag": "tg-out" } + //include_out_config + // ], "dns": { "server": [ - "8.8.8.8", - "8.8.4.4", "1.1.1.1", "1.0.0.1", + "8.8.8.8", + "8.8.4.4", "localhost" ] }, diff --git a/config/server/tcp.json b/config/server/tcp.json index 1ae18bf..01819bf 100644 --- a/config/server/tcp.json +++ b/config/server/tcp.json @@ -31,7 +31,7 @@ //include_ss //include_socks //include_mtproto - //include_config + //include_in_config // ], "outbounds": [ @@ -54,13 +54,15 @@ "settings": {}, "tag": "tg-out" } + //include_out_config + // ], "dns": { "server": [ - "8.8.8.8", - "8.8.4.4", "1.1.1.1", "1.0.0.1", + "8.8.8.8", + "8.8.4.4", "localhost" ] }, diff --git a/config/server/ws.json b/config/server/ws.json index ac416dc..4a45f22 100644 --- a/config/server/ws.json +++ b/config/server/ws.json @@ -31,7 +31,7 @@ //include_ss //include_socks //include_mtproto - //include_config + //include_in_config // ], "outbounds": [ @@ -54,13 +54,15 @@ "settings": {}, "tag": "tg-out" } + //include_out_config + // ], "dns": { "server": [ - "8.8.8.8", - "8.8.4.4", "1.1.1.1", "1.0.0.1", + "8.8.8.8", + "8.8.4.4", "localhost" ] }, diff --git a/src/config.sh b/src/config.sh index 293cc63..19060df 100644 --- a/src/config.sh +++ b/src/config.sh @@ -1,6 +1,14 @@ # vmess _load vmess-config.sh +# ss +_load ss-config.sh + +# socks +_load socks-config.sh + +# mtproto +_load mtproto-config.sh # ban domain _load ban_xx.sh @@ -11,17 +19,5 @@ _load ban_bt.sh # ban ad _load ban_ad.sh -# custom rules -_load custom_rules.sh - -# ss -_load ss-config.sh - -# socks -_load socks-config.sh - -# mtproto -_load mtproto-config.sh - # custom config _load custom_config.sh diff --git a/src/custom_config.sh b/src/custom_config.sh index 16ad6ec..909ff9c 100644 --- a/src/custom_config.sh +++ b/src/custom_config.sh @@ -1,6 +1,18 @@ -# custom config -if [[ -f /etc/v2ray/custom/config.json ]]; then - custom_config_file="/etc/v2ray/custom/config.json" - sed -i "/\/\/include_config/r $custom_config_file" $v2ray_server_config - sed -i "s#//include_config#,#" $v2ray_server_config +# custom inbounds config +if [[ -f /etc/v2ray/custom/in.json ]]; then + custom_config_file="/etc/v2ray/custom/in.json" + sed -i "/\/\/include_in_config/r $custom_config_file" $v2ray_server_config + sed -i "s#//include_in_config#,#" $v2ray_server_config fi +# custom outbounds config +if [[ -f /etc/v2ray/custom/out.json ]]; then + custom_config_file="/etc/v2ray/custom/out.json" + sed -i "/\/\/include_out_config/r $custom_config_file" $v2ray_server_config + sed -i "s#//include_out_config#,#" $v2ray_server_config +fi +# custom rules +if [[ -f /etc/v2ray/custom/rules.json ]]; then + custom_rules_file="/etc/v2ray/custom/rules.json" + sed -i "/\/\/include_rules/r $custom_rules_file" $v2ray_server_config + sed -i "s#//include_rules#,#" $v2ray_server_config +fi \ No newline at end of file diff --git a/src/custom_rules.sh b/src/custom_rules.sh deleted file mode 100644 index d5345c3..0000000 --- a/src/custom_rules.sh +++ /dev/null @@ -1,6 +0,0 @@ -# custom rules -if [[ -f /etc/v2ray/custom/rules.json ]]; then - custom_rules_file="/etc/v2ray/custom/rules.json" - sed -i "/\/\/include_rules/r $custom_rules_file" $v2ray_server_config - sed -i "s#//include_rules#,#" $v2ray_server_config -fi diff --git a/v2ray.sh b/v2ray.sh index 535512b..9407648 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.05" +_version="v3.06" cmd="apt-get"