|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
using Hangfire;
|
|
|
|
|
using Hangfire.Dashboard.BasicAuthorization;
|
|
|
|
|
using Hangfire.MySql;
|
|
|
|
|
using Microsoft.AspNetCore.Builder;
|
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
|
@ -70,7 +71,25 @@ namespace JobServer
|
|
|
|
|
|
|
|
|
|
app.UsePathBase(basePath);
|
|
|
|
|
|
|
|
|
|
app.UseHangfireDashboard(pathMatch: "/job");
|
|
|
|
|
var options = new DashboardOptions
|
|
|
|
|
{
|
|
|
|
|
Authorization = new[] { new BasicAuthAuthorizationFilter(new BasicAuthAuthorizationFilterOptions
|
|
|
|
|
{
|
|
|
|
|
RequireSsl = false,
|
|
|
|
|
SslRedirect = false,
|
|
|
|
|
LoginCaseSensitive = true,
|
|
|
|
|
Users = new []
|
|
|
|
|
{
|
|
|
|
|
new BasicAuthAuthorizationUser
|
|
|
|
|
{
|
|
|
|
|
Login = Configuration["auth:usr"],
|
|
|
|
|
PasswordClear = Configuration["auth:pwd"]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}) }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
app.UseHangfireDashboard("/job", options);
|
|
|
|
|
|
|
|
|
|
app.UseHangfireServer();
|
|
|
|
|
|
|
|
|
@ -80,8 +99,6 @@ namespace JobServer
|
|
|
|
|
|
|
|
|
|
app.UseRouting();
|
|
|
|
|
|
|
|
|
|
app.UseAuthorization();
|
|
|
|
|
|
|
|
|
|
app.UseEndpoints(endpoints =>
|
|
|
|
|
{
|
|
|
|
|
endpoints.MapControllerRoute(
|
|
|
|
|