Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improvement] 文档和默认/示例配置同步 #729

Open
3 tasks done
Xiami2012 opened this issue Mar 21, 2024 · 1 comment
Open
3 tasks done

[Improvement] 文档和默认/示例配置同步 #729

Xiami2012 opened this issue Mar 21, 2024 · 1 comment

Comments

@Xiami2012
Copy link
Contributor

verify

  • 我已经仔细阅读项目文档,确认现有功能无法解决我的需求
  • 我已经检索过现有issue,确认与现有issue的内容并不重复
  • 我已经尝试自行解决,确认自己没有能力解决

功能描述

Tip

The issue is neither a feature request nor a bug report. It is categorized under 'Feature' due to procedure requirements.

目前 pref.example.ini, pref.example.yml 和 README.cn 的说明(默认值、示例)保持一致。但程序默认使用的配置是 pref.example.toml 。

简单对比了 pref.example.tomlpref.example.ini 的内容。把 toml 同步到 ini 后的不同处如下: (diff 方向为 原 -> 现)

点此展开 diff
diff --git a/base/pref.example.ini b/base/pref.example.ini
index fe1688f..e0da7d4 100644
--- a/base/pref.example.ini
+++ b/base/pref.example.ini
@@ -16,7 +16,7 @@ insert_url=
 prepend_insert_url=true
 
 ;Exclude nodes which remarks match the following patterns. Supports regular expression.
-exclude_remarks=(到期|剩余流量|时间|官网|产品|平台)
+exclude_remarks=(到期|剩余流量|时间|官网|产品)
 ;exclude_remarks=(other rule)
 
 ;Only include nodes which remarks match the following patterns. Supports regular expression.
@@ -83,16 +83,14 @@ reload_conf_on_request=false
 stream_rule=^剩余流量:(.*?)\|总流量:(.*)$|total=$2&left=$1
 stream_rule=^剩余流量:(.*?) (.*)$|total=$1&left=$2
 stream_rule=^Bandwidth: (.*?)/(.*)$|used=$1&total=$2
-stream_rule=^\[.*?\]剩余(.*?)@(?:.*)$|total=$1
-stream_rule=^.*?流量:(.*?) 剩:(?:.*)$|total=$1
+stream_rule=^.*剩余(.*?)(?:\s*?)@(?:.*)$|total=$1
 
 ;Rules to extract expire time data from node
 ;Format: full_match_regex|new_format_regex
 ;where new_format_regex should follow this example: yyyy:mm:dd:hh:mm:ss
 time_rule=^过期时间:(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)$|$1:$2:$3:$4:$5:$6
-time_rule=^到期时间(:|:)(\d+)-(\d+)-(\d+)$|$1:$2:$3:0:0:0
+time_rule=^到期时间:(\d+)-(\d+)-(\d+)$|$1:$2:$3:0:0:0
 time_rule=^Smart Access expire: (\d+)/(\d+)/(\d+)$|$1:$2:$3:0:0:0
-time_rule=^.*?流量:(?:.*?) 剩:(.*)$|left=$1d
 
 [node_pref]
 ;udp_flag=false
@@ -152,7 +150,7 @@ quanx_device_id=
 resolve_hostname=true
 
 [emojis]
-add_emoji=true
+add_emoji=false
 remove_old_emoji=true
 
 ;Rule to add emojis. Supports regular expression.
@@ -239,7 +237,6 @@ singbox.mixed_port=2080
 ;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
@@ -255,6 +252,7 @@ singbox.mixed_port=2080
 /ssr=/sub?target=ssr
 /v2ray=/sub?target=v2ray
 /trojan=/sub?target=trojan
+/test=/render?path=templates/test.tpl
 
 [tasks]
 ;Tasks to be run regularly during server execution.
@@ -269,20 +267,20 @@ listen=0.0.0.0
 port=25500
 
 ;Root folder for web server, keep empty to disable
-serve_file_root=
+serve_file_root=web
 
 [advanced]
-log_level=info
-print_debug_info=false
+log_level=debug
+print_debug_info=true
 max_pending_connections=10240
-max_concurrent_threads=2
-max_allowed_rulesets=0
+max_concurrent_threads=4
+max_allowed_rulesets=64
 max_allowed_rules=0
 max_allowed_download_size=0
-enable_cache=false
+enable_cache=true
 cache_subscription=60
 cache_config=300
 cache_ruleset=21600
 script_clean_context=true
 async_fetch_ruleset=false
-skip_failed_links=false
+skip_failed_links=true

Note

diff 中不包含:

  1. Set most node_pref settings to indeterminate by default #728 的变更。
  2. 所引用的 snippets 目录内的文件。

可能的解决方案

不知道是否接受统一各处的 PR 。以及如果接受,以哪侧为统一基准?

@tindy2013
Copy link
Owner

匹配规则以最全的为准,高级选项等最好以 pref.example.ini 中最初的版本为准

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants