mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-06-29 01:45:54 +08:00
chore: 全面代码审查修复 + 开源标配完善
## 审查修复 (18 项)
- TitleBar 版本号改为动态 import package.json
- CLI profile_apply 加 verify_and_save 原子性保护
- CLI 新增 profile rename 子命令
- cmd_clean 默认清理 system+user 两个 hive
- Rust import_csv 加 BOM/header 处理
- exportToJson/exportToCsv 保留 enabled 状态
- CLI version 使用 env!("CARGO_PKG_VERSION")
- export_paths 返回 Result, 未知格式报错
- importFromContent 未知扩展名 throw Error
- profile 文件名加路径遍历/Win保留字校验
- 数据路径统一到 ~/.patheditor/
## clippy (18 处修复)
- backup/scanner/system/profiles: empty_line_after_doc_comments
- profiles: needless_borrow ×5, unnecessary_map_or
- scanner: collapsible_if
- cli: nonminimal_bool ×6, implicit_saturating_sub, to_string_in_format_args
- 零警告通过
## 测试 (33 条新增)
- Rust: backup(3) + disabled(1) + fs(13) + scanner(4) + profiles(1) = 25 条
- 前端: merge-preview(2) + analyze-dialog(1) + import-parity(5) = 8 条
- Rust 10→35, 前端 72→80
## Scanner 并行化
- std::thread::scope 多线程并行扫描目录,N 倍性能提升
## expand_env_vars UTF-16 修复
- 非法码点编码为 \u{XXXX} 而非静默丢弃
## 开源标配
- CODE_OF_CONDUCT.md (Contributor Covenant 2.1)
- SECURITY.md (漏洞报告流程)
- .github/PULL_REQUEST_TEMPLATE.md
- CONTRIBUTING.md (贡献指南)
- CHANGELOG.md (v4.0~v5.0)
## E2E 测试 (4 条新增)
- keyboard / analyze / profiles / import-export
- IPC mock 扩展 scan/profiles 命令
## CI
- Rust job 目录调整为 workspace 根
## 其他
- rustdoc: 8 个 pub fn 补文档注释
- 帮助文本 v4.0→v5.0
- 前后端导入逻辑加交叉引用注释
- .gitignore 添加 target/
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+37
@@ -0,0 +1,37 @@
|
||||
# 安全策略
|
||||
|
||||
## 报告漏洞
|
||||
|
||||
如果你发现安全漏洞,请**不要**在公开 Issue 中报告。请通过以下方式私下报告:
|
||||
|
||||
- GitHub: 在 [Security Advisories](https://github.com/LHY0125/PathEditor/security/advisories) 页面提交
|
||||
- 邮件: 联系项目维护者
|
||||
|
||||
我们会在 **48 小时内**确认收到报告,并在 7 天内提供初步评估和修复计划。
|
||||
|
||||
## 安全最佳实践
|
||||
|
||||
### 作为用户
|
||||
|
||||
- 仅从 [Releases](https://github.com/LHY0125/PathEditor/releases) 页面下载安装包
|
||||
- 保存前确认 PATH 内容正确,备份文件存放在 `~/.patheditor/backups/`
|
||||
- 编辑系统 PATH 需要管理员权限
|
||||
|
||||
### 作为开发者
|
||||
|
||||
- 永远不要在源代码中硬编码密钥或凭据
|
||||
- 所有 `unsafe` 块必须有 `// SAFETY:` 注释
|
||||
- 输入验证在系统边界执行
|
||||
- 敏感操作(注册表写入)使用最小权限原则
|
||||
|
||||
## 支持版本
|
||||
|
||||
| 版本 | 支持状态 |
|
||||
|------|----------|
|
||||
| v5.x | 活跃支持 |
|
||||
| v4.x | 仅安全修复 |
|
||||
| < v4.0 | 不再支持 |
|
||||
|
||||
## 已知问题
|
||||
|
||||
- 备份文件格式为纯文本,不加密。如需保护备份,请将 `~/.patheditor/` 目录设为仅当前用户可读。
|
||||
Reference in New Issue
Block a user