From ed46491a3d94ed02e34be51ae0d9a3d47c848aa4 Mon Sep 17 00:00:00 2001 From: Deon Thomas Date: Sat, 7 May 2022 16:23:26 -0400 Subject: [PATCH 1/4] fixed typo not => note --- docs/remote-cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: From b4f5ed6618ea5e1cc62601ab4fd6b395e9db8b99 Mon Sep 17 00:00:00 2001 From: Deon Thomas Date: Sun, 8 May 2022 15:06:12 -0400 Subject: [PATCH 2/4] order ip address output, IPv4 first --- cmd/headscale/cli/nodes.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cmd/headscale/cli/nodes.go b/cmd/headscale/cli/nodes.go index aafd9b9..805d2ee 100644 --- a/cmd/headscale/cli/nodes.go +++ b/cmd/headscale/cli/nodes.go @@ -4,7 +4,6 @@ import ( "fmt" "log" "strconv" - "strings" "time" survey "github.com/AlecAivazis/survey/v2" @@ -13,6 +12,7 @@ import ( "github.com/pterm/pterm" "github.com/spf13/cobra" "google.golang.org/grpc/status" + "inet.af/netaddr" "tailscale.com/types/key" ) @@ -452,6 +452,16 @@ func nodesToPtables( // Shared into this namespace namespace = pterm.LightYellow(machine.Namespace.Name) } + + var IpAddresses string + if netaddr.MustParseIP(machine.IpAddresses[0]).Is4() { + IpAddresses = machine.IpAddresses[0] + IpAddresses += ", " + machine.IpAddresses[1] + } else { + IpAddresses = machine.IpAddresses[1] + IpAddresses += ", " + machine.IpAddresses[0] + } + tableData = append( tableData, []string{ @@ -459,7 +469,7 @@ func nodesToPtables( machine.Name, nodeKey.ShortString(), namespace, - strings.Join(machine.IpAddresses, ", "), + IpAddresses, strconv.FormatBool(ephemeral), lastSeenTime, online, From 6ed79b7bb8217547af814ec6761d0c45f72e35f9 Mon Sep 17 00:00:00 2001 From: Deon Thomas Date: Sun, 8 May 2022 15:21:10 -0400 Subject: [PATCH 3/4] order Ip Address, IPv4 first, cleanup --- cmd/headscale/cli/nodes.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/cmd/headscale/cli/nodes.go b/cmd/headscale/cli/nodes.go index 805d2ee..9159b32 100644 --- a/cmd/headscale/cli/nodes.go +++ b/cmd/headscale/cli/nodes.go @@ -4,6 +4,7 @@ import ( "fmt" "log" "strconv" + "strings" "time" survey "github.com/AlecAivazis/survey/v2" @@ -453,13 +454,14 @@ func nodesToPtables( namespace = pterm.LightYellow(machine.Namespace.Name) } - var IpAddresses string - if netaddr.MustParseIP(machine.IpAddresses[0]).Is4() { - IpAddresses = machine.IpAddresses[0] - IpAddresses += ", " + machine.IpAddresses[1] - } else { - IpAddresses = machine.IpAddresses[1] - IpAddresses += ", " + machine.IpAddresses[0] + var IpV4Address string + var IpV6Address string + for _, addr := range machine.IpAddresses { + if netaddr.MustParseIP(addr).Is4() { + IpV4Address = addr + } else { + IpV6Address = addr + } } tableData = append( @@ -469,7 +471,7 @@ func nodesToPtables( machine.Name, nodeKey.ShortString(), namespace, - IpAddresses, + strings.Join([]string{IpV4Address, IpV6Address}, ", "), strconv.FormatBool(ephemeral), lastSeenTime, online, From 31bdba74561898c72819d34e5432f65fd45c7631 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 8 May 2022 21:57:04 +0000 Subject: [PATCH 4/4] docs(README): update contributors --- README.md | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) 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/