SagerNet

Stars and mentions

Last 30 days, Oct 4 – Nov 2

GitHub stars903
mentions4
016324864Oct 4Oct 18Nov 2
UTC days · repositories SagerNet owns8 repositories

Package downloads

No package download history available yet.

Top repositories

SagerNet’s repositories ranked by new stars, as on trending.

Loading

Contributes to

Repositories outside SagerNet’s account where SagerNet opened or reviewed pull requests in the past 365 days.

Who noticed SagerNet

Everyone who starred or forked SagerNet’s repositories since the archive began in 2011.

Notable accounts

Ordered by the stars their own repositories have received.

Biggest fans

Accounts that starred the most of these repositories.

Breakout weeks

Each repository’s best week of new stars, with the release published around it.

Mentions

4posts
Nov 30 posts
  1. sagernet/tailscale 感谢 singbox 作者@nek0hasekai 的tailscale 贡献,这个库真好用,现在加入了直接内置可以走 tailscale 地址连接的功能。ai vibe 的基础全是前辈们的库。。

    10 likes · 2,076 views
  2. @SamadiPour @iyedoost توی سینگ‌باکس قبلا ایشو برای این موضوع دیده بودم، این بود: sing-box#2991 اما به هر صورت بد نیست یه ایشو باز کنید برای این مساله. مهمه.

    2 likes · 23 views
  3. V2EX · · 分享发现 · @OpenList · SagerNet/sing-box

    [教程] sing-box 更新 1.14.3 后节点全部失效、Bus error、DNS 解析失败的修复方法 最近将几台 VPS 的 sing-box 更新到 1.14.3 后,发现节点无法连接,其中一台服务器还出现了 Bus error。 经过排查,最终成功修复,Shadowsocks 和 VLESS REALITY 节点均恢复正常。 这里记录完整的排查和解决过程,供遇到类似问题的朋友参考。 一、故障环境 | 项目 | 环境 | |---|---| | 系统 | Debian 12 | | 架构 | Linux AMD64 / x86_64 | | 虚拟化 | KVM | | sing-box | 1.14.3 | | 管理脚本 | sing-box script v1.18 | | 磁盘 | 2GB | | 节点协议 | Shadowsocks / VLESS REALITY | 更新后出现以下问题: - sing-box 服务启动失败 - 执行 sing-box version 提示 Bus error - 客户端所有节点无法正常访问网络 - VPS 磁盘使用率达到 100% 注意:以下操作适用于使用 systemd 、且 sing-box 安装在 /etc/sing-box/bin/sing-box 的服务器。其他安装方式需要调整路径。 二、检查 sing-box 服务 SSH 登录服务器,执行: systemctl status sing-box --no-pager -l 发现报错: Active: failed (Result: signal) Main process exited, code=killed, status=7/BUS Start request repeated too quickly. 继续检查: /etc/sing-box/bin/sing-box version 结果: Bus error 说明程序在执行基本版本命令时就发生崩溃。 这种情况优先检查二进制文件本身,而不是直接修改节点配置。 三、检查 VPS 磁盘空间 执行: df -h / 发现: Filesystem Size Used Avail Use% /dev/vda1 2.0G 2.0G 0 100% 磁盘已经完全写满。 继续检查: du -xhd1 /var /root /etc /usr 2>/dev/null 发现: 836M /var/log 进一步检查: du -ah /var/log 2>/dev/null | sort -hr | head -30 发现问题: 836M /var/log 772M /var/log/sing-box/access.log 原来 sing-box 的访问日志已经增长到 772MB 。 对于只有 2GB 磁盘的 VPS ,这个日志文件占用了大量空间。 解决方法:清空访问日志 确认不需要保留历史访问日志后,执行: truncate -s 0 /var/log/sing-box/access.log 再次检查: df -h / 清理后: Filesystem Size Used Avail Use% /dev/vda1 2.0G 1.3G 583M 69% 磁盘空间成功恢复。 注意:不要直接执行 rm -rf /var/log/*,避免误删其他系统和服务日志。 四、修复 sing-box Bus error 磁盘恢复后,发现原来的 sing-box 二进制仍然出现: Bus error 怀疑此前升级时磁盘空间不足,造成二进制文件损坏。 这属于根据故障过程作出的推测,并非已经通过文件校验证实的唯一原因。 1. 备份原程序 systemctl stop sing-box cp -a /etc/sing-box/bin/sing-box \ /root/sing-box.broken 2. 下载官方 sing-box 1.14.3 创建新目录: mkdir -p /root/sing-box-fix cd /root/sing-box-fix 下载: curl -fL --retry 3 \ -o sing-box.tar.gz \ https://github.com/SagerNet/sing-box/releases/download/v1.14.3/sing-box-1.14.3-linux-amd64.tar.gz 检查压缩包: tar -tzf sing-box.tar.gz >/dev/null && echo "Archive OK" 输出: Archive OK 解压: tar -xzf sing-box.tar.gz 注意:压缩包能够解压并不等于通过官方校验和验证;如果需要校验来源和完整性,应进一步核对官方发布的 SHA-256 。 3. 测试新程序 /root/sing-box-fix/sing-box-1.14.3-linux-amd64/sing-box version 正常输出: sing-box version 1.14.3 Environment: go1.26.8 linux/amd64 新下载的程序运行正常,没有出现 Bus error。 4. 替换原程序 确认新程序正常后,执行: install -m 755 \ /root/sing-box-fix/sing-box-1.14.3-linux-amd64/sing-box \ /etc/sing-box/bin/sing-box 验证: /etc/sing-box/bin/sing-box version 成功显示版本号,二进制崩溃问题解决。 五、修复 DNS 解析失败 替换程序后,sing-box 可以启动,但是节点仍然无法正常访问网络。 查看日志: tail -n 30 /var/log/sing-box/access.log 发现: ERROR ntp: initialize time: lookup time.apple.com: The name org.freedesktop.resolve1 was not provided by any .service files 同时,Shadowsocks 出站报错: lookup www.gstatic.com: The name org.freedesktop.resolve1 was not provided by any .service files VLESS REALITY 握手也失败: TLS handshake: REALITY: failed to dial dest: lookup dash.cloudflare.com 由此发现: - sing-box 端口已经正常监听 - 客户端能够连接到服务器 - 服务器 DNS 域名解析失败 - REALITY 无法解析目标域名 - Shadowsocks 无法正常建立域名出站连接 1. 检查 DNS 配置 执行: grep -n -A 20 '"dns"' /etc/sing-box/config.json 原来的主配置为: "dns": {} 2. 备份配置 cp -a /etc/sing-box/config.json \ /etc/sing-box/config.json.bak 3. 修改 DNS 配置 执行: nano /etc/sing-box/config.json 找到: "dns": {} 替换为: "dns": { "servers": [ { "type": "local", "tag": "local", "prefer_go": true } ], "final": "local" } 这里最重要的参数是: "prefer_go": true 它可以使本地 DNS 优先使用 Go 解析方式,避免当前环境中不可用的 systemd-resolved D-Bus 解析路径。 注意:这个修改适用于本次遇到的空 DNS 配置和对应错误。其他服务器如果已经配置了复杂 DNS 规则,不应直接覆盖整个 DNS 对象。 此外,仍需确保 /etc/resolv.conf 中有可用的 DNS 解析服务器。 4. nano 保存方法 修改完毕: 1. 按 Ctrl + O 保存 2. 按 Enter 确认文件名 3. 按 Ctrl + X 退出 5. 检查配置 执行: /etc/sing-box/bin/sing-box check \ -c /etc/sing-box/config.json \ -C /etc/sing-box/conf 没有报错,代表配置检查通过。 注意:以上命令同时检查主配置和 /etc/sing-box/conf 目录配置,与本次 systemd 服务实际使用的启动参数一致。 6. 重启 sing-box systemctl reset-failed sing-box systemctl restart sing-box systemctl status sing-box --no-pager -l 成功显示: Active: active (running) 随后测试客户端: - Shadowsocks 正常 - VLESS REALITY 正常 - 网页访问正常 至此,两个节点全部恢复。 六、防止日志再次占满磁盘 之前的访问日志增长到了 772MB ,所以必须解决日志持续增长的问题。 1. 降低 sing-box 日志级别 编辑配置: nano /etc/sing-box/config.json 找到: "log": { "output": "/var/log/sing-box/access.log", "level": "info", "timestamp": true } 修改为: "log": { "output": "/var/log/sing-box/access.log", "level": "warn", "timestamp": true } 这样能减少大量普通连接日志,仅保留警告和错误信息。 2. 配置 logrotate 执行: cat > /etc/logrotate.d/sing-box <<'EOF' /var/log/sing-box/*.log { size 10M rotate 3 missingok notifempty compress copytruncate } EOF 检查: logrotate -d /etc/logrotate.d/sing-box 配置含义: - size 10M:logrotate 检查时,日志达到 10MB 则轮转 - rotate 3:保留最多 3 份旧日志 - compress:压缩旧日志 - copytruncate:复制日志后清空原文件,避免必须重启服务 注意:logrotate 不是实时监控。实际轮转频率取决于系统的定时任务。如果日志增长非常快,建议提高检查频率或进一步减少日志写入。 七、最终检查 执行: systemctl is-active sing-box 预期: active 检查监听端口: ss -lntup | grep sing-box 检查磁盘: df -h / 检查日志: du -sh /var/log/sing-box 检查最近错误: tail -n 30 /var/log/sing-box/access.log 最后通过客户端实际测试节点,确认连接正常。 八、其他 VPS 遇到相同问题怎么办? 如果有多台服务器出现类似情况,可以按照以下顺序处理: | 故障现象 | 处理方法 | |---|---| | 磁盘使用率 100% | 检查并清理占空间的大日志 | | sing-box 提示 Bus error | 重新下载并测试官方二进制 | | resolve1 DNS 错误 | 检查系统 DNS 和 prefer_go | | REALITY TLS handshake 失败 | 检查目标域名是否能正常解析 | | Shadowsocks 连接后无法上网 | 检查出站 DNS 和网络 | | access.log 持续增长 | 设置 warn 日志级别和 logrotate | 建议先选择一台服务器修复成功,再逐台处理其他 VPS ,不要直接同时重启所有服务器。 不同 VPS 的系统、安装目录、DNS 配置和管理脚本可能不同,不能保证所有服务器都适用相同修改。 九、总结 这次 sing-box 1.14.3 更新后的故障,主要经历了以下过程: sing-box 更新 | v 发现节点全部失效 | v 检查服务:SIGBUS / Bus error | v 发现 VPS 磁盘 100% | v 找到 772MB access.log | v 清理日志,释放磁盘 | v 重新下载官方 sing-box | v 替换异常二进制 | v sing-box 成功启动 | v 发现 DNS / resolve1 错误 | v 添加 prefer_go: true | v Shadowsocks + VLESS REALITY 恢复正常 | v 降低日志级别 + 设置日志轮转 最终成功恢复全部节点,无需重装 Debian ,也无需重新配置节点或证书。 最后提醒 如果 VPS 只有 2GB 磁盘,建议平时定期检查: df -h / 以及: du -sh /var/log/sing-box 尽量保留充足的可用空间。 本次实际修复成功,但磁盘满与二进制损坏之间的因果关系尚未经过完整校验。遇到相同报错时,应根据实际日志判断原因。 希望这篇记录能帮到同样在更新 sing-box 后遇到问题的朋友。

    2 comments
  4. 想說找看看有沒有專案可以 tailscale 的 exit node 接 socks5,結果就發現牛刀 SagerNet/sing-box 專案也支援 tailscale 了...

Trending awards, every completed day and week
Gold
01st place finishes
Silver
02nd place finishes
Bronze
03rd place finishes
Awarded repositories
0Owned by SagerNet now

No trending awards yet

None of the repositories SagerNet owns has finished in the top three of a completed trending day or week, by stars, forks or PR authors. See who is trending now.

A repository earns an award for finishing first, second or third in a completed trending day or week, ranked by new stars, new forks or pull request authors. Awards follow a repository through renames and transfers and count toward its current owner. Weeks run Monday to Sunday, UTC.