fix(docker-setup): yaml_get handles 4-space YAML indentation
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user