Windows: Secrets.ts set saves key then fails with .env must be mode 0600 after set

未关闭 适合新手
#3,018 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 5 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
半天
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
bun, typescript

调研方向

从 LIFEOS/TOOLS/Secrets.ts 开始,其中会保存 secret 并执行 POSIX 0600 模式检查。在 Windows 11 上运行 issue 中的 Bun 命令来复现问题,并在设置密钥后比较 .env 的权限。更新 Windows 专用的验证逻辑,使成功写入 secret 时不会失败,同时保留现有的 POSIX 行为。

由索引模型根据 Issue 内容生成。

描述

On Windows 11, bun LIFEOS/TOOLS/Secrets.ts set FISH_API_KEY saves the key (has returns yes) then exits with: X INVARIANT VIOLATION: .env must be mode 0600 after set. Root cause: chmodSync 0o600 cannot remove NT AUTHORITY\SYSTEM / BUILTIN\Administrators from the ACL, so a POSIX mode check can never pass. Working workaround: icacls $env:USERPROFILE.claude.env /inheritance:r /grant:r. Suggested fix: on win32 skip the 0600 check or verify via ACL that only the current user has access. LifeOS 8.761.0.

主要语言
TypeScript
星标
20k
派生
2.5k
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

danielmiessler/LifeOS 的其他 Issue

查看 danielmiessler/LifeOS 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。