跳到主要内容

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

浏览文件

run

39 行 · 1.5 KB历史下载
1#!/usr/bin/env bash
2#
3# fs_suite.py against the rooted SFTP server of third_party/sshocker, through
4# real sshfs, as the Lima hostagent serves agent-vm's shares.
5#
6# tests/sftp/run [case-substring...] the server agent-vm ships
7# tests/sftp/run --openssh [case-substring...] OpenSSH's sftp-server, the control
8#
9# Needs Go, sshfs, fusermount (user_allow_other in /etc/fuse.conf), python3,
10# git, tar and patch. WORK (default /tmp/sftp-work) must be on this machine's
11# own disk, never on a share served by the code under test.
12
13set -euo pipefail
14
15HERE="$(CDPATH= cd -P -- "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
16ROOT="$(CDPATH= cd -P -- "$HERE/../.." >/dev/null && pwd)"
17WORK="${WORK:-/tmp/sftp-work}"
18
19if [ "${1:-}" = --openssh ]; then
20 shift
21 harness="$HERE/openssh_harness.sh"
22 run="$WORK/run-openssh"
23else
24 # A copy of third_party/sshocker with the harness added, built against
25 # third_party/sftp as agent-vm's module builds it.
26 src="$WORK/src"
27 rm -rf "$src"
28 mkdir -p "$WORK"
29 cp -R "$ROOT/third_party/sshocker" "$src"
30 cp "$HERE/testdata/harness/harness_export.go" "$src/pkg/reversesshfs/"
31 mkdir -p "$src/cmd/harness"
32 cp "$HERE/testdata/harness/main.go" "$src/cmd/harness/"
33 ( cd "$src" \
34 && go mod edit -replace "github.com/pkg/sftp=$ROOT/third_party/sftp" \
35 && GOFLAGS=-mod=mod go build -o "$WORK/harness" ./cmd/harness )
36 harness="$WORK/harness"
37 run="$WORK/run"
38fi
39exec python3 "$HERE/fs_suite.py" "$harness" "$run" "$@"