From 10e4a7cfaa64fbd4383369dcddd04c61f1aaf67c Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Thu, 30 Nov 2023 14:28:42 -0800 Subject: [PATCH] fix: disables action routes if not configured (#2549) --- internal/web/routes.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/web/routes.go b/internal/web/routes.go index da035d91..8044e33e 100644 --- a/internal/web/routes.go +++ b/internal/web/routes.go @@ -106,7 +106,9 @@ func createRouter(h *handler) *chi.Mux { r.Get("/api/logs/download/{host}/{id}", h.downloadLogs) r.Get("/api/logs/{host}/{id}", h.fetchLogsBetweenDates) r.Get("/api/events/stream", h.streamEvents) - r.Post("/api/actions/{action}/{host}/{id}", h.containerActions) + if h.config.EnableActions { + r.Post("/api/actions/{action}/{host}/{id}", h.containerActions) + } r.Get("/api/releases", h.releases) r.Patch("/api/profile", h.updateProfile) r.Get("/api/content/{id}", h.staticContent)