跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

提交记录
修改docs/ci-cd.md+2 −0看文件
@@ -16,6 +16,8 @@ Cage 的日常推送会检查 macOS、Windows 和 Linux,并保存测试安装
1616
1717Windows 的 NSIS 文件匹配按打包工具所在平台使用路径分隔符,Windows runner 和其他主机上的交叉打包共用一份安装脚本。Linux 原生验收在 Ubuntu 22.04 托管 runner 上的一次性 Debian 12 容器内以普通用户运行;Ubuntu 24.04 的宿主策略会额外限制容器用户的 UID 映射。容器放开 bubblewrap 所需的外层 AppArmor、seccomp 和挂载限制,并先验证命名空间可用,应用自身的 WebKit 沙箱保持开启。这些容器设置不进入发行包,也不改变用户主机的安全配置。
1818
19新增:Windows 配套的 QEMU 源码归档使用固定提交、换行设置和 tar 权限,生成后核对固定摘要再写入缓存,避免开发者或 runner 的 Git 默认设置改变归档内容。该校验在安装器压缩前执行,摘要不符时立即停止。
20新增:
1921官网文件的普通推送只做检查和构建。官网部署随显式发布流程完成,也可以由维护者明确运行网站部署工作流。
2022
2123## 明确发版后的自动流程
修改scripts/package-windows.ps1+3 −2看文件
@@ -42,6 +42,9 @@ if ($Release) {
4242 if ($webview.Status -ne 'Valid' -or $webview.SignerCertificate.Subject -notmatch 'O=Microsoft Corporation') { throw 'WebView2 installer must have a valid Microsoft signature.' }
4343}
4444New-Item -ItemType Directory -Path $OutputDirectory -Force | Out-Null
45新增:# Verify source material before the expensive installer compression.
46新增:$dependencies = Get-Content -LiteralPath (Join-Path $repository 'packaging/windows/dependencies.json') -Raw | ConvertFrom-Json
47新增:$qemuTar = Get-VerifiedGitArchive $dependencies.qemuSource (Join-Path $repository '_output/windows-deps')
4548$suffix = if ($Release) { '' } else { '-unsigned' }
4649$artifact = Join-Path $OutputDirectory "Cage-$version-windows-amd64-setup$suffix.exe"
4750$manifest = Join-Path $OutputDirectory 'uninstall-files.nsh'
@@ -66,13 +69,11 @@ if ($Release) { Sign-CageFile $artifact $signTool }
6669if ((Get-Item -LiteralPath $artifact).Length -gt 512MB) { throw 'Installer exceeds the application updater 512 MiB limit.' }
6770
6871# Source materials travel beside the binary, not inside the application directory.
69删除:$dependencies = Get-Content -LiteralPath (Join-Path $repository 'packaging/windows/dependencies.json') -Raw | ConvertFrom-Json
7072$coreSource = Join-Path $OutputDirectory "mihomo-$($dependencies.mihomo.version)-source.tar.gz"
7173$verifiedCoreSource = Get-VerifiedDependency $dependencies.mihomoSource (Join-Path $repository '_output/windows-deps')
7274Copy-Item -LiteralPath $verifiedCoreSource -Destination $coreSource -Force
7375Invoke-BuildTool $sevenZip @('t', '-bso0', '-bsp0', $coreSource)
7476$releaseFiles = @($artifact, $coreSource)
75删除:$qemuTar = Get-VerifiedGitArchive $dependencies.qemuSource (Join-Path $repository '_output/windows-deps')
7677$qemuSource = Join-Path $OutputDirectory ($dependencies.qemuSource.file + '.gz')
7778if (Test-Path -LiteralPath $qemuSource) { Remove-Item -LiteralPath $qemuSource }
7879Invoke-BuildTool $sevenZip @('a', '-tgzip', '-mx=9', '-bso0', '-bsp0', $qemuSource, $qemuTar)
修改scripts/windows-common.ps1+7 −2看文件
@@ -62,14 +62,19 @@ function Get-VerifiedGitArchive {
6262 Invoke-BuildTool $git @('--git-dir', $checkout, 'fetch', '--depth=1', $Dependency.repository, $Dependency.commit)
6363 $actualCommit = & $git '--git-dir' $checkout 'rev-parse' 'FETCH_HEAD'
6464 if ($LASTEXITCODE -ne 0 -or $actualCommit -ne $Dependency.commit) { throw 'Fetched source commit does not match the pinned QEMU build.' }
65删除: Invoke-BuildTool $git @('--git-dir', $checkout, 'archive', '--format=tar', "--prefix=$($Dependency.prefix)", "--output=$partial", $Dependency.commit)
65新增: # Git for Windows defaults can change archive bytes. Keep the
66新增: # pinned source identical to the reviewed POSIX-generated archive.
67新增: Invoke-BuildTool $git @('--git-dir', $checkout, '-c', 'core.autocrlf=false', '-c', 'tar.umask=0002', 'archive', '--format=tar', "--prefix=$($Dependency.prefix)", "--output=$partial", $Dependency.commit)
68新增: $actualHash = (Get-FileHash -LiteralPath $partial -Algorithm SHA256).Hash.ToLowerInvariant()
69新增: if ($actualHash -ne $Dependency.hash) { throw "Source archive checksum mismatch: $($Dependency.file); expected $($Dependency.hash), actual $actualHash" }
6670 Move-Item -LiteralPath $partial -Destination $archive
6771 } finally {
6872 Remove-Item -LiteralPath $checkout -Recurse -Force -ErrorAction SilentlyContinue
6973 Remove-Item -LiteralPath $partial -Force -ErrorAction SilentlyContinue
7074 }
7175 }
72删除: if ((Get-FileHash -LiteralPath $archive -Algorithm SHA256).Hash -ne $Dependency.hash) { throw "Source archive checksum mismatch: $($Dependency.file)" }
76新增: $actualHash = (Get-FileHash -LiteralPath $archive -Algorithm SHA256).Hash.ToLowerInvariant()
77新增: if ($actualHash -ne $Dependency.hash) { throw "Source archive checksum mismatch: $($Dependency.file); expected $($Dependency.hash), actual $actualHash. Remove the cached file and retry." }
7378 return $archive
7479}
7580