From ff8d736e8b7ce4c8c91b6eb04b4ea375c9827139 Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Thu, 16 Sep 2021 10:54:46 -0400 Subject: [PATCH] Fix SQL Connection String (#1584) * Update SQL connection string storage method * Revert Docker Compose template * Revert Docker Compose Builder version back to 3 --- util/Setup/EnvironmentFileBuilder.cs | 4 ++-- util/Setup/Helpers.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/util/Setup/EnvironmentFileBuilder.cs b/util/Setup/EnvironmentFileBuilder.cs index b52537b684..224c954086 100644 --- a/util/Setup/EnvironmentFileBuilder.cs +++ b/util/Setup/EnvironmentFileBuilder.cs @@ -75,7 +75,7 @@ namespace Bit.Setup _globalOverrideValues = new Dictionary { ["globalSettings__baseServiceUri__vault"] = _context.Config.Url, - ["globalSettings__sqlServer__connectionString"] = $"'{dbConnectionString}'", + ["globalSettings__sqlServer__connectionString"] = $"\"{dbConnectionString.Replace("\"", "\\\"")}\"", ["globalSettings__identityServer__certificatePassword"] = _context.Install?.IdentityCertPassword, ["globalSettings__internalIdentityKey"] = _context.Stub ? "RANDOM_IDENTITY_KEY" : Helpers.SecureRandomString(64, alpha: true, numeric: true), @@ -142,7 +142,7 @@ namespace Bit.Setup } else { - _values.Add(lineParts[0], value); + _values.Add(lineParts[0], value.Replace("\\\"", "\"")); } } } diff --git a/util/Setup/Helpers.cs b/util/Setup/Helpers.cs index 66ec19271b..2b19e9ef5a 100644 --- a/util/Setup/Helpers.cs +++ b/util/Setup/Helpers.cs @@ -105,7 +105,7 @@ namespace Bit.Setup { if (line.StartsWith($"{key}=")) { - return line.Split(new char[] { '=' }, 2)[1].Trim('"'); + return line.Split(new char[] { '=' }, 2)[1].Trim('"').Replace("\\\"", "\""); } }