mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
upgrade to aspnet core 3.1
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
|
||||
|
||||
LABEL com.bitwarden.product="bitwarden"
|
||||
|
||||
|
@ -1,14 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
|
||||
<RootNamespace>Bit.Server</RootNamespace>
|
||||
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.App" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -33,12 +33,17 @@ namespace Bit.Server
|
||||
{
|
||||
if(configuration.GetValue<bool?>("serveUnknown") ?? false)
|
||||
{
|
||||
app.Map("/alive", HandleMapAlive);
|
||||
app.UseStaticFiles(new StaticFileOptions
|
||||
{
|
||||
ServeUnknownFileTypes = true,
|
||||
DefaultContentType = "application/octet-stream"
|
||||
});
|
||||
app.UseRouting();
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapGet("/alive",
|
||||
async context => await context.Response.WriteAsync(System.DateTime.UtcNow.ToString()));
|
||||
});
|
||||
}
|
||||
else if(configuration.GetValue<bool?>("webVault") ?? false)
|
||||
{
|
||||
@ -71,14 +76,14 @@ namespace Bit.Server
|
||||
}
|
||||
else
|
||||
{
|
||||
app.Map("/alive", HandleMapAlive);
|
||||
app.UseFileServer();
|
||||
app.UseRouting();
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapGet("/alive",
|
||||
async context => await context.Response.WriteAsync(System.DateTime.UtcNow.ToString()));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private static void HandleMapAlive(IApplicationBuilder app)
|
||||
{
|
||||
app.Run(async context => await context.Response.WriteAsync(System.DateTime.UtcNow.ToString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user