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

[BUG] 生成本地配置文件出错 #741

Open
2 tasks done
fxzxmicah opened this issue Apr 8, 2024 · 4 comments
Open
2 tasks done

[BUG] 生成本地配置文件出错 #741

fxzxmicah opened this issue Apr 8, 2024 · 4 comments

Comments

@fxzxmicah
Copy link
Contributor

确认版本最新

  • 我已经确认在最新Action编译的版本中复现

检索issue

  • 我已经确认之前没有issue涉及此BUG

subconverter版本

0.9.0

转换过程

Clash到Clash?

转换设置

generate.ini:

[default]
path=Static/Clash/config.yaml
target=clash
url=!!import:Profiles/Default_Link.ini
config=Clash/Config/Conf_Default.ini
type=default

[profile-1]
path=Static/Clash/profile-1.yaml
target=clash
url=!!import:Profiles/Subscription_Link_1.ini
config=Clash/Config/Conf_Profile.ini
type=profile

[profile-2]
path=Static/Clash/profile-2.yaml
target=clash
url=!!import:Profiles/Subscription_Link_2.ini
config=Clash/Config/Conf_Profile.ini
type=profile

Conf_Profile.ini:

;acl4SSR规则_Modified
[custom]
ruleset=🎯 全球直连,Clash/Rules/LocalAreaNetwork.list
ruleset=🎯 全球直连,Clash/Rules/UnBan.list
ruleset=🛑 全球拦截,Clash/Rules/BanAD.list
ruleset=🛑 全球拦截,Clash/Rules/BanProgramAD.list
ruleset=🎯 全球直连,Clash/Rules/Ruleset/GoogleCN.list
ruleset=🎯 全球直连,Clash/Rules/Ruleset/SteamCN.list
ruleset=🎵 Spotify,Clash/Rules/Ruleset/Spotify.list
ruleset=🎶 TikTok,Clash/Rules/Ruleset/TikTok.list
ruleset=🎮 游戏平台,Clash/Rules/Ruleset/Epic.list
ruleset=🎮 游戏平台,Clash/Rules/Ruleset/Steam.list
ruleset=🎮 游戏平台,Clash/Rules/Ruleset/Xbox.list
ruleset=📺 哔哩哔哩,Clash/Rules/Ruleset/Bilibili.list
ruleset=📺 哔哩哔哩,Clash/Rules/Ruleset/BilibiliHMT.list
ruleset=📽️ 巴哈姆特,Clash/Rules/Ruleset/Bahamut.list
ruleset=🎯 全球直连,Clash/Rules/ChinaDomain.list
ruleset=🎯 全球直连,Clash/Rules/ChinaCompanyIp.list
ruleset=🎯 全球直连,Clash/Rules/Direct.list
ruleset=🚀 节点选择,Clash/Rules/Proxy.list
ruleset=🎯 全球直连,[]GEOIP,CN
ruleset=🚀 节点选择,[]FINAL

custom_proxy_group=🚀 节点选择`select`[]🌐 自动选择`[]🔀 故障转移`[]🇭🇰 香港节点`[]🇹🇼 台湾节点`[]🇸🇬 狮城节点`[]🇯🇵 日本节点`[]🇺🇲 美国节点`[]🔯 其它节点
custom_proxy_group=🔯 其它节点`select`^(((?!(港|HK|Hong Kong)|(台|新北|彰化|TW|Taiwan)|(新加坡|坡|狮城|SG|Singapore)|(日本|东京|大阪|[^-]日[^利]|JP|Japan)|(美|洛杉矶|圣何塞|US|United States)).)*)$
custom_proxy_group=🎵 Spotify`select`[]🎯 全球直连`[]🇸🇬 狮城节点`[]🇯🇵 日本节点
custom_proxy_group=🎶 TikTok`select`[]🇸🇬 狮城节点`[]🇯🇵 日本节点`[]🇺🇲 美国节点
custom_proxy_group=🎮 游戏平台`select`[]🇭🇰 香港节点`[]🇺🇲 美国节点
custom_proxy_group=📺 哔哩哔哩`select`[]🎯 全球直连`[]🇹🇼 台湾节点
custom_proxy_group=📽️ 巴哈姆特`select`[]🇹🇼 台湾节点
custom_proxy_group=🎯 全球直连`select`[]DIRECT
custom_proxy_group=🛑 全球拦截`select`[]REJECT
custom_proxy_group=🌐 自动选择`url-test`.*`http://www.gstatic.com/generate_204`300
custom_proxy_group=🔀 故障转移`fallback`.*`http://www.gstatic.com/generate_204`180
custom_proxy_group=🇭🇰 香港节点`url-test`^.*(港|HK|Hong Kong).*$`http://www.gstatic.com/generate_204`180,5
custom_proxy_group=🇹🇼 台湾节点`url-test`^.*(台|新北|彰化|TW|Taiwan).*$`http://www.gstatic.com/generate_204`180,5
custom_proxy_group=🇸🇬 狮城节点`url-test`^.*(新加坡|坡|狮城|SG|Singapore).*$`http://www.gstatic.com/generate_204`180,5
custom_proxy_group=🇯🇵 日本节点`url-test`^.*(日本|东京|大阪|[^-]日[^利]|JP|Japan).*$`http://www.gstatic.com/generate_204`180,5
custom_proxy_group=🇺🇲 美国节点`url-test`^.*(美|洛杉矶|圣何塞|US|United States).*$`http://www.gstatic.com/generate_204`180,5

enable_rule_generator=true
overwrite_original_rules=true

复现步骤

使用上述配置在本地生成配置。

期望结果

生成成功。

实际结果

三个配置基本按照[default]配置生成了。

错误信息

2024/04/08 Mon 14:37:51.749752 [1721 Thread-1][INFO] SubConverter v0.9.0 starting up..
2024/04/08 Mon 14:37:51.750644 [1721 Thread-1][INFO] Loading preference settings...
Error: /08 Mon 14:37:51.755046 [1721 Thread-1][DEBG] [error] toml::parse_key: an invalid key appeared.
 --> pref.ini
   |
 2 | ;API mode, set to true to prevent loading local subscriptions or serving local files directly
   | ^--- is not a valid key
   |
Hint: bare keys  : non-empty strings composed only of [A-Za-z0-9_-].
Hint: quoted keys: same as "basic strings" or 'literal strings'.
Hint: dotted keys: sequence of bare or quoted keys joined with a dot.
2024/04/08 Mon 14:37:51.755070 [1721 Thread-1][DEBG] Unable to load preference settings as TOML.
2024/04/08 Mon 14:37:51.755484 [1721 Thread-1][VERB] Imported 0 item(s).
2024/04/08 Mon 14:37:51.755555 [1721 Thread-1][VERB] Imported 0 item(s).
2024/04/08 Mon 14:37:51.755606 [1721 Thread-1][VERB] Trying to import items from Snippets/Emoji.txt
2024/04/08 Mon 14:37:51.755773 [1721 Thread-1][VERB] Imported 54 item(s).
2024/04/08 Mon 14:37:51.755984 [1721 Thread-1][INFO] Load preference settings in INI format completed.
2024/04/08 Mon 14:37:51.756018 [1721 Thread-1][INFO] Reading generator configuration...
2024/04/08 Mon 14:37:51.756084 [1721 Thread-1][INFO] Read generator configuration completed.

2024/04/08 Mon 14:37:51.756098 [1721 Thread-1][INFO] Generating all artifacts...
2024/04/08 Mon 14:37:51.756116 [1721 Thread-1][INFO] Generating artifact 'default'...
2024/04/08 Mon 14:37:51.756159 [1721 Thread-1][INFO] External configuration file provided. Loading...
2024/04/08 Mon 14:37:51.756667 [1721 Thread-1][INFO] Adding rule 'FINAL,🎯 全球直连'.
2024/04/08 Mon 14:37:51.756874 [1721 Thread-1][INFO] Fetching node data from url 'ss://Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpwYXNzd29yZA@localhost:1080#LocalHost'.
2024/04/08 Mon 14:37:51.759287 [1721 Thread-1][INFO] Generate target: Clash
2024/04/08 Mon 14:37:51.764370 [1721 Thread-1][INFO] Generate completed.
2024/04/08 Mon 14:37:51.764488 [1721 Thread-1][INFO] Artifact 'default' generate SUCCESS!

2024/04/08 Mon 14:37:51.764509 [1721 Thread-1][INFO] Generating artifact 'profile-1'...
2024/04/08 Mon 14:37:51.764547 [1721 Thread-1][INFO] External configuration file provided. Loading...
2024/04/08 Mon 14:37:51.765713 [1721 Thread-1][INFO] Adding rule 'FINAL,🎯 全球直连'.
2024/04/08 Mon 14:37:51.765840 [1721 Thread-1][INFO] Fetching node data from url 'ss://Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpwYXNzd29yZA@localhost:1080#LocalHost'.
2024/04/08 Mon 14:37:51.767637 [1721 Thread-1][INFO] Generate target: Clash
2024/04/08 Mon 14:37:51.768727 [1721 Thread-1][INFO] Generate completed.
2024/04/08 Mon 14:37:51.768903 [1721 Thread-1][INFO] Artifact 'profile-1' generate SUCCESS!

2024/04/08 Mon 14:37:51.768922 [1721 Thread-1][INFO] Generating artifact 'profile-2'...
2024/04/08 Mon 14:37:51.768959 [1721 Thread-1][INFO] External configuration file provided. Loading...
2024/04/08 Mon 14:37:51.769343 [1721 Thread-1][INFO] Adding rule 'FINAL,🎯 全球直连'.
2024/04/08 Mon 14:37:51.769465 [1721 Thread-1][INFO] Fetching node data from url 'ss://Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpwYXNzd29yZA@localhost:1080#LocalHost'.
2024/04/08 Mon 14:37:51.771403 [1721 Thread-1][INFO] Generate target: Clash
2024/04/08 Mon 14:37:51.772239 [1721 Thread-1][INFO] Generate completed.
2024/04/08 Mon 14:37:51.772357 [1721 Thread-1][INFO] Artifact 'profile-2' generate SUCCESS!

2024/04/08 Mon 14:37:51.772375 [1721 Thread-1][INFO] All artifact generated. Exiting...
@fxzxmicah
Copy link
Contributor Author

fxzxmicah commented Apr 8, 2024

0.8.1版本生成日志:

2024/04/07 Sun 06:37:58.868988 [1650 10884376][INFO] SubConverter v0.8.1 starting up..
2024/04/07 Sun 06:37:58.869834 [1650 10884376][INFO] Loading preference settings...
Error: /07 Sun 06:37:58.874000 [1650 10884376][DEBG] [error] toml::parse_key: an invalid key appeared.
 --> pref.ini
   |
 2 | ;API mode, set to true to prevent loading local subscriptions or serving local files directly
   | ^--- is not a valid key
   |
Hint: bare keys  : non-empty strings composed only of [A-Za-z0-9_-].
Hint: quoted keys: same as "basic strings" or 'literal strings'.
Hint: dotted keys: sequence of bare or quoted keys joined with a dot.
2024/04/07 Sun 06:37:58.875801 [1650 10884376][DEBG] Unable to load preference settings as TOML.
2024/04/07 Sun 06:37:58.876227 [1650 10884376][VERB] Imported 0 item(s).
2024/04/07 Sun 06:37:58.876386 [1650 10884376][VERB] Imported 0 item(s).
2024/04/07 Sun 06:37:58.876412 [1650 10884376][VERB] Trying to import items from Snippets/Emoji.txt
2024/04/07 Sun 06:37:58.876658 [1650 10884376][VERB] Imported 54 item(s).
2024/04/07 Sun 06:37:58.876949 [1650 10884376][INFO] Load preference settings in INI format completed.
2024/04/07 Sun 06:37:58.877097 [1650 10884376][INFO] Reading generator configuration...
2024/04/07 Sun 06:37:58.877263 [1650 10884376][INFO] Read generator configuration completed.

2024/04/07 Sun 06:37:58.877279 [1650 10884376][INFO] Generating all artifacts...
2024/04/07 Sun 06:37:58.877338 [1650 10884376][INFO] Generating artifact 'default'...
2024/04/07 Sun 06:37:58.877415 [1650 10884376][INFO] External configuration file provided. Loading...
2024/04/07 Sun 06:37:58.878161 [1650 10884376][INFO] Adding rule 'FINAL,🎯 全球直连'.
2024/04/07 Sun 06:37:58.878438 [1650 10884376][INFO] Fetching node data from url 'ss://Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpwYXNzd29yZA@localhost:1080#LocalHost'.
2024/04/07 Sun 06:37:58.880772 [1650 10884376][INFO] Generate target: Clash
2024/04/07 Sun 06:37:58.881773 [1650 10884376][INFO] Generate completed.
2024/04/07 Sun 06:37:58.881882 [1650 10884376][INFO] Artifact 'default' generate SUCCESS!

2024/04/07 Sun 06:37:58.881901 [1650 10884376][INFO] Generating artifact 'profile-1'...
2024/04/07 Sun 06:37:58.881993 [1650 10884376][INFO] External configuration file provided. Loading...
2024/04/07 Sun 06:37:58.883459 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/LocalAreaNetwork.list' with group '🎯 全球直连'.
2024/04/07 Sun 06:37:58.883513 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/UnBan.list' with group '🎯 全球直连'.
2024/04/07 Sun 06:37:58.883563 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/BanAD.list' with group '🛑 全球拦截'.
2024/04/07 Sun 06:37:58.883611 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/BanProgramAD.list' with group '🛑 全球拦截'.
2024/04/07 Sun 06:37:58.883659 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/GoogleCN.list' with group '🎯 全球直连'.
2024/04/07 Sun 06:37:58.883715 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/SteamCN.list' with group '🎯 全球直连'.
2024/04/07 Sun 06:37:58.883761 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/Spotify.list' with group '🎵 Spotify'.
2024/04/07 Sun 06:37:58.883808 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/TikTok.list' with group '🎶 TikTok'.
2024/04/07 Sun 06:37:58.883853 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/Epic.list' with group '🎮 游戏平台'.
2024/04/07 Sun 06:37:58.883914 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/Steam.list' with group '🎮 游戏平台'.
2024/04/07 Sun 06:37:58.883963 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/Xbox.list' with group '🎮 游戏平台'.
2024/04/07 Sun 06:37:58.884008 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/Bilibili.list' with group '📺 哔哩哔哩'.
2024/04/07 Sun 06:37:58.884057 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/BilibiliHMT.list' with group '📺 哔哩哔哩'.
2024/04/07 Sun 06:37:58.884105 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/Bahamut.list' with group '📽️ 巴哈姆特'.
2024/04/07 Sun 06:37:58.884149 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/ChinaDomain.list' with group '🎯 全球直连'.
2024/04/07 Sun 06:37:58.884193 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/ChinaCompanyIp.list' with group '🎯 全球直连'.
2024/04/07 Sun 06:37:58.884239 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Direct.list' with group '🎯 全球直连'.
2024/04/07 Sun 06:37:58.884286 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Proxy.list' with group '🚀 节点选择'.
2024/04/07 Sun 06:37:58.884334 [1650 10884376][INFO] Adding rule 'GEOIP,CN,🎯 全球直连'.
2024/04/07 Sun 06:37:58.884377 [1650 10884376][INFO] Adding rule 'FINAL,🚀 节点选择'.
2024/04/07 Sun 06:37:58.884487 [1650 10884376][INFO] Fetching node data from url '***'.
2024/04/07 Sun 06:37:59.295990 [1650 10884376][INFO] Generate target: Clash
2024/04/07 Sun 06:37:59.307185 [1650 10884376][INFO] Generate completed.
2024/04/07 Sun 06:37:59.307665 [1650 10884376][INFO] Artifact 'profile-1' generate SUCCESS!

2024/04/07 Sun 06:37:59.307698 [1650 10884376][INFO] Generating artifact 'profile-2'...
2024/04/07 Sun 06:37:59.307768 [1650 10884376][INFO] External configuration file provided. Loading...
2024/04/07 Sun 06:37:59.308979 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/LocalAreaNetwork.list' with group '🎯 全球直连'.
2024/04/07 Sun 06:37:59.309039 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/UnBan.list' with group '🎯 全球直连'.
2024/04/07 Sun 06:37:59.309113 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/BanAD.list' with group '🛑 全球拦截'.
2024/04/07 Sun 06:37:59.309164 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/BanProgramAD.list' with group '🛑 全球拦截'.
2024/04/07 Sun 06:37:59.309219 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/GoogleCN.list' with group '🎯 全球直连'.
2024/04/07 Sun 06:37:59.309283 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/SteamCN.list' with group '🎯 全球直连'.
2024/04/07 Sun 06:37:59.309333 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/Spotify.list' with group '🎵 Spotify'.
2024/04/07 Sun 06:37:59.309390 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/TikTok.list' with group '🎶 TikTok'.
2024/04/07 Sun 06:37:59.309449 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/Epic.list' with group '🎮 游戏平台'.
2024/04/07 Sun 06:37:59.309538 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/Steam.list' with group '🎮 游戏平台'.
2024/04/07 Sun 06:37:59.309595 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/Xbox.list' with group '🎮 游戏平台'.
2024/04/07 Sun 06:37:59.309647 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/Bilibili.list' with group '📺 哔哩哔哩'.
2024/04/07 Sun 06:37:59.309700 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/BilibiliHMT.list' with group '📺 哔哩哔哩'.
2024/04/07 Sun 06:37:59.309750 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Ruleset/Bahamut.list' with group '📽️ 巴哈姆特'.
2024/04/07 Sun 06:37:59.309802 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/ChinaDomain.list' with group '🎯 全球直连'.
2024/04/07 Sun 06:37:59.309861 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/ChinaCompanyIp.list' with group '🎯 全球直连'.
2024/04/07 Sun 06:37:59.309950 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Direct.list' with group '🎯 全球直连'.
2024/04/07 Sun 06:37:59.310051 [1650 10884376][INFO] Updating ruleset url 'Clash/Rules/Proxy.list' with group '🚀 节点选择'.
2024/04/07 Sun 06:37:59.310117 [1650 10884376][INFO] Adding rule 'GEOIP,CN,🎯 全球直连'.
2024/04/07 Sun 06:37:59.310181 [1650 10884376][INFO] Adding rule 'FINAL,🚀 节点选择'.
2024/04/07 Sun 06:37:59.310321 [1650 10884376][INFO] Fetching node data from url '***'.
2024/04/07 Sun 06:38:00.008647 [1650 10884376][INFO] Generate target: Clash
2024/04/07 Sun 06:38:00.022410 [1650 10884376][INFO] Generate completed.
2024/04/07 Sun 06:38:00.022933 [1650 10884376][INFO] Artifact 'profile-2' generate SUCCESS!

2024/04/07 Sun 06:38:00.022974 [1650 10884376][INFO] All artifact generated. Exiting...

@fxzxmicah
Copy link
Contributor Author

先回退到0.8.1了。

tindy2013 added a commit that referenced this issue Apr 8, 2024
Fix not properly handling data from multipart-form POST (#739).
Fix not cleaning up request parameters when generating profiles (#741).
@tindy2013
Copy link
Owner

Fixed in referenced commit.

@fxzxmicah
Copy link
Contributor Author

@tindy2013 好的,多谢。另外关于 pref.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