Add protected files support

This commit is contained in:
Sergey Nazarov 2024-03-19 20:26:42 +04:00
parent 2976bd0d83
commit 09f42d2f2b
2 changed files with 3 additions and 1 deletions

2
.gitignore vendored
View File

@ -226,6 +226,6 @@ Thumbs.db
.idea/ .idea/
# custom # custom
/*/appsettings.protected.json /**/**/appsettings.protected.json
**/**/deployment.yml **/**/deployment.yml

View File

@ -11,6 +11,8 @@ public class HostBuilderFactory<TStartup> where TStartup : class
{ {
if (!string.IsNullOrWhiteSpace(baseDirectory)) if (!string.IsNullOrWhiteSpace(baseDirectory))
configurationBuilder.SetBasePath(baseDirectory); configurationBuilder.SetBasePath(baseDirectory);
configurationBuilder.AddJsonFile("appsettings.protected.json", false);
}) })
.ConfigureWebHostDefaults(host => { host.UseStartup<TStartup>(); }) .ConfigureWebHostDefaults(host => { host.UseStartup<TStartup>(); })
.UseSerilog((ctx, logBuilder) => .UseSerilog((ctx, logBuilder) =>