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] 订阅中包含多个wireguard节点时转换为SURGE配置出现异常 #726

Open
2 tasks done
kiminih opened this issue Mar 16, 2024 · 2 comments
Open
2 tasks done

Comments

@kiminih
Copy link

kiminih commented Mar 16, 2024

确认版本最新

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

检索issue

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

subconverter版本

docker-latest

转换过程

clash转换为surge4配置

转换设置

proxies:

  • name: "wg0"
    type: wireguard
    server: 127.0.0.1
    port: 444
    ip: 127.0.0.1
    private-key: eCtXsJZ27+4PbhDkHnB923tkUn2Gj59wZw5wFA75MnU=
    public-key: Cr8hWlKvtDt7nrvf+f0brNQQzabAqrjfBvas9pmowjo=
  • name: "wg1"
    type: wireguard
    server: 127.0.0.1
    port: 444
    ip: 127.0.0.1
    private-key: eCtXsJZ27+4PbhDkHnB923tkUn2Gj59wZw5wFA75MnU=
    public-key: Cr8hWlKvtDt7nrvf+f0brNQQzabAqrjfBvas9pmowjo=

复现步骤

转换为为Surge 4配置仅生成了一个Section,多个wg node指向同一个section-name

期望结果

单独为每个wg node生成并指向对应section

实际结果

转换为为Surge 4配置仅生成了一个Section,多个wg node指向同一个section-name
wg0 = wireguard, section-name=YPU3R, tfo=false, udp-relay=true
wg1 = wireguard, section-name=YPU3R, tfo=false, udp-relay=true

错误信息

No response

@CescMessi
Copy link

问题原因是,每次生成section-name时,都会使用当前时间作为种子生成随机数,如果CPU速度太快,多个节点生成section-name的时间在同一秒内,生成的随机数就是完全一样的了。一种临时的解决方法是,删去设置种子的这行,使用默认的种子来生成随机数。缺点是随机数可以预测,当然我觉得这也不算什么问题,应该没有安全风险。

@mrhaoxx
Copy link

mrhaoxx commented Apr 26, 2024

我在 #747 中使用 name 的哈希作为了 section-name

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

3 participants