跳到主要内容

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

浏览文件

pack-kit.sh

27 行 · 1.5 KB历史下载
1#!/usr/bin/env bash
2# Inputs: trusted Linux Cage build, the verified guest build directory, Docker archives.
3set -euo pipefail
4cd "$(dirname "$0")/../.."
5: "${CAGE_SERVER_BINARY:?Specify the Linux amd64 Cage binary}"
6: "${CAGE_GUEST_BUILD:?Specify the build-guest.sh output directory}"
7: "${CAGE_DOCKER_DOWNLOADS:?Specify the directory containing the two pinned Docker archives}"
8target="${CAGE_KIT_OUTPUT:-$PWD/_output/cloud-kit}"
9mkdir -p "$target"
10stage=$(mktemp -d "$target/kit.XXXXXX")
11trap 'rm -rf "$stage"' EXIT
12(cd "$CAGE_GUEST_BUILD"; shasum -a 256 -c SHA256SUMS)
13grep -Exq 'sha256:[a-f0-9]{64}' "$CAGE_GUEST_BUILD/image-id"
14cp "$CAGE_GUEST_BUILD/image-id" "$stage/"
15zstd -q -T2 -4 "$CAGE_GUEST_BUILD/cage-guest.tar" -o "$stage/guest.tar.zst"
16cp "$CAGE_SERVER_BINARY" "$stage/cage"
17bash scripts/fetch-linux-proxy-core.sh
18cp _output/linux-deps/mihomo "$stage/"
19cp deploy/cloud/*.service "$stage/"
20while read -r digest archive; do
21 cp "$CAGE_DOCKER_DOWNLOADS/$archive" "$stage/"
22 (cd "$stage"; printf '%s %s\n' "$digest" "$archive" | shasum -a 256 -c -)
23done < <(node -e 'for(const a of require("./deploy/cloud/runtime-artifacts.json").artifacts)console.log(a.sha256,a.file)')
24name=cloud-linux-amd64.tar
25COPYFILE_DISABLE=1 tar -cf "$stage/$name" -C "$stage" cage mihomo cage-container-engine.service cage-server.service image-id guest.tar.zst docker-29.9.1.tgz docker-rootless-extras-29.9.1.tgz
26shasum -a 256 "$stage/$name" | cut -d' ' -f1 > "$stage/$name.sha256"
27mv "$stage/$name" "$stage/$name.sha256" "$target/"