From 5a3f266bbc12c1806ac1ba864b3dcbe7d02cd655 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Wed, 12 Feb 2025 10:58:28 +0100 Subject: [PATCH] fix(config): mask special chars in setting keys --- templates/gitea/config.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/templates/gitea/config.yaml b/templates/gitea/config.yaml index 20a6d23..c551c96 100644 --- a/templates/gitea/config.yaml +++ b/templates/gitea/config.yaml @@ -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() {