Skip to content

Commit 97ee0bc

Browse files
Tom DNettotwitchyliquid64
Tom DNetto
authored andcommitted
cmd/tailscale: improve error message when signing without a tailnet lock key
Updates tailscale#8568 Signed-off-by: Tom DNetto <[email protected]>
1 parent b0a984d commit 97ee0bc

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

cmd/tailscale/cli/network-lock.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,16 @@ func runNetworkLockSign(ctx context.Context, args []string) error {
465465
}
466466
}
467467

468-
return localClient.NetworkLockSign(ctx, nodeKey, []byte(rotationKey.Verifier()))
468+
err := localClient.NetworkLockSign(ctx, nodeKey, []byte(rotationKey.Verifier()))
469+
// Provide a better help message for when someone clicks through the signing flow
470+
// on the wrong device.
471+
if err != nil && strings.Contains(err.Error(), "this node is not trusted by network lock") {
472+
fmt.Fprintln(os.Stderr, "Error: Signing is not available on this device because it does not have a trusted tailnet lock key.")
473+
fmt.Fprintln(os.Stderr)
474+
fmt.Fprintln(os.Stderr, "Try again on a signing device instead. Tailnet admins can see signing devices on the admin panel.")
475+
fmt.Fprintln(os.Stderr)
476+
}
477+
return err
469478
}
470479

471480
var nlDisableCmd = &ffcli.Command{

0 commit comments

Comments
 (0)