From a7efc22045ad251d32e23a599ba801c0b7730e51 Mon Sep 17 00:00:00 2001 From: Juan Font Alonso Date: Sat, 13 Aug 2022 21:17:05 +0200 Subject: [PATCH 1/6] Fix expired node registration URL --- api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api.go b/api.go index 561545b8..c6a1eca2 100644 --- a/api.go +++ b/api.go @@ -605,8 +605,8 @@ func (h *Headscale) handleMachineExpired( resp.AuthURL = fmt.Sprintf("%s/oidc/register/%s", strings.TrimSuffix(h.cfg.ServerURL, "/"), machineKey.String()) } else { - resp.AuthURL = fmt.Sprintf("%s/register?key=%s", - strings.TrimSuffix(h.cfg.ServerURL, "/"), machineKey.String()) + resp.AuthURL = fmt.Sprintf("%s/register/%s", + strings.TrimSuffix(h.cfg.ServerURL, "/"), NodePublicKeyStripPrefix(registerRequest.NodeKey)) } respBody, err := encode(resp, &machineKey, h.privateKey) From 8c13f64d3c47abdedc890b130877f7962b662bfb Mon Sep 17 00:00:00 2001 From: Juan Font Alonso Date: Sat, 13 Aug 2022 21:55:44 +0200 Subject: [PATCH 2/6] Changed missing path --- api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.go b/api.go index c6a1eca2..7e76b3e3 100644 --- a/api.go +++ b/api.go @@ -603,7 +603,7 @@ func (h *Headscale) handleMachineExpired( if h.cfg.OIDC.Issuer != "" { resp.AuthURL = fmt.Sprintf("%s/oidc/register/%s", - strings.TrimSuffix(h.cfg.ServerURL, "/"), machineKey.String()) + strings.TrimSuffix(h.cfg.ServerURL, "/"), NodePublicKeyStripPrefix(registerRequest.NodeKey)) } else { resp.AuthURL = fmt.Sprintf("%s/register/%s", strings.TrimSuffix(h.cfg.ServerURL, "/"), NodePublicKeyStripPrefix(registerRequest.NodeKey)) From d56b409cb9aa14ed5f345502125b3535e8d51c42 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 13 Aug 2022 20:44:38 +0000 Subject: [PATCH 3/6] docs(README): update contributors --- README.md | 70 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 0cfed4dd..911fd2e4 100644 --- a/README.md +++ b/README.md @@ -232,13 +232,6 @@ make build unreality - - - Moritz -
- Moritz Poldrack -
- ohdearaugustin/ @@ -246,8 +239,22 @@ make build ohdearaugustin + + + Moritz +
+ Moritz Poldrack +
+ + + + GrigoriyMikhalkin/ +
+ GrigoriyMikhalkin +
+ Niek @@ -262,13 +269,6 @@ make build Eugen Biegler - - - Aaron -
- Aaron Bieber -
- Anton @@ -276,6 +276,13 @@ make build Anton Schubert + + + Aaron +
+ Aaron Bieber +
+ Fernando @@ -283,13 +290,6 @@ make build Fernando De Lucchi - - - GrigoriyMikhalkin/ -
- GrigoriyMikhalkin -
- @@ -496,6 +496,13 @@ make build Pierre Carru + + + Rasmus +
+ Rasmus Moorats +
+ rcursaru/ @@ -503,6 +510,8 @@ make build rcursaru + + WhiteSource @@ -510,8 +519,6 @@ make build WhiteSource Renovate - - Ryan @@ -526,6 +533,13 @@ make build Shaanan Cohney + + + sophware/ +
+ sophware +
+ Tanner/ @@ -540,6 +554,8 @@ make build Teteros + + The @@ -554,8 +570,6 @@ make build Tianon Gravi - - Tjerk @@ -584,6 +598,8 @@ make build Ziyuan Han + + derelm/ @@ -598,8 +614,6 @@ make build henning mueller - - ignoramous/ @@ -628,6 +642,8 @@ make build Wakeful-Cloud + + zy/ From 5b14cafddd91bad3b0b9a5a454601f131b863d7e Mon Sep 17 00:00:00 2001 From: Juan Font Alonso Date: Sun, 14 Aug 2022 12:04:31 +0200 Subject: [PATCH 4/6] Fixed another recurrence of MachineKey --- api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.go b/api.go index 7e76b3e3..2c27ba8b 100644 --- a/api.go +++ b/api.go @@ -699,7 +699,7 @@ func (h *Headscale) handleMachineRegistrationNew( resp.AuthURL = fmt.Sprintf( "%s/oidc/register/%s", strings.TrimSuffix(h.cfg.ServerURL, "/"), - machineKey.String(), + NodePublicKeyStripPrefix(registerRequest.NodeKey), ) } else { resp.AuthURL = fmt.Sprintf("%s/register/%s", From 90bb6ea907b74794dfdcf77edee3c7f23f6ea5de Mon Sep 17 00:00:00 2001 From: Juan Font Alonso Date: Sun, 14 Aug 2022 12:10:20 +0200 Subject: [PATCH 5/6] Minor formatting changes --- api.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/api.go b/api.go index 2c27ba8b..2d55ccd3 100644 --- a/api.go +++ b/api.go @@ -603,10 +603,12 @@ func (h *Headscale) handleMachineExpired( if h.cfg.OIDC.Issuer != "" { resp.AuthURL = fmt.Sprintf("%s/oidc/register/%s", - strings.TrimSuffix(h.cfg.ServerURL, "/"), NodePublicKeyStripPrefix(registerRequest.NodeKey)) + strings.TrimSuffix(h.cfg.ServerURL, "/"), + NodePublicKeyStripPrefix(registerRequest.NodeKey)) } else { resp.AuthURL = fmt.Sprintf("%s/register/%s", - strings.TrimSuffix(h.cfg.ServerURL, "/"), NodePublicKeyStripPrefix(registerRequest.NodeKey)) + strings.TrimSuffix(h.cfg.ServerURL, "/"), + NodePublicKeyStripPrefix(registerRequest.NodeKey)) } respBody, err := encode(resp, &machineKey, h.privateKey) @@ -703,7 +705,8 @@ func (h *Headscale) handleMachineRegistrationNew( ) } else { resp.AuthURL = fmt.Sprintf("%s/register/%s", - strings.TrimSuffix(h.cfg.ServerURL, "/"), NodePublicKeyStripPrefix(registerRequest.NodeKey)) + strings.TrimSuffix(h.cfg.ServerURL, "/"), + NodePublicKeyStripPrefix(registerRequest.NodeKey)) } respBody, err := encode(resp, &machineKey, h.privateKey) From 8557bcedae15c7bd02eb2b877568c050184ee31c Mon Sep 17 00:00:00 2001 From: Juan Font Alonso Date: Sun, 14 Aug 2022 23:22:41 +0200 Subject: [PATCH 6/6] Added changelog entries for 0.16.x --- CHANGELOG.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b63a234..0cd52944 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,16 @@ # CHANGELOG -## 0.17.0 (2022-xx-xx) +## 0.17.0 (2022-XX-XX) + +## 0.16.2 (2022-08-14) + +### Changes + +- Fixed bugs in the client registration process after migration to NodeKey [#735](https://github.com/juanfont/headscale/pull/735) + +## 0.16.1 (2022-08-12) + +### Changes - Updated dependencies (including the library that lacked armhf support) [#722](https://github.com/juanfont/headscale/pull/722) - Fix missing group expansion in function `excludeCorretlyTaggedNodes` [#563](https://github.com/juanfont/headscale/issues/563)