feat(linux): support managed user installs and updates on Arch/Omarchy - #3922
feat(linux): support managed user installs and updates on Arch/Omarchy#3922dashhuang wants to merge 2 commits into
Conversation
Add verified user-owned installation transactions, stable desktop and login callbacks, and keyring selector preservation. Document migration and release acceptance; cover native updater failures and Linux test fixtures. Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
| Filename | Overview |
|---|---|
| apps/desktop/resources/linux/install-user.sh | 实现用户级安装和原子版本切换,但中断后的幂等修复及 previous 提交顺序存在一致性缺陷。 |
| apps/desktop/src/main/linuxInstallation.ts | 对受管理用户安装和 dpkg 所有关系进行保守识别,并检查用户、路径、marker 与当前 release。 |
| apps/desktop/src/main/updateScriptLinux.ts | 将用户安装事务嵌入脱离进程的 Linux 更新脚本,并保留稳定启动路径和密码存储参数。 |
| apps/desktop/src/main/updateService.ts | 在停止活动工作前执行 Linux 安装方式和依赖预检,并在执行前再次验证布局。 |
| apps/desktop/src/renderer/components/sidebar/UpdateBanner.tsx | 为不受支持的 Linux 安装新增指南、稍后和重新检查流程,并复用现有活动任务保护。 |
| apps/desktop/forge-linux.ts | 为 Linux 打包产物写入安装器所需的版本、架构、region 与可执行文件身份。 |
| apps/desktop/resources/linux/register-desktop.sh | 为受管理安装创建稳定的桌面入口、CLI 启动路径和深链接关联。 |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[下载官方 DEB] --> B[校验大小与 SHA-256]
B --> C{识别当前 Linux 安装}
C -->|受管理用户安装| D[私有快照并解包载荷]
C -->|dpkg 所有| E[通过 pkexec 安装系统 DEB]
C -->|未知或第三方布局| F[保留下载并显示迁移/包管理器指南]
D --> G[校验版本、架构、region 与链接]
G --> H[创建版本化 release]
H --> I[记录 previous]
I --> J[原子切换 current]
J --> K[通过稳定 current/Cindy 重新启动]
E --> K
Prompt To Fix All With AI
### Issue 1
apps/desktop/resources/linux/install-user.sh:117-118
**中断后无法补齐启动器**
首次安装在切换 `current` 后、创建 `launch` 前如果被信号、崩溃或断电中断,已激活的 release 会被保留。用户重试同一安装包时,这里的幂等分支会直接成功退出,跳过 `launch` 的创建。结果是文档要求的 `PREFIX/launch` 不存在,`register-desktop.sh` 也会因为该文件不可执行而拒绝注册,正常重试无法修复安装。应让幂等重试补齐启动器,或在激活前原子地准备启动器。
### Issue 2
apps/desktop/resources/linux/install-user.sh:127-133
**激活失败会破坏回退指针**
更新事务在切换 `current` 之前就覆盖了 `previous`。如果激活重命名失败,或进程在两次重命名之间中断,`current` 仍指向旧版本,但 `previous` 也已被改成同一个版本,原来的回退指针就会丢失;退出清理也不会恢复它。这会让文档中保留的上一版本指针失去作用。请将两个指针作为可恢复的提交步骤处理,或在激活失败时恢复旧的 `previous`。
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat(linux): support managed user instal..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf89981d63
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@dashhuang 👋 这个 PR 还有 3 条 review conversation 没 resolve(apps/desktop/resources/linux/install-user.sh),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
|
@dashhuang 👋 这个 PR 改动了受保护的路径(.github/workflows/ci.yml),auto-review 因此不合并、也不会自动审查。 这些路径的改动需要人工处理。如果执意要改,请联系 Lizi。 |
|
命中 UI 路径(apps/desktop/src/renderer/components/sidebar/UpdateBanner.tsx)但 description 未附界面效果证据——建议补充改动后效果:截图/录屏,或改动后界面的 HTML 页面(```html 代码块、.html 附件或在线预览链接),便于确认界面符合 DESIGN.md 设计规范 |
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
这次改了什么
摘要
为 Arch Linux / Omarchy 提供可维护的用户级安装、更新和桌面集成路径,解决手动解包 DEB 后更新仍走 apt/dpkg、重启丢失安全存储选择器的问题。目标是完整打通这条安装生命周期,不是宣称所有 Linux 功能和硬件都已验收。
更新器改动已与 owner 确认:本任务由已核验仓库管理员身份的 @dashhuang 明确授权 Linux 安装/更新/凭据兼容支持及提交 PR;没有执行合并或发布。
变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
current切换;私有快照的 size/SHA-256 校验,版本/架构/region 校验,失败清理与重试,保留旧版本。UI 变化
docs/design-rules/DESIGN.md§4 Dialog/Modal、§10 明暗主题、§14.2 焦点。复用ConfirmDialog和已有语义 token,主按钮自动获得焦点;五种语言齐全,明暗主题下均有 DOM 交互测试。怎么验证的
自动验证
首轮验证曾出现 native module 加载崩溃(测试与开发启动的原生模块重建并发)和并发下的 5s import 超时。改用受支持的 Node 22、将原生模块重建与测试分开、降低测试并发后,最终完整 gate 通过。发现的 Linux Pi 夹具错误经真实二进制和上游实现核对后修正,未改任何生产权限逻辑。
手工验证
未执行的验证
DESKTOP_DEV_VERDICT=failed code=WHOAMI_MISMATCH,不能宣称启动验收通过;没有为绕过它改启动判定。风险
风险分类
影响与回滚
提交前检查