From fab720db5f0b09c8e56c9fb178ac0a293e82cf12 Mon Sep 17 00:00:00 2001 From: bcmmbaga Date: Fri, 14 Aug 2026 19:35:19 +0300 Subject: [PATCH] quote and escape the DSN written to .env --- infrastructure_files/migrate-to-enterprise.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infrastructure_files/migrate-to-enterprise.sh b/infrastructure_files/migrate-to-enterprise.sh index 6475e46da..c9baf5689 100755 --- a/infrastructure_files/migrate-to-enterprise.sh +++ b/infrastructure_files/migrate-to-enterprise.sh @@ -282,10 +282,10 @@ detect_postgres_depends_condition() { fi } -# Compose interpolates .env values, so a literal $ has to be written as $$. env_value() { local value="$1" - printf '%s' "$value" | sed 's/\$/$$/g' + value=$(printf '%s' "$value" | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/\$/$$/g') + printf '"%s"' "$value" } detect_compose_network() {