From b8fcca459d7e28f08cac3cda93ab3f588201fbfb Mon Sep 17 00:00:00 2001 From: groot Date: Thu, 9 Oct 2025 21:24:51 +0000 Subject: [PATCH] main.go aktualisiert --- main.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/main.go b/main.go index d58c53b..edb86d7 100644 --- a/main.go +++ b/main.go @@ -247,6 +247,17 @@ func main() { mux := http.NewServeMux() mux.Handle("/ubuntu/", http.StripPrefix("/ubuntu", handler)) + // Microsoft-Repos unter /ms/ (nur wenn vorhanden) + if st, err := os.Stat(*msRoot); err == nil && st.IsDir() { + mux.Handle("/ms/", http.StripPrefix("/ms", fileHandler{ + fs: http.Dir(*msRoot), + autoIndex: *autoIndex, + cacheMaxAge: time.Duration(*cacheSeconds) * time.Second, + })) + log.Printf("serving Microsoft repos at /ms from %s", *msRoot) + } else { + log.Printf("warn: microsoft root not found (%s) — /ms disabled", *msRoot) + } mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) _, _ = w.Write([]byte("ok"))