feat: backend security base — single-instance + op-lock, SSRF guard, atomic config, disk preflight#76
Merged
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
… (clippy -D warnings)
This was referenced Jun 16, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR-1:后端安全基座。实现 4 个 issue,operation lock 是后续 PR 复用的地基。
实现(#59 #64 #66 #62)
tauri-plugin-single-instance(第二实例聚焦 + unminimize 现有窗,与最小化按钮协同);OS advisory 文件锁(fs4,崩溃自动释放、无脏锁)+ 进程内互斥 + RAII guard;破坏性命令(install/update/uninstall/adopt/set-root)全包 guard,并发拿不到锁即友好拒绝。source改严格 enum(未知值不静默);url_guard校验自定义源(只 https,拒 loopback/private/link-local/裸 IP/userinfo/云元数据/IPv4-mapped/ULA);5 处 curl 加--proto =https --proto-redir =https(真正的下载侧闸门)。disk.rs统一 available_space(unix statvfs);mac_space_budget + preflight 接入 stage/perform/install 下载前。验收(Claude 把关,非 GPT 自判)
cargo build✓;cargo test32 passed / 0 failed(Claude 复跑确认;曾抓到并打回修复一处 operation-lock close-reopen race)。已知残留风险(spec 显式声明)
Refs #59, #64, #66, #62