diff --git a/appveyor.yml b/appveyor.yml
index 5d01d0060..c463fa4ce 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -86,7 +86,7 @@ build_script:
$env:ASPNETCORE_ENVIRONMENT = "Production"
cd .\src\Api
dotnet swagger tofile --output ..\..\swagger.json --host api.bitwarden.com --format Indented `
- .\bin\Debug\netcoreapp2.1\Api.dll public
+ .\bin\Debug\netcoreapp2.2\Api.dll public
cd ..\..
$env:ASPNETCORE_ENVIRONMENT = ""
$env:swaggerGen = ""
diff --git a/bitwarden-server.sln b/bitwarden-server.sln
index 6eda803c3..9acc83dd4 100644
--- a/bitwarden-server.sln
+++ b/bitwarden-server.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.27130.2003
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29102.190
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D}"
EndProject
@@ -47,7 +47,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.Test", "test\Core.Test
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventsProcessor", "src\EventsProcessor\EventsProcessor.csproj", "{79BB453F-D0D8-4DDF-9809-A405C56692BD}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migrator", "util\Migrator\Migrator.csproj", "{54DED792-A022-417E-9804-21FCC9C7C610}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migrator", "util\Migrator\Migrator.csproj", "{54DED792-A022-417E-9804-21FCC9C7C610}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/src/Admin/Admin.csproj b/src/Admin/Admin.csproj
index 9f5736cf2..88122dbd6 100644
--- a/src/Admin/Admin.csproj
+++ b/src/Admin/Admin.csproj
@@ -1,10 +1,11 @@
- 1.30.4
- netcoreapp2.1
+ 1.31.0
+ netcoreapp2.2
Bit.Admin
bitwarden-Admin
+ InProcess
@@ -13,17 +14,8 @@
-
-
-
-
-
-
- $(IncludeRazorContentInPack)
-
-
- $(IncludeRazorContentInPack)
-
+
+
diff --git a/src/Admin/Dockerfile b/src/Admin/Dockerfile
index 67bab4773..e44b83735 100644
--- a/src/Admin/Dockerfile
+++ b/src/Admin/Dockerfile
@@ -1,4 +1,4 @@
-FROM mcr.microsoft.com/dotnet/core/aspnet:2.1.10
+FROM mcr.microsoft.com/dotnet/core/aspnet:2.2
LABEL com.bitwarden.product="bitwarden"
diff --git a/src/Admin/Program.cs b/src/Admin/Program.cs
index 0f2e22083..bb90511e7 100644
--- a/src/Admin/Program.cs
+++ b/src/Admin/Program.cs
@@ -1,5 +1,7 @@
-using Microsoft.AspNetCore;
+using Bit.Core.Utilities;
+using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
+using Serilog.Events;
namespace Bit.Admin
{
@@ -10,6 +12,8 @@ namespace Bit.Admin
WebHost
.CreateDefaultBuilder(args)
.UseStartup()
+ .ConfigureLogging((hostingContext, logging) =>
+ logging.AddSerilog(hostingContext, e => e.Level >= LogEventLevel.Error))
.Build()
.Run();
}
diff --git a/src/Admin/Startup.cs b/src/Admin/Startup.cs
index 67ff4f80b..e77d65195 100644
--- a/src/Admin/Startup.cs
+++ b/src/Admin/Startup.cs
@@ -5,13 +5,10 @@ using Bit.Core.Identity;
using Bit.Core.Utilities;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
-using Serilog.Events;
using Stripe;
namespace Bit.Admin
@@ -98,10 +95,9 @@ namespace Bit.Admin
IApplicationBuilder app,
IHostingEnvironment env,
IApplicationLifetime appLifetime,
- GlobalSettings globalSettings,
- ILoggerFactory loggerFactory)
+ GlobalSettings globalSettings)
{
- loggerFactory.AddSerilog(app, env, appLifetime, globalSettings, (e) => e.Level >= LogEventLevel.Error);
+ app.UseSerilog(env, appLifetime, globalSettings);
if(globalSettings.SelfHosted)
{
diff --git a/src/Api/Api.csproj b/src/Api/Api.csproj
index 956b3b05f..a6e3ac129 100644
--- a/src/Api/Api.csproj
+++ b/src/Api/Api.csproj
@@ -2,10 +2,11 @@
1.30.4
- netcoreapp2.1
+ netcoreapp2.2
Bit.Api
bitwarden-Api
false
+ InProcess
bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml
@@ -22,7 +23,7 @@
-
+
diff --git a/src/Api/Dockerfile b/src/Api/Dockerfile
index 2b29a5e9a..bcd3c8ca2 100644
--- a/src/Api/Dockerfile
+++ b/src/Api/Dockerfile
@@ -1,4 +1,4 @@
-FROM mcr.microsoft.com/dotnet/core/aspnet:2.1.10
+FROM mcr.microsoft.com/dotnet/core/aspnet:2.2
LABEL com.bitwarden.product="bitwarden"
diff --git a/src/Api/Program.cs b/src/Api/Program.cs
index 083713695..9542b7ece 100644
--- a/src/Api/Program.cs
+++ b/src/Api/Program.cs
@@ -1,5 +1,9 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
+using Bit.Core.Utilities;
+using Serilog.Events;
+using Microsoft.IdentityModel.Tokens;
+using AspNetCoreRateLimit;
namespace Bit.Api
{
@@ -10,6 +14,29 @@ namespace Bit.Api
WebHost
.CreateDefaultBuilder(args)
.UseStartup()
+ .ConfigureLogging((hostingContext, logging) =>
+ logging.AddSerilog(hostingContext, e =>
+ {
+ var context = e.Properties["SourceContext"].ToString();
+ if(e.Exception != null && (e.Exception.GetType() == typeof(SecurityTokenValidationException) ||
+ e.Exception.Message == "Bad security stamp."))
+ {
+ return false;
+ }
+
+ if(e.Level == LogEventLevel.Information && context.Contains(typeof(IpRateLimitMiddleware).FullName))
+ {
+ return true;
+ }
+
+ if(context.Contains("IdentityServer4.Validation.TokenValidator") ||
+ context.Contains("IdentityServer4.Validation.TokenRequestValidator"))
+ {
+ return e.Level > LogEventLevel.Error;
+ }
+
+ return e.Level >= LogEventLevel.Error;
+ }))
.Build()
.Run();
}
diff --git a/src/Api/Startup.cs b/src/Api/Startup.cs
index 52036a24d..28152722a 100644
--- a/src/Api/Startup.cs
+++ b/src/Api/Startup.cs
@@ -3,13 +3,11 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
-using Microsoft.IdentityModel.Tokens;
using Bit.Api.Utilities;
using Bit.Core;
using Bit.Core.Identity;
using Newtonsoft.Json.Serialization;
using AspNetCoreRateLimit;
-using Serilog.Events;
using Stripe;
using Bit.Core.Utilities;
using IdentityModel;
@@ -140,32 +138,10 @@ namespace Bit.Api
public void Configure(
IApplicationBuilder app,
IHostingEnvironment env,
- ILoggerFactory loggerFactory,
IApplicationLifetime appLifetime,
GlobalSettings globalSettings)
{
- loggerFactory.AddSerilog(app, env, appLifetime, globalSettings, (e) =>
- {
- var context = e.Properties["SourceContext"].ToString();
- if(e.Exception != null && (e.Exception.GetType() == typeof(SecurityTokenValidationException) ||
- e.Exception.Message == "Bad security stamp."))
- {
- return false;
- }
-
- if(e.Level == LogEventLevel.Information && context.Contains(typeof(IpRateLimitMiddleware).FullName))
- {
- return true;
- }
-
- if(context.Contains("IdentityServer4.Validation.TokenValidator") ||
- context.Contains("IdentityServer4.Validation.TokenRequestValidator"))
- {
- return e.Level > LogEventLevel.Error;
- }
-
- return e.Level >= LogEventLevel.Error;
- });
+ app.UseSerilog(env, appLifetime, globalSettings);
// Default Middleware
app.UseDefaultMiddleware(env);
diff --git a/src/Api/web.config b/src/Api/web.config
index 4dcf28ca2..2733ccc69 100644
--- a/src/Api/web.config
+++ b/src/Api/web.config
@@ -2,10 +2,13 @@
-
+
-
-
+
+
+
+
+
diff --git a/src/Billing/Billing.csproj b/src/Billing/Billing.csproj
index ea6afd938..80d9f20d3 100644
--- a/src/Billing/Billing.csproj
+++ b/src/Billing/Billing.csproj
@@ -2,10 +2,11 @@
1.30.4
- netcoreapp2.1
+ netcoreapp2.2
Bit.Billing
bitwarden-Billing
false
+ InProcess
@@ -13,8 +14,8 @@
-
-
+
+
diff --git a/src/Billing/Program.cs b/src/Billing/Program.cs
index e2a33eac6..553e3d679 100644
--- a/src/Billing/Program.cs
+++ b/src/Billing/Program.cs
@@ -1,5 +1,7 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
+using Bit.Core.Utilities;
+using Serilog.Events;
namespace Bit.Billing
{
@@ -10,6 +12,18 @@ namespace Bit.Billing
WebHost
.CreateDefaultBuilder(args)
.UseStartup()
+ .ConfigureLogging((hostingContext, logging) =>
+ logging.AddSerilog(hostingContext, e =>
+ {
+ var context = e.Properties["SourceContext"].ToString();
+ if(e.Level == LogEventLevel.Information &&
+ (context.StartsWith("\"Bit.Billing.Jobs") || context.StartsWith("\"Bit.Core.Jobs")))
+ {
+ return true;
+ }
+
+ return e.Level >= LogEventLevel.Warning;
+ }))
.Build()
.Run();
}
diff --git a/src/Billing/Startup.cs b/src/Billing/Startup.cs
index 3fa906f29..19f634d52 100644
--- a/src/Billing/Startup.cs
+++ b/src/Billing/Startup.cs
@@ -3,11 +3,9 @@ using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
using Bit.Core;
using Stripe;
using Bit.Core.Utilities;
-using Serilog.Events;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.AspNetCore.Routing;
@@ -75,20 +73,9 @@ namespace Bit.Billing
IApplicationBuilder app,
IHostingEnvironment env,
IApplicationLifetime appLifetime,
- GlobalSettings globalSettings,
- ILoggerFactory loggerFactory)
+ GlobalSettings globalSettings)
{
- loggerFactory.AddSerilog(app, env, appLifetime, globalSettings, (e) =>
- {
- var context = e.Properties["SourceContext"].ToString();
- if(e.Level == LogEventLevel.Information &&
- (context.StartsWith("\"Bit.Billing.Jobs") || context.StartsWith("\"Bit.Core.Jobs")))
- {
- return true;
- }
-
- return e.Level >= LogEventLevel.Warning;
- });
+ app.UseSerilog(env, appLifetime, globalSettings);
if(env.IsDevelopment())
{
diff --git a/src/Core/Core.csproj b/src/Core/Core.csproj
index f1abb50b9..19209cd5c 100644
--- a/src/Core/Core.csproj
+++ b/src/Core/Core.csproj
@@ -1,7 +1,7 @@
- netcoreapp2.1
+ netcoreapp2.2
Bit.Core
false
bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml
@@ -26,20 +26,21 @@
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+
+
@@ -55,7 +56,7 @@
-
+
diff --git a/src/Core/Utilities/LoggerFactoryExtensions.cs b/src/Core/Utilities/LoggerFactoryExtensions.cs
index 308f72e0a..e0e09249e 100644
--- a/src/Core/Utilities/LoggerFactoryExtensions.cs
+++ b/src/Core/Utilities/LoggerFactoryExtensions.cs
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Serilog;
using Serilog.Events;
@@ -9,17 +10,32 @@ namespace Bit.Core.Utilities
{
public static class LoggerFactoryExtensions
{
- public static ILoggerFactory AddSerilog(
- this ILoggerFactory factory,
- IApplicationBuilder appBuilder,
+ public static void UseSerilog(
+ this IApplicationBuilder appBuilder,
IHostingEnvironment env,
- IApplicationLifetime appLifetime,
- GlobalSettings globalSettings,
- Func filter = null)
+ IApplicationLifetime applicationLifetime,
+ GlobalSettings globalSettings)
{
if(env.IsDevelopment())
{
- return factory;
+ return;
+ }
+
+ if(CoreHelpers.SettingHasValue(globalSettings?.Sentry.Dsn))
+ {
+ appBuilder.AddSentryContext();
+ }
+ applicationLifetime.ApplicationStopped.Register(Log.CloseAndFlush);
+ }
+
+ public static ILoggingBuilder AddSerilog(
+ this ILoggingBuilder builder,
+ WebHostBuilderContext context,
+ Func filter = null)
+ {
+ if(context.HostingEnvironment.IsDevelopment())
+ {
+ return builder;
}
bool inclusionPredicate(LogEvent e)
@@ -36,6 +52,9 @@ namespace Bit.Core.Utilities
return filter(e);
}
+ var globalSettings = new GlobalSettings();
+ ConfigurationBinder.Bind(context.Configuration.GetSection("GlobalSettings"), globalSettings);
+
var config = new LoggerConfiguration()
.Enrich.FromLogContext()
.Filter.ByIncludingOnly(inclusionPredicate);
@@ -55,8 +74,6 @@ namespace Bit.Core.Utilities
.Enrich.WithProperty("Project", globalSettings.ProjectName)
.Destructure.With()
.Filter.ByExcluding(e => e.Exception?.CheckIfCaptured() == true);
-
- appBuilder.AddSentryContext();
}
else if(CoreHelpers.SettingHasValue(globalSettings.LogDirectory))
{
@@ -66,10 +83,9 @@ namespace Bit.Core.Utilities
}
var serilog = config.CreateLogger();
- factory.AddSerilog(serilog);
- appLifetime.ApplicationStopped.Register(Log.CloseAndFlush);
+ builder.AddSerilog(serilog);
- return factory;
+ return builder;
}
}
}
diff --git a/src/Events/Dockerfile b/src/Events/Dockerfile
index 1beede9d4..cd3346661 100644
--- a/src/Events/Dockerfile
+++ b/src/Events/Dockerfile
@@ -1,4 +1,4 @@
-FROM mcr.microsoft.com/dotnet/core/aspnet:2.1.10
+FROM mcr.microsoft.com/dotnet/core/aspnet:2.2
LABEL com.bitwarden.product="bitwarden"
diff --git a/src/Events/Events.csproj b/src/Events/Events.csproj
index 53b058a25..0d1a027c8 100644
--- a/src/Events/Events.csproj
+++ b/src/Events/Events.csproj
@@ -2,14 +2,15 @@
1.30.4
- netcoreapp2.1
+ netcoreapp2.2
Bit.Events
bitwarden-Events
false
+ InProcess
-
+
diff --git a/src/Events/Program.cs b/src/Events/Program.cs
index e804c86ce..995a42808 100644
--- a/src/Events/Program.cs
+++ b/src/Events/Program.cs
@@ -1,5 +1,7 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
+using Bit.Core.Utilities;
+using Serilog.Events;
namespace Bit.Events
{
@@ -10,6 +12,18 @@ namespace Bit.Events
WebHost
.CreateDefaultBuilder(args)
.UseStartup()
+ .ConfigureLogging((hostingContext, logging) =>
+ logging.AddSerilog(hostingContext, e =>
+ {
+ var context = e.Properties["SourceContext"].ToString();
+ if(context.Contains("IdentityServer4.Validation.TokenValidator") ||
+ context.Contains("IdentityServer4.Validation.TokenRequestValidator"))
+ {
+ return e.Level > LogEventLevel.Error;
+ }
+
+ return e.Level >= LogEventLevel.Error;
+ }))
.Build()
.Run();
}
diff --git a/src/Events/Startup.cs b/src/Events/Startup.cs
index 6a0aac916..1408a52eb 100644
--- a/src/Events/Startup.cs
+++ b/src/Events/Startup.cs
@@ -7,8 +7,6 @@ using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
-using Serilog.Events;
namespace Bit.Events
{
@@ -82,21 +80,10 @@ namespace Bit.Events
public void Configure(
IApplicationBuilder app,
IHostingEnvironment env,
- ILoggerFactory loggerFactory,
IApplicationLifetime appLifetime,
GlobalSettings globalSettings)
{
- loggerFactory.AddSerilog(app, env, appLifetime, globalSettings, (e) =>
- {
- var context = e.Properties["SourceContext"].ToString();
- if(context.Contains("IdentityServer4.Validation.TokenValidator") ||
- context.Contains("IdentityServer4.Validation.TokenRequestValidator"))
- {
- return e.Level > LogEventLevel.Error;
- }
-
- return e.Level >= LogEventLevel.Error;
- });
+ app.UseSerilog(env, appLifetime, globalSettings);
if(env.IsDevelopment())
{
diff --git a/src/EventsProcessor/EventsProcessor.csproj b/src/EventsProcessor/EventsProcessor.csproj
index 3aba918fb..1f0c45be2 100644
--- a/src/EventsProcessor/EventsProcessor.csproj
+++ b/src/EventsProcessor/EventsProcessor.csproj
@@ -2,13 +2,14 @@
1.30.4
- netcoreapp2.1
+ netcoreapp2.2
Bit.EventsProcessor
bitwarden-EventsProcessor
+ InProcess
-
+
diff --git a/src/EventsProcessor/Program.cs b/src/EventsProcessor/Program.cs
index cf7fb579b..de0d1aba0 100644
--- a/src/EventsProcessor/Program.cs
+++ b/src/EventsProcessor/Program.cs
@@ -1,5 +1,7 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
+using Bit.Core.Utilities;
+using Serilog.Events;
namespace Bit.EventsProcessor
{
@@ -10,6 +12,8 @@ namespace Bit.EventsProcessor
WebHost
.CreateDefaultBuilder(args)
.UseStartup()
+ .ConfigureLogging((hostingContext, logging) =>
+ logging.AddSerilog(hostingContext, e => e.Level >= LogEventLevel.Warning))
.Build()
.Run();
}
diff --git a/src/EventsProcessor/Startup.cs b/src/EventsProcessor/Startup.cs
index c1307136a..02915484c 100644
--- a/src/EventsProcessor/Startup.cs
+++ b/src/EventsProcessor/Startup.cs
@@ -5,9 +5,7 @@ using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
using Microsoft.IdentityModel.Logging;
-using Serilog.Events;
namespace Bit.EventsProcessor
{
@@ -29,7 +27,7 @@ namespace Bit.EventsProcessor
services.AddOptions();
// Settings
- var globalSettings = services.AddGlobalSettingsServices(Configuration);
+ services.AddGlobalSettingsServices(Configuration);
// Hosted Services
services.AddHostedService();
@@ -38,12 +36,11 @@ namespace Bit.EventsProcessor
public void Configure(
IApplicationBuilder app,
IHostingEnvironment env,
- ILoggerFactory loggerFactory,
IApplicationLifetime appLifetime,
GlobalSettings globalSettings)
{
IdentityModelEventSource.ShowPII = true;
- loggerFactory.AddSerilog(app, env, appLifetime, globalSettings, (e) => e.Level >= LogEventLevel.Warning);
+ app.UseSerilog(env, appLifetime, globalSettings);
}
}
}
diff --git a/src/Icons/Dockerfile b/src/Icons/Dockerfile
index 3e1ff49a7..5cb5b6a27 100644
--- a/src/Icons/Dockerfile
+++ b/src/Icons/Dockerfile
@@ -1,4 +1,4 @@
-FROM mcr.microsoft.com/dotnet/core/aspnet:2.1.10
+FROM mcr.microsoft.com/dotnet/core/aspnet:2.2
LABEL com.bitwarden.product="bitwarden"
diff --git a/src/Icons/Icons.csproj b/src/Icons/Icons.csproj
index 5a685944c..993c07a71 100644
--- a/src/Icons/Icons.csproj
+++ b/src/Icons/Icons.csproj
@@ -2,7 +2,7 @@
1.30.4
- netcoreapp2.1
+ netcoreapp2.2
Bit.Icons
bitwarden-Icons
false
@@ -10,7 +10,7 @@
-
+
diff --git a/src/Icons/Program.cs b/src/Icons/Program.cs
index 5b098f95b..0282b48e5 100644
--- a/src/Icons/Program.cs
+++ b/src/Icons/Program.cs
@@ -1,6 +1,7 @@
-using System;
-using Microsoft.AspNetCore;
+using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
+using Bit.Core.Utilities;
+using Serilog.Events;
namespace Bit.Icons
{
@@ -11,6 +12,8 @@ namespace Bit.Icons
WebHost
.CreateDefaultBuilder(args)
.UseStartup()
+ .ConfigureLogging((hostingContext, logging) =>
+ logging.AddSerilog(hostingContext, e => e.Level >= LogEventLevel.Error))
.Build()
.Run();
}
diff --git a/src/Icons/Startup.cs b/src/Icons/Startup.cs
index b88f4ccca..fc49dec4e 100644
--- a/src/Icons/Startup.cs
+++ b/src/Icons/Startup.cs
@@ -8,9 +8,7 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers;
-using Serilog.Events;
namespace Bit.Icons
{
@@ -52,11 +50,10 @@ namespace Bit.Icons
public void Configure(
IApplicationBuilder app,
IHostingEnvironment env,
- ILoggerFactory loggerFactory,
IApplicationLifetime appLifetime,
GlobalSettings globalSettings)
{
- loggerFactory.AddSerilog(app, env, appLifetime, globalSettings, (e) => e.Level >= LogEventLevel.Error);
+ app.UseSerilog(env, appLifetime, globalSettings);
if(env.IsDevelopment())
{
diff --git a/src/Identity/Dockerfile b/src/Identity/Dockerfile
index 67bab4773..e44b83735 100644
--- a/src/Identity/Dockerfile
+++ b/src/Identity/Dockerfile
@@ -1,4 +1,4 @@
-FROM mcr.microsoft.com/dotnet/core/aspnet:2.1.10
+FROM mcr.microsoft.com/dotnet/core/aspnet:2.2
LABEL com.bitwarden.product="bitwarden"
diff --git a/src/Identity/Identity.csproj b/src/Identity/Identity.csproj
index b3dc884d1..450f4709e 100644
--- a/src/Identity/Identity.csproj
+++ b/src/Identity/Identity.csproj
@@ -2,10 +2,11 @@
1.30.4
- netcoreapp2.1
+ netcoreapp2.2
Bit.Identity
bitwarden-Identity
false
+ InProcess
@@ -13,7 +14,7 @@
-
+
diff --git a/src/Identity/Program.cs b/src/Identity/Program.cs
index 5e1912f3e..18d48449e 100644
--- a/src/Identity/Program.cs
+++ b/src/Identity/Program.cs
@@ -1,5 +1,8 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
+using Bit.Core.Utilities;
+using Serilog.Events;
+using AspNetCoreRateLimit;
namespace Bit.Identity
{
@@ -10,6 +13,23 @@ namespace Bit.Identity
WebHost
.CreateDefaultBuilder(args)
.UseStartup()
+ .ConfigureLogging((hostingContext, logging) =>
+ logging.AddSerilog(hostingContext, e =>
+ {
+ var context = e.Properties["SourceContext"].ToString();
+ if(context.Contains(typeof(IpRateLimitMiddleware).FullName) && e.Level == LogEventLevel.Information)
+ {
+ return true;
+ }
+
+ if(context.Contains("IdentityServer4.Validation.TokenValidator") ||
+ context.Contains("IdentityServer4.Validation.TokenRequestValidator"))
+ {
+ return e.Level > LogEventLevel.Error;
+ }
+
+ return e.Level >= LogEventLevel.Error;
+ }))
.Build()
.Run();
}
diff --git a/src/Identity/Startup.cs b/src/Identity/Startup.cs
index 39555ab3d..a5a477914 100644
--- a/src/Identity/Startup.cs
+++ b/src/Identity/Startup.cs
@@ -2,11 +2,9 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Configuration;
using Bit.Core;
using Bit.Core.Utilities;
-using Serilog.Events;
using AspNetCoreRateLimit;
using System.Globalization;
@@ -76,26 +74,10 @@ namespace Bit.Identity
public void Configure(
IApplicationBuilder app,
IHostingEnvironment env,
- ILoggerFactory loggerFactory,
IApplicationLifetime appLifetime,
GlobalSettings globalSettings)
{
- loggerFactory.AddSerilog(app, env, appLifetime, globalSettings, (e) =>
- {
- var context = e.Properties["SourceContext"].ToString();
- if(context.Contains(typeof(IpRateLimitMiddleware).FullName) && e.Level == LogEventLevel.Information)
- {
- return true;
- }
-
- if(context.Contains("IdentityServer4.Validation.TokenValidator") ||
- context.Contains("IdentityServer4.Validation.TokenRequestValidator"))
- {
- return e.Level > LogEventLevel.Error;
- }
-
- return e.Level >= LogEventLevel.Error;
- });
+ app.UseSerilog(env, appLifetime, globalSettings);
// Default Middleware
app.UseDefaultMiddleware(env);
diff --git a/src/Notifications/Dockerfile b/src/Notifications/Dockerfile
index 3e1ff49a7..5cb5b6a27 100644
--- a/src/Notifications/Dockerfile
+++ b/src/Notifications/Dockerfile
@@ -1,4 +1,4 @@
-FROM mcr.microsoft.com/dotnet/core/aspnet:2.1.10
+FROM mcr.microsoft.com/dotnet/core/aspnet:2.2
LABEL com.bitwarden.product="bitwarden"
diff --git a/src/Notifications/Notifications.csproj b/src/Notifications/Notifications.csproj
index 7c0b6558c..d54ab8996 100644
--- a/src/Notifications/Notifications.csproj
+++ b/src/Notifications/Notifications.csproj
@@ -2,15 +2,16 @@
1.30.4
- netcoreapp2.1
+ netcoreapp2.2
Bit.Notifications
bitwarden-Notifications
+ InProcess
-
-
-
+
+
+
diff --git a/src/Notifications/Program.cs b/src/Notifications/Program.cs
index a0d0401c5..d243a6e42 100644
--- a/src/Notifications/Program.cs
+++ b/src/Notifications/Program.cs
@@ -1,5 +1,7 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
+using Bit.Core.Utilities;
+using Serilog.Events;
namespace Bit.Notifications
{
@@ -10,6 +12,28 @@ namespace Bit.Notifications
WebHost
.CreateDefaultBuilder(args)
.UseStartup()
+ .ConfigureLogging((hostingContext, logging) =>
+ logging.AddSerilog(hostingContext, e =>
+ {
+ var context = e.Properties["SourceContext"].ToString();
+ if(context.Contains("IdentityServer4.Validation.TokenValidator") ||
+ context.Contains("IdentityServer4.Validation.TokenRequestValidator"))
+ {
+ return e.Level > LogEventLevel.Error;
+ }
+
+ if(e.Level == LogEventLevel.Error && e.MessageTemplate.Text == "Failed connection handshake.")
+ {
+ return false;
+ }
+
+ if(e.Level == LogEventLevel.Warning && e.MessageTemplate.Text.StartsWith("Heartbeat took longer"))
+ {
+ return false;
+ }
+
+ return e.Level >= LogEventLevel.Warning;
+ }))
.Build()
.Run();
}
diff --git a/src/Notifications/Startup.cs b/src/Notifications/Startup.cs
index c8f2c10e0..e2c45cafb 100644
--- a/src/Notifications/Startup.cs
+++ b/src/Notifications/Startup.cs
@@ -8,9 +8,7 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
using Microsoft.IdentityModel.Logging;
-using Serilog.Events;
namespace Bit.Notifications
{
@@ -84,32 +82,11 @@ namespace Bit.Notifications
public void Configure(
IApplicationBuilder app,
IHostingEnvironment env,
- ILoggerFactory loggerFactory,
IApplicationLifetime appLifetime,
GlobalSettings globalSettings)
{
IdentityModelEventSource.ShowPII = true;
- loggerFactory.AddSerilog(app, env, appLifetime, globalSettings, (e) =>
- {
- var context = e.Properties["SourceContext"].ToString();
- if(context.Contains("IdentityServer4.Validation.TokenValidator") ||
- context.Contains("IdentityServer4.Validation.TokenRequestValidator"))
- {
- return e.Level > LogEventLevel.Error;
- }
-
- if(e.Level == LogEventLevel.Error && e.MessageTemplate.Text == "Failed connection handshake.")
- {
- return false;
- }
-
- if(e.Level == LogEventLevel.Warning && e.MessageTemplate.Text.StartsWith("Heartbeat took longer"))
- {
- return false;
- }
-
- return e.Level >= LogEventLevel.Warning;
- });
+ app.UseSerilog(env, appLifetime, globalSettings);
if(env.IsDevelopment())
{
diff --git a/test/Core.Test/Core.Test.csproj b/test/Core.Test/Core.Test.csproj
index bd7a46207..d27370127 100644
--- a/test/Core.Test/Core.Test.csproj
+++ b/test/Core.Test/Core.Test.csproj
@@ -1,14 +1,14 @@
- netcoreapp2.1
+ netcoreapp2.2
false
Bit.Core.Test
-
-
+
+
all
diff --git a/util/Migrator/Migrator.csproj b/util/Migrator/Migrator.csproj
index a49ea63d3..e7d5d98e6 100644
--- a/util/Migrator/Migrator.csproj
+++ b/util/Migrator/Migrator.csproj
@@ -1,7 +1,7 @@
- netcoreapp2.1
+ netcoreapp2.2
Bit.Migrator
@@ -11,7 +11,7 @@
-
+
diff --git a/util/Server/Dockerfile b/util/Server/Dockerfile
index 8beb3e58a..9fb35fcf1 100644
--- a/util/Server/Dockerfile
+++ b/util/Server/Dockerfile
@@ -1,4 +1,4 @@
-FROM mcr.microsoft.com/dotnet/core/aspnet:2.1.10
+FROM mcr.microsoft.com/dotnet/core/aspnet:2.2
LABEL com.bitwarden.product="bitwarden"
diff --git a/util/Server/Program.cs b/util/Server/Program.cs
index fa5339a4e..c9367db1a 100644
--- a/util/Server/Program.cs
+++ b/util/Server/Program.cs
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
namespace Bit.Server
{
@@ -14,7 +15,12 @@ namespace Bit.Server
var builder = new WebHostBuilder()
.UseConfiguration(config)
.UseKestrel()
- .UseStartup();
+ .UseStartup()
+ .ConfigureLogging((hostingContext, logging) =>
+ {
+ logging.AddConsole().AddDebug();
+ })
+ .ConfigureKestrel((context, options) => { });
var contentRoot = config.GetValue("contentRoot");
if(string.IsNullOrWhiteSpace(contentRoot))
diff --git a/util/Server/Server.csproj b/util/Server/Server.csproj
index ac754b62f..96b99c6a6 100644
--- a/util/Server/Server.csproj
+++ b/util/Server/Server.csproj
@@ -1,13 +1,14 @@
- netcoreapp2.1
+ netcoreapp2.2
false
Bit.Server
+ InProcess
-
+
diff --git a/util/Server/Startup.cs b/util/Server/Startup.cs
index 5e290d299..a8bd14048 100644
--- a/util/Server/Startup.cs
+++ b/util/Server/Startup.cs
@@ -5,7 +5,6 @@ using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
namespace Bit.Server
{
@@ -30,13 +29,8 @@ namespace Bit.Server
public void Configure(
IApplicationBuilder app,
- ILoggerFactory loggerFactory,
IConfiguration configuration)
{
- loggerFactory
- .AddConsole()
- .AddDebug();
-
if(configuration.GetValue("serveUnknown") ?? false)
{
app.UseStaticFiles(new StaticFileOptions
diff --git a/util/Setup/Dockerfile b/util/Setup/Dockerfile
index f82509ddd..d724debda 100644
--- a/util/Setup/Dockerfile
+++ b/util/Setup/Dockerfile
@@ -1,4 +1,4 @@
-FROM mcr.microsoft.com/dotnet/core/runtime:2.1.10
+FROM mcr.microsoft.com/dotnet/core/runtime:2.2
LABEL com.bitwarden.product="bitwarden" com.bitwarden.project="setup"
diff --git a/util/Setup/Setup.csproj b/util/Setup/Setup.csproj
index 394f84436..7c9a8999b 100644
--- a/util/Setup/Setup.csproj
+++ b/util/Setup/Setup.csproj
@@ -2,7 +2,7 @@
Exe
- netcoreapp2.1
+ netcoreapp2.2
1701;1702;1705;NU1701
Bit.Setup
@@ -13,7 +13,7 @@
-
+