From 0f7963f79c3856f34ce59e89da9e5826e81fb4cf Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 15 Mar 2019 09:28:39 -0400 Subject: [PATCH] stub install --- util/Setup/CertBuilder.cs | 9 +++++++++ util/Setup/Context.cs | 1 + util/Setup/Program.cs | 12 +++++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/util/Setup/CertBuilder.cs b/util/Setup/CertBuilder.cs index b6582b6d2a..fe786bedb8 100644 --- a/util/Setup/CertBuilder.cs +++ b/util/Setup/CertBuilder.cs @@ -14,6 +14,15 @@ namespace Bit.Setup public void BuildForInstall() { + if(_context.Stub) + { + _context.Config.Ssl = true; + _context.Install.Trusted = true; + _context.Install.SelfSignedCert = false; + _context.Install.DiffieHellman = false; + return; + } + _context.Config.Ssl = _context.Config.SslManagedLetsEncrypt; if(!_context.Config.Ssl) diff --git a/util/Setup/Context.cs b/util/Setup/Context.cs index 8c7fc22a6d..c76c62f605 100644 --- a/util/Setup/Context.cs +++ b/util/Setup/Context.cs @@ -12,6 +12,7 @@ namespace Bit.Setup public string[] Args { get; set; } public bool Quiet { get; set; } + public bool Stub { get; set; } public IDictionary Parameters { get; set; } public string OutputDir { get; set; } = "/etc/bitwarden"; public string HostOS { get; set; } = "win"; diff --git a/util/Setup/Program.cs b/util/Setup/Program.cs index 881fd6267a..1934022bc1 100644 --- a/util/Setup/Program.cs +++ b/util/Setup/Program.cs @@ -36,6 +36,11 @@ namespace Bit.Setup { _context.WebVersion = _context.Parameters["webv"]; } + if(_context.Parameters.ContainsKey("stub")) + { + _context.Stub = _context.Parameters["stub"] == "true" || + _context.Parameters["stub"] == "1"; + } Helpers.WriteLine(_context); @@ -69,7 +74,12 @@ namespace Bit.Setup _context.Install.Domain = _context.Parameters["domain"].ToLowerInvariant(); } - if(!ValidateInstallation()) + if(_context.Stub) + { + _context.Install.InstallationId = Guid.Empty; + _context.Install.InstallationKey = "SECRET_INSTALLATION_KEY"; + } + else if(!ValidateInstallation()) { return; }