pref.ini 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. [common]
  2. ;API mode, set to true to prevent loading local subscriptions or serving local files directly
  3. api_mode=false
  4. ;Access token used for performing critical action through Web interface
  5. api_access_token=password
  6. ;Default URLs, used when no URL is provided in request, use "|" to separate multiple subscription links, supports local files/URL
  7. default_url=
  8. ;Insert subscription links to requests. Can be used to add node(s) to all exported subscriptions.
  9. enable_insert=true
  10. ;URLs to insert to subscription links, use "|" to separate multiple subscription links, supports local files/URL
  11. insert_url=
  12. ;Prepend inserted URLs to subscription links. Nodes in insert_url will be added to groups first with non-group-specific match pattern.
  13. prepend_insert_url=true
  14. ;Exclude nodes which remarks match the following patterns. Supports regular expression.
  15. exclude_remarks=(到期|剩余流量|时间|官网|产品)
  16. ;exclude_remarks=(other rule)
  17. ;Only include nodes which remarks match the following patterns. Supports regular expression.
  18. ;include_remarks=V3.*港
  19. ;Enable script support for filtering nodes
  20. enable_filter=false
  21. ;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.
  22. ;Example: Inline script: Set value to content of script. Replace all line break with "\n".
  23. ; Script path: Set value to "path:/path/to/script.js".
  24. ;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}
  25. ;Setting an external config file as default when none is specified, supports local files/URL
  26. ;default_external_config=config/example_external_config.ini
  27. ;The file scope limit of the 'rule_base' options in external configs.
  28. base_path=base
  29. ;Clash config base used by the generator, supports local files/URL
  30. clash_rule_base=base/all_base.tpl
  31. ;Surge config base used by the generator, supports local files/URL
  32. surge_rule_base=base/all_base.tpl
  33. ;Surfboard config base used by the generator, supports local files/URL
  34. surfboard_rule_base=base/all_base.tpl
  35. ;Mellow config base used by the generator, supports local files/URL
  36. mellow_rule_base=base/all_base.tpl
  37. ;Quantumult config base used by the generator, supports local files/URL
  38. quan_rule_base=base/all_base.tpl
  39. ;Quantumult X config base used by the generator, supports local files/URL
  40. quanx_rule_base=base/all_base.tpl
  41. ;Loon config base used by the generator, supports local files/URL
  42. loon_rule_base=base/all_base.tpl
  43. ;Shadowsocks Android config base used by the generator, supports local files/URL
  44. sssub_rule_base=base/all_base.tpl
  45. ;Proxy used to download configs, rulesets or subscriptions, set to NONE or empty to disable it, set to SYSTEM to use system proxy.
  46. ;Accept cURL-supported proxies (http:// https:// socks4a:// socks5://)
  47. ;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.
  48. ;Example: http://127.0.0.1:80 socks5://example.com:1080 cors:https://cors-anywhere.herokuapp.com/
  49. proxy_config=SYSTEM
  50. proxy_ruleset=SYSTEM
  51. proxy_subscription=NONE
  52. ;Append a proxy type string ([SS] [SSR] [VMess]) to node remark.
  53. append_proxy_type=false
  54. [userinfo]
  55. ;Rules to extract stream data from node
  56. ;Format: full_match_regex|new_format_regex
  57. ;where new_format_regex should be like "total=$1&left=$2&used=$3"
  58. stream_rule=^剩余流量:(.*?)\|总流量:(.*)$|total=$2&left=$1
  59. stream_rule=^剩余流量:(.*?) (.*)$|total=$1&left=$2
  60. stream_rule=^Bandwidth: (.*?)/(.*)$|used=$1&total=$2
  61. stream_rule=^\[.*?\]剩余(.*?)@(?:.*)$|total=$1
  62. stream_rule=^.*?流量:(.*?) 剩:(?:.*)$|total=$1
  63. ;Rules to extract expire time data from node
  64. ;Format: full_match_regex|new_format_regex
  65. ;where new_format_regex should follow this example: yyyy:mm:dd:hh:mm:ss
  66. time_rule=^过期时间:(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)$|$1:$2:$3:$4:$5:$6
  67. time_rule=^到期时间(:|:)(\d+)-(\d+)-(\d+)$|$1:$2:$3:0:0:0
  68. time_rule=^Smart Access expire: (\d+)/(\d+)/(\d+)$|$1:$2:$3:0:0:0
  69. time_rule=^.*?流量:(?:.*?) 剩:(.*)$|left=$1d
  70. [node_pref]
  71. ;udp_flag=false
  72. ;tcp_fast_open_flag=false
  73. ;skip_cert_verify_flag=false
  74. ;tls13_flag=false
  75. sort_flag=false
  76. ;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.
  77. ;Examples can be seen at the filter_script option in [common] section.
  78. ;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}
  79. filter_deprecated_nodes=false
  80. append_sub_userinfo=true
  81. clash_use_new_field_name=true
  82. ;Generate style of the proxies section of Clash subscriptions.
  83. ;Supported styles: block, flow, compact
  84. ;Block: - name: name1 Flow: - {name: name1, key: value} Compact: [{name: name1, key: value},{name: name2, key: value}]
  85. ; key: value - {name: name2, key: value}
  86. ; - name: name2
  87. ; key: value
  88. clash_proxies_style=flow
  89. ;Rename remarks with the following patterns. Supports regular expression.
  90. ;Format: Search_Pattern@Replace_Pattern
  91. ;rename_node=IPLC@专线
  92. ;rename_node=RELAY@中转
  93. ;rename_node=BGP-@
  94. ;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}
  95. ;rename_node=!!script:path:/path/to/script.js
  96. rename_node=!!import:snippets/rename_node.txt
  97. [managed_config]
  98. ;Append a '#!MANAGED-CONFIG' info to Surge configurations
  99. write_managed_config=true
  100. ;Address prefix for MANAGED-CONFIG info, without the trailing "/".
  101. ;This address will also be used for generating /getruleset, /qx-rewrite, /qx-script addresses.
  102. managed_config_prefix=http://127.0.0.1:25500
  103. ;Managed config update interval in seconds, determine how long the config will be updated.
  104. config_update_interval=86400
  105. ;If config_update_strict is set to true, Surge will require a force update after the interval.
  106. config_update_strict=false
  107. ;Device ID to be written to rewrite scripts for some version of Quantumult X
  108. quanx_device_id=
  109. [surge_external_proxy]
  110. ;surge_ssr_path=/usr/bin/ssr-local
  111. resolve_hostname=true
  112. [emojis]
  113. add_emoji=true
  114. remove_old_emoji=true
  115. ;Rule to add emojis. Supports regular expression.
  116. ;Format: Remark_Search_Pattern,emoji
  117. ;rule=(流量|时间|应急|过期|Bandwidth|expire),🏳️‍🌈
  118. ;rule=AC,🇦🇨
  119. ;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}
  120. ;rule=!!script:path:/path/to/script/.js
  121. rule=!!import:snippets/emoji.txt
  122. [rulesets]
  123. ;Enable generating rules with rulesets
  124. enabled=true
  125. ;Overwrite the existing rules in rule_base
  126. overwrite_original_rules=false
  127. ;Perform a ruleset update on request
  128. update_ruleset_on_request=false
  129. ;Ruleset addresses, supports local files/URL
  130. ;Format: Group name,[type:]URL[,interval]
  131. ; Group name,[]Rule
  132. ;where "type" supports the following value: surge, quanx, clash-domain, clash-ipcidr, clash-classic
  133. ;type defaults to surge if omitted
  134. ;ruleset=DIRECT,https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Unbreak.list,86400
  135. ;ruleset=🎯 全球直连,rules/LocalAreaNetwork.list
  136. ;ruleset=DIRECT,surge:rules/LocalAreaNetwork.list
  137. ;ruleset=Advertising,quanx:https://raw.githubusercontent.com/ConnersHua/Profiles/master/Quantumult/X/Filter/Advertising.list,86400
  138. ;ruleset=Domestic Services,clash-domain:https://ruleset.dev/clash_domestic_services_domains,86400
  139. ;ruleset=Domestic Services,clash-ipcidr:https://ruleset.dev/clash_domestic_services_ips,86400
  140. ;ruleset=DIRECT,clash-classic:https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/RuleSet/China.yaml,86400
  141. ;ruleset=🎯 全球直连,[]GEOIP,CN
  142. ;ruleset=🐟 漏网之鱼,[]FINAL
  143. ruleset=!!import:snippets/rulesets.txt
  144. [proxy_groups]
  145. ;Generate Clash Proxy Group with the following patterns. Node filtering rule supports regular expression.
  146. ;Format: Group_Name`select`Rule_1`Rule_2`...
  147. ; Group_Name`url-test|fallback|load-balance`Rule_1`Rule_2`...`test_url`interval[,timeout][,tolerance]
  148. ;Rule with "[]" prefix will be added directly.
  149. ;custom_proxy_group=Proxy`select`.*`[]AUTO`[]DIRECT`.*
  150. ;custom_proxy_group=UrlTest`url-test`.*`http://www.gstatic.com/generate_204`300,5,100
  151. ;custom_proxy_group=FallBack`fallback`.*`http://www.gstatic.com/generate_204`300,5
  152. ;custom_proxy_group=LoadBalance`load-balance`.*`http://www.gstatic.com/generate_204`300,,100
  153. ;custom_proxy_group=SSID`ssid`default_group`celluar=group0,ssid1=group1,ssid2=group2
  154. ;custom_proxy_group=g1`select`!!GROUPID=0
  155. ;custom_proxy_group=g2`select`!!GROUPID=1
  156. ;custom_proxy_group=v2ray`select`!!GROUP=V2RayProvider
  157. ;custom_proxy_group=g1hk`select`!!GROUPID=0!!(HGC|HKBN|PCCW|HKT|hk|港)
  158. ;custom_proxy_group=sstw`select`!!GROUP=V2RayProvider!!(深台|彰化|新北|台|tw)
  159. ;custom_proxy_group=provider`select`!!PROVIDER=prov1,prov2,prov3`fallback_nodes
  160. ;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.
  161. ;custom_proxy_group=script`select`script:/path/to/script.js
  162. ;for forcerule.yml
  163. ;custom_proxy_group=!!import:snippets/groups_forcerule.txt
  164. ;for Surge rulesets
  165. custom_proxy_group=!!import:snippets/groups.txt
  166. [template]
  167. ;The file scope limit of 'include' statement inside the templates.
  168. template_path=templates
  169. ;The following settings will be added to the "global" scope of the template variables
  170. ;Value of 'clash.http_port' can be accessed with 'global.clash.http_port' in the template.
  171. clash.http_port=7890
  172. clash.socks_port=7891
  173. clash.allow_lan=true
  174. clash.log_level=info
  175. [aliases]
  176. ;Aliases for accessing interfaces. Can be used to shorten the URI.
  177. ;All arguments passed when accessing the alias name will be appended to the arguments of the alias target.
  178. ;Format: uri=target
  179. /v=/version
  180. /clash=/sub?target=clash
  181. /clashr=/sub?target=clashr
  182. /surge=/sub?target=surge
  183. /quan=/sub?target=quan
  184. /quanx=/sub?target=quanx
  185. /mellow=/sub?target=mellow
  186. /surfboard=/sub?target=surfboard
  187. /loon=/sub?target=loon
  188. /ss=/sub?target=ss
  189. /ssd=/sub?target=ssd
  190. /sssub=/sub?target=sssub
  191. /ssr=/sub?target=ssr
  192. /v2ray=/sub?target=v2ray
  193. /trojan=/sub?target=trojan
  194. [server]
  195. ;Address to bind on for Web Server
  196. listen=0.0.0.0
  197. ;Port to bind on for Web Server
  198. port=25500
  199. ;Root folder for web server, keep empty to disable
  200. serve_file_root=
  201. [advanced]
  202. log_level=info
  203. print_debug_info=false
  204. max_pending_connections=10240
  205. max_concurrent_threads=2
  206. max_allowed_rulesets=0
  207. max_allowed_rules=0
  208. max_allowed_download_size=0
  209. enable_cache=false
  210. cache_subscription=60
  211. cache_config=300
  212. cache_ruleset=21600
  213. async_fetch_ruleset=false
  214. skip_failed_links=false