Skip to content

Bugfix: Standalone ACMESH_${cid}_DNS_API_CONFIG env variable is not properly formatted to be parsed correctly. #1154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/letsencrypt_service
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,15 @@ function update_cert {
local default_acmesh_dns_api="${DEFAULT_ACMESH_DNS_API_CONFIG[DNS_API]}"
[[ -n "$default_acmesh_dns_api" ]] && acmesh_dns_config_used='default'

local -n acmesh_dns_config="ACMESH_${cid}_DNS_API_CONFIG"
local -n acmesh_dns_config_env_var="ACMESH_${cid}_DNS_API_CONFIG"

# Fix formatting for jq (switch single quotes for double)
acmesh_dns_config_env_var=${acmesh_dns_config_env_var//\'/\"}

# Convert json to assoc array
declare -A acmesh_dns_config=$(
jq -r '"(",(to_entries | .[] | "["+(.key|@sh)+"]="+(.value|@sh)),")"' <<< $acmesh_dns_config_env_var
)
local acmesh_dns_api="${acmesh_dns_config[DNS_API]}"
[[ -n "$acmesh_dns_api" ]] && acmesh_dns_config_used='container'

Expand Down