Skip to content

Commit

Permalink
[PM-2594] Added new property "CloudRegion" to GlobalSettings and Conf…
Browse files Browse the repository at this point in the history
…igResponseModel to be able to override the cloud url value for selfhost instances (#3024)

* [PM-2594] Added new property "CloudVault" to GlobalSettings and ConfigResponseModel to be able to override this value for selfhost instances

* [PM-2594] Renamed EnvironmentConfigResponseModel.CloudVault to CloudWebVault

* [PM-2594] Added default value for globalSettings__baseServiceUri__cloudWebVault on EnvironmentFileBuilder

* [PM-2594] Erased CloudWebVault environment variable and added CloudVaultRegion

* [PM-2594] Changed var name on EnvironmentFileBuilder

* [PM-2594] Renamed the env. variable and also the output property to CloudRegion

(cherry picked from commit b151605)
  • Loading branch information
r-tome committed Jul 3, 2023
1 parent 693f79c commit 70eefc5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Api/Models/Response/ConfigResponseModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public ConfigResponseModel(
GitHash = AssemblyHelpers.GetGitHash();
Environment = new EnvironmentConfigResponseModel
{
CloudRegion = globalSettings.BaseServiceUri.CloudRegion,
Vault = globalSettings.BaseServiceUri.Vault,
Api = globalSettings.BaseServiceUri.Api,
Identity = globalSettings.BaseServiceUri.Identity,
Expand All @@ -46,6 +47,7 @@ public class ServerConfigResponseModel

public class EnvironmentConfigResponseModel
{
public string CloudRegion { get; set; }
public string Vault { get; set; }
public string Api { get; set; }
public string Identity { get; set; }
Expand Down
1 change: 1 addition & 0 deletions src/Core/Settings/GlobalSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public BaseServiceUriSettings(GlobalSettings globalSettings)
_globalSettings = globalSettings;
}

public string CloudRegion { get; set; }
public string Vault { get; set; }
public string VaultWithHash => $"{Vault}/#";

Expand Down
1 change: 1 addition & 0 deletions src/Core/Settings/IBaseServiceUriSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace Bit.Core.Settings;

public interface IBaseServiceUriSettings
{
string CloudRegion { get; set; }
string Vault { get; set; }
string VaultWithHash { get; }
string Api { get; set; }
Expand Down
1 change: 1 addition & 0 deletions util/Setup/EnvironmentFileBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ private void Init()
_globalOverrideValues = new Dictionary<string, string>
{
["globalSettings__baseServiceUri__vault"] = _context.Config.Url,
["globalSettings__baseServiceUri__cloudVaultRegion"] = "US",
["globalSettings__sqlServer__connectionString"] = $"\"{dbConnectionString.Replace("\"", "\\\"")}\"",
["globalSettings__identityServer__certificatePassword"] = _context.Install?.IdentityCertPassword,
["globalSettings__internalIdentityKey"] = _context.Stub ? "RANDOM_IDENTITY_KEY" :
Expand Down

0 comments on commit 70eefc5

Please sign in to comment.