v2.5.0: read quoted main proxy secret

This commit is contained in:
Виталий Литвинов
2026-04-25 16:45:57 +03:00
parent cae552ec87
commit 5a6bc9f614
2 changed files with 47 additions and 5 deletions

View File

@@ -132,13 +132,24 @@ get_config_value() {
awk '
/^\[access\.users\]/ { in_users=1; next }
/^\[/ && in_users { exit }
in_users && $1 == "main" {
sub(/^[^=]*=[[:space:]]*"/, "")
sub(/".*$/, "")
print
in_users && /^[[:space:]]*[^#[:space:]][^=]*=/ {
user_key=$1
gsub(/"/, "", user_key)
if (user_key != "main") next
value=$0
sub(/^[^=]*=[[:space:]]*/, "", value)
sub(/^"/, "", value)
sub(/".*$/, "", value)
gsub(/[[:space:]]/, "", value)
if (value != "") {
print value
found=1
}
exit
}
' "$config" | tr -d ' '
END { exit found ? 0 : 1 }
' "$config"
;;
port)
# [server] port = 443