From 45cf527050839db3c40361fd9656686608b26b2c Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Sun, 22 Feb 2026 11:27:44 +0100 Subject: [PATCH] fix(docker-setup): yaml_get handles 4-space YAML indentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hub YAML is generated by Go's yaml.v3 which uses 4-space indentation. The yaml_get helper was matching " key:" (2 spaces) so all extractions silently returned empty — BASE_DOMAIN stayed as homeserver.local and CF_TUNNEL_TOKEN was never set from hub config. Strip leading whitespace before key matching, making yaml_get indentation-agnostic. Co-Authored-By: Claude Sonnet 4.6 --- scripts/docker-setup.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/docker-setup.sh b/scripts/docker-setup.sh index ba87de9..0884728 100644 --- a/scripts/docker-setup.sh +++ b/scripts/docker-setup.sh @@ -1473,10 +1473,15 @@ EOF #------------------------------------------------------------------------------- yaml_get() { local file="$1" section="$2" key="$3" - awk -v s="${section}:" -v k=" ${key}:" ' + awk -v s="${section}:" -v k="${key}:" ' /^[[:alpha:]]/ { in_s = ($0 == s) } - in_s && index($0, k) == 1 { - sub(/^[^:]*: */, ""); gsub(/^"|"$/, ""); print; exit + in_s && /^[[:space:]]/ { + line = $0; sub(/^[[:space:]]+/, "", line) + if (index(line, k) == 1) { + sub(/^[^:]*:[[:space:]]*/, "", line) + gsub(/^"|"$/, "", line) + print line; exit + } } ' "$file" }