跳到主要内容

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

浏览文件

fetch-proxy-core.sh

35 行 · 1.7 KB历史下载
1#!/usr/bin/env bash
2set -euo pipefail
3cd "$(dirname "$0")/.."
4version=v1.19.33
5case "${CAGE_CORE_ARCH:-$(uname -m)}" in
6 arm64) asset="mihomo-darwin-arm64-$version.gz"; checksum=060b64b0f2c9a310831db0fe4adb2878de67bfa606c311813c1f13966aa504b6 ;;
7 x86_64|amd64) asset="mihomo-darwin-amd64-compatible-$version.gz"; checksum=eefe967b74312f70b64efa0dfa54929d00c7af8e94416e1b12df09863a40f35b ;;
8 *) echo 'Unsupported Cage proxy-core architecture' >&2; exit 1 ;;
9esac
10directory=_output/proxy-core
11mkdir -p "$directory"
12archive="$directory/$asset"
13if [[ ! -f "$archive" ]]; then
14 curl --fail --location --retry 2 --connect-timeout 15 --max-time 180 "https://github.com/MetaCubeX/mihomo/releases/download/$version/$asset" -o "$archive.part"
15 mv "$archive.part" "$archive"
16fi
17actual="$(shasum -a 256 "$archive" | cut -d ' ' -f 1)"
18if [[ "$actual" != "$checksum" ]]; then echo 'Cage proxy-core archive checksum mismatch' >&2; exit 1; fi
19gzip -dc "$archive" > "$directory/mihomo.part"
20chmod 755 "$directory/mihomo.part"
21mv "$directory/mihomo.part" "$directory/mihomo"
22if [[ ! -f "$directory/LICENSE" ]]; then
23 curl --fail --location --retry 2 --connect-timeout 15 --max-time 60 "https://raw.githubusercontent.com/MetaCubeX/mihomo/$version/LICENSE" -o "$directory/LICENSE.part"
24 mv "$directory/LICENSE.part" "$directory/LICENSE"
25fi
26cat > "$directory/NOTICE" <<EOF
27Mihomo $version, distributed as a separate executable by Cage.
28Upstream: https://github.com/MetaCubeX/mihomo
29Source for this unmodified binary: https://github.com/MetaCubeX/mihomo/archive/refs/tags/$version.tar.gz
30License: GPL-3.0. See LICENSE.
31Archive: $asset
32SHA-256: $checksum
33Release digest: https://api.github.com/repos/MetaCubeX/mihomo/releases/tags/$version
34EOF
35"$directory/mihomo" -v