docs: align Hangfire dashboard guide with route (#370)
Heimdall Gitea / Detect CI scope (push) Successful in 4s
Heimdall Gitea / Build and tests (push) Skipped
Heimdall Gitea / Build and scan server image (push) Skipped
Heimdall Gitea / Build and scan agent image (push) Skipped
Heimdall Gitea / Build and scan NVIDIA Agent image (push) Skipped
Heimdall Gitea / Publish versioned installer release (push) Skipped
Heimdall Gitea / CI policy (push) Successful in 1s
Heimdall Gitea / Detect CI scope (push) Successful in 4s
Heimdall Gitea / Build and tests (push) Skipped
Heimdall Gitea / Build and scan server image (push) Skipped
Heimdall Gitea / Build and scan agent image (push) Skipped
Heimdall Gitea / Build and scan NVIDIA Agent image (push) Skipped
Heimdall Gitea / Publish versioned installer release (push) Skipped
Heimdall Gitea / CI policy (push) Successful in 1s
Co-authored-by: Arnaud Dartois <admin@tordais.cc>
This commit was merged in pull request #370.
This commit is contained in:
1 parent
f20ec93f6f
commit
021bdecab3
2 files changed
+12
-17
No files matched your search
+10
-17
@@ -15,7 +15,7 @@
|
||||
│ │
|
||||
│ Hangfire Server │
|
||||
│ ├── Storage: PostgreSQL (Hangfire.PostgreSql) │
|
||||
│ ├── Dashboard: /admin/jobs (authentifié, Admin only) │
|
||||
│ ├── Dashboard: /hangfire (AdminJobs ou rôle Admin) │
|
||||
│ └── Jobs: │
|
||||
│ ├── RetentionCheck (Recurring, daily) │
|
||||
│ ├── S3Cleanup (Recurring, daily) │
|
||||
@@ -467,27 +467,20 @@ public class HangfireInitializer : IHostedService
|
||||
|
||||
Intégré à l'UI Admin, authentifié, pas exposé publiquement :
|
||||
|
||||
La route Central est mappée par `MapHangfireDashboard("/hangfire", ...)` dans
|
||||
`src/Heimdall.Web/Program.cs`. `HangfireAdminAuthorizationFilter` autorise les
|
||||
requêtes authentifiées portant `Admin.Jobs` ou le rôle `Admin`. Le dashboard
|
||||
n'est pas mappé dans l'environnement `Testing`.
|
||||
|
||||
```csharp
|
||||
// Heimdall.Api / Program.cs
|
||||
app.UseHangfireDashboard("/admin/jobs", new DashboardOptions
|
||||
// Heimdall.Web/Program.cs
|
||||
app.MapHangfireDashboard("/hangfire", new DashboardOptions
|
||||
{
|
||||
Authorization =
|
||||
[
|
||||
new HangfireAuthorizationFilter() // vérifie AppPermissions.AdminJobs
|
||||
new HangfireAdminAuthorizationFilter()
|
||||
],
|
||||
StatsPollingInterval = 3000, // 3s
|
||||
DisplayStorageConnectionString = false,
|
||||
DashboardTitle = "Heimdall — Jobs",
|
||||
});
|
||||
|
||||
public class HangfireAuthorizationFilter : IDashboardAuthorizationFilter
|
||||
{
|
||||
public bool Authorize(DashboardContext context)
|
||||
{
|
||||
var httpContext = context.GetHttpContext();
|
||||
return httpContext.User?.IsInRole(AppRoles.Admin) == true;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
@@ -529,4 +522,4 @@ Hangfire dashboard is accessible only to Admin
|
||||
Hangfire dashboard returns 403 for non-Admin
|
||||
Agent jobs are recreated after agent restart
|
||||
Agent InMemory storage does not persist across restarts
|
||||
```
|
||||
```
|
||||
Reference in new issue
Block a user