From 1c79728984af1b0b065ce5879581f41fa9f03da3 Mon Sep 17 00:00:00 2001 From: Geert Stappers Date: Thu, 5 Jan 2023 00:21:47 +0100 Subject: feat: add human-friendly entry point * Added /start as entry point, for humans and iPXE The '/poll/1/${netX/mac:hexhyp}' is fairly iPXE internal, not something that invites curious people to look better at shoelaces. Neither it is looking nice in DHCP server configuration. This change adds a HTTP handler for '/start'. And '/start' points to '/poll/1/${netX/mac:hexhyp}'. The benefit of it is that human visible documentation can replace the "voodoo" '/poll/1/${netX/mac:hexhyp}' with "friendly" '/start'. Because it is an addition are the existing HTTP handlers not effected, neither the installed deployments effected. Signed-off-by: Geert Stappers --- internal/router/router.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'internal/router') diff --git a/internal/router/router.go b/internal/router/router.go index d729d16..1313705 100644 --- a/internal/router/router.go +++ b/internal/router/router.go @@ -53,6 +53,9 @@ func ShoelacesRouter(env *environment.Environment) http.Handler { r.PathPrefix("/configs/").Handler(http.StripPrefix("/configs/", handlers.TemplateServer())) + // Starting point for iPXE boot agents, usualy defined by DHCP server. + // Gets the iPXE boot agents into the polling loop. + r.HandleFunc("/start", handlers.StartPollingHandler).Methods("GET") // Called by iPXE boot agents, returns boot script specified on the configuration // or if the host is unknown makes it retry for a while until the user specifies // alternative ipxe boot script -- cgit v1.2.3