From 82540472ae4637f6c824854e8249e30924dbb568 Mon Sep 17 00:00:00 2001 From: Damien Date: Thu, 30 Jul 2026 13:33:20 +0200 Subject: [PATCH] gitea-runner: fix log_info/warn/error writing to stdout, corrupting TEMPLATE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit log_info() etc. wrote to stdout, unlike openbao's identical functions which write to stderr specifically so $(fn) capture is safe. lib/common.sh's detect_latest_alpine_template() does `log_info "Selected..."; echo "$tmpl"` — in gitea-runner, TEMPLATE=$(detect_latest_alpine_template) therefore captured the log line and ANSI codes along with the template name, breaking both the pveam list lookup and pct create's template argument. --- gitea-runner/install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gitea-runner/install.sh b/gitea-runner/install.sh index 91cd3f0..7efcfb2 100644 --- a/gitea-runner/install.sh +++ b/gitea-runner/install.sh @@ -28,9 +28,10 @@ GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' -log_info() { echo -e "${GREEN}[INFO]${NC} $1"; } -log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; } -log_error() { echo -e "${RED}[ERROR]${NC} $1"; } +# Logs go to stderr so callers can safely use $(fn) without capturing log noise. +log_info() { echo -e "${GREEN}[INFO]${NC} $1" >&2; } +log_warn() { echo -e "${YELLOW}[WARN]${NC} $1" >&2; } +log_error() { echo -e "${RED}[ERROR]${NC} $1" >&2; } require_root() { if [[ "$(id -u)" -ne 0 ]]; then