1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 16:12:49 -05:00

Feature/self hosted development (#1921)

* Add self-host option to migration runner

* Add Self-host launch options

* Add self-hosted settings override

Let's a single secrets/env config file control both
cloud and self-hosted settings by allowing
overrides to cloud settings with self-hosted

* Allow dev-signed licenses on dev self-hosted

* Allow setting bitwarden cloud api url

Useful for testing api integration between installations and cloud

* Remove testing echoes

* Remove run config property groups

* Use `getopts` for options

* Pass in full environment
This commit is contained in:
Matt Gibson
2022-03-21 18:13:00 -04:00
committed by GitHub
parent dea1427ba2
commit 4814cef245
23 changed files with 564 additions and 28 deletions

View File

@ -462,10 +462,17 @@ namespace Bit.SharedWeb.Utilities
}
public static GlobalSettings AddGlobalSettingsServices(this IServiceCollection services,
IConfiguration configuration)
IConfiguration configuration, IWebHostEnvironment environment)
{
var globalSettings = new GlobalSettings();
ConfigurationBinder.Bind(configuration.GetSection("GlobalSettings"), globalSettings);
if (environment.IsDevelopment() && configuration.GetValue<bool>("developSelfHosted"))
{
// Override settings with selfHostedOverride settings
ConfigurationBinder.Bind(configuration.GetSection("Dev:SelfHostOverride:GlobalSettings"), globalSettings);
}
services.AddSingleton(s => globalSettings);
services.AddSingleton<IGlobalSettings, GlobalSettings>(s => globalSettings);
return globalSettings;