go.mod: update from OSS

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
bradfitz/shared_user_dev
Denton Gentry 2 years ago
parent 2118ca5b38
commit aa32919ac3

@ -24,6 +24,7 @@ import (
"tailscale.com/logtail"
"tailscale.com/logtail/filch"
"tailscale.com/net/dns"
"tailscale.com/net/netmon"
"tailscale.com/net/tsdial"
"tailscale.com/smallzstd"
"tailscale.com/types/logger"
@ -322,6 +323,15 @@ func (b *backend) CloseTUNs() {
// SetupLogs sets up remote logging.
func (b *backend) SetupLogs(logDir string, logID logid.PrivateID) {
logf := logger.RusagePrefixLog(log.Printf)
netMon, err := netmon.New(func(format string, args ...any) {
logf(format, args...)
})
if err != nil {
log.Printf("netmon.New: %w", err)
}
transport := logpolicy.NewLogtailTransport(logtail.DefaultHost, netMon)
logcfg := logtail.Config{
Collection: logtail.CollectionNode,
PrivateID: logID,
@ -332,7 +342,7 @@ func (b *backend) SetupLogs(logDir string, logID logid.PrivateID) {
NewZstdEncoder: func() logtail.Encoder {
return must.Get(smallzstd.NewEncoder(nil))
},
HTTPC: &http.Client{Transport: logpolicy.NewLogtailTransport(logtail.DefaultHost)},
HTTPC: &http.Client{Transport: transport},
}
logcfg.FlushDelayFn = func() time.Duration { return 2 * time.Minute }
@ -346,7 +356,6 @@ func (b *backend) SetupLogs(logDir string, logID logid.PrivateID) {
logcfg.Buffer, filchErr = filch.New(logPath, filchOpts)
}
logf := logger.RusagePrefixLog(log.Printf)
b.logger = logtail.NewLogger(logcfg, logf)
log.SetFlags(0)

@ -11,7 +11,7 @@ require (
golang.org/x/exp/shiny v0.0.0-20220827204233-334a2380cb91
golang.org/x/sys v0.6.0
inet.af/netaddr v0.0.0-20220617031823-097006376321
tailscale.com v1.1.1-0.20230417223824-280255acae60
tailscale.com v1.1.1-0.20230422043621-e3b2250e2654
)
require (

@ -712,5 +712,5 @@ nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
software.sslmate.com/src/go-pkcs12 v0.2.0 h1:nlFkj7bTysH6VkC4fGphtjXRbezREPgrHuJG20hBGPE=
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=
tailscale.com v1.1.1-0.20230417223824-280255acae60 h1:2HRc4eZppqmfGjsih892UFBgFbBH9t9iW1GM26OZqTw=
tailscale.com v1.1.1-0.20230417223824-280255acae60/go.mod h1:j5vekUD4eLhLpHl/tNBps25strCOBXyiKUsdR1HhMq8=
tailscale.com v1.1.1-0.20230422043621-e3b2250e2654 h1:lSCSMwc0Zo24IUi9xwB8KbsCJvJxP76eNpNIaZNyGJ0=
tailscale.com v1.1.1-0.20230422043621-e3b2250e2654/go.mod h1:j5vekUD4eLhLpHl/tNBps25strCOBXyiKUsdR1HhMq8=

Loading…
Cancel
Save