Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
tindy2013 committed Jul 23, 2020
1 parent 7657ccc commit 351185b
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 27 deletions.
4 changes: 2 additions & 2 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# download latest release and unzip it
curl -LO https://github.com/tindy2013/subconverter/releases/latest/download/subconverter_linux64.tar.gz
tar xvf subconverter_linux64.tar.gz
rm subconverter_linux64.tar.gz
# change extension to make now recognize it
mv -f subconverter/subconverter subconverter/subconverter.exe
# overwrite preference settings
cp -f pref.ini subconverter/

cp -R profiles/* subconverter/
120 changes: 95 additions & 25 deletions pref.ini → files/pref.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ api_access_token=password
;Default URLs, used when no URL is provided in request, use "|" to separate multiple subscription links, supports local files/URL
default_url=

;URLs to insert before subscription links, can be used to add node(s) to all exported subscriptions, use "|" to separate multiple subscription links, supports local files/URL
;Insert subscription links to requests. Can be used to add node(s) to all exported subscriptions.
enable_insert=true
;URLs to insert to subscription links, use "|" to separate multiple subscription links, supports local files/URL
insert_url=
;Prepend inserted URLs to subscription links. Nodes in insert_url will be added to groups first with non-group-specific match pattern.
prepend_insert_url=true

;Exclude nodes which remarks match the following patterns. Supports regular expression.
exclude_remarks=(到期|剩余流量|时间|官网|产品)
Expand All @@ -18,6 +22,19 @@ exclude_remarks=(到期|剩余流量|时间|官网|产品)
;Only include nodes which remarks match the following patterns. Supports regular expression.
;include_remarks=V3.*港

;Enable script support for filtering nodes
enable_filter=false
;Script used for filtering nodes. Supports inline script and script path. A "filter" function with 1 argument which is a node should be defined in the script.
;Example: Inline script: Set value to content of script. Replace all line break with "\n".
; Script path: Set value to "path:/path/to/script.js".
;filter_script=function filter(node) {\n const info = JSON.parse(node.ProxyInfo);\n if(info.EncryptMethod.includes('chacha20'))\n return true;\n return false;\n}

;Setting an external config file as default when none is specified, supports local files/URL
;default_external_config=config/example_external_config.ini

;The file scope limit of the 'rule_base' options in external configs.
base_path=base

;Clash config base used by the generator, supports local files/URL
clash_rule_base=base/all_base.tpl

Expand All @@ -44,6 +61,8 @@ 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://)
;Additional support for CORS proxy ( https://github.com/Rob--W/cors-anywhere https://github.com/Zibri/cloudflare-cors-anywhere etc.), prefix the address with "cors:" to recognize the address as CORS proxy.
;Example: http://127.0.0.1:80 socks5://example.com:1080 cors:https://cors-anywhere.herokuapp.com/
proxy_config=SYSTEM
proxy_ruleset=SYSTEM
proxy_subscription=NONE
Expand All @@ -70,19 +89,27 @@ time_rule=^Smart Access expire: (\d+)/(\d+)/(\d+)$|$1:$2:$3:0:0:0
time_rule=^.*?流量:(?:.*?) 剩:(.*)$|left=$1d

[node_pref]
udp_flag=false
tcp_fast_open_flag=false
;udp_flag=false
;tcp_fast_open_flag=false
;skip_cert_verify_flag=false
;tls13_flag=false

sort_flag=false
skip_cert_verify_flag=false
;Script used for sorting nodes. A "compare" function with 2 arguments which are the 2 nodes to be compared should be defined in the script. Supports inline script and script path.
;Examples can be seen at the filter_script option in [common] section.
;sort_script=function compare(node_a, node_b) {\n const info_a = JSON.parse(node_a.ProxyInfo);\n const info_b = JSON.parse(node_b.ProxyInfo);\n return info_a.Remark > info_b.Remark;\n}

filter_deprecated_nodes=false
append_sub_userinfo=true
clash_use_new_field_name=false
clash_use_new_field_name=true

;Rename remarks with the following patterns. Supports regular expression.
;Format: Search_Pattern@Replace_Pattern
;rename_node=IPLC@专线
;rename_node=RELAY@中转
;rename_node=BGP-@
;rename_node=!!script:function rename(node) {\n const info = JSON.parse(node.ProxyInfo);\n const geoinfo = JSON.parse(geoip(info.Hostname));\n if(geoinfo.country_code == "CN")\n return "CN " + node.Remark;\n}
;rename_node=!!script:path:/path/to/script.js

rename_node=!!import:snippets/rename_node.txt

Expand All @@ -97,14 +124,15 @@ managed_config_prefix=
;Managed config update interval in seconds, determine how long the config will be updated.
config_update_interval=86400

;If config_update_struct is set to true, Surge will require a force update after the interval.
config_update_struct=false
;If config_update_strict is set to true, Surge will require a force update after the interval.
config_update_strict=false

;Device ID to be written to rewrite scripts for some version of Quantumult X
quanx_device_id=

[surge_external_proxy]
;surge_ssr_path=/usr/bin/ssr-local
resolve_hostname=true

[emojis]
add_emoji=true
Expand All @@ -115,10 +143,12 @@ remove_old_emoji=true

;rule=(流量|时间|应急|过期|Bandwidth|expire),🏳️‍🌈
;rule=AC,🇦🇨
;rule=!!script:function getEmoji(node) {\n const info = JSON.parse(node.ProxyInfo);\n const geoinfo = JSON.parse(geoip(info.Hostname));\n if(geoinfo.country_code == "CN")\n return "🏳️‍🌈";\n}
;rule=!!script:path:/path/to/script/.js

rule=!!import:snippets/emoji.txt

[ruleset]
[rulesets]
;Enable generating rules with rulesets
enabled=true

Expand All @@ -129,26 +159,33 @@ overwrite_original_rules=false
update_ruleset_on_request=false

;Ruleset addresses, supports local files/URL
;Format: Group name,URL
;Format: Group name,[type:]URL[,interval]
; Group name,[]Rule

;surge_ruleset=DIRECT,https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Unbreak.list
;surge_ruleset=🎯 全球直连,rules/LocalAreaNetwork.list
;surge_ruleset=🎯 全球直连,[]GEOIP,CN
;surge_ruleset=🐟 漏网之鱼,[]FINAL

surge_ruleset=!!import:snippets/rulesets.txt

[clash_proxy_group]
;Generate Clash Proxy Group with the following patterns. Node filterting rule supports regular expression.
;where "type" supports the following value: surge, quanx, clash-domain, clash-ipcidr, clash-classic
;type defaults to surge if omitted

;ruleset=DIRECT,https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Unbreak.list,86400
;ruleset=🎯 全球直连,rules/LocalAreaNetwork.list
;ruleset=DIRECT,surge:rules/LocalAreaNetwork.list
;ruleset=Advertising,quanx:https://raw.githubusercontent.com/ConnersHua/Profiles/master/Quantumult/X/Filter/Advertising.list,86400
;ruleset=Domestic Services,clash-domain:https://ruleset.dev/clash_domestic_services_domains,86400
;ruleset=Domestic Services,clash-ipcidr:https://ruleset.dev/clash_domestic_services_ips,86400
;ruleset=DIRECT,clash-classic:https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/RuleSet/China.yaml,86400
;ruleset=🎯 全球直连,[]GEOIP,CN
;ruleset=🐟 漏网之鱼,[]FINAL

ruleset=!!import:snippets/rulesets.txt

[proxy_groups]
;Generate Clash Proxy Group with the following patterns. Node filtering rule supports regular expression.
;Format: Group_Name`select`Rule_1`Rule_2`...
; Group_Name`url-test|fallback|load-balance`Rule_1`Rule_2`...`test_url`interval
; Group_Name`url-test|fallback|load-balance`Rule_1`Rule_2`...`test_url`interval[,timeout][,tolerance]
;Rule with "[]" prefix will be added directly.

;custom_proxy_group=Proxy`select`.*`[]AUTO`[]DIRECT`.*
;custom_proxy_group=UrlTest`url-test`.*`http://www.gstatic.com/generate_204`300
;custom_proxy_group=FallBack`fallback`.*`http://www.gstatic.com/generate_204`300
;custom_proxy_group=LoadBalance`load-balance`.*`http://www.gstatic.com/generate_204`300
;custom_proxy_group=UrlTest`url-test`.*`http://www.gstatic.com/generate_204`300,5,100
;custom_proxy_group=FallBack`fallback`.*`http://www.gstatic.com/generate_204`300,5
;custom_proxy_group=LoadBalance`load-balance`.*`http://www.gstatic.com/generate_204`300,,100
;custom_proxy_group=SSID`ssid`default_group`celluar=group0,ssid1=group1,ssid2=group2

;custom_proxy_group=g1`select`!!GROUPID=0
Expand All @@ -157,6 +194,10 @@ surge_ruleset=!!import:snippets/rulesets.txt

;custom_proxy_group=g1hk`select`!!GROUPID=0!!(HGC|HKBN|PCCW|HKT|hk|港)
;custom_proxy_group=sstw`select`!!GROUP=V2RayProvider!!(深台|彰化|新北|台|tw)
;custom_proxy_group=provider`select`!!PROVIDER=prov1,prov2,prov3`fallback_nodes

;Also supports using script for filtering nodes. A "filter" function with one argument which is an array of all available nodes should be defined in the script.
;custom_proxy_group=script`select`script:/path/to/script.js

;for forcerule.yml
;custom_proxy_group=!!import:snippets/groups_forcerule.txt
Expand All @@ -165,12 +206,39 @@ 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

;Profile example
/myairport=/getprofile?name=profiles/my_airport.ini

[server]
;Address to bind on for Web Server
listen=127.0.0.1
Expand All @@ -183,10 +251,12 @@ log_level=verbose
print_debug_info=true
max_pending_connections=5
max_concurrent_threads=1
max_allowed_rulesets=0
max_allowed_rules=0
enable_base_gen=false
enable_cache=false
cache_subscription=60
cache_config=300
cache_ruleset=21600
async_fetch_ruleset=true

skip_failed_links=false
4 changes: 4 additions & 0 deletions files/profiles/my_airport.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[Profile]
profile_token=airport
url=ss://[email protected]:1080#Example
target=clash

0 comments on commit 351185b

Please sign in to comment.