Enhancements

Fix compiler warnings.
Add detailed description for some settings in pref configuration.
Add passing arguments of alias name to alias target.
Optimize codes.
This commit is contained in:
Tindy X
2020-04-23 00:27:38 +08:00
parent 11c3e2a7c8
commit 8662aa36cc
9 changed files with 117 additions and 104 deletions

View File

@@ -81,7 +81,7 @@ proxy_group:
- {import: snippets/groups.txt}
template:
template_path: "template"
template_path: "templates"
globals:
- {key: clash.http_port, value: 7890}
- {key: clash.socks_port, value: 7891}
@@ -90,6 +90,20 @@ template:
aliases:
- {uri: /v, target: /version}
- {uri: /clash, target: "/sub?target=clash"}
- {uri: /clashr, target: "/sub?target=clashr"}
- {uri: /surge, target: "/sub?target=surge"}
- {uri: /quan, target: "/sub?target=quan"}
- {uri: /quanx, target: "/sub?target=quanx"}
- {uri: /mellow, target: "/sub?target=mellow"}
- {uri: /surfboard, target: "/sub?target=surfboard"}
- {uri: /loon, target: "/sub?target=loon"}
- {uri: /ss, target: "/sub?target=ss"}
- {uri: /ssd, target: "/sub?target=ssd"}
- {uri: /sssub, target: "/sub?target=sssub"}
- {uri: /ssr, target: "/sub?target=ssr"}
- {uri: /v2ray, target: "/sub?target=v2ray"}
- {uri: /trojan, target: "/sub?target=trojan"}
server:
listen: 0.0.0.0

View File

@@ -168,14 +168,35 @@ surge_ruleset=!!import:snippets/rulesets.txt
custom_proxy_group=!!import:snippets/groups.txt
[template]
template_path=template
;The file scope limit of 'include' statement inside the templates.
template_path=templates
;The following settings will be added to the "global" scope of the template variables
;Value of 'clash.http_port' can be accessed with 'global.clash.http_port' in the template.
clash.http_port=7890
clash.socks_port=7891
clash.allow_lan=true
clash.log_level=info
[aliases]
;Aliases for accessing interfaces. Can be used to shorten the URI.
;All arguments passed when accessing the alias name will be appended to the arguments of the alias target.
;Format: uri=target
/v=/version
/clash=/sub?target=clash
/clashr=/sub?target=clashr
/surge=/sub?target=surge
/quan=/sub?target=quan
/quanx=/sub?target=quanx
/mellow=/sub?target=mellow
/surfboard=/sub?target=surfboard
/loon=/sub?target=loon
/ss=/sub?target=ss
/ssd=/sub?target=ssd
/sssub=/sub?target=sssub
/ssr=/sub?target=ssr
/v2ray=/sub?target=v2ray
/trojan=/sub?target=trojan
[server]
;Address to bind on for Web Server