Skip to content

Commit 9ae3570

Browse files
authored
drop versions older than 1.62 (#2405)
1 parent f12cb2e commit 9ae3570

File tree

6 files changed

+38
-21
lines changed

6 files changed

+38
-21
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Next
44

5+
6+
## 0.25.0 (2025-02-xx)
7+
58
### BREAKING
69

710
- Authentication flow has been rewritten
@@ -13,6 +16,8 @@
1316
[#1310](https://github.com/juanfont/headscale/issues/1310)).
1417
- A logged out node logging in with the same user will replace the existing
1518
node.
19+
- Remove support for Tailscale clients older than 1.62 (Capability version 87)
20+
[#2405](https://github.com/juanfont/headscale/pull/2405)
1621

1722
### Changes
1823

hscontrol/app.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,8 @@ func nodesChangedHook(db *db.HSDatabase, polMan policy.PolicyManager, notif *not
547547

548548
// Serve launches the HTTP and gRPC server service Headscale and the API.
549549
func (h *Headscale) Serve() error {
550+
capver.CanOldCodeBeCleanedUp()
551+
550552
if profilingEnabled {
551553
if profilingPath != "" {
552554
err := os.MkdirAll(profilingPath, os.ModePerm)
@@ -566,7 +568,7 @@ func (h *Headscale) Serve() error {
566568

567569
log.Info().
568570
Caller().
569-
Str("minimum_version", capver.TailscaleVersion(MinimumCapVersion)).
571+
Str("minimum_version", capver.TailscaleVersion(capver.MinSupportedCapabilityVersion)).
570572
Msg("Clients with a lower minimum version will be rejected")
571573

572574
// Fetch an initial DERP Map before we start serving

hscontrol/capver/capver.go

+14
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ import (
99
"tailscale.com/util/set"
1010
)
1111

12+
const MinSupportedCapabilityVersion tailcfg.CapabilityVersion = 88
13+
14+
// CanOldCodeBeCleanedUp is intended to be called on startup to see if
15+
// there are old code that can ble cleaned up, entries should contain
16+
// a CapVer where something can be cleaned up and a panic if it can.
17+
// This is only intended to catch things in tests.
18+
//
19+
// All uses of Capability version checks should be listed here.
20+
func CanOldCodeBeCleanedUp() {
21+
if MinSupportedCapabilityVersion >= 111 {
22+
panic("LegacyDERP can be cleaned up in tail.go")
23+
}
24+
}
25+
1226
func tailscaleVersSorted() []string {
1327
vers := xmaps.Keys(tailscaleToCapVer)
1428
sort.Strings(vers)

hscontrol/capver/capver_test.go

+13
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@ func TestTailscaleLatestMajorMinor(t *testing.T) {
1515
}{
1616
{3, false, []string{"v1.76", "v1.78", "v1.80"}},
1717
{2, true, []string{"1.78", "1.80"}},
18+
// Lazy way to see all supported versions
19+
{10, true, []string{
20+
"1.62",
21+
"1.64",
22+
"1.66",
23+
"1.68",
24+
"1.70",
25+
"1.72",
26+
"1.74",
27+
"1.76",
28+
"1.78",
29+
"1.80",
30+
}},
1831
{0, false, nil},
1932
}
2033

hscontrol/noise.go

+3-7
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,8 @@ func (ns *noiseServer) earlyNoise(protocolVersion int, writer io.Writer) error {
150150
return nil
151151
}
152152

153-
const (
154-
MinimumCapVersion tailcfg.CapabilityVersion = 82
155-
)
156-
157153
func isSupportedVersion(version tailcfg.CapabilityVersion) bool {
158-
return version >= MinimumCapVersion
154+
return version >= capver.MinSupportedCapabilityVersion
159155
}
160156

161157
func rejectUnsupported(
@@ -168,9 +164,9 @@ func rejectUnsupported(
168164
if !isSupportedVersion(version) {
169165
log.Error().
170166
Caller().
171-
Int("minimum_cap_ver", int(MinimumCapVersion)).
167+
Int("minimum_cap_ver", int(capver.MinSupportedCapabilityVersion)).
172168
Int("client_cap_ver", int(version)).
173-
Str("minimum_version", capver.TailscaleVersion(MinimumCapVersion)).
169+
Str("minimum_version", capver.TailscaleVersion(capver.MinSupportedCapabilityVersion)).
174170
Str("client_version", capver.TailscaleVersion(version)).
175171
Str("node_key", nkey.ShortString()).
176172
Str("machine_key", mkey.ShortString()).

integration/scenario.go

-13
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,6 @@ const (
3434

3535
var usePostgresForTest = envknob.Bool("HEADSCALE_INTEGRATION_POSTGRES")
3636

37-
func enabledVersions(vs map[string]bool) []string {
38-
var ret []string
39-
for version, enabled := range vs {
40-
if enabled {
41-
ret = append(ret, version)
42-
}
43-
}
44-
45-
sort.Sort(sort.Reverse(sort.StringSlice(ret)))
46-
47-
return ret
48-
}
49-
5037
var (
5138
errNoHeadscaleAvailable = errors.New("no headscale available")
5239
errNoUserAvailable = errors.New("no user available")

0 commit comments

Comments
 (0)