Fixed configs.

This commit is contained in:
Ruberoid 2025-07-18 17:19:03 +03:00
parent b7736a1891
commit fc2e511985
9 changed files with 17 additions and 98 deletions

2
.gitignore vendored
View File

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

View File

@ -12,7 +12,7 @@ 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", true); configurationBuilder.AddJsonFile("appsettings.protected.json", optional: true);
}) })
.ConfigureWebHostDefaults(host => { host.UseStartup<TStartup>(); }) .ConfigureWebHostDefaults(host => { host.UseStartup<TStartup>(); })
.UseSerilog((ctx, logBuilder) => .UseSerilog((ctx, logBuilder) =>

View File

@ -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}"
}
}
]
},
"ConnectionStrings": {
"UsersContext": "server=localhost;port=3307;database=nocr_users;uid=root;pwd=toor"
}
}

View File

@ -1,25 +0,0 @@
{
"Serilog": {
"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/users-.log",
"outputTemplate": "[{Level:u3}] {Timestamp:dd-MM-yyyy HH:mm:ss} {TraceId} {SourceContext:l} {Message:lj}{NewLine}{Exception}",
"fileSizeLimitBytes": 104857600,
"rollingInterval": "Day",
"rollOnFileSizeLimit": true
}
}
]
},
"ConnectionStrings": {
"UsersContext": "server=nocr-users-db;port=3306;database=nocr_users;uid=root;pwd=toor"
}
}

View File

@ -1,25 +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/users-.log",
"outputTemplate": "[{Level:u3}] {Timestamp:dd-MM-yyyy HH:mm:ss} {TraceId} {SourceContext:l} {Message:lj}{NewLine}{Exception}",
"fileSizeLimitBytes": 104857600,
"rollingInterval": "Day",
"rollOnFileSizeLimit": true
}
}
]
}
}

View File

@ -7,6 +7,17 @@
"Microsoft.AspNetCore": "Error", "Microsoft.AspNetCore": "Error",
"System.Net.Http.HttpClient": "Warning" "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}"
}
}
]
},
"ConnectionStrings": {
"UsersContext": ""
} }
} }

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/users/nocr-users-.log",
"outputTemplate": "[{Level:u3}] {Timestamp:dd-MM-yyyy HH:mm:ss} {TraceId} {SourceContext:l} {Message:lj}{NewLine}{Exception}",
"fileSizeLimitBytes": 104857600,
"rollingInterval": "Day",
"rollOnFileSizeLimit": true
}
}
]
},
"ConnectionStrings": {
"UsersContext": ""
}
}

View File

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

View File

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