|
|
@ -55,6 +55,7 @@ import (
|
|
|
|
"tailscale.com/util/clientmetric"
|
|
|
|
"tailscale.com/util/clientmetric"
|
|
|
|
"tailscale.com/util/multierr"
|
|
|
|
"tailscale.com/util/multierr"
|
|
|
|
"tailscale.com/util/singleflight"
|
|
|
|
"tailscale.com/util/singleflight"
|
|
|
|
|
|
|
|
"tailscale.com/util/syspolicy"
|
|
|
|
"tailscale.com/util/systemd"
|
|
|
|
"tailscale.com/util/systemd"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
@ -566,6 +567,11 @@ func (c *Direct) doLogin(ctx context.Context, opt loginOpt) (mustRegen bool, new
|
|
|
|
err = errors.New("hostinfo: BackendLogID missing")
|
|
|
|
err = errors.New("hostinfo: BackendLogID missing")
|
|
|
|
return regen, opt.URL, nil, err
|
|
|
|
return regen, opt.URL, nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tailnet, err := syspolicy.GetString(syspolicy.Tailnet, "")
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
c.logf("unable to provide Tailnet field in register request. err: %v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
now := c.clock.Now().Round(time.Second)
|
|
|
|
now := c.clock.Now().Round(time.Second)
|
|
|
|
request := tailcfg.RegisterRequest{
|
|
|
|
request := tailcfg.RegisterRequest{
|
|
|
|
Version: 1,
|
|
|
|
Version: 1,
|
|
|
@ -577,6 +583,7 @@ func (c *Direct) doLogin(ctx context.Context, opt loginOpt) (mustRegen bool, new
|
|
|
|
Timestamp: &now,
|
|
|
|
Timestamp: &now,
|
|
|
|
Ephemeral: (opt.Flags & LoginEphemeral) != 0,
|
|
|
|
Ephemeral: (opt.Flags & LoginEphemeral) != 0,
|
|
|
|
NodeKeySignature: nodeKeySignature,
|
|
|
|
NodeKeySignature: nodeKeySignature,
|
|
|
|
|
|
|
|
Tailnet: tailnet,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if opt.Logout {
|
|
|
|
if opt.Logout {
|
|
|
|
request.Expiry = time.Unix(123, 0) // far in the past
|
|
|
|
request.Expiry = time.Unix(123, 0) // far in the past
|
|
|
|