Breaking changes

Fix broken /sub2clashr and /surge2clash interface.
Add template support for base configurations.
Add support for exporting HTTP/Socks 5 nodes to Quantumult configurations.
Add support for VMess HTTP nodes in Clash configurations.
Optimize codes.
This commit is contained in:
Tindy X committed 2020-04-02 23:18:26 +08:00
1 parent 58349a086d
commit eeae32f8eb
11 files changed
+27151 -57

No files matched your search

+207
View File
@@ -0,0 +1,207 @@
{% if request.target == "clash" or request.target == "clashr" %}
port: {{ global.clash.http_port }}
socks-port: {{ global.clash.socks_port }}
allow-lan: {{ global.clash.allow_lan }}
mode: Rule
log-level: {{ global.clash.log_level }}
external-controller: :9090
{% if exists("request.clash.dns") %}
{% if request.clash.dns == "1" %}
dns:
enabled: true
listen: 1053
{% endif %}
{% endif %}
{% if local.clash.new_field_name == "true" %}
proxies: ~
proxy-groups: ~
rules: ~
{% else %}
Proxy: ~
Proxy Group: ~
Rule: ~
{% endif %}
{% endif %}
{% if request.target == "surge" %}
[General]
loglevel = notify
bypass-system = true
skip-proxy = 127.0.0.1,192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,100.64.0.0/10,localhost,*.local,e.crashlytics.com,captive.apple.com,::ffff:0:0:0:0/1,::ffff:128:0:0:0/1
#DNS设置或根据自己网络情况进行相应设置
bypass-tun = 192.168.0.0/16,10.0.0.0/8,172.16.0.0/12
dns-server = 119.29.29.29,223.5.5.5
[Script]
http-request https?:\/\/.*\.iqiyi\.com\/.*authcookie= script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/iQIYI-DailyBonus/iQIYI_GetCookie.js
{% endif %}
{% if request.target == "loon" %}
[General]
skip-proxy = 192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,localhost,*.local,e.crashlynatics.com
bypass-tun = 10.0.0.0/8,100.64.0.0/10,127.0.0.0/8,169.254.0.0/16,172.16.0.0/12,192.0.0.0/24,192.0.2.0/24,192.88.99.0/24,192.168.0.0/16,198.18.0.0/15,198.51.100.0/24,203.0.113.0/24,224.0.0.0/4,255.255.255.255/32
dns-server = system,119.29.29.29,223.5.5.5
allow-udp-proxy = false
host = 127.0.0.1
[Proxy]
[Remote Proxy]
[Proxy Group]
[Rule]
[Remote Rule]
[URL Rewrite]
enable = true
^https?:\/\/(www.)?(g|google)\.cn https://www.google.com 302
[Remote Rewrite]
https://raw.githubusercontent.com/Loon0x00/LoonExampleConfig/master/Rewrite/AutoRewrite_Example.list,auto
[MITM]
hostname = *.example.com,*.sample.com
enable = true
skip-server-cert-verify = true
#ca-p12 =
#ca-passphrase =
{% endif %}
{% if request.target == "quan" %}
[SERVER]
[SOURCE]
[BACKUP-SERVER]
[SUSPEND-SSID]
[POLICY]
[DNS]
1.1.1.1
[REWRITE]
[URL-REJECTION]
[TCP]
[GLOBAL]
[HOST]
[STATE]
STATE,AUTO
[MITM]
{% endif %}
{% if request.target == "quanx" %}
[general]
excluded_routes=192.168.0.0/16, 172.16.0.0/12, 100.64.0.0/10, 10.0.0.0/8
geo_location_checker=http://ip-api.com/json/?lang=zh-CN, https://github.com/KOP-XIAO/QuantumultX/raw/master/Scripts/IP_API.js
network_check_url=http://www.baidu.com/
server_check_url=http://www.gstatic.com/generate_204
[dns]
server=119.29.29.29
server=223.5.5.5
server=1.0.0.1
server=8.8.8.8
[policy]
static=♻️ 自动选择, direct, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Auto.png
static=🔰 节点选择, direct, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Proxy.png
static=🌍 国外媒体, direct, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/GlobalMedia.png
static=🌏 国内媒体, direct, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/DomesticMedia.png
static=Ⓜ️ 微软服务, direct, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Microsoft.png
static=📲 电报信息, direct, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Telegram.png
static=🍎 苹果服务, direct, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Apple.png
static=🎯 全球直连, direct, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Direct.png
static=🛑 全球拦截, direct, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Advertising.png
static=🐟 漏网之鱼, direct, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Final.png
[server_remote]
[filter_remote]
[rewrite_remote]
[server_local]
[filter_local]
[rewrite_local]
[mitm]
{% endif %}
{% if request.target == "mellow" %}
[Endpoint]
DIRECT, builtin, freedom, domainStrategy=UseIP
REJECT, builtin, blackhole
Dns-Out, builtin, dns
[Routing]
domainStrategy = IPIfNonMatch
[Dns]
hijack = Dns-Out
clientIp = 114.114.114.114
[DnsServer]
localhost
223.5.5.5
8.8.8.8, 53, Remote
8.8.4.4
[DnsRule]
DOMAIN-KEYWORD, geosite:geolocation-!cn, Remote
DOMAIN-SUFFIX, google.com, Remote
[DnsHost]
doubleclick.net = 127.0.0.1
[Log]
loglevel = warning
{% endif %}
{% if request.target == "surfboard" %}
[General]
loglevel = notify
interface = 127.0.0.1
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local
ipv6 = false
dns-server = system, 223.5.5.5
exclude-simple-hostnames = true
enhanced-mode-by-rule = true
{% endif %}
{% if request.target == "sssub" %}
{
"route": "bypass-lan-china",
"remote_dns": "dns.google",
"ipv6": false,
"metered": false,
"proxy_apps": {
"enabled": false,
"bypass": true,
"android_list": [
"com.eg.android.AlipayGphone",
"com.wudaokou.hippo",
"com.zhihu.android"
]
},
"udpdns": false
}
{% endif %}
+4
View File
@@ -55,3 +55,7 @@ clash_rule_base=base/forcerule.yml
;Options for filtering nodes
;include_remarks=
;exclude_remarks=
;[template]
;;variables in the local scope
;clash.dns.port=5353
+2
View File
@@ -23,3 +23,5 @@ custom:
# include_remarks: []
# exclude_remarks: []
# template_args:
# - {key: clash.dns.port, value: 5353}
+16 -8
View File
@@ -5,14 +5,14 @@ common:
insert_url: []
exclude_remarks: ["(到期|剩余流量|时间|官网|产品)"]
include_remarks: []
clash_rule_base: base/simple_base.yml
surge_rule_base: base/surge.conf
surfboard_rule_base: base/surfboard.conf
mellow_rule_base: base/mellow.conf
quan_rule_base: base/quan.conf
quanx_rule_base: base/quanx.conf
loon_rule_base: base/loon.conf
sssub_rule_base: base/shadowsocks_base.json
clash_rule_base: base/all_base.tpl
surge_rule_base: base/all_base.tpl
surfboard_rule_base: base/all_base.tpl
mellow_rule_base: base/all_base.tpl
quan_rule_base: base/all_base.tpl
quanx_rule_base: base/all_base.tpl
loon_rule_base: base/all_base.tpl
sssub_rule_base: base/all_base.tpl
proxy_config: SYSTEM
proxy_ruleset: SYSTEM
proxy_subscription: NONE
@@ -79,6 +79,14 @@ proxy_group:
# - {name: ssid group, type: ssid, rule: ["default_group", "celluar=group0,ssid1=group1,ssid2=group2"]}
- {import: snippets/groups.txt}
template:
template_path: "template"
globals:
- {key: clash.http_port, value: 7890}
- {key: clash.socks_port, value: 7891}
- {key: clash.allow_lan, value: true}
- {key: clash.log_level, value: info}
server:
listen: 0.0.0.0
port: 25500
+15 -8
View File
@@ -19,28 +19,28 @@ exclude_remarks=(到期|剩余流量|时间|官网|产品)
;include_remarks=V3.*港
;Clash config base used by the generator, supports local files/URL
clash_rule_base=base/simple_base.yml
clash_rule_base=base/all_base.tpl
;Surge config base used by the generator, supports local files/URL
surge_rule_base=base/surge.conf
surge_rule_base=base/all_base.tpl
;Surfboard config base used by the generator, supports local files/URL
surfboard_rule_base=base/surfboard.conf
surfboard_rule_base=base/all_base.tpl
;Mellow config base used by the generator, supports local files/URL
mellow_rule_base=base/mellow.conf
mellow_rule_base=base/all_base.tpl
;Quantumult config base used by the generator, supports local files/URL
quan_rule_base=base/quan.conf
quan_rule_base=base/all_base.tpl
;Quantumult X config base used by the generator, supports local files/URL
quanx_rule_base=base/quanx.conf
quanx_rule_base=base/all_base.tpl
;Loon config base used by the generator, supports local files/URL
loon_rule_base=base/loon.conf
loon_rule_base=base/all_base.tpl
;Shadowsocks Android config base used by the generator, supports local files/URL
sssub_rule_base=base/shadowsocks_base.json
sssub_rule_base=base/all_base.tpl
;Proxy used to download configs, rulesets or subscriptions, set to NONE or empty to disable it, set to SYSTEM to use system proxy.
;Accept cURL-supported proxies (http:// https:// socks4a:// socks5://)
@@ -164,6 +164,13 @@ surge_ruleset=!!import:snippets/rulesets.txt
;for Surge rulesets
custom_proxy_group=!!import:snippets/groups.txt
[template]
template_path=template
clash.http_port=7890
clash.socks_port=7891
clash.allow_lan=true
clash.log_level=info
[server]
;Address to bind on for Web Server
listen=0.0.0.0