pref.example.ini 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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. ;sing-box config base used by the generator, supports local files/URL
  46. singbox_rule_base=base/all_base.tpl
  47. ;Proxy used to download configs, rulesets or subscriptions, set to NONE or empty to disable it, set to SYSTEM to use system proxy.
  48. ;Accept cURL-supported proxies (http:// https:// socks4a:// socks5://)
  49. ;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.
  50. ;Example: http://127.0.0.1:80 socks5://example.com:1080 cors:https://cors-anywhere.herokuapp.com/
  51. proxy_config=SYSTEM
  52. proxy_ruleset=SYSTEM
  53. proxy_subscription=NONE
  54. ;Append a proxy type string ([SS] [SSR] [VMess]) to node remark.
  55. append_proxy_type=false
  56. ;When requesting /sub, reload this config file first.
  57. reload_conf_on_request=false
  58. [userinfo]
  59. ;Rules to extract stream data from node
  60. ;Format: full_match_regex|new_format_regex
  61. ;where new_format_regex should be like "total=$1&left=$2&used=$3"
  62. stream_rule=^剩余流量:(.*?)\|总流量:(.*)$|total=$2&left=$1
  63. stream_rule=^剩余流量:(.*?) (.*)$|total=$1&left=$2
  64. stream_rule=^Bandwidth: (.*?)/(.*)$|used=$1&total=$2
  65. stream_rule=^\[.*?\]剩余(.*?)@(?:.*)$|total=$1
  66. stream_rule=^.*?流量:(.*?) 剩:(?:.*)$|total=$1
  67. ;Rules to extract expire time data from node
  68. ;Format: full_match_regex|new_format_regex
  69. ;where new_format_regex should follow this example: yyyy:mm:dd:hh:mm:ss
  70. time_rule=^过期时间:(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)$|$1:$2:$3:$4:$5:$6
  71. time_rule=^到期时间(:|:)(\d+)-(\d+)-(\d+)$|$1:$2:$3:0:0:0
  72. time_rule=^Smart Access expire: (\d+)/(\d+)/(\d+)$|$1:$2:$3:0:0:0
  73. time_rule=^.*?流量:(?:.*?) 剩:(.*)$|left=$1d
  74. [node_pref]
  75. ;udp_flag=false
  76. ;tcp_fast_open_flag=false
  77. ;skip_cert_verify_flag=false
  78. ;tls13_flag=false
  79. sort_flag=false
  80. ;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.
  81. ;Examples can be seen at the filter_script option in [common] section.
  82. ;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}
  83. filter_deprecated_nodes=false
  84. append_sub_userinfo=true
  85. clash_use_new_field_name=true
  86. ;Generate style of the proxies and proxy groups section of Clash subscriptions.
  87. ;Supported styles: block, flow, compact
  88. ;Block: - name: name1 Flow: - {name: name1, key: value} Compact: [{name: name1, key: value},{name: name2, key: value}]
  89. ; key: value - {name: name2, key: value}
  90. ; - name: name2
  91. ; key: value
  92. clash_proxies_style=flow
  93. clash_proxy_groups_style=block
  94. ;add Clash mode to sing-box rules, and add a GLOBAL group to end of outbounds
  95. singbox_add_clash_modes=true
  96. ;Rename remarks with the following patterns. Supports regular expression.
  97. ;Format: Search_Pattern@Replace_Pattern
  98. ;rename_node=IPLC@专线
  99. ;rename_node=RELAY@中转
  100. ;rename_node=BGP-@
  101. ;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}
  102. ;rename_node=!!script:path:/path/to/script.js
  103. rename_node=!!import:snippets/rename_node.txt
  104. [managed_config]
  105. ;Append a '#!MANAGED-CONFIG' info to Surge configurations
  106. write_managed_config=true
  107. ;Address prefix for MANAGED-CONFIG info, without the trailing "/".
  108. ;This address will also be used for generating /getruleset, /qx-rewrite, /qx-script addresses.
  109. managed_config_prefix=http://127.0.0.1:25500
  110. ;Managed config update interval in seconds, determine how long the config will be updated.
  111. config_update_interval=86400
  112. ;If config_update_strict is set to true, Surge will require a force update after the interval.
  113. config_update_strict=false
  114. ;Device ID to be written to rewrite scripts for some version of Quantumult X
  115. quanx_device_id=
  116. [surge_external_proxy]
  117. ;surge_ssr_path=/usr/bin/ssr-local
  118. resolve_hostname=true
  119. [emojis]
  120. add_emoji=true
  121. remove_old_emoji=true
  122. ;Rule to add emojis. Supports regular expression.
  123. ;Format: Remark_Search_Pattern,emoji
  124. ;rule=(流量|时间|应急|过期|Bandwidth|expire),🏳️‍🌈
  125. ;rule=AC,🇦🇨
  126. ;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}
  127. ;rule=!!script:path:/path/to/script/.js
  128. rule=!!import:snippets/emoji.txt
  129. [rulesets]
  130. ;Enable generating rules with rulesets
  131. enabled=true
  132. ;Overwrite the existing rules in rule_base
  133. overwrite_original_rules=false
  134. ;Perform a ruleset update on request
  135. update_ruleset_on_request=false
  136. ;Ruleset addresses, supports local files/URL
  137. ;Format: Group name,[type:]URL[,interval]
  138. ; Group name,[]Rule
  139. ;where "type" supports the following value: surge, quanx, clash-domain, clash-ipcidr, clash-classic
  140. ;type defaults to surge if omitted
  141. ;ruleset=DIRECT,https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/Guard/Unbreak.list,86400
  142. ;ruleset=🎯 全球直连,rules/LocalAreaNetwork.list
  143. ;ruleset=DIRECT,surge:rules/LocalAreaNetwork.list
  144. ;ruleset=Advertising,quanx:https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Filter/Guard/Advertising.list,86400
  145. ;ruleset=Domestic Services,clash-domain:https://ruleset.dev/clash_domestic_services_domains,86400
  146. ;ruleset=Domestic Services,clash-ipcidr:https://ruleset.dev/clash_domestic_services_ips,86400
  147. ;ruleset=DIRECT,clash-classic:https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/RuleSet/China.yaml,86400
  148. ;ruleset=🎯 全球直连,[]GEOIP,CN
  149. ;ruleset=🐟 漏网之鱼,[]FINAL
  150. ruleset=!!import:snippets/rulesets.txt
  151. [proxy_groups]
  152. ;Generate Clash Proxy Group with the following patterns. Node filtering rule supports regular expression.
  153. ;Format: Group_Name`select`Rule_1`Rule_2`...
  154. ; Group_Name`url-test|fallback|load-balance`Rule_1`Rule_2`...`test_url`interval[,timeout][,tolerance]
  155. ;Rule with "[]" prefix will be added directly.
  156. ;custom_proxy_group=Proxy`select`.*`[]AUTO`[]DIRECT`.*
  157. ;custom_proxy_group=UrlTest`url-test`.*`http://www.gstatic.com/generate_204`300,5,100
  158. ;custom_proxy_group=FallBack`fallback`.*`http://www.gstatic.com/generate_204`300,5
  159. ;custom_proxy_group=LoadBalance`load-balance`.*`http://www.gstatic.com/generate_204`300,,100
  160. ;custom_proxy_group=SSID`ssid`default_group`celluar=group0,ssid1=group1,ssid2=group2
  161. ;custom_proxy_group=g1`select`!!GROUPID=0
  162. ;custom_proxy_group=g2`select`!!GROUPID=1
  163. ;custom_proxy_group=v2ray`select`!!GROUP=V2RayProvider
  164. ;custom_proxy_group=g1hk`select`!!GROUPID=0!!(HGC|HKBN|PCCW|HKT|hk|港)
  165. ;custom_proxy_group=sstw`select`!!GROUP=V2RayProvider!!(深台|彰化|新北|台|tw)
  166. ;custom_proxy_group=provider`select`!!PROVIDER=prov1,prov2,prov3`fallback_nodes
  167. ;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.
  168. ;custom_proxy_group=script`select`script:/path/to/script.js
  169. ;for forcerule.yml
  170. ;custom_proxy_group=!!import:snippets/groups_forcerule.txt
  171. ;for Surge rulesets
  172. custom_proxy_group=!!import:snippets/groups.txt
  173. [template]
  174. ;The file scope limit of 'include' statement inside the templates.
  175. template_path=
  176. ;The following settings will be added to the "global" scope of the template variables
  177. ;Value of 'clash.http_port' can be accessed with 'global.clash.http_port' in the template.
  178. clash.http_port=7890
  179. clash.socks_port=7891
  180. clash.allow_lan=true
  181. clash.log_level=info
  182. clash.external_controller=127.0.0.1:9090
  183. singbox.allow_lan=true
  184. singbox.mixed_port=2080
  185. [aliases]
  186. ;Aliases for accessing interfaces. Can be used to shorten the URI.
  187. ;All arguments passed when accessing the alias name will be appended to the arguments of the alias target.
  188. ;Format: uri=target
  189. /v=/version
  190. /clash=/sub?target=clash
  191. /clashr=/sub?target=clashr
  192. /surge=/sub?target=surge
  193. /quan=/sub?target=quan
  194. /quanx=/sub?target=quanx
  195. /mellow=/sub?target=mellow
  196. /surfboard=/sub?target=surfboard
  197. /loon=/sub?target=loon
  198. /singbox=/sub?target=singbox
  199. /ss=/sub?target=ss
  200. /ssd=/sub?target=ssd
  201. /sssub=/sub?target=sssub
  202. /ssr=/sub?target=ssr
  203. /v2ray=/sub?target=v2ray
  204. /trojan=/sub?target=trojan
  205. [tasks]
  206. ;Tasks to be run regularly during server execution.
  207. ;Format: Name`Cron_Expression`JS_Path`Timeout_in_seconds
  208. ;task=tick`0/10 * * * * ?`tick.js`3
  209. [server]
  210. ;Address to bind on for Web Server
  211. listen=0.0.0.0
  212. ;Port to bind on for Web Server
  213. port=25500
  214. ;Root folder for web server, keep empty to disable
  215. serve_file_root=
  216. [advanced]
  217. log_level=info
  218. print_debug_info=false
  219. max_pending_connections=10240
  220. max_concurrent_threads=2
  221. max_allowed_rulesets=0
  222. max_allowed_rules=0
  223. max_allowed_download_size=0
  224. enable_cache=false
  225. cache_subscription=60
  226. cache_config=300
  227. cache_ruleset=21600
  228. script_clean_context=true
  229. async_fetch_ruleset=false
  230. skip_failed_links=false