[PR #645] [CLOSED] Implement TS2021 #1550

Closed
opened 2025-12-29 02:30:32 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/645
Author: @juanfont
Created: 6/16/2022
Status: Closed

Base: mainHead: hs2021


📝 Commits (7)

  • c908627 Generate and read the Noise private key
  • 304987b TS2021: Convert /key handler to send the Noise key too
  • b40b4e8 Added Noise upgrade handler and Noise mux
  • e8205e8 TS2021: Use NodeKey for everything, as MachineKey is deprecated in TS2021
  • 670c7d9 TS2021: Add Noise endpoint for node registration
  • 7078d36 Added MapPoll to Noise protocol
  • 96b02f7 Updated test config to work with TS2021

📊 Changes

14 files changed (+1415 additions, -40 deletions)

View changed files

📝 api.go (+32 -2)
📝 app.go (+42 -9)
📝 config-example.yaml (+7 -0)
📝 config.go (+4 -0)
📝 integration_test/etc/alt-config.dump.gold.yaml (+1 -0)
📝 integration_test/etc/alt-config.yaml (+1 -0)
📝 integration_test/etc/config.dump.gold.yaml (+1 -0)
📝 integration_test/etc_embedded_derp/config.yaml (+3 -2)
📝 machine.go (+25 -9)
📝 machine_test.go (+30 -0)
noise.go (+125 -0)
noise_api.go (+389 -0)
noise_poll.go (+737 -0)
📝 oidc.go (+18 -18)

📄 Description

This PR adds full support for TS2021, the new control protocol of Tailscale. For reference, see https://github.com/juanfont/headscale/issues/526.

This is the second implementation I do of this, this time without using Gin - just plain old net/http. Gin was terminating the Noise connection or not flushing it.

T2021 prefers to run over http, to avoid double encryption. Currently, any port is supported for http. However, for https only tcp/443 works. https://github.com/tailscale/tailscale/pull/4323 is open in upstream to change that.

Tests are not working yet. Working on that. But It Should Work(tm)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/645 **Author:** [@juanfont](https://github.com/juanfont) **Created:** 6/16/2022 **Status:** ❌ Closed **Base:** `main` ← **Head:** `hs2021` --- ### 📝 Commits (7) - [`c908627`](https://github.com/juanfont/headscale/commit/c908627e68fb54fce462287bd391b447e8f4a075) Generate and read the Noise private key - [`304987b`](https://github.com/juanfont/headscale/commit/304987b4ffc9d109e4a56229951077a1758a73c4) TS2021: Convert /key handler to send the Noise key too - [`b40b4e8`](https://github.com/juanfont/headscale/commit/b40b4e8d45cd4a2eaf5712a1098f6c19a3993875) Added Noise upgrade handler and Noise mux - [`e8205e8`](https://github.com/juanfont/headscale/commit/e8205e8d5acc14dd5cc969735cf1efa4cbb74d44) TS2021: Use NodeKey for everything, as MachineKey is deprecated in TS2021 - [`670c7d9`](https://github.com/juanfont/headscale/commit/670c7d9144ad7b76a344178a7afe5c7278d9ac9b) TS2021: Add Noise endpoint for node registration - [`7078d36`](https://github.com/juanfont/headscale/commit/7078d36dc605a8e58dc101d57fd173e214b6ab2f) Added MapPoll to Noise protocol - [`96b02f7`](https://github.com/juanfont/headscale/commit/96b02f7d89e91368915d594f13fec49d71be60cd) Updated test config to work with TS2021 ### 📊 Changes **14 files changed** (+1415 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `api.go` (+32 -2) 📝 `app.go` (+42 -9) 📝 `config-example.yaml` (+7 -0) 📝 `config.go` (+4 -0) 📝 `integration_test/etc/alt-config.dump.gold.yaml` (+1 -0) 📝 `integration_test/etc/alt-config.yaml` (+1 -0) 📝 `integration_test/etc/config.dump.gold.yaml` (+1 -0) 📝 `integration_test/etc_embedded_derp/config.yaml` (+3 -2) 📝 `machine.go` (+25 -9) 📝 `machine_test.go` (+30 -0) ➕ `noise.go` (+125 -0) ➕ `noise_api.go` (+389 -0) ➕ `noise_poll.go` (+737 -0) 📝 `oidc.go` (+18 -18) </details> ### 📄 Description This PR adds full support for TS2021, the new control protocol of Tailscale. For reference, see https://github.com/juanfont/headscale/issues/526. This is the second implementation I do of this, this time without using Gin - just plain old net/http. Gin was terminating the Noise connection or not flushing it. T2021 prefers to run over http, to avoid double encryption. Currently, any port is supported for http. However, for https only tcp/443 works. https://github.com/tailscale/tailscale/pull/4323 is open in upstream to change that. Tests are not working yet. Working on that. But It Should Work(tm) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 02:30:32 +01:00
adam closed this issue 2025-12-29 02:30:32 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1550