跳到主要内容

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

浏览文件

10-alpine-prep.sh

45 行 · 1.4 KB历史下载
1#!/bin/sh
2
3# SPDX-FileCopyrightText: Copyright The Lima Authors
4# SPDX-License-Identifier: Apache-2.0
5
6set -eux
7
8# This script prepares Alpine for lima; there is nothing in here for other distros.
9# The script is executed in plain mode too, as the host agent depends on bash, sudo,
10# and public key auth for checking the boot completion, and on sshd TCP forwarding
11# for forwarding static ports.
12test -f /etc/alpine-release || exit 0
13
14# Configure apk repos
15BRANCH=edge
16VERSION_ID=$(awk -F= '$1=="VERSION_ID" {print $2}' /etc/os-release)
17case ${VERSION_ID} in
18*_alpha* | *_beta*) BRANCH=edge ;;
19*.*.*) BRANCH=v${VERSION_ID%.*} ;;
20esac
21
22for REPO in main community; do
23 URL="https://dl-cdn.alpinelinux.org/alpine/${BRANCH}/${REPO}"
24 if ! grep -q "^${URL}$" /etc/apk/repositories; then
25 echo "${URL}" >>/etc/apk/repositories
26 fi
27done
28
29# Alpine comes with doas instead of sudo
30if ! command -v sudo >/dev/null 2>&1; then
31 apk add sudo
32fi
33
34# Alpine doesn't use PAM so we need to explicitly allow public key auth
35usermod -p '*' "${LIMA_CIDATA_USER}"
36
37# Alpine disables TCP forwarding, which is needed by the lima-guestagent
38sed -i 's/AllowTcpForwarding no/AllowTcpForwarding yes/g' /etc/ssh/sshd_config
39# Enable PAM so as to load /etc/environment via pam_env
40sed -i 's/#UsePAM no/UsePAM yes/g' /etc/ssh/sshd_config
41rc-service --ifstarted sshd reload
42
43# `limactl stop` tells acpid to powerdown
44rc-update add acpid
45rc-service acpid start