mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
trace: Remove restriction on tracing pages
By default, golang.org/x/net/trace currently only allows the tracing pages to be seen from localhost. This restriction can be confusing for people accessing the monitoring server remotely, and adds no value in our environment. The monitoring server already exports very sensitive information, and must be enabled with care, and is not on by default. This is well documented. This patch removes the restriction, making all the monitoring pages equally accessible.
This commit is contained in:
@@ -3,6 +3,7 @@ package trace
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"blitiri.com.ar/go/log"
|
||||
@@ -10,6 +11,15 @@ import (
|
||||
nettrace "golang.org/x/net/trace"
|
||||
)
|
||||
|
||||
func init() {
|
||||
// golang.org/x/net/trace has its own authorization which by default only
|
||||
// allows localhost. This can be confusing and limiting in environments
|
||||
// which access the monitoring server remotely.
|
||||
nettrace.AuthRequest = func(req *http.Request) (any, sensitive bool) {
|
||||
return true, true
|
||||
}
|
||||
}
|
||||
|
||||
// A Trace represents an active request.
|
||||
type Trace struct {
|
||||
family string
|
||||
|
||||
Reference in New Issue
Block a user