Файлы, правки отображения
This commit is contained in:
@@ -1,39 +1,41 @@
|
||||
using Knot.Modules.Messaging;
|
||||
using Knot.Shared.Infrastructure;
|
||||
using Knot.Modules.Auth;
|
||||
using Knot.Modules.Auth.Presentation.Endpoints;
|
||||
using Knot.Modules.Profiles;
|
||||
using Knot.Modules.Profiles.Presentation.Endpoints;
|
||||
using Knot.Modules.Settings;
|
||||
using Knot.Modules.Settings.Presentation.Endpoints;
|
||||
using Knot.Modules.Admin;
|
||||
using Knot.Modules.Conversations;
|
||||
using Knot.Modules.Conversations.Infrastructure.SignalR;
|
||||
using Knot.Modules.Conversations.Presentation.Endpoints;
|
||||
using Knot.Modules.Auth.Infrastructure.Persistence;
|
||||
using Knot.Modules.Conversations.Infrastructure.Persistence;
|
||||
using Knot.Modules.Storage;
|
||||
using Knot.Modules.Stories;
|
||||
using Knot.Modules.Stories.Presentation.Endpoints;
|
||||
using Knot.Modules.Klipy;
|
||||
using Knot.Modules.Federation;
|
||||
using Knot.Modules.WebRtc;
|
||||
using Knot.Modules.WebRtc.Presentation.Endpoints;
|
||||
using Knot.Modules.TelegramImport;
|
||||
using Knot.Modules.TelegramImport.Presentation.Endpoints;
|
||||
using Knot.Modules.Relations;
|
||||
using Knot.Modules.Relations.Presentation.Endpoints;
|
||||
using Host.Endpoints;
|
||||
using Knot.Host.Presentation.Endpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using System.Text;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Security.Claims;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using Knot.Modules.Admin;
|
||||
using Knot.Modules.Admin.Presentation.Endpoints;
|
||||
using Knot.Modules.Auth;
|
||||
using Knot.Modules.Auth.Infrastructure.Persistence;
|
||||
using Knot.Modules.Auth.Presentation.Endpoints;
|
||||
using Knot.Modules.Conversations;
|
||||
using Knot.Modules.Conversations.Infrastructure.Persistence;
|
||||
using Knot.Modules.Conversations.Infrastructure.SignalR;
|
||||
using Knot.Modules.Conversations.Presentation.Endpoints;
|
||||
using Knot.Modules.Federation;
|
||||
using Knot.Modules.Federation.Presentation.Endpoints;
|
||||
using Knot.Modules.Klipy;
|
||||
using Knot.Modules.Klipy.Presentation.Endpoints;
|
||||
using Knot.Modules.Messaging;
|
||||
using Knot.Modules.Profiles;
|
||||
using Knot.Modules.Profiles.Presentation.Endpoints;
|
||||
using Knot.Modules.Relations;
|
||||
using Knot.Modules.Relations.Presentation.Endpoints;
|
||||
using Knot.Modules.Settings;
|
||||
using Knot.Modules.Settings.Presentation.Endpoints;
|
||||
using Knot.Modules.Storage;
|
||||
using Knot.Modules.Storage.Presentation.Endpoints;
|
||||
using Knot.Modules.Stories;
|
||||
using Knot.Modules.Stories.Presentation.Endpoints;
|
||||
using Knot.Modules.TelegramImport;
|
||||
using Knot.Modules.TelegramImport.Presentation.Endpoints;
|
||||
using Knot.Modules.WebRtc;
|
||||
using Knot.Modules.WebRtc.Presentation.Endpoints;
|
||||
using Knot.Shared.Infrastructure;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
|
||||
|
||||
|
||||
@@ -72,6 +74,7 @@ builder.Services.AddSettingsModule(builder.Configuration);
|
||||
builder.Services.AddMessagingModule(builder.Configuration);
|
||||
builder.Services.AddConversationsModule(builder.Configuration);
|
||||
builder.Services.AddProfilesModule(builder.Configuration);
|
||||
builder.Services.AddRelationsModule(builder.Configuration);
|
||||
builder.Services.AddStorageModule(builder.Configuration);
|
||||
builder.Services.AddStoriesModule(builder.Configuration);
|
||||
builder.Services.AddKlipyModule();
|
||||
@@ -86,7 +89,8 @@ builder.Services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblies(
|
||||
typeof(Knot.Modules.Messaging.DependencyInjection).Assembly,
|
||||
typeof(Knot.Modules.Conversations.DependencyInjection).Assembly,
|
||||
typeof(Knot.Modules.Stories.DependencyInjection).Assembly,
|
||||
typeof(Knot.Modules.Klipy.DependencyInjection).Assembly
|
||||
typeof(Knot.Modules.Klipy.DependencyInjection).Assembly,
|
||||
typeof(Knot.Modules.Relations.DependencyInjection).Assembly
|
||||
));
|
||||
|
||||
// Настройка CORS
|
||||
@@ -96,9 +100,9 @@ builder.Services.AddCors(options =>
|
||||
{
|
||||
var originsFromConfig = builder.Configuration["Cors:Origins"];
|
||||
var domain = builder.Configuration["DOMAIN"];
|
||||
|
||||
var origins = !string.IsNullOrEmpty(originsFromConfig)
|
||||
? originsFromConfig.Split(',')
|
||||
|
||||
var origins = !string.IsNullOrEmpty(originsFromConfig)
|
||||
? originsFromConfig.Split(',')
|
||||
: (!string.IsNullOrEmpty(domain) ? new[] { $"https://{domain}" } : new[] { "*" });
|
||||
|
||||
var corsBuilder = policy.WithOrigins(origins)
|
||||
@@ -120,7 +124,7 @@ builder.Services.AddCors(options =>
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
// Настройка маршрутизации
|
||||
builder.Services.AddRouting(options =>
|
||||
builder.Services.AddRouting(options =>
|
||||
{
|
||||
options.LowercaseUrls = true;
|
||||
options.LowercaseQueryStrings = true;
|
||||
@@ -184,7 +188,7 @@ using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
var identityDb = scope.ServiceProvider.GetRequiredService<AuthDbContext>();
|
||||
await identityDb.Database.MigrateAsync();
|
||||
|
||||
|
||||
var chatsDb = scope.ServiceProvider.GetRequiredService<Knot.Modules.Conversations.Infrastructure.Persistence.ChatsDbContext>();
|
||||
await chatsDb.Database.MigrateAsync();
|
||||
|
||||
@@ -194,6 +198,9 @@ using (var scope = app.Services.CreateScope())
|
||||
var storiesDb = scope.ServiceProvider.GetRequiredService<Knot.Modules.Stories.Infrastructure.Database.StoriesDbContext>();
|
||||
await storiesDb.Database.MigrateAsync();
|
||||
|
||||
var relationsDb = scope.ServiceProvider.GetRequiredService<Knot.Modules.Relations.Infrastructure.Persistence.RelationsDbContext>();
|
||||
await relationsDb.Database.MigrateAsync();
|
||||
|
||||
// Set Encryption Service for MongoDB serializers
|
||||
var encryptionService = scope.ServiceProvider.GetRequiredService<Knot.Shared.Kernel.Security.IEncryptionService>();
|
||||
Knot.Modules.Messaging.Infrastructure.Persistence.Mongo.EncryptedStringSerializer.EncryptionService = encryptionService;
|
||||
|
||||
Reference in New Issue
Block a user