diff --git a/main.go b/main.go index 1d63690824ee338a38249f2c4c8333948f7db232..3d085b15f7d188edfc53c63282f9654af1c67ac8 100644 --- a/main.go +++ b/main.go @@ -169,25 +169,27 @@ Options: } else { InfoLogger.Printf("Starting ACME Web server") } - for _, provider := range acmeProviders { baseURLs = append(baseURLs, "/"+provider, "/"+provider+"/") } - + for _, provider := range acmeProviders { + otherURLs = append(otherURLs, "/"+provider+"/by_name.html", "/"+provider+"/by_date.html") + } for _, provider := range acmeProviders { apiURLs = append( apiURLs, "/api/"+provider, "/api/"+provider+"/", "/api/"+provider+"/"+provider+".json", "/api/"+provider+"/"+provider+"_expired.json", ) } - - for _, provider := range acmeProviders { - otherURLs = append(otherURLs, "/"+provider+"/by_name.html", "/"+provider+"/by_date.html") + if verboseBool { + DebugLogger.Printf("Serving baseURLs: %v", baseURLs) + DebugLogger.Printf("Serving apiURLs: %v", apiURLs) + DebugLogger.Printf("Serving otherURLs: %v", otherURLs) } puppetURL := "/puppet" - fs := http.FileServer(http.Dir("/var/www/acme_web/static")) + fs := http.FileServer(http.Dir(filepath.Join(webDir, "static"))) http.Handle("/static/", http.StripPrefix("/static/", fs)) http.HandleFunc(puppetURL, triggerPuppet)