From 095c8552597e09bc07534e716f2bc3d30cbc79f3 Mon Sep 17 00:00:00 2001 From: nite07 Date: Sun, 20 Oct 2024 01:02:01 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Modify=20templates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/linux/dns.json | 60 ++++++++++++++++++++++++++ templates/linux/experimental.json | 13 ++++++ templates/linux/inbounds.json | 14 ++++++ templates/linux/log.json | 6 +++ templates/{ => linux}/outbounds.json | 0 templates/linux/route.json | 53 +++++++++++++++++++++++ templates/linux/route_rule_set.json | 62 +++++++++++++++++++++++++++ templates/windows/dns.json | 60 ++++++++++++++++++++++++++ templates/windows/experimental.json | 13 ++++++ templates/windows/inbounds.json | 13 ++++++ templates/windows/log.json | 6 +++ templates/windows/outbounds.json | 21 +++++++++ templates/windows/route.json | 53 +++++++++++++++++++++++ templates/windows/route_rule_set.json | 62 +++++++++++++++++++++++++++ 14 files changed, 436 insertions(+) create mode 100644 templates/linux/dns.json create mode 100644 templates/linux/experimental.json create mode 100644 templates/linux/inbounds.json create mode 100644 templates/linux/log.json rename templates/{ => linux}/outbounds.json (100%) create mode 100644 templates/linux/route.json create mode 100644 templates/linux/route_rule_set.json create mode 100644 templates/windows/dns.json create mode 100644 templates/windows/experimental.json create mode 100644 templates/windows/inbounds.json create mode 100644 templates/windows/log.json create mode 100644 templates/windows/outbounds.json create mode 100644 templates/windows/route.json create mode 100644 templates/windows/route_rule_set.json diff --git a/templates/linux/dns.json b/templates/linux/dns.json new file mode 100644 index 0000000..2d51c85 --- /dev/null +++ b/templates/linux/dns.json @@ -0,0 +1,60 @@ +{ + "dns": { + "servers": [ + { + "tag": "google", + "address": "tls://8.8.8.8", + "detour": "default" + }, + { + "tag": "local", + "address": "https://223.5.5.5/dns-query", + "detour": "direct" + }, + { + "tag": "refused", + "address": "rcode://refused" + } + ], + "rules": [ + { + "rule_set": "geosite-category-ads-all", + "server": "refused" + }, + { + "outbound": "any", + "server": "local" + }, + { + "clash_mode": "Direct", + "server": "local" + }, + { + "clash_mode": "Global", + "server": "google" + }, + { + "rule_set": "geosite-geolocation-cn", + "server": "local" + }, + { + "type": "logical", + "mode": "and", + "rules": [ + { + "rule_set": "geosite-geolocation-!cn", + "invert": true + }, + { + "rule_set": "geoip-cn" + } + ], + "server": "google", + "client_subnet": "114.114.114.114/24" + } + ], + "final": "local", + "disable_cache": false, + "disable_expire": false + } +} diff --git a/templates/linux/experimental.json b/templates/linux/experimental.json new file mode 100644 index 0000000..3a610ad --- /dev/null +++ b/templates/linux/experimental.json @@ -0,0 +1,13 @@ +{ + "experimental": { + "cache_file": { + "enabled": true + }, + "clash_api": { + "external_controller": "127.0.0.1:9090", + "external_ui": "./ui", + "external_ui_download_detour": "default", + "default_mode": "Enhanced" + } + } +} diff --git a/templates/linux/inbounds.json b/templates/linux/inbounds.json new file mode 100644 index 0000000..350dfce --- /dev/null +++ b/templates/linux/inbounds.json @@ -0,0 +1,14 @@ +{ + "inbounds": [ + { + "type": "tun", + "auto_route": true, + "auto_redirect": true, + "strict_route": true, + "sniff": true, + "sniff_override_destination": true, + "address": ["172.16.0.1/30", "fdfe:dcba:9876::1/126"], + "exclude_interface": ["tailscale0"] + } + ] +} diff --git a/templates/linux/log.json b/templates/linux/log.json new file mode 100644 index 0000000..0f43ea2 --- /dev/null +++ b/templates/linux/log.json @@ -0,0 +1,6 @@ +{ + "log": { + "level": "trace", + "timestamp": true + } +} diff --git a/templates/outbounds.json b/templates/linux/outbounds.json similarity index 100% rename from templates/outbounds.json rename to templates/linux/outbounds.json diff --git a/templates/linux/route.json b/templates/linux/route.json new file mode 100644 index 0000000..1824fab --- /dev/null +++ b/templates/linux/route.json @@ -0,0 +1,53 @@ +{ + "route": { + "rules": [ + { + "type": "logical", + "mode": "or", + "rules": [ + { + "protocol": "dns" + }, + { + "port": 53 + } + ], + "outbound": "dns" + }, + { + "ip_is_private": true, + "outbound": "direct" + }, + { + "clash_mode": "Direct", + "outbound": "direct" + }, + { + "clash_mode": "Global", + "outbound": "default" + }, + { + "rule_set": "geosite-google", + "outbound": "default" + }, + { + "type": "logical", + "mode": "or", + "rules": [ + { + "rule_set": [ + "geoip-cn", + "geosite-geolocation-cn", + "geosite-cn", + "geosite-category-games@cn", + "geosite-steam@cn" + ] + } + ], + "outbound": "direct" + } + ], + "final": "default", + "auto_detect_interface": true + } +} diff --git a/templates/linux/route_rule_set.json b/templates/linux/route_rule_set.json new file mode 100644 index 0000000..abba2a2 --- /dev/null +++ b/templates/linux/route_rule_set.json @@ -0,0 +1,62 @@ +{ + "route": { + "rule_set": [ + { + "type": "remote", + "tag": "geosite-category-ads-all", + "format": "binary", + "url": "https://ghp.ci/https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-ads-all.srs", + "download_detour": "default" + }, + { + "type": "remote", + "tag": "geosite-geolocation-cn", + "format": "binary", + "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-cn.srs", + "download_detour": "default" + }, + { + "type": "remote", + "tag": "geosite-geolocation-!cn", + "format": "binary", + "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-!cn.srs", + "download_detour": "default" + }, + { + "type": "remote", + "tag": "geoip-cn", + "format": "binary", + "url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs", + "download_detour": "default" + }, + { + "type": "remote", + "tag": "geosite-category-games@cn", + "format": "binary", + "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-games@cn.srs", + "download_detour": "default" + }, + { + "type": "remote", + "tag": "geosite-steam@cn", + "format": "binary", + "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-steam@cn.srs", + "download_detour": "default" + }, + { + "type": "remote", + "tag": "geosite-cn", + "format": "binary", + "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-cn.srs", + "download_detour": "default" + }, + { + "type": "remote", + "tag": "geosite-google", + "format": "binary", + "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-google.srs", + "download_detour": "default" + } + ] + } +} diff --git a/templates/windows/dns.json b/templates/windows/dns.json new file mode 100644 index 0000000..2d51c85 --- /dev/null +++ b/templates/windows/dns.json @@ -0,0 +1,60 @@ +{ + "dns": { + "servers": [ + { + "tag": "google", + "address": "tls://8.8.8.8", + "detour": "default" + }, + { + "tag": "local", + "address": "https://223.5.5.5/dns-query", + "detour": "direct" + }, + { + "tag": "refused", + "address": "rcode://refused" + } + ], + "rules": [ + { + "rule_set": "geosite-category-ads-all", + "server": "refused" + }, + { + "outbound": "any", + "server": "local" + }, + { + "clash_mode": "Direct", + "server": "local" + }, + { + "clash_mode": "Global", + "server": "google" + }, + { + "rule_set": "geosite-geolocation-cn", + "server": "local" + }, + { + "type": "logical", + "mode": "and", + "rules": [ + { + "rule_set": "geosite-geolocation-!cn", + "invert": true + }, + { + "rule_set": "geoip-cn" + } + ], + "server": "google", + "client_subnet": "114.114.114.114/24" + } + ], + "final": "local", + "disable_cache": false, + "disable_expire": false + } +} diff --git a/templates/windows/experimental.json b/templates/windows/experimental.json new file mode 100644 index 0000000..3a610ad --- /dev/null +++ b/templates/windows/experimental.json @@ -0,0 +1,13 @@ +{ + "experimental": { + "cache_file": { + "enabled": true + }, + "clash_api": { + "external_controller": "127.0.0.1:9090", + "external_ui": "./ui", + "external_ui_download_detour": "default", + "default_mode": "Enhanced" + } + } +} diff --git a/templates/windows/inbounds.json b/templates/windows/inbounds.json new file mode 100644 index 0000000..ec0d705 --- /dev/null +++ b/templates/windows/inbounds.json @@ -0,0 +1,13 @@ +{ + "inbounds": [ + { + "type": "tun", + "auto_route": true, + "strict_route": true, + "sniff": true, + "sniff_override_destination": true, + "address": ["172.16.0.1/30", "fdfe:dcba:9876::1/126"], + "exclude_interface": ["tailscale0"] + } + ] +} diff --git a/templates/windows/log.json b/templates/windows/log.json new file mode 100644 index 0000000..0f43ea2 --- /dev/null +++ b/templates/windows/log.json @@ -0,0 +1,6 @@ +{ + "log": { + "level": "trace", + "timestamp": true + } +} diff --git a/templates/windows/outbounds.json b/templates/windows/outbounds.json new file mode 100644 index 0000000..9cbeaae --- /dev/null +++ b/templates/windows/outbounds.json @@ -0,0 +1,21 @@ +{ + "outbounds": [ + { + "outbounds": ["", "direct"], + "tag": "default", + "type": "selector" + }, + { + "tag": "direct", + "type": "direct" + }, + { + "tag": "block", + "type": "block" + }, + { + "tag": "dns", + "type": "dns" + } + ] +} diff --git a/templates/windows/route.json b/templates/windows/route.json new file mode 100644 index 0000000..1824fab --- /dev/null +++ b/templates/windows/route.json @@ -0,0 +1,53 @@ +{ + "route": { + "rules": [ + { + "type": "logical", + "mode": "or", + "rules": [ + { + "protocol": "dns" + }, + { + "port": 53 + } + ], + "outbound": "dns" + }, + { + "ip_is_private": true, + "outbound": "direct" + }, + { + "clash_mode": "Direct", + "outbound": "direct" + }, + { + "clash_mode": "Global", + "outbound": "default" + }, + { + "rule_set": "geosite-google", + "outbound": "default" + }, + { + "type": "logical", + "mode": "or", + "rules": [ + { + "rule_set": [ + "geoip-cn", + "geosite-geolocation-cn", + "geosite-cn", + "geosite-category-games@cn", + "geosite-steam@cn" + ] + } + ], + "outbound": "direct" + } + ], + "final": "default", + "auto_detect_interface": true + } +} diff --git a/templates/windows/route_rule_set.json b/templates/windows/route_rule_set.json new file mode 100644 index 0000000..abba2a2 --- /dev/null +++ b/templates/windows/route_rule_set.json @@ -0,0 +1,62 @@ +{ + "route": { + "rule_set": [ + { + "type": "remote", + "tag": "geosite-category-ads-all", + "format": "binary", + "url": "https://ghp.ci/https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-ads-all.srs", + "download_detour": "default" + }, + { + "type": "remote", + "tag": "geosite-geolocation-cn", + "format": "binary", + "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-cn.srs", + "download_detour": "default" + }, + { + "type": "remote", + "tag": "geosite-geolocation-!cn", + "format": "binary", + "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-!cn.srs", + "download_detour": "default" + }, + { + "type": "remote", + "tag": "geoip-cn", + "format": "binary", + "url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs", + "download_detour": "default" + }, + { + "type": "remote", + "tag": "geosite-category-games@cn", + "format": "binary", + "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-games@cn.srs", + "download_detour": "default" + }, + { + "type": "remote", + "tag": "geosite-steam@cn", + "format": "binary", + "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-steam@cn.srs", + "download_detour": "default" + }, + { + "type": "remote", + "tag": "geosite-cn", + "format": "binary", + "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-cn.srs", + "download_detour": "default" + }, + { + "type": "remote", + "tag": "geosite-google", + "format": "binary", + "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-google.srs", + "download_detour": "default" + } + ] + } +}