diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index d5da2d7..ee1e6b0 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -23,11 +23,14 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: '7.0.x' - include-prerelease: true + dotnet-version: '8.0' +# include-prerelease: true + - name: Restore dependencies run: dotnet restore *.sln + - name: Build run: dotnet build --no-restore *.sln + - name: Test run: dotnet test --no-build --verbosity normal *.sln diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index 5483a08..53537ab 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -34,7 +34,7 @@ jobs: - name: Setup dotnet uses: actions/setup-dotnet@v1 with: - dotnet-version: 7.0.x + dotnet-version: '8.0' # Publish - name: Build, Pack & Publish ${{ matrix.project.name }} to ${{ matrix.nuget.name }} diff --git a/Directory.Build.props b/Directory.Build.props index 7d1c136..5154ce7 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -5,7 +5,7 @@ latest 3.1 - rc4 + rc5 Sakura Akeno Isayeki Nodsoft Systems diff --git a/SocialGuard.Api.DbMigrator/SocialGuard.Api.DbMigrator.csproj b/SocialGuard.Api.DbMigrator/SocialGuard.Api.DbMigrator.csproj index 11f129b..4a2902f 100644 --- a/SocialGuard.Api.DbMigrator/SocialGuard.Api.DbMigrator.csproj +++ b/SocialGuard.Api.DbMigrator/SocialGuard.Api.DbMigrator.csproj @@ -1,15 +1,15 @@ - net6.0 + net8.0 enable enable dotnet-SocialGuard.Api.DbMigrator-3AA5545F-89A5-43BD-81AE-EEB10C452C57 - - + + diff --git a/SocialGuard.Api/Program.cs b/SocialGuard.Api/Program.cs index c06e443..e03a5ee 100644 --- a/SocialGuard.Api/Program.cs +++ b/SocialGuard.Api/Program.cs @@ -50,6 +50,6 @@ public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup()) - .UseSerilog(); + .UseSerilog((hostingCtx, config) => config.ReadFrom.Configuration(hostingCtx.Configuration)); } } diff --git a/SocialGuard.Api/Services/Authentication/AuthenticationService.cs b/SocialGuard.Api/Services/Authentication/AuthenticationService.cs index 033392e..4e2350f 100644 --- a/SocialGuard.Api/Services/Authentication/AuthenticationService.cs +++ b/SocialGuard.Api/Services/Authentication/AuthenticationService.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Identity; using Microsoft.IdentityModel.Tokens; using SocialGuard.Common.Data.Models.Authentication; using System.IdentityModel.Tokens.Jwt; @@ -141,4 +141,4 @@ public record AuthServiceResponse public Response Response { get; init; } } -public record AuthServiceResponse : AuthServiceResponse; \ No newline at end of file +public sealed record AuthServiceResponse : AuthServiceResponse; \ No newline at end of file diff --git a/SocialGuard.Api/SocialGuard.Api.csproj b/SocialGuard.Api/SocialGuard.Api.csproj index e56703c..74a8595 100644 --- a/SocialGuard.Api/SocialGuard.Api.csproj +++ b/SocialGuard.Api/SocialGuard.Api.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 328b09f5-4635-4228-b9af-a4f5bab47844 true @@ -16,28 +16,25 @@ - - - - - - - - - - + + + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - + + + + + + + diff --git a/SocialGuard.Api/Startup.cs b/SocialGuard.Api/Startup.cs index d6120b0..8bfd76a 100644 --- a/SocialGuard.Api/Startup.cs +++ b/SocialGuard.Api/Startup.cs @@ -22,247 +22,246 @@ using SocialGuard.Api.Services.Admin; -namespace SocialGuard.Api +namespace SocialGuard.Api; + +public class Startup { - public class Startup + public Startup(IConfiguration configuration) { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } + Configuration = configuration; + } - public IConfiguration Configuration { get; } - public static string Version { get; } = typeof(Startup).Assembly.GetCustomAttribute()?.InformationalVersion; + public IConfiguration Configuration { get; } + public static string Version { get; } = typeof(Startup).Assembly.GetCustomAttribute()?.InformationalVersion; - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddControllers(config => { config.ModelBinderProviders.Insert(0, new CommaSeparatedArrayModelBinderProvider()); }); + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddControllers(config => { config.ModelBinderProviders.Insert(0, new CommaSeparatedArrayModelBinderProvider()); }); - services.AddApiVersioning(config => - { - config.DefaultApiVersion = new(3, 1, "rc1"); - config.AssumeDefaultVersionWhenUnspecified = true; - config.ReportApiVersions = true; - } - ); + services.AddApiVersioning(config => + { + config.DefaultApiVersion = new(3, 1, "rc1"); + config.AssumeDefaultVersionWhenUnspecified = true; + config.ReportApiVersions = true; + } + ); - services.AddVersionedApiExplorer(options => - { - // add the versioned api explorer, which also adds IApiVersionDescriptionProvider service - // note: the specified format code will format the version as "'v'major[.minor][-status]" - options.GroupNameFormat = "'v'VVV"; + services.AddVersionedApiExplorer(options => + { + // add the versioned api explorer, which also adds IApiVersionDescriptionProvider service + // note: the specified format code will format the version as "'v'major[.minor][-status]" + options.GroupNameFormat = "'v'VVV"; - // note: this option is only necessary when versioning by url segment. the SubstitutionFormat - // can also be used to control the format of the API version in route templates - options.SubstituteApiVersionInUrl = true; - } - ); + // note: this option is only necessary when versioning by url segment. the SubstitutionFormat + // can also be used to control the format of the API version in route templates + options.SubstituteApiVersionInUrl = true; + } + ); - string dbConnectionString = Configuration.GetConnectionString("Database"); + string dbConnectionString = Configuration.GetConnectionString("Database"); - services.AddDbContextPool(o => - o.UseNpgsql(dbConnectionString, p => - p.EnableRetryOnFailure() - ) - .UseSnakeCaseNamingConvention() - ); + services.AddDbContextPool(o => + o.UseNpgsql(dbConnectionString, p => + p.EnableRetryOnFailure() + ) + .UseSnakeCaseNamingConvention() + ); - services.AddDbContextPool(o => - o.UseNpgsql(dbConnectionString, p => - p.EnableRetryOnFailure() - ) - .UseSnakeCaseNamingConvention() - ); + services.AddDbContextPool(o => + o.UseNpgsql(dbConnectionString, p => + p.EnableRetryOnFailure() + ) + .UseSnakeCaseNamingConvention() + ); + + services.AddTransient, ConfigureSwaggerOptions>(); - services.AddTransient, ConfigureSwaggerOptions>(); + services.AddSwaggerGen(options => + { + options.OperationFilter(); + + // Set the comments path for the Swagger JSON and UI. + string xmlFile = $"{typeof(Startup).Assembly.GetName().Name}.xml"; + string xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); + options.IncludeXmlComments(xmlPath); + + // Bearer token authentication + options.AddSecurityDefinition("jwt_auth", new() + { + Name = "bearer", + BearerFormat = "JWT", + Scheme = "bearer", + Description = "Specify the authorization token.", + In = ParameterLocation.Header, + Type = SecuritySchemeType.Http, + } + ); - services.AddSwaggerGen(options => + // Make sure swagger UI requires a Bearer token specified + OpenApiSecurityScheme securityScheme = new() { - options.OperationFilter(); - - // Set the comments path for the Swagger JSON and UI. - string xmlFile = $"{typeof(Startup).Assembly.GetName().Name}.xml"; - string xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); - options.IncludeXmlComments(xmlPath); - - // Bearer token authentication - options.AddSecurityDefinition("jwt_auth", new() - { - Name = "bearer", - BearerFormat = "JWT", - Scheme = "bearer", - Description = "Specify the authorization token.", - In = ParameterLocation.Header, - Type = SecuritySchemeType.Http, - } - ); - - // Make sure swagger UI requires a Bearer token specified - OpenApiSecurityScheme securityScheme = new() + Reference = new() { - Reference = new() - { - Id = "jwt_auth", - Type = ReferenceType.SecurityScheme - } - }; + Id = "jwt_auth", + Type = ReferenceType.SecurityScheme + } + }; - options.AddSecurityRequirement(new() - { - { securityScheme, Array.Empty() } - } - ); - } - ); + options.AddSecurityRequirement(new() + { + { securityScheme, Array.Empty() } + } + ); + } + ); - services.AddSignalR(config => config.EnableDetailedErrors = true) - .AddMessagePackProtocol(); + services.AddSignalR(config => config.EnableDetailedErrors = true) + .AddMessagePackProtocol(); - /* - services.AddIdentityMongoDbProvider( - options => { }, - mongo => - { - IConfigurationSection config = Configuration.GetSection("Auth"); - mongo.ConnectionString = config["ConnectionString"]; - mongo.MigrationCollection = config["Tables:Migration"]; - mongo.RolesCollection = config["Tables:Role"]; - mongo.UsersCollection = config["Tables:User"]; - }); - */ + /* + services.AddIdentityMongoDbProvider( + options => { }, + mongo => + { + IConfigurationSection config = Configuration.GetSection("Auth"); + mongo.ConnectionString = config["ConnectionString"]; + mongo.MigrationCollection = config["Tables:Migration"]; + mongo.RolesCollection = config["Tables:Role"]; + mongo.UsersCollection = config["Tables:User"]; + }); + */ - // Add Identity - services.AddIdentity() - .AddEntityFrameworkStores() - .AddDefaultTokenProviders(); + // Add Identity + services.AddIdentity() + .AddEntityFrameworkStores() + .AddDefaultTokenProviders(); - services.AddAuthentication(options => - { - options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; - options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; - options.DefaultScheme = JwtBearerDefaults.AuthenticationScheme; - } - ) + services.AddAuthentication(options => + { + options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; + options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; + options.DefaultScheme = JwtBearerDefaults.AuthenticationScheme; + } + ) - // Adding Jwt Bearer - .AddJwtBearer(options => + // Adding Jwt Bearer + .AddJwtBearer(options => + { + options.SaveToken = true; + options.RequireHttpsMetadata = false; + options.TokenValidationParameters = new() { - options.SaveToken = true; - options.RequireHttpsMetadata = false; - options.TokenValidationParameters = new() - { - ValidateIssuer = true, - ValidateAudience = true, - ValidAudience = Configuration["JWT:ValidAudience"], - ValidIssuer = Configuration["JWT:ValidIssuer"], - IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Configuration["JWT:Secret"])) - }; - } - ); - - services.AddCors(c => c.AddDefaultPolicy(builder => builder - .AllowAnyOrigin() - .AllowAnyHeader() - .AllowAnyMethod() - ) + ValidateIssuer = true, + ValidateAudience = true, + ValidAudience = Configuration["JWT:ValidAudience"], + ValidIssuer = Configuration["JWT:ValidIssuer"], + IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Configuration["JWT:Secret"])) + }; + } ); + services.AddCors(c => c.AddDefaultPolicy(builder => builder + .AllowAnyOrigin() + .AllowAnyHeader() + .AllowAnyMethod() + ) + ); - services.AddTransient(); - services.AddTransient(); + services.AddTransient(); - services.AddSingleton(s => new MongoClient(Configuration["MongoDatabase:ConnectionString"]).GetDatabase(Configuration["MongoDatabase:DatabaseName"])); + services.AddTransient(); - services.AddScoped() - .AddScoped(); + services.AddSingleton(s => new MongoClient(Configuration["MongoDatabase:ConnectionString"]).GetDatabase(Configuration["MongoDatabase:DatabaseName"])); - services.AddTransient(); + services.AddScoped() + .AddScoped(); - services.AddApplicationInsightsTelemetry(options => - { + services.AddTransient(); + + services.AddApplicationInsightsTelemetry(options => + { #if DEBUG - options.DeveloperMode = true; + options.DeveloperMode = true; #endif - } - ); + } + ); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IApiVersionDescriptionProvider provider) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); } - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IApiVersionDescriptionProvider provider) + List allowedProxies = Configuration.GetSection("AllowedProxies")?.Get()?.Select(IPAddress.Parse).ToList(); + + // Nginx configuration step + ForwardedHeadersOptions forwardedHeadersOptions = new() { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } + ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto + }; - List allowedProxies = Configuration.GetSection("AllowedProxies")?.Get()?.Select(IPAddress.Parse).ToList(); + if (allowedProxies is { Count: > 0 }) + { + forwardedHeadersOptions.KnownProxies.Clear(); - // Nginx configuration step - ForwardedHeadersOptions forwardedHeadersOptions = new() + foreach (IPAddress address in allowedProxies) { - ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto - }; + forwardedHeadersOptions.KnownProxies.Add(address); + } + } + + app.UseStaticFiles(); - if (allowedProxies is { Count: > 0 }) + app.UseSwagger(options => { options.RouteTemplate = "swagger/{documentName}/swagger.json"; }); + app.UseSwaggerUI(options => { - forwardedHeadersOptions.KnownProxies.Clear(); + options.RoutePrefix = "swagger"; - foreach (IPAddress address in allowedProxies) + foreach (ApiVersionDescription description in provider.ApiVersionDescriptions.OrderByDescending(x => x.ApiVersion)) { - forwardedHeadersOptions.KnownProxies.Add(address); + options.SwaggerEndpoint($"/swagger/{description.GroupName}/swagger.json", description.GroupName.ToLowerInvariant()); } } + ); - app.UseStaticFiles(); - - app.UseSwagger(options => { options.RouteTemplate = "swagger/{documentName}/swagger.json"; }); - app.UseSwaggerUI(options => - { - options.RoutePrefix = "swagger"; - - foreach (ApiVersionDescription description in provider.ApiVersionDescriptions.OrderByDescending(x => x.ApiVersion)) - { - options.SwaggerEndpoint($"/swagger/{description.GroupName}/swagger.json", description.GroupName.ToLowerInvariant()); - } - } - ); - - app.UseHttpsRedirection(); + app.UseHttpsRedirection(); - app.UseRouting(); - app.UseCors(); + app.UseRouting(); + app.UseCors(); - app.UseForwardedHeaders(forwardedHeadersOptions); + app.UseForwardedHeaders(forwardedHeadersOptions); - app.UseAuthentication(); - app.UseAuthorization(); + app.UseAuthentication(); + app.UseAuthorization(); - app.UseMiddleware(); + app.UseMiddleware(); - app.UseEndpoints(endpoints => - { - /* - * Remove once proper website is built. - */ - endpoints.MapGet("/", context => - { - context.Response.Redirect("/swagger/index.html"); + app.UseEndpoints(endpoints => + { + /* + * Remove once proper website is built. + */ + endpoints.MapGet("/", context => + { + context.Response.Redirect("/swagger/index.html"); - return Task.CompletedTask; - } - ); + return Task.CompletedTask; + } + ); - endpoints.MapControllers(); + endpoints.MapControllers(); - endpoints.MapHub("/hubs/trustlist"); - } - ); - } + endpoints.MapHub("/hubs/trustlist"); + } + ); } } \ No newline at end of file diff --git a/SocialGuard.Api/appsettings.Development.json b/SocialGuard.Api/appsettings.Development.json index 7d5732e..fa32807 100644 --- a/SocialGuard.Api/appsettings.Development.json +++ b/SocialGuard.Api/appsettings.Development.json @@ -1,10 +1,24 @@ { - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } + "Serilog": { + "Using": [ + "Serilog.Sinks.Console" + ], + "MinimumLevel": { + "Default": "Debug", + "Override": { + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "Enrich": [ + "FromLogContext", + "WithAssemblyName" + ], + "WriteTo": [ + { + "Name": "Console" + } + ] }, "MongoDatabase": { diff --git a/SocialGuard.Api/appsettings.json b/SocialGuard.Api/appsettings.json index c3ec507..29b5352 100644 --- a/SocialGuard.Api/appsettings.json +++ b/SocialGuard.Api/appsettings.json @@ -1,11 +1,26 @@ { - "Logging": { - "LogLevel": { + "Serilog": { + "Using": [ + "Serilog.Sinks.Console" + ], + "MinimumLevel": { "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } + "Override": { + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "Enrich": [ + "FromLogContext", + "WithAssemblyName" + ], + "WriteTo": [ + { + "Name": "Console" + } + ] }, + "AllowedHosts": "*", "MongoDatabase": { diff --git a/SocialGuard.Client.Http/SocialGuard.Client.Http.csproj b/SocialGuard.Client.Http/SocialGuard.Client.Http.csproj index d2fc3a5..678bd5f 100644 --- a/SocialGuard.Client.Http/SocialGuard.Client.Http.csproj +++ b/SocialGuard.Client.Http/SocialGuard.Client.Http.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 enable enable @@ -21,8 +21,7 @@ - - + diff --git a/SocialGuard.Common/Data/Models/Emitter.cs b/SocialGuard.Common/Data/Models/Emitter.cs index f943309..176d90b 100644 --- a/SocialGuard.Common/Data/Models/Emitter.cs +++ b/SocialGuard.Common/Data/Models/Emitter.cs @@ -13,6 +13,6 @@ public record Emitter public ulong Snowflake { get; init; } - [Required, DisallowNull] + [Required] public string DisplayName { get; init; } = string.Empty; } diff --git a/SocialGuard.Common/SocialGuard.Common.csproj b/SocialGuard.Common/SocialGuard.Common.csproj index 42a52ca..4593d70 100644 --- a/SocialGuard.Common/SocialGuard.Common.csproj +++ b/SocialGuard.Common/SocialGuard.Common.csproj @@ -1,6 +1,6 @@ - net6.0 + net8.0 enable Common assets for NSYS SocialGuard. @@ -15,7 +15,7 @@ - + diff --git a/SocialGuard.Web.Viewer/SocialGuard.Web.Viewer.csproj b/SocialGuard.Web.Viewer/SocialGuard.Web.Viewer.csproj index f948a93..a9a2784 100644 --- a/SocialGuard.Web.Viewer/SocialGuard.Web.Viewer.csproj +++ b/SocialGuard.Web.Viewer/SocialGuard.Web.Viewer.csproj @@ -1,11 +1,10 @@  - net7.0 + net8.0 enable enable service-worker-assets.js - viewer @@ -13,16 +12,15 @@ - - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/SocialGuard.Web.Viewer/Utilities.cs b/SocialGuard.Web.Viewer/Utilities.cs index b9e0f66..2f2a7e4 100644 --- a/SocialGuard.Web.Viewer/Utilities.cs +++ b/SocialGuard.Web.Viewer/Utilities.cs @@ -6,7 +6,8 @@ public static class Utilities { public static string GetTrustlistLevelBootstrapColor(this TrustlistEntry entry) => entry.EscalationLevel switch { - >= 3 => "danger", + > 3 => "nuclear", + 3 => "danger", 2 => "warning", 1 => "info", _ => "success" @@ -14,7 +15,8 @@ public static class Utilities public static string GetTrustlistLevelDisplayString(this TrustlistEntry entry) => entry.EscalationLevel switch { - >= 3 => "Dangerous", + > 3 => "☢️ Nuclear ☢️", + 3 => "Dangerous", 2 => "Untrusted", 1 => "Suspicious", _ => "Clean" diff --git a/SocialGuard.Web.Viewer/wwwroot/css/blazor.scss b/SocialGuard.Web.Viewer/wwwroot/css/blazor.scss index 9718b97..8a46824 100644 --- a/SocialGuard.Web.Viewer/wwwroot/css/blazor.scss +++ b/SocialGuard.Web.Viewer/wwwroot/css/blazor.scss @@ -85,6 +85,52 @@ h1:focus { } } +@keyframes flash-nuclear-color { + 0% { + color: red; + } + 50% { + color: yellow; + } + 100% { + color: red; + } +} + +@keyframes flash-nuclear-border { + 0% { + border-color: red; + } + 50% { + border-color: yellow; + } + 100% { + border-color: red; + } +} + +%color-nuclear { + // Flash colors from red to yellow and back + animation: flash-nuclear-color 1s linear infinite; +} + +%border-nuclear { + // Flash colors from red to yellow and back + animation: flash-nuclear-border 1s linear infinite; +} + +.text { + &-nuclear { + @extend %color-nuclear; + } +} + +.border { + &-nuclear { + @extend %border-nuclear; + } +} + @keyframes lds-dual-ring { 0% { transform: rotate(0deg); diff --git a/SocialGuard.Web/App.razor b/SocialGuard.Web/App.razor index 6f67a6e..8e86f23 100644 --- a/SocialGuard.Web/App.razor +++ b/SocialGuard.Web/App.razor @@ -1,4 +1,4 @@ - + diff --git a/SocialGuard.Web/Pages/Docs.razor b/SocialGuard.Web/Pages/Docs.razor index 6908924..d3780be 100644 --- a/SocialGuard.Web/Pages/Docs.razor +++ b/SocialGuard.Web/Pages/Docs.razor @@ -18,7 +18,17 @@

Not Found

- @FoundNote.Render(context.Item1) + + @FoundIndexNote.Render(context with + { + DisplayOptions = context.DisplayOptions with + { + DisplayIndexNoteNavigation = VaultPath is not (null or "") + } + }) + + + @@ -31,7 +41,7 @@ [Parameter] public string VaultPath { get; set; } - public static ObsidianVaultDisplayOptions VaultDisplayOptions { get; } = new() { }; + public static ObsidianVaultDisplayOptions VaultDisplayOptions { get; } = new() { }; /// /// Builds a Bootstrap breadcrumb using a slash-separated path string. diff --git a/SocialGuard.Web/Program.cs b/SocialGuard.Web/Program.cs index eebfa4b..2b198b6 100644 --- a/SocialGuard.Web/Program.cs +++ b/SocialGuard.Web/Program.cs @@ -9,35 +9,31 @@ -namespace SocialGuard.Web +namespace SocialGuard.Web; + +public class Program { - public class Program + public static async Task Main(string[] args) { - public static async Task Main(string[] args) - { - IHost host = CreateHostBuilder(args).Build(); + IHost host = CreateHostBuilder(args).Build(); - Log.Logger = new LoggerConfiguration() - #if DEBUG - .MinimumLevel.Debug() + Log.Logger = new LoggerConfiguration() +#if DEBUG + .MinimumLevel.Debug() #else .MinimumLevel.Information() .MinimumLevel.Override("Microsoft", LogEventLevel.Warning) .MinimumLevel.Override("Microsoft.Hosting.Lifetime", LogEventLevel.Information) #endif - .Enrich.FromLogContext() - .WriteTo.Console() - .CreateLogger(); - - await host.RunAsync(); - } + .Enrich.FromLogContext() + .WriteTo.Console() + .CreateLogger(); - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - webBuilder.UseSerilog(); - }); + await host.RunAsync(); } -} + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup()) + .UseSerilog(); +} \ No newline at end of file diff --git a/SocialGuard.Web/Shared/Docs/VaultSidebar.razor b/SocialGuard.Web/Shared/Docs/VaultSidebar.razor index 9214317..404e6b8 100644 --- a/SocialGuard.Web/Shared/Docs/VaultSidebar.razor +++ b/SocialGuard.Web/Shared/Docs/VaultSidebar.razor @@ -1,12 +1,4 @@ -