feat!(backend): unify script run and ad-hoc job run

This commit is contained in:
2026-04-05 04:10:59 +03:00
parent add1242b97
commit 8226429b5b
7 changed files with 95 additions and 174 deletions
+4 -2
View File
@@ -96,7 +96,8 @@ func main() {
log.Printf("Warning: failed to initialize script interpreters table: %v", err)
}
scriptSvc := service.NewScriptServiceWithInterpreters(h.Repo, scriptRepo)
scriptHandlers := handlers.NewScriptHandlers(scriptSvc, cmdTracker)
scriptHandlers := handlers.NewScriptHandlers(scriptSvc, cmdTracker,
os.Getenv("WHEREAMI"))
jobsHandlers := handlers.NewJobsHandlers(cmdTracker, scriptSvc,
os.Getenv("WHEREAMI"), /* our address for redirects */
jobRepo,
@@ -104,7 +105,8 @@ func main() {
// Initialize script management service and handlers
scriptManageSvc := service.NewScriptService(h.Repo)
scriptManageHandlers := handlers.NewScriptHandlersGroup(scriptManageSvc, cmdr)
scriptManageHandlers := handlers.NewScriptHandlersGroup(scriptManageSvc, cmdr,
os.Getenv("WHEREAMI"))
agents := handlers.NewAgentsGroup(h, coll)
auth := handlers.AuthGroup{Handlers: h}