Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Ombi/commit/be746442716c1d2129713334202b36d6034c1c77
You should set ROOT_URL correctly, otherwise the web may not work correctly.
1 changed files with
17 additions and
1 deletions
@ -5,6 +5,7 @@ using System.Text;
using AutoMapper ;
using AutoMapper.EquivalencyExpression ;
using Hangfire ;
using Hangfire.Dashboard ;
using Hangfire.MemoryStorage ;
using Microsoft.AspNetCore.Builder ;
using Microsoft.AspNetCore.Hosting ;
@ -21,6 +22,7 @@ using Microsoft.Extensions.Options;
using Microsoft.Extensions.PlatformAbstractions ;
using Microsoft.IdentityModel.Tokens ;
using Ombi.Config ;
using Ombi.Core.Claims ;
using Ombi.DependencyInjection ;
using Ombi.Helpers ;
using Ombi.Mapping ;
@ -195,7 +197,10 @@ namespace Ombi
}
app . UseHangfireServer ( ) ;
app . UseHangfireDashboard ( ) ;
app . UseHangfireDashboard ( "/hangfire" , new DashboardOptions
{
Authorization = new [ ] { new HangfireAuthorizationFilter ( ) }
} ) ; ) ;
app . UseSwaggerUI ( c = >
{
@ -230,4 +235,15 @@ namespace Ombi
} ) ;
}
}
public class HangfireAuthorizationFilter : IDashboardAuthorizationFilter
{
public bool Authorize ( DashboardContext context )
{
var httpContext = context . GetHttpContext ( ) ;
// Allow all authenticated users to see the Dashboard (potentially dangerous).
return httpContext . User . IsInRole ( OmbiRoles . Admin ) ;
}
}
}