main.go aktualisiert
Some checks failed
release-tag / release-image (push) Has been cancelled

This commit is contained in:
2025-10-09 21:24:51 +00:00
parent 0d013a2496
commit b8fcca459d

11
main.go
View File

@@ -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"))