Skip to content

Commit

Permalink
enable hf dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
retailcoder committed Oct 27, 2024
1 parent 69db574 commit f64802e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rubberduckvba.Server/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Hangfire;
using Hangfire.Annotations;
using Hangfire.Dashboard;
using Hangfire.SqlServer;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Options;
Expand All @@ -18,6 +20,11 @@

namespace rubberduckvba.com.Server;

public class HangfireAuthenticationFilter : IDashboardAuthorizationFilter
{
public bool Authorize([NotNull] DashboardContext context) => true;
}

public class Program
{
public static void Main(string[] args)
Expand Down Expand Up @@ -120,7 +127,7 @@ private static void StartHangfire(WebApplication app)
hangfireOptions.UpdateXmldocContentSchedule);
}

app.UseHangfireDashboard(HangfireConstants.DashboardUrl, storage: scheduler.Storage);
app.UseHangfireDashboard(HangfireConstants.DashboardUrl, new DashboardOptions { DarkModeEnabled = true, Authorization = [new HangfireAuthenticationFilter()] }, scheduler.Storage);
CleanStartHangfire(scheduler.Storage);
}
}
Expand Down

0 comments on commit f64802e

Please sign in to comment.