feat: Add build-time configuration injection and macOS build support #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 更新内容
🎯 新增功能
1. 构建时配置注入系统
.build.config) 在构建时自动注入后端地址实现文件:
main.go- 添加可注入的配置变量build.sh- 增强构建脚本,支持配置读取和注入.build.config.example- 配置文件模板.build.config- 实际配置文件(已添加到.gitignore)2. 完善的日志系统
~/.config/antihook/kiro.log)实现文件:
main.go- 添加日志记录功能3. 用户体验优化
实现文件:
main.go- 优化弹框显示逻辑4. macOS 协议注册优化
实现文件:
registry/registry_darwin.go- 完善 macOS 协议注册5. GitHub Actions 多平台构建
实现文件:
.github/workflows/build.yml- 重构为多平台矩阵构建📚 文档更新
新增文档
BUILD_GUIDE.md- 详细的构建配置指南MAC_INSTALL_GUIDE.md- macOS 完整安装和使用教程TROUBLESHOOTING.md- 故障排查指南API_ISSUE_REPORT.md- API 诊断报告模板更新文档
README.md- 添加所有新功能说明、使用方法和文档索引🔧 配置文件
新增配置
.build.config.example- 配置文件模板.build.config- 生产环境配置(已配置 tunnel.mortis.edu.kg)更新配置
.gitignore- 添加.build.config到忽略列表📊 技术细节
构建时配置注入实现
配置优先级(从高到低):
KIRO_SERVER_URL,BACKEND_URL).build.config)localhost)注入方式:
go build -ldflags="-X 'main.DefaultServerURL=$SERVER_URL' -X 'main.DefaultBackendURL=$BACKEND_URL'"GitHub Actions 构建矩阵
日志系统
日志文件:
~/.config/antihook/kiro.log日志内容:
🧪 测试说明
本地测试
CI/CD 测试
Push 到 main/master 分支后:
📈 影响范围
修改的文件
main.go- 核心功能增强registry/registry_darwin.go- macOS 协议注册修复build.sh- 构建脚本增强.github/workflows/build.yml- CI/CD 多平台支持README.md- 文档更新新增的文件
.build.config.example- 配置模板.build.config- 生产配置BUILD_GUIDE.md- 构建指南MAC_INSTALL_GUIDE.md- macOS 安装指南TROUBLESHOOTING.md- 故障排查API_ISSUE_REPORT.md- API 诊断✅ 检查清单
🔄 Breaking Changes
无破坏性变更。所有现有功能保持向后兼容。
📝 备注
.build.config已添加到.gitignore,不会被提交KIRO_SERVER_URL和BACKEND_URL🎯 后续计划
测试环境:
相关 Issue:#N/A
文档:所有文档已更新,详见 README.md