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

Additional cleanup

This commit is contained in:
Hinton 2025-05-01 14:14:26 +02:00
parent 107e2fc0c3
commit 01093e8bbd
No known key found for this signature in database
GPG Key ID: 5F7295599C5D965C
3 changed files with 2 additions and 36 deletions

View File

@ -9,15 +9,7 @@ public static class GlobalSettingsFactory
public static GlobalSettings GlobalSettings
{
get
{
if (_globalSettings == null)
{
_globalSettings = LoadGlobalSettings();
}
return _globalSettings;
}
get { return _globalSettings ??= LoadGlobalSettings(); }
}
private static GlobalSettings LoadGlobalSettings()
@ -34,32 +26,9 @@ public static class GlobalSettingsFactory
var configuration = configBuilder.Build();
var globalSettingsSection = configuration.GetSection("globalSettings");
// Debug: Print all settings from globalSettings section
foreach (var setting in globalSettingsSection.GetChildren())
{
Console.WriteLine($"Found setting: {setting.Key}");
foreach (var child in setting.GetChildren())
{
Console.WriteLine($" - {setting.Key}.{child.Key}");
}
}
var settings = new GlobalSettings();
globalSettingsSection.Bind(settings);
// Output the loaded settings
Console.WriteLine($"Loaded DatabaseProvider: {settings.DatabaseProvider}");
Console.WriteLine($"PostgreSql settings loaded: {settings.PostgreSql != null}");
Console.WriteLine($"SqlServer settings loaded: {settings.SqlServer != null}");
Console.WriteLine($"MySql settings loaded: {settings.MySql != null}");
Console.WriteLine($"Sqlite settings loaded: {settings.Sqlite != null}");
// Check for case sensitivity issue with PostgreSql/postgresql keys
var postgresqlValue = globalSettingsSection.GetSection("postgresql")?.Value;
var postgreSqlValue = globalSettingsSection.GetSection("postgreSql")?.Value;
Console.WriteLine($"Raw check - postgresql setting exists: {postgresqlValue != null}");
Console.WriteLine($"Raw check - postgreSql setting exists: {postgreSqlValue != null}");
return settings;
}
}

View File

@ -9,9 +9,6 @@ public class Program
{
private static int Main(string[] args)
{
// Ensure global settings are loaded
var globalSettings = GlobalSettingsFactory.GlobalSettings;
return new AppRunner<Program>()
.Run(args);
}

View File

@ -26,4 +26,4 @@
<Compile Remove="..\..\Program.cs" />
</ItemGroup>
</Project>
</Project>