Skip to content

Commit

Permalink
Fix permissions of file in clash_cfg_dir. Add updating provider with …
Browse files Browse the repository at this point in the history
…api. And fix some bug.
  • Loading branch information
JohanChane committed Mar 19, 2024
1 parent ba9c087 commit c39fb22
Show file tree
Hide file tree
Showing 20 changed files with 1,085 additions and 248 deletions.
100 changes: 100 additions & 0 deletions Example/profiles/profile1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
pp:
interval: 3600
intehealth-check:
enable: true
url: https://www.gstatic.com/generate_204
interval: 300
delay_test:
url: https://www.gstatic.com/generate_204
interval: 300
proxy-groups:
- name: Entry
type: select
proxies:
- FilterFbAll
- name: FilterFbAll
type: fallback
use:
- provider0
- provider1
filter: (?i)美|us|unitedstates|united states|日本|jp|japan|韩|kr|korea|southkorea|south korea|新|sg|singapore
<<:
url: https://www.gstatic.com/generate_204
interval: 300
- name: Entry-RuleMode
type: select
proxies:
- DIRECT
- Entry
- name: Entry-LastMatch
type: select
proxies:
- Entry
- DIRECT
proxy-providers:
provider1:
<<:
interval: 3600
intehealth-check:
enable: true
url: https://www.gstatic.com/generate_204
interval: 300
type: http
url: https://www.example.com
path: proxy-providers/tpl/provider1.yaml
provider0:
<<:
interval: 3600
intehealth-check:
enable: true
url: https://www.gstatic.com/generate_204
interval: 300
type: http
url: https://www.example.com
path: proxy-providers/tpl/provider0.yaml
rule-anchor:
ip:
interval: 86400
behavior: ipcidr
format: yaml
domain:
type: http
interval: 86400
behavior: domain
format: yaml
rule-providers:
private:
type: http
url: https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/private.yaml
path: ./rule-providers/tpl/private.yaml
<<:
type: http
interval: 86400
behavior: domain
format: yaml
rules:
- RULE-SET,private,DIRECT
- DOMAIN-SUFFIX,cn.bing.com,DIRECT
- DOMAIN-SUFFIX,bing.com,Entry
- DOMAIN,aur.archlinux.org,Entry
- GEOIP,lan,DIRECT,no-resolve
- GEOSITE,biliintl,Entry
- GEOSITE,ehentai,Entry
- GEOSITE,github,Entry
- GEOSITE,twitter,Entry
- GEOSITE,youtube,Entry
- GEOSITE,google,Entry
- GEOSITE,telegram,Entry
- GEOSITE,netflix,Entry
- GEOSITE,bilibili,Entry-RuleMode
- GEOSITE,bahamut,Entry
- GEOSITE,spotify,Entry
- GEOSITE,geolocation-!cn,Entry
- GEOIP,google,Entry
- GEOIP,netflix,Entry
- GEOIP,telegram,Entry
- GEOIP,twitter,Entry
- GEOSITE,pixiv,Entry
- GEOSITE,CN,Entry-RuleMode
- GEOIP,CN,Entry-RuleMode
- MATCH,Entry-LastMatch
26 changes: 13 additions & 13 deletions Example/templates/generic_tpl_with_filter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,29 @@ proxy-groups:
- name: "Entry"
type: select
proxies:
- FilterFallback
- FilterSelect
- <Auto>
- <Select>
- FilterSelectAll
- <FilterFb> # use proxy-groups which name is `FilterFb`.
- <Auto> # Empathize with `FilterFb`
- <Select> # Empathize with `FilterFb`

- name: "FilterSelect"
- name: "FilterSelectAll"
type: select
use:
- <provider>
- <provider> # use proxy-providers which name is `provider`: provider0, provider1, ...
filter: "(?i)美|us|unitedstates|united states|日本|jp|japan|韩|kr|korea|southkorea|south korea|新|sg|singapore"

- name: "FilterFallback"
- name: "FilterFb" # `FilterFb` name is customizable. Generate proxy-providers: FilterFb-provider0, FilterFb-provider1, ...
tpl_param:
providers: ["provider"]
type: fallback
use:
- <provider>
filter: "(?i)美|us|unitedstates|united states|日本|jp|japan|韩|kr|korea|southkorea|south korea|新|sg|singapore"
<<: *delay_test

- name: "Select"
- name: "Select" # Empathize with `FilterFb`
tpl_param:
providers: ["provider"]
type: select

- name: "Auto"
- name: "Auto" # Empathize with `FilterFb`
tpl_param:
providers: ["provider"]
type: url-test
Expand All @@ -47,12 +46,13 @@ proxy-groups:
- DIRECT

proxy-providers:
provider:
provider: # `provider` name is customizable. Generate proxy-providers which name is `provider`: provider0, provider1, ...
tpl_param:
type: http
<<: *pp

rules:
#- IN-TYPE,INNER,DIRECT # set inner type connection. e.g. update proxy-providers, rule-providers etc.
- GEOIP,lan,DIRECT,no-resolve
- GEOSITE,biliintl,Entry
- GEOSITE,ehentai,Entry
Expand Down
68 changes: 68 additions & 0 deletions clashtui/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion clashtui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ serde_json = "1.0"
log = "0.4"
log4rs = {version = "1.3", default-features = false, features = ["pattern_encoder", "file_appender"]}
enumflags2 = "0.7.9"
nix = {version = "0.28.0", features = ["fs", "user"]}
libc = "0.2.153"
regex = "1.10.3"

[target.'cfg(target_os = "windows")'.dependencies]
encoding = "0.2.33"
Expand All @@ -54,4 +57,4 @@ assets = [
['target/release/clashtui', 'usr/bin/clashtui', '755'],
['../README.md', 'usr/share/doc/hust-network-login/README.md', '644'],
]
maintainer-scripts = 'debian/'
maintainer-scripts = 'debian/'
1 change: 1 addition & 0 deletions clashtui/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ serde = { version = "1.0", features = ["derive"] }
minreq = { version = "2.11", features = ["proxy", "https"] }
serde_json = "1.0"
serde-this-or-that = { version = "0.4.2", optional = true }
chrono = "0.4.35"

[features]
deprecated = ["github_api"]
Expand Down
Loading

0 comments on commit c39fb22

Please sign in to comment.