diff --git a/README.md b/README.md index bb456b3..20f6024 100644 --- a/README.md +++ b/README.md @@ -276,6 +276,13 @@ make build Hoàng Đức Hiếu + + + Deon +
+ Deon Thomas +
+ Mevan @@ -283,6 +290,8 @@ make build Mevan Samaratunga + + Michael @@ -290,8 +299,6 @@ make build Michael G. - - Paul @@ -327,6 +334,8 @@ make build Stefan Majer + + lachy2849/ @@ -334,8 +343,6 @@ make build lachy2849 - - thomas/ @@ -371,6 +378,8 @@ make build Arthur Woimbée + + Bryan @@ -378,8 +387,6 @@ make build Bryan Stenson - - Carson @@ -415,6 +422,8 @@ make build Jamie Greeff + + Jim @@ -422,8 +431,6 @@ make build Jim Tittsler - - Pierre @@ -459,6 +466,8 @@ make build Shaanan Cohney + + Tanner/ @@ -466,8 +475,6 @@ make build Tanner - - Teteros/ @@ -503,6 +510,8 @@ make build Yang Bin + + Zakhar @@ -510,8 +519,6 @@ make build Zakhar Bessarab - - ZiYuan/ @@ -547,6 +554,8 @@ make build ignoramous + + lion24/ @@ -554,8 +563,6 @@ make build lion24 - - pernila/ diff --git a/cmd/headscale/cli/nodes.go b/cmd/headscale/cli/nodes.go index 12021f4..fa8b1b2 100644 --- a/cmd/headscale/cli/nodes.go +++ b/cmd/headscale/cli/nodes.go @@ -13,6 +13,7 @@ import ( "github.com/pterm/pterm" "github.com/spf13/cobra" "google.golang.org/grpc/status" + "inet.af/netaddr" "tailscale.com/types/key" ) @@ -496,12 +497,23 @@ func nodesToPtables( // Shared into this namespace namespace = pterm.LightYellow(machine.Namespace.Name) } + + var IpV4Address string + var IpV6Address string + for _, addr := range machine.IpAddresses { + if netaddr.MustParseIP(addr).Is4() { + IpV4Address = addr + } else { + IpV6Address = addr + } + } + nodeData := []string{ strconv.FormatUint(machine.Id, headscale.Base10), machine.Name, nodeKey.ShortString(), namespace, - strings.Join(machine.IpAddresses, ", "), + strings.Join([]string{IpV4Address, IpV6Address}, ", "), strconv.FormatBool(ephemeral), lastSeenTime, online, diff --git a/docs/remote-cli.md b/docs/remote-cli.md index 3b1dc84..c9d1968 100644 --- a/docs/remote-cli.md +++ b/docs/remote-cli.md @@ -24,7 +24,7 @@ To create a API key, log into your `headscale` server and generate a key: headscale apikeys create --expiration 90d ``` -Copy the output of the command and save it for later. Please not that you can not retrieve a key again, +Copy the output of the command and save it for later. Please note that you can not retrieve a key again, if the key is lost, expire the old one, and create a new key. To list the keys currently assosicated with the server: