- 26 Dec, 2025 2 commits
-
-
ianshaw authored
- 添加 Gemini OAuth 配置结构 - 实现 geminicli 包(OAuth、Token、CodeAssist 类型) - 更新配置示例文件
-
NepetaLemon authored
* refactor: 自定义业务错误 * refactor: 隐藏服务器错误与统一 panic 响应
-
- 25 Dec, 2025 1 commit
-
-
Forest authored
-
- 24 Dec, 2025 3 commits
- 22 Dec, 2025 1 commit
-
-
shaw authored
-
- 20 Dec, 2025 2 commits
-
-
Forest authored
-
NepetaLemon authored
## 变更内容 ### CI/CD - 添加 GitHub Actions 工作流(test + golangci-lint) - 添加 golangci-lint 配置,启用 errcheck/govet/staticcheck/unused/depguard - 通过 depguard 强制 service 层不能直接导入 repository ### 错误处理修复 - 修复 CSV 写入、SSE 流式输出、随机数生成等未处理的错误 - GenerateRedeemCode() 现在返回 error ### 资源泄露修复 - 统一使用 defer func() { _ = xxx.Close() }() 模式 ### 代码清理 - 移除未使用的常量 - 简化 nil map 检查 - 统一代码格式
-
- 19 Dec, 2025 3 commits
-
-
Forest authored
-
shaw authored
- 新增 GET /api/v1/admin/accounts/:id/models 接口获取账号可用模型 - 账号测试弹窗新增模型选择下拉框 - 测试时支持传入 model_id 参数,不传则默认使用 Sonnet - API Key 账号支持根据 model_mapping 映射测试模型 - 将模型常量提取到 claude 包统一管理
-
shaw authored
- 新增 internal/pkg/claude 包统一管理 Claude Code 相关常量 - 统一账号测试逻辑,所有账号类型使用相同的 Claude Code 风格请求 - 网关服务使用常量包替换硬编码的 beta header 字符串
-
- 18 Dec, 2025 6 commits
-
-
shaw authored
重构内容: - 移除复杂的 sudo systemctl restart 方案 - 改用 os.Exit(0) + systemd Restart=always 的标准做法 - 删除 sudoers 配置及相关代码 - 删除 sub2api-sudoers 文件 优势: - 代码从 85+ 行简化到 47 行 - 无需 sudo 权限配置 - 无需特殊用户 shell 配置 - 更简单、更可靠 - 符合行业最佳实践(Docker/K8s 等均采用此方案) 工作原理: - 服务调用 os.Exit(0) 优雅退出 - systemd 检测到退出后自动重启(Restart=always)
-
shaw authored
问题原因: - cmd.Start() 启动的子进程与父进程在同一会话中 - 当 systemctl restart 发送 SIGTERM 给父进程时 - 子进程可能也会被终止,导致重启命令无法完成 修复内容: - 使用 setsid 创建新会话,子进程完全独立于父进程 - 分离标准输入/输出/错误流 - 确保即使父进程被 kill,重启命令仍能执行完成
-
shaw authored
问题原因: - systemd 服务的 PATH 环境变量可能受限 - 直接使用 "sudo" 可能找不到可执行文件 修复内容: - 添加 findExecutable 函数动态查找可执行文件路径 - 先尝试 exec.LookPath,再检查常见系统路径 - 添加日志显示实际使用的路径,方便调试 - 兼容不同 Linux 发行版的路径差异
-
shaw authored
问题原因: - sudo 命令没有 -n 选项 - 在后台服务中,sudo 会尝试从终端读取密码 - 由于没有终端,命令静默失败 修复内容: - 添加 sudo -n 选项强制非交互模式 - 如果需要密码会立即失败并返回错误,而不是挂起
-
shaw authored
-
shaw authored
-