From 7724109caaebade257e68c122b9efef8ab53552a Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 15 Mar 2019 11:19:52 -0400 Subject: [PATCH] placeholders for random values --- util/Setup/CertBuilder.cs | 3 ++- util/Setup/EnvironmentFileBuilder.cs | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/util/Setup/CertBuilder.cs b/util/Setup/CertBuilder.cs index b514787ca1..9a729fea8c 100644 --- a/util/Setup/CertBuilder.cs +++ b/util/Setup/CertBuilder.cs @@ -57,7 +57,8 @@ namespace Bit.Setup _context.Install.Trusted = true; _context.Install.DiffieHellman = true; Directory.CreateDirectory($"/bitwarden/letsencrypt/live/{_context.Install.Domain}/"); - Helpers.Exec($"openssl dhparam -out /bitwarden/letsencrypt/live/{_context.Install.Domain}/dhparam.pem 2048"); + Helpers.Exec($"openssl dhparam -out " + + $"/bitwarden/letsencrypt/live/{_context.Install.Domain}/dhparam.pem 2048"); } else if(_context.Config.Ssl && !_context.Install.SelfSignedCert) { diff --git a/util/Setup/EnvironmentFileBuilder.cs b/util/Setup/EnvironmentFileBuilder.cs index 2369f185b3..92e6e30967 100644 --- a/util/Setup/EnvironmentFileBuilder.cs +++ b/util/Setup/EnvironmentFileBuilder.cs @@ -68,7 +68,7 @@ namespace Bit.Setup private void Init() { - var dbPassword = _context.Stub ? "DATABASE_PASSWORD" : Helpers.SecureRandomString(32); + var dbPassword = _context.Stub ? "RANDOM_DATABASE_PASSWORD" : Helpers.SecureRandomString(32); var dbConnectionString = new SqlConnectionStringBuilder { DataSource = "tcp:mssql,1433", @@ -96,8 +96,10 @@ namespace Bit.Setup ["globalSettings__dataProtection__directory"] = $"{_context.OutputDir}/core/aspnet-dataprotection", ["globalSettings__logDirectory"] = $"{_context.OutputDir}/logs", ["globalSettings__licenseDirectory"] = $"{_context.OutputDir}/core/licenses", - ["globalSettings__internalIdentityKey"] = Helpers.SecureRandomString(64, alpha: true, numeric: true), - ["globalSettings__duo__aKey"] = Helpers.SecureRandomString(64, alpha: true, numeric: true), + ["globalSettings__internalIdentityKey"] = _context.Stub ? "RANDOM_IDENTITY_KEY" : + Helpers.SecureRandomString(64, alpha: true, numeric: true), + ["globalSettings__duo__aKey"] = _context.Stub ? "RANDOM_DUO_AKEY" : + Helpers.SecureRandomString(64, alpha: true, numeric: true), ["globalSettings__installation__id"] = _context.Install?.InstallationId.ToString(), ["globalSettings__installation__key"] = _context.Install?.InstallationKey, ["globalSettings__yubico__clientId"] = "REPLACE",