From 02eb8d70e4f14e7f81ab8a9cfa790b7475ea6838 Mon Sep 17 00:00:00 2001 From: Roland Date: Sun, 5 Jul 2026 13:02:59 -0600 Subject: [PATCH] Caddy install: run gpg --dearmor with --batch --yes. If the caddy keyring file already exists (left by a prior partial install), gpg prompts to overwrite via /dev/tty, which fails under the tty-less wrolpi-upgrade.service ("cannot open '/dev/tty'") and aborts the upgrade. --batch --yes overwrites silently, making the caddy install idempotent in all four scripts that share this pattern. Co-Authored-By: Claude Fable 5 --- pi-gen/stage2/04-wrolpi/03-run-chroot.sh | 2 +- scripts/install_debian_12.sh | 2 +- scripts/install_raspberrypios.sh | 2 +- scripts/upgrade.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pi-gen/stage2/04-wrolpi/03-run-chroot.sh b/pi-gen/stage2/04-wrolpi/03-run-chroot.sh index 327c62b0..212a016f 100755 --- a/pi-gen/stage2/04-wrolpi/03-run-chroot.sh +++ b/pi-gen/stage2/04-wrolpi/03-run-chroot.sh @@ -63,7 +63,7 @@ echo "Controller pre-installed" chown -R wrolpi:wrolpi /opt/wrolpi # Install Caddy from official apt repo. -curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg +curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --batch --yes --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list apt-get update apt-get install -y caddy diff --git a/scripts/install_debian_12.sh b/scripts/install_debian_12.sh index f1866a18..cf59ede6 100755 --- a/scripts/install_debian_12.sh +++ b/scripts/install_debian_12.sh @@ -49,7 +49,7 @@ grep wrolpi: /etc/passwd || useradd -md /home/wrolpi wrolpi -s "$(command -v bas # Install Caddy from official apt repo if not already installed. if ! command -v caddy &>/dev/null; then - curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg + curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --batch --yes --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list apt-get update apt-get install -y caddy diff --git a/scripts/install_raspberrypios.sh b/scripts/install_raspberrypios.sh index 39ffc905..c43626d6 100755 --- a/scripts/install_raspberrypios.sh +++ b/scripts/install_raspberrypios.sh @@ -49,7 +49,7 @@ grep wrolpi: /etc/passwd || useradd -md /home/wrolpi wrolpi -s "$(command -v bas # Install Caddy from official apt repo if not already installed. if ! command -v caddy &>/dev/null; then - curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg + curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --batch --yes --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list apt-get update apt-get install -y caddy diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index cce9da2b..368f0c6f 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh @@ -131,7 +131,7 @@ if ! command -v caddy &>/dev/null; then systemctl stop nginx 2>/dev/null || : systemctl disable nginx 2>/dev/null || : # Install Caddy from official apt repo. - curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg + curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --batch --yes --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list apt-get update apt-get install -y caddy