mirror of
https://github.com/bitwarden/server.git
synced 2025-04-14 17:48:12 -05:00
feat: allow custom app-id.json location for rootless
Co-authored-by: Justin Baur <justindbaur@users.noreply.github.com>
This commit is contained in:
parent
9c67d7cf5b
commit
a9d15790d5
@ -26,7 +26,8 @@ public class Startup
|
|||||||
|
|
||||||
public void Configure(
|
public void Configure(
|
||||||
IApplicationBuilder app,
|
IApplicationBuilder app,
|
||||||
IConfiguration configuration)
|
IConfiguration configuration,
|
||||||
|
ILogger<Startup> logger)
|
||||||
{
|
{
|
||||||
if (configuration.GetValue<bool?>("serveUnknown") ?? false)
|
if (configuration.GetValue<bool?>("serveUnknown") ?? false)
|
||||||
{
|
{
|
||||||
@ -44,6 +45,22 @@ public class Startup
|
|||||||
}
|
}
|
||||||
else if (configuration.GetValue<bool?>("webVault") ?? false)
|
else if (configuration.GetValue<bool?>("webVault") ?? false)
|
||||||
{
|
{
|
||||||
|
var appIdLocation = configuration.GetValue<string>("appIdLocation");
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(appIdLocation))
|
||||||
|
{
|
||||||
|
app.UseRouting();
|
||||||
|
app.UseEndpoints(endpoints =>
|
||||||
|
{
|
||||||
|
endpoints.MapGet("/app-id.json", async context =>
|
||||||
|
{
|
||||||
|
var appId = await File.ReadAllTextAsync(appIdLocation);
|
||||||
|
context.Response.ContentType = "application/json";
|
||||||
|
await context.Response.WriteAsync(appId);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: This should be removed when asp.net natively support avif
|
// TODO: This should be removed when asp.net natively support avif
|
||||||
var provider = new FileExtensionContentTypeProvider { Mappings = { [".avif"] = "image/avif" } };
|
var provider = new FileExtensionContentTypeProvider { Mappings = { [".avif"] = "image/avif" } };
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user