update conf

This commit is contained in:
quackerd 2020-06-09 10:40:04 +08:00
parent c9fd9b04f3
commit 05191501ce
Signed by: d
GPG Key ID: 590A22374D0B819F
2 changed files with 33 additions and 4 deletions

View File

@ -7,7 +7,15 @@
"dns": { "dns": {
"servers": [ "servers": [
"223.5.5.5",
"114.114.114.114", "114.114.114.114",
{
"address": "8.8.8.8",
"port": 53,
"domains": [
"geosite:geolocation-!cn"
]
},
{ {
"address": "1.1.1.1", "address": "1.1.1.1",
"port": 53, "port": 53,
@ -19,12 +27,23 @@
}, },
"routing": { "routing": {
"domainStrategy": "IPOnDemand", "domainStrategy": "IPIfNonMatch",
"rules": [ "rules": [
{ {
"type": "field", "type": "field",
"outboundTag": "direct", "outboundTag": "direct",
"domain": ["geosite:cn"] "ip": [
"223.5.5.5",
"114.114.114.114"
]
},
{
"type": "field",
"outboundTag": "proxy",
"ip": [
"8.8.8.8",
"1.1.1.1"
]
}, },
{ {
"type": "field", "type": "field",
@ -34,6 +53,11 @@
"geoip:private" "geoip:private"
] ]
}, },
{
"type": "field",
"outboundTag": "direct",
"domain": ["geosite:cn"]
},
{ {
"type": "field", "type": "field",
"outboundTag": "proxy", "outboundTag": "proxy",
@ -88,6 +112,11 @@
"protocol": "freedom", "protocol": "freedom",
"settings": {}, "settings": {},
"tag": "direct" "tag": "direct"
},
{
"protocol": "blackhole",
"settings": {},
"tag": "block"
} }
] ]
} }

View File

@ -139,8 +139,8 @@ def main():
with open("nginx/nginx/site-confs/default", "w") as file: with open("nginx/nginx/site-confs/default", "w") as file:
file.write(output) file.write(output)
# process client.conf # process client.json
with open("client.conf", "r") as file: with open("client.json", "r") as file:
template = jinja2.Template(file.read()) template = jinja2.Template(file.read())
output = template.render(uuid = v_uuid, path = v_path, server_name = server_name) output = template.render(uuid = v_uuid, path = v_path, server_name = server_name)