Pin srt to a tested version; support only Pop!_OS 26.04 and later
srt is pinned to 0.0.83, the version the smoketest passed with. A computer with another version sees the agents item as to do in configure, which installs the pinned one. Move the pin only after smoketest/run 50 80 passes. The installer and configure stop on Pop!_OS (or Ubuntu) older than 26.04. The smoketest builds on Ubuntu 26.04, with checks that 24.04 is refused. 26.04's own AppArmor profile lets bubblewrap make user namespaces, so the connector's profile for it, and the code that offered to add it, are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,7 +13,6 @@ BASE_CONFIG="$CONNECTOR/sandbox/config/base.json"
|
||||
BASHRC="$HOME/.bashrc"
|
||||
BLOCK_START="# >>> Federated Connector: agents >>>"
|
||||
BLOCK_END="# <<< Federated Connector: agents <<<"
|
||||
APPARMOR_PROFILE="/etc/apparmor.d/federated-connector-bwrap"
|
||||
source "$CONNECTOR/configure.d/lib/json.sh"
|
||||
source "$CONNECTOR/configure.d/lib/tools.sh"
|
||||
|
||||
@@ -61,31 +60,12 @@ put_on_path() {
|
||||
|
||||
# --- bubblewrap and Ubuntu's AppArmor ---------------------------------------------
|
||||
|
||||
# Ubuntu 24.04 lets only programs AppArmor allows make the user namespaces
|
||||
# bubblewrap needs, and has no rule for bubblewrap itself
|
||||
# Pop!_OS 26.04 lets bubblewrap make user namespaces: Ubuntu's AppArmor
|
||||
# profile for it (bwrap-userns-restrict) allows them
|
||||
bwrap_works() {
|
||||
bwrap --ro-bind / / --unshare-user --unshare-net true 2> /dev/null
|
||||
}
|
||||
|
||||
allow_bwrap() {
|
||||
echo "Ubuntu's AppArmor doesn't let bubblewrap, which the sandbox is built on, make"
|
||||
echo "user namespaces. A profile for /usr/bin/bwrap allows it, as Ubuntu suggests."
|
||||
confirm_yes "Add it ($APPARMOR_PROFILE)?" || return 1
|
||||
sudo tee "$APPARMOR_PROFILE" > /dev/null << 'EOF' || return 1
|
||||
# Written by Federated Connector (configure agents): let bubblewrap, which the
|
||||
# AI agent sandbox uses, make user namespaces
|
||||
abi <abi/4.0>,
|
||||
include <tunables/global>
|
||||
|
||||
profile federated-connector-bwrap /usr/bin/bwrap flags=(unconfined) {
|
||||
userns,
|
||||
include if exists <local/federated-connector-bwrap>
|
||||
}
|
||||
EOF
|
||||
sudo apparmor_parser -r "$APPARMOR_PROFILE" || return 1
|
||||
bwrap_works || { echo "bubblewrap still can't make user namespaces."; return 1; }
|
||||
}
|
||||
|
||||
# --- Claude Code -------------------------------------------------------------------
|
||||
|
||||
# Claude Code runs every command it starts in its own sandbox, also built on
|
||||
@@ -214,7 +194,7 @@ sandbox_cline() {
|
||||
# --- The item -------------------------------------------------------------------------
|
||||
|
||||
sandbox_ready() {
|
||||
srt_path > /dev/null && on_path && pkg_installed "${SANDBOX_PACKAGES[@]}" && bwrap_works \
|
||||
srt_current && on_path && pkg_installed "${SANDBOX_PACKAGES[@]}" && bwrap_works \
|
||||
&& { ! agent_installed claude || { claude_sandbox_on && ! old_claude_notifications; }; } \
|
||||
&& gateway_ok && cline_ok
|
||||
}
|
||||
@@ -263,12 +243,8 @@ run_configure() {
|
||||
echo
|
||||
pkg_ensure "The sandbox" "${SANDBOX_PACKAGES[@]}" || return 1
|
||||
if ! bwrap_works; then
|
||||
if [ "$(sysctl -n kernel.apparmor_restrict_unprivileged_userns 2> /dev/null)" = 1 ]; then
|
||||
allow_bwrap || { echo -e "\e[31mWithout it, the agents can't run in the sandbox.\e[0m"; return 1; }
|
||||
else
|
||||
echo -e "\e[31mbubblewrap can't make user namespaces on this computer, so the sandbox can't run.\e[0m"
|
||||
return 1
|
||||
fi
|
||||
echo -e "\e[31mbubblewrap can't make user namespaces on this computer, so the sandbox can't run.\e[0m"
|
||||
return 1
|
||||
fi
|
||||
srt_ensure || { echo -e "\e[31mWithout srt, opencode and Hermes can't run in the sandbox.\e[0m"; return 1; }
|
||||
if ! on_path; then
|
||||
|
||||
Reference in New Issue
Block a user