From b266c3f1d81154020cc2f20e7a4cce3634167678 Mon Sep 17 00:00:00 2001 From: dtoro Date: Wed, 1 Jul 2026 12:34:12 +0200 Subject: [PATCH] fix(bootstrap): sops has no apt/dnf package, fetch the binary directly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Discovered live re-running bootstrap on strong for secrets issuance: apt-get install sops fails outright (no such Debian package — matches what agent-enrollment.md's manual-install recipe already does, fetching the binary from GitHub releases instead of a package manager). dnf would have the same problem. Added install_sops_binary(), used on both the dnf and apt paths; Darwin still installs via brew, which does carry sops. Co-Authored-By: Claude Sonnet 5 --- bootstrap.sh | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 2dcdd0b..f99c569 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -133,6 +133,22 @@ fi if [ "$NO_SECRETS" -eq 0 ]; then for cmd in age sops; do command -v "$cmd" >/dev/null || missing+=("$cmd"); done fi +# sops isn't a real Debian/Fedora package (there is no apt/dnf "sops"), so it +# always needs the direct-binary-download path, on both distros. Only Darwin +# (brew) can install it via a package manager. +install_sops_binary() { + local sops_version=v3.9.4 + local arch + arch="$(uname -m)" + case "$arch" in + x86_64|amd64) arch=amd64 ;; + aarch64|arm64) arch=arm64 ;; + *) echo "[bootstrap] unsupported arch for sops binary download: $arch" >&2; return 1 ;; + esac + curl -fsSL "https://github.com/getsops/sops/releases/download/${sops_version}/sops-${sops_version}.linux.${arch}" \ + -o /usr/local/bin/sops && chmod +x /usr/local/bin/sops +} + if [ "${#missing[@]}" -gt 0 ]; then if [ "$DRY_RUN" -eq 1 ]; then echo "+ would install missing tools: ${missing[*]}" @@ -153,13 +169,23 @@ if [ "${#missing[@]}" -gt 0 ]; then for m in "${missing[@]}"; do case "$m" in python3-yaml) dnf_list+=("python3-pyyaml") ;; + sops) install_sops_binary ;; *) dnf_list+=("$m") ;; esac done - dnf install -y "${dnf_list[@]}" + [ "${#dnf_list[@]}" -gt 0 ] && dnf install -y "${dnf_list[@]}" elif command -v apt-get >/dev/null 2>&1; then - DEBIAN_FRONTEND=noninteractive apt-get update - DEBIAN_FRONTEND=noninteractive apt-get install -y "${missing[@]}" + apt_list=() + for m in "${missing[@]}"; do + case "$m" in + sops) install_sops_binary ;; + *) apt_list+=("$m") ;; + esac + done + if [ "${#apt_list[@]}" -gt 0 ]; then + DEBIAN_FRONTEND=noninteractive apt-get update + DEBIAN_FRONTEND=noninteractive apt-get install -y "${apt_list[@]}" + fi else echo "[bootstrap] no supported package manager for: ${missing[*]}" >&2 echo "[bootstrap] install with your package manager + re-run" >&2