fix(config): mask special chars in setting keys
Some checks failed
build / lint-node (push) Has been cancelled
build / lint-helm (push) Has been cancelled
build / e2e (v1.28.15+k3s1) (push) Has been cancelled
build / e2e (v1.31.5+k3s1) (push) Has been cancelled
build / e2e (v1.32.1+k3s1) (push) Has been cancelled
build / test-success (push) Has been cancelled
build / publish (push) Has been cancelled

This commit is contained in:
Michael Kriese 2025-02-12 10:58:28 +01:00
parent d6b799cd55
commit 5a3f266bbc
No known key found for this signature in database
GPG key ID: F8D7748549A5986A

View file

@ -89,15 +89,18 @@ stringData:
env2ini::log " + '${setting}'"
local masked_setting="${setting//./_0X2E_}" # '//' instructs to replace all matches
masked_setting="${masked_setting//-/_0X2D_}"
if [[ -z "${section}" ]]; then
export "FORGEJO____${setting^^}=${value}" # '^^' makes the variable content uppercase
export "FORGEJO____${masked_setting^^}=${value}" # '^^' makes the variable content uppercase
return
fi
local masked_section="${section//./_0X2E_}" # '//' instructs to replace all matches
masked_section="${masked_section//-/_0X2D_}"
export "FORGEJO__${masked_section^^}__${setting^^}=${value}" # '^^' makes the variable content uppercase
export "FORGEJO__${masked_section^^}__${masked_setting^^}=${value}" # '^^' makes the variable content uppercase
}
function env2ini::reload_preset_envs() {