Fixed nice configs.
This commit is contained in:
parent
269826b70f
commit
6c74bdbefc
2
.gitignore
vendored
2
.gitignore
vendored
@ -230,6 +230,6 @@ Thumbs.db
|
||||
.idea/
|
||||
|
||||
# custom
|
||||
/**/**/appsettings.protected.json
|
||||
/**/**/appsettings.*.json
|
||||
|
||||
**/**/deployment.yml
|
||||
|
||||
@ -7,14 +7,14 @@ public class HostBuilderFactory<TStartup> where TStartup : class
|
||||
public IHostBuilder CreateHostBuilder(string[] args, string? baseDirectory = null)
|
||||
{
|
||||
var builder = Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder(args)
|
||||
.ConfigureWebHostDefaults(host => { host.UseStartup<TStartup>(); })
|
||||
.ConfigureAppConfiguration((_, configurationBuilder) =>
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(baseDirectory))
|
||||
configurationBuilder.SetBasePath(baseDirectory);
|
||||
|
||||
configurationBuilder.AddJsonFile(".secrets/appsettings.protected.json", true);
|
||||
configurationBuilder.AddJsonFile("appsettings.protected.json", optional: true);
|
||||
})
|
||||
.ConfigureWebHostDefaults(host => { host.UseStartup<TStartup>(); })
|
||||
.UseSerilog((ctx, logBuilder) =>
|
||||
{
|
||||
logBuilder.ReadFrom.Configuration(ctx.Configuration)
|
||||
|
||||
@ -31,14 +31,6 @@ public class Startup
|
||||
builder.Transport(t =>
|
||||
{
|
||||
var rebusOptions = ctx.GetRequiredService<IOptions<RebusRabbitMqOptions>>().Value;
|
||||
|
||||
Console.WriteLine("*** DEBUG ***");
|
||||
|
||||
Console.WriteLine(Environment.GetEnvironmentVariable("RebusRabbitMqOptions__ConnectionString"));
|
||||
Console.WriteLine(rebusOptions.ConnectionString);
|
||||
|
||||
Console.WriteLine("*** DEBUG ***");
|
||||
|
||||
t.UseRabbitMq(rebusOptions.ConnectionString, rebusOptions.InputQueueName)
|
||||
.DefaultQueueOptions(queue => queue.SetDurable(true))
|
||||
.ExchangeNames(rebusOptions.DirectExchangeName, rebusOptions.TopicsExchangeName);
|
||||
|
||||
@ -1,15 +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/"
|
||||
}
|
||||
}
|
||||
@ -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/telegram-listener/telegram-listener-.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/"
|
||||
}
|
||||
}
|
||||
@ -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/telegram-listener/telegram-listener-.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": ""
|
||||
}
|
||||
}
|
||||
@ -7,11 +7,25 @@
|
||||
"Microsoft.AspNetCore": "Error",
|
||||
"System.Net.Http.HttpClient": "Warning"
|
||||
}
|
||||
}
|
||||
},
|
||||
"WriteTo": [
|
||||
{
|
||||
"Name": "Console",
|
||||
"Args": {
|
||||
"outputTemplate": "[{Level:u3}] {Timestamp:MM-dd HH:mm:ss} {TraceId} {SourceContext:l} {Message:lj}{NewLine}{Exception}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"RebusRabbitMqOptions": {
|
||||
"ConnectionString": "",
|
||||
"InputQueueName": "nocr.telegram.listener.queue",
|
||||
"DirectExchangeName": "nocr.direct",
|
||||
"TopicsExchangeName": "nocr.topics"
|
||||
},
|
||||
"WTelegramClientOptions": {
|
||||
"ApiId": "",
|
||||
"ApiHash": "",
|
||||
"PhoneNumber": ""
|
||||
}
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
{
|
||||
"Serilog": {
|
||||
"MinimumLevel": {
|
||||
"Default": "Debug"
|
||||
},
|
||||
"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/telegram-listener/telegram-listener-.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": ""
|
||||
},
|
||||
"WTelegramClientOptions": {
|
||||
"ApiId": "",
|
||||
"ApiHash": "",
|
||||
"PhoneNumber": ""
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user