diff --git a/cmd/derper/derper.go b/cmd/derper/derper.go index ef7a56f52..bad33d683 100644 --- a/cmd/derper/derper.go +++ b/cmd/derper/derper.go @@ -204,6 +204,15 @@ func main() { func debugHandler(s *derp.Server) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.RequestURI == "/debug/check" { + err := s.ConsistencyCheck() + if err != nil { + http.Error(w, err.Error(), 500) + } else { + io.WriteString(w, "derp.Server ConsistencyCheck okay") + } + return + } f := func(format string, args ...interface{}) { fmt.Fprintf(w, format, args...) } f(`

DERP debug

@@ -218,6 +227,7 @@ func debugHandler(s *derp.Server) http.Handler {
  • /debug/pprof/
  • /debug/pprof/goroutine (collapsed)
  • /debug/pprof/goroutine (full)
  • +
  • /debug/check internal consistency check