From 3b4b67df335a4fb1f791dda32a689f3958e1d13b Mon Sep 17 00:00:00 2001 From: fancy Date: Tue, 5 May 2020 18:11:02 +0800 Subject: [PATCH] small change --- cgproxy.conf | 16 +++++----------- v2ray_config/00_log.json | 2 +- v2ray_config/02_dns.json | 5 ++++- v2ray_config/03_routing.json | 7 ------- v2ray_config/merge.sh | 2 +- 5 files changed, 11 insertions(+), 21 deletions(-) diff --git a/cgproxy.conf b/cgproxy.conf index 6f37473..15ecdc2 100644 --- a/cgproxy.conf +++ b/cgproxy.conf @@ -1,24 +1,19 @@ -# see how to configure -# https://github.com/springzfx/cgproxy - -######################################################################## ## cgroup transparent proxy +## see how to configure, https://github.com/springzfx/cgproxy + ## any process in cgroup_proxy will be proxied, and cgroup_noproxy the opposite -## cgroup must start with slash '/' -# cgroup_proxy="/" +## note, cgroup must start with slash '/' +# cgroup_proxy="/" # for global tproxy +# cgroup_noproxy="/system.slice/v2ray.service" # for v2ray service cgroup_proxy="/proxy.slice" cgroup_noproxy="/noproxy.slice" -# cgroup_noproxy="/system.slice/v2ray.service" -######################################################################## ## allow as gateway for local network enable_gateway=false -######################################################################## ## listening port of another proxy process, for example v2ray port=12345 -######################################################################## ## if you set to false, it's traffic won't go through proxy, but still can go direct to internet enable_dns=true enable_tcp=true @@ -26,7 +21,6 @@ enable_udp=true enable_ipv4=true enable_ipv6=true -######################################################################## ## do not modify this if you don't known what you are doing table=100 fwmark=0x01 diff --git a/v2ray_config/00_log.json b/v2ray_config/00_log.json index b3dea47..820a528 100644 --- a/v2ray_config/00_log.json +++ b/v2ray_config/00_log.json @@ -1,5 +1,5 @@ { "log": { - "loglevel": "error" + "loglevel": "none" } } diff --git a/v2ray_config/02_dns.json b/v2ray_config/02_dns.json index 022e3fa..9a063e7 100644 --- a/v2ray_config/02_dns.json +++ b/v2ray_config/02_dns.json @@ -1,7 +1,10 @@ { "dns": { + "hosts": { + "geosite:category-ads": "127.0.0.1" + }, "servers": [ - "https://223.5.5.5/dns-query", + "https+local://223.5.5.5/dns-query", "https://1.1.1.1/dns-query", { "address": "localhost", diff --git a/v2ray_config/03_routing.json b/v2ray_config/03_routing.json index 268af0a..1d5fe2c 100644 --- a/v2ray_config/03_routing.json +++ b/v2ray_config/03_routing.json @@ -21,13 +21,6 @@ "port": "53", "type": "field" }, - { - "inboundTag": [ - "dns_inbound" - ], - "outboundTag": "outBound_DIRECT", - "type": "field" - }, { "domain": [ "geosite:google", diff --git a/v2ray_config/merge.sh b/v2ray_config/merge.sh index 8eae41a..1f7764f 100644 --- a/v2ray_config/merge.sh +++ b/v2ray_config/merge.sh @@ -1,2 +1,2 @@ #!/bin/bash -jq -rs 'reduce .[] as $item ({}; . + $item + {inbounds: (.inbounds + $item.inbounds)} + {outbounds: ($item.outbounds + .outbounds)})' *.json |sudo tee /etc/v2ray/config.json +jq -rs 'reduce .[] as $item ({}; . + $item + {inbounds: (.inbounds + $item.inbounds)} + {outbounds: ($item.outbounds + .outbounds)})' *.json |sudo tee /etc/v2ray/config.json > /dev/null