mirror of
https://github.com/bitwarden/server.git
synced 2025-04-08 22:58:11 -05:00
set base admin path for self host
This commit is contained in:
parent
73a4af3f17
commit
997839a2c7
@ -7,6 +7,7 @@ using Bit.Core;
|
|||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace Bit.Admin.Controllers
|
namespace Bit.Admin.Controllers
|
||||||
{
|
{
|
||||||
@ -52,7 +53,7 @@ namespace Bit.Admin.Controllers
|
|||||||
foreach(var result in results)
|
foreach(var result in results)
|
||||||
{
|
{
|
||||||
var name = result["name"].ToString();
|
var name = result["name"].ToString();
|
||||||
if(name != "latest" && name != "beta")
|
if(name.Count(c => c == '.') > 2)
|
||||||
{
|
{
|
||||||
return new JsonResult(name);
|
return new JsonResult(name);
|
||||||
}
|
}
|
||||||
|
@ -69,6 +69,15 @@ namespace Bit.Admin
|
|||||||
app.UseDeveloperExceptionPage();
|
app.UseDeveloperExceptionPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(globalSettings.SelfHosted)
|
||||||
|
{
|
||||||
|
app.Use(async (context, next) =>
|
||||||
|
{
|
||||||
|
context.Request.PathBase = "/admin";
|
||||||
|
await next.Invoke();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
app.UseMvcWithDefaultRoute();
|
app.UseMvcWithDefaultRoute();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user