Fixed config usages.

This commit is contained in:
Ruberoid 2025-07-18 17:11:55 +03:00
parent 1dddca85ba
commit ebbec35e62
9 changed files with 19 additions and 114 deletions

2
.gitignore vendored
View File

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

View File

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

View File

@ -1,18 +0,0 @@
{
"Serilog": {
"WriteTo": [
{
"Name": "Console",
"Args": {
"outputTemplate": "[{Level:u3}] {Timestamp:MM-dd HH:mm:ss} {TraceId} {SourceContext:l} {Message:lj}{NewLine}{Exception}"
}
}
]
},
"RebusRabbitMqOptions": {
"ConnectionString": "amqp://admin:admin@localhost:5672/"
},
"ConnectionStrings": {
"TextMatcherContext": "server=localhost;port=3306;database=nocr_text_matcher;uid=root;pwd=toor"
}
}

View File

@ -1,31 +0,0 @@
{
"Serilog": {
"MinimumLevel": {
"Default": "Information"
},
"WriteTo": [
{
"Name": "Console",
"Args": {
"outputTemplate": "[{Level:u3}] {Timestamp:MM-dd HH:mm:ss} {TraceId} {SourceContext:l} {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "File",
"Args": {
"path": "/var/log/nocr/text-matcher/nocr-text-matcher-.log",
"outputTemplate": "[{Level:u3}] {Timestamp:dd-MM-yyyy HH:mm:ss} {TraceId} {SourceContext:l} {Message:lj}{NewLine}{Exception}",
"fileSizeLimitBytes": 104857600,
"rollingInterval": "Day",
"rollOnFileSizeLimit": true
}
}
]
},
"RebusRabbitMqOptions": {
"ConnectionString": "amqp://admin:admin@nocr-rabbitmq:5672/"
},
"ConnectionStrings": {
"TextMatcherContext": "server=nocr-text-matcher-db;port=3306;database=nocr_text_matcher;uid=root;pwd=toor"
}
}

View File

@ -1,28 +0,0 @@
{
"Serilog": {
"MinimumLevel": {
"Default": "Information"
},
"WriteTo": [
{
"Name": "Console",
"Args": {
"outputTemplate": "[{Level:u3}] {Timestamp:MM-dd HH:mm:ss} {TraceId} {SourceContext:l} {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "File",
"Args": {
"path": "/var/log/nocr/text-matcher/nocr-text-matcher-.log",
"outputTemplate": "[{Level:u3}] {Timestamp:dd-MM-yyyy HH:mm:ss} {TraceId} {SourceContext:l} {Message:lj}{NewLine}{Exception}",
"fileSizeLimitBytes": 104857600,
"rollingInterval": "Day",
"rollOnFileSizeLimit": true
}
}
]
},
"RebusRabbitMqOptions": {
"ConnectionString": "amqp://admin:admin@nocr-rabbitmq:5672/"
}
}

View File

@ -6,11 +6,23 @@
"Microsoft": "Information",
"Microsoft.AspNetCore": "Error",
"System.Net.Http.HttpClient": "Warning",
"Rebus": "Warning"
"Rebus": "Debug"
}
}
},
"WriteTo": [
{
"Name": "Console",
"Args": {
"outputTemplate": "[{Level:u3}] {Timestamp:MM-dd HH:mm:ss} {TraceId} {SourceContext:l} {Message:lj}{NewLine}{Exception}"
}
}
]
},
"ConnectionStrings": {
"TextMatcherContext": ""
},
"RebusRabbitMqOptions": {
"ConnectionString": "",
"InputQueueName": "nocr.text.matcher.queue",
"DirectExchangeName": "nocr.direct",
"TopicsExchangeName": "nocr.topics",

View File

@ -1,31 +0,0 @@
{
"Serilog": {
"MinimumLevel": {
"Default": "Information"
},
"WriteTo": [
{
"Name": "Console",
"Args": {
"outputTemplate": "[{Level:u3}] {Timestamp:MM-dd HH:mm:ss} {TraceId} {SourceContext:l} {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "File",
"Args": {
"path": "/var/log/nocr/text-matcher/nocr-text-matcher-.log",
"outputTemplate": "[{Level:u3}] {Timestamp:dd-MM-yyyy HH:mm:ss} {TraceId} {SourceContext:l} {Message:lj}{NewLine}{Exception}",
"fileSizeLimitBytes": 104857600,
"rollingInterval": "Day",
"rollOnFileSizeLimit": true
}
}
]
},
"RebusRabbitMqOptions": {
"ConnectionString": ""
},
"ConnectionStrings": {
"TextMatcherContext": ""
}
}

View File

@ -16,6 +16,7 @@ public class DesignTimeTextMatcherContextFactory : IDesignTimeDbContextFactory<T
var configuration = new ConfigurationBuilder()
.SetBasePath(AppDomain.CurrentDomain.BaseDirectory)
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddJsonFile("appsettings.protected.json", optional: false, reloadOnChange: true)
.AddEnvironmentVariables()
.Build();

View File

@ -1,7 +1,7 @@
{
"ConnectionStrings": {
"Development": "server=localhost;port=3306;database=nocr_text_matcher;uid=root;pwd=toor",
"DockerCompose": "server=nocr-text-matcher-db;port=3306;database=nocr_text_matcher;uid=root;pwd=toor",
"Development": "",
"DockerCompose": "",
"k8s": ""
}
}