feat(backend): add service graph yaml
ci-agent / build (push) Has been cancelled

This commit is contained in:
2026-04-05 07:48:44 +03:00
parent d79e9dd829
commit 7aa25b02c5
4 changed files with 538 additions and 0 deletions
+16
View File
@@ -106,6 +106,12 @@ func main() {
scriptManageHandlers := handlers.NewScriptHandlersGroup(scriptSvc, cmdr,
os.Getenv("WHEREAMI"))
graphPath := os.Getenv("GRAPH_YAML_PATH")
if graphPath == "" {
graphPath = "/etc/hellreign/services.yaml"
}
graphHandlers := handlers.NewGraphHandlers(graphPath)
agents := handlers.NewAgentsGroup(h, coll)
auth := handlers.AuthGroup{Handlers: h}
agentReg := handlers.NewAgentRegistrationGroup(h)
@@ -212,6 +218,16 @@ func main() {
jobsGroup.GET("/metrics", jobsHandlers.GetJobMetrics)
}
// Service dependency graph (requires admin permission)
graphGroup := v1.Group("/graph")
graphGroup.Use(auth.AuthMiddleware(), handlers.RequireAdmin())
{
graphGroup.GET("", graphHandlers.GetYAML)
graphGroup.PUT("", graphHandlers.UpdateYAML)
graphGroup.GET("/order", graphHandlers.StartupOrder)
graphGroup.GET("/cycle", graphHandlers.CycleCheck)
}
// Agent registration
agentRegGroup := v1.Group("/agents")
{