chore(secrets): load API key, connection strings, and AuthBlocks via CredentialTools across all three hosts; strip secret placeholders from appsettings.json
This commit is contained in:
@@ -9,11 +9,15 @@ using DeepDrftContent.Services.FileDatabase.Services;
|
||||
using DeepDrftContent.Services.Processors;
|
||||
using DeepDrftCli.Services;
|
||||
using DeepDrftCli.Models;
|
||||
using NetBlocks.Utilities.Environment;
|
||||
|
||||
var builder = Host.CreateApplicationBuilder(args);
|
||||
|
||||
// Load configuration from environment/config.json
|
||||
builder.Configuration.AddJsonFile($"{AppDomain.CurrentDomain.BaseDirectory}environment/connections.json", optional: false, reloadOnChange: true);
|
||||
var connectionsPath = CredentialTools.ResolvePathOrThrow(
|
||||
"connections",
|
||||
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "environment", "connections.json"));
|
||||
builder.Configuration.AddJsonFile(connectionsPath, optional: false, reloadOnChange: false);
|
||||
var cliSettings = builder.Configuration.GetSection(nameof(CliSettings)).Get<CliSettings>();
|
||||
if (cliSettings is null) { throw new Exception("CLI settings are not configured"); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user