From 0b62009fa384a53752b3ddf912314dbc6c44c30c Mon Sep 17 00:00:00 2001 From: Seednode Date: Thu, 14 Sep 2023 21:13:12 -0500 Subject: [PATCH] Remove debug argument --- README.md | 2 +- cmd/root.go | 6 ++---- cmd/web.go | 16 ---------------- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index eda875e..b074124 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ Flags: -i, --info expose informational endpoints --maximum-files uint32 skip directories with file counts above this value (default 4294967295) --minimum-files uint32 skip directories with file counts below this value (default 1) - --page-length uint32 pagination length for statistics and debug pages + --page-length uint32 pagination length for info pages -p, --port uint16 port to listen on (default 8080) --prefix string root path for http handlers (for reverse proxying) (default "/") --profile register net/http/pprof handlers diff --git a/cmd/root.go b/cmd/root.go index d3d0205..7a62b97 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -11,7 +11,7 @@ import ( ) const ( - ReleaseVersion string = "0.84.3" + ReleaseVersion string = "0.84.4" ) var ( @@ -21,7 +21,6 @@ var ( Cache bool CacheFile string Code bool - Debug bool Filtering bool Flash bool Handlers bool @@ -71,7 +70,6 @@ func init() { rootCmd.Flags().BoolVarP(&Cache, "cache", "c", false, "generate directory cache at startup") rootCmd.Flags().StringVar(&CacheFile, "cache-file", "", "path to optional persistent cache file") rootCmd.Flags().BoolVar(&Code, "code", false, "enable support for source code files") - rootCmd.Flags().BoolVar(&Debug, "debug", false, "display debug information") rootCmd.Flags().BoolVarP(&Filtering, "filter", "f", false, "enable filtering") rootCmd.Flags().BoolVar(&Flash, "flash", false, "enable support for shockwave flash files (via ruffle.rs)") rootCmd.Flags().BoolVar(&Handlers, "handlers", false, "display registered handlers (for debugging)") @@ -79,7 +77,7 @@ func init() { rootCmd.Flags().BoolVarP(&Info, "info", "i", false, "expose informational endpoints") rootCmd.Flags().Uint32Var(&MaximumFileCount, "maximum-files", 1<<32-1, "skip directories with file counts above this value") rootCmd.Flags().Uint32Var(&MinimumFileCount, "minimum-files", 1, "skip directories with file counts below this value") - rootCmd.Flags().Uint32Var(&PageLength, "page-length", 0, "pagination length for statistics and debug pages") + rootCmd.Flags().Uint32Var(&PageLength, "page-length", 0, "pagination length for info pages") rootCmd.Flags().Uint16VarP(&Port, "port", "p", 8080, "port to listen on") rootCmd.Flags().StringVar(&Prefix, "prefix", "/", "root path for http handlers (for reverse proxying)") rootCmd.Flags().BoolVar(&Profile, "profile", false, "register net/http/pprof handlers") diff --git a/cmd/web.go b/cmd/web.go index 726fd52..4b555ba 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -49,9 +49,6 @@ func serveStaticFile(paths []string, cache *fileCache) httprouter.Handle { if err != nil { fmt.Println(err) - if Debug { - fmt.Printf("Call to stripQueryParams(%v) failed inside serveStaticFile()\n", path) - } serverError(w, r, nil) return @@ -61,9 +58,6 @@ func serveStaticFile(paths []string, cache *fileCache) httprouter.Handle { if err != nil { fmt.Println(err) - if Debug { - fmt.Printf("Call to filepath.EvalSymlinks(%v) failed inside serveStaticFile()\n", strings.TrimPrefix(prefixedFilePath, prefix)) - } serverError(w, r, nil) return @@ -77,9 +71,6 @@ func serveStaticFile(paths []string, cache *fileCache) httprouter.Handle { exists, err := fileExists(filePath) if err != nil { - if Debug { - fmt.Printf("Call to fileExists(%v) failed inside serveStaticFile()\n", filePath) - } serverError(w, r, nil) return @@ -95,9 +86,6 @@ func serveStaticFile(paths []string, cache *fileCache) httprouter.Handle { buf, err := os.ReadFile(filePath) if err != nil { - if Debug { - fmt.Printf("Call to os.ReadFile(%v) failed inside serveStaticFile()\n", filePath) - } serverError(w, r, nil) return @@ -110,10 +98,6 @@ func serveStaticFile(paths []string, cache *fileCache) httprouter.Handle { if Russian { err = os.Remove(filePath) if err != nil { - if Debug { - fmt.Printf("Call to os.Remove(%v) failed inside serveStaticFile()\n", filePath) - } - serverError(w, r, nil) return