mirror of
https://github.com/juanfont/headscale.git
synced 2025-02-08 02:08:07 +09:00
drop versions older than 1.62 (#2405)
Some checks are pending
Build / build-nix (push) Waiting to run
Build / build-cross (GOARCH=386 GOOS=linux) (push) Waiting to run
Build / build-cross (GOARCH=amd64 GOOS=darwin) (push) Waiting to run
Build / build-cross (GOARCH=amd64 GOOS=linux) (push) Waiting to run
Build / build-cross (GOARCH=arm GOOS=linux GOARM=5) (push) Waiting to run
Build / build-cross (GOARCH=arm GOOS=linux GOARM=6) (push) Waiting to run
Build / build-cross (GOARCH=arm GOOS=linux GOARM=7) (push) Waiting to run
Build / build-cross (GOARCH=arm64 GOOS=darwin) (push) Waiting to run
Build / build-cross (GOARCH=arm64 GOOS=linux) (push) Waiting to run
Deploy docs / deploy (push) Waiting to run
Tests / test (push) Waiting to run
Some checks are pending
Build / build-nix (push) Waiting to run
Build / build-cross (GOARCH=386 GOOS=linux) (push) Waiting to run
Build / build-cross (GOARCH=amd64 GOOS=darwin) (push) Waiting to run
Build / build-cross (GOARCH=amd64 GOOS=linux) (push) Waiting to run
Build / build-cross (GOARCH=arm GOOS=linux GOARM=5) (push) Waiting to run
Build / build-cross (GOARCH=arm GOOS=linux GOARM=6) (push) Waiting to run
Build / build-cross (GOARCH=arm GOOS=linux GOARM=7) (push) Waiting to run
Build / build-cross (GOARCH=arm64 GOOS=darwin) (push) Waiting to run
Build / build-cross (GOARCH=arm64 GOOS=linux) (push) Waiting to run
Deploy docs / deploy (push) Waiting to run
Tests / test (push) Waiting to run
This commit is contained in:
parent
f12cb2e048
commit
9ae3570154
6 changed files with 38 additions and 21 deletions
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
## Next
|
## Next
|
||||||
|
|
||||||
|
|
||||||
|
## 0.25.0 (2025-02-xx)
|
||||||
|
|
||||||
### BREAKING
|
### BREAKING
|
||||||
|
|
||||||
- Authentication flow has been rewritten
|
- Authentication flow has been rewritten
|
||||||
|
@ -13,6 +16,8 @@
|
||||||
[#1310](https://github.com/juanfont/headscale/issues/1310)).
|
[#1310](https://github.com/juanfont/headscale/issues/1310)).
|
||||||
- A logged out node logging in with the same user will replace the existing
|
- A logged out node logging in with the same user will replace the existing
|
||||||
node.
|
node.
|
||||||
|
- Remove support for Tailscale clients older than 1.62 (Capability version 87)
|
||||||
|
[#2405](https://github.com/juanfont/headscale/pull/2405)
|
||||||
|
|
||||||
### Changes
|
### Changes
|
||||||
|
|
||||||
|
|
|
@ -547,6 +547,8 @@ func nodesChangedHook(db *db.HSDatabase, polMan policy.PolicyManager, notif *not
|
||||||
|
|
||||||
// Serve launches the HTTP and gRPC server service Headscale and the API.
|
// Serve launches the HTTP and gRPC server service Headscale and the API.
|
||||||
func (h *Headscale) Serve() error {
|
func (h *Headscale) Serve() error {
|
||||||
|
capver.CanOldCodeBeCleanedUp()
|
||||||
|
|
||||||
if profilingEnabled {
|
if profilingEnabled {
|
||||||
if profilingPath != "" {
|
if profilingPath != "" {
|
||||||
err := os.MkdirAll(profilingPath, os.ModePerm)
|
err := os.MkdirAll(profilingPath, os.ModePerm)
|
||||||
|
@ -566,7 +568,7 @@ func (h *Headscale) Serve() error {
|
||||||
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Caller().
|
Caller().
|
||||||
Str("minimum_version", capver.TailscaleVersion(MinimumCapVersion)).
|
Str("minimum_version", capver.TailscaleVersion(capver.MinSupportedCapabilityVersion)).
|
||||||
Msg("Clients with a lower minimum version will be rejected")
|
Msg("Clients with a lower minimum version will be rejected")
|
||||||
|
|
||||||
// Fetch an initial DERP Map before we start serving
|
// Fetch an initial DERP Map before we start serving
|
||||||
|
|
|
@ -9,6 +9,20 @@ import (
|
||||||
"tailscale.com/util/set"
|
"tailscale.com/util/set"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const MinSupportedCapabilityVersion tailcfg.CapabilityVersion = 88
|
||||||
|
|
||||||
|
// CanOldCodeBeCleanedUp is intended to be called on startup to see if
|
||||||
|
// there are old code that can ble cleaned up, entries should contain
|
||||||
|
// a CapVer where something can be cleaned up and a panic if it can.
|
||||||
|
// This is only intended to catch things in tests.
|
||||||
|
//
|
||||||
|
// All uses of Capability version checks should be listed here.
|
||||||
|
func CanOldCodeBeCleanedUp() {
|
||||||
|
if MinSupportedCapabilityVersion >= 111 {
|
||||||
|
panic("LegacyDERP can be cleaned up in tail.go")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func tailscaleVersSorted() []string {
|
func tailscaleVersSorted() []string {
|
||||||
vers := xmaps.Keys(tailscaleToCapVer)
|
vers := xmaps.Keys(tailscaleToCapVer)
|
||||||
sort.Strings(vers)
|
sort.Strings(vers)
|
||||||
|
|
|
@ -15,6 +15,19 @@ func TestTailscaleLatestMajorMinor(t *testing.T) {
|
||||||
}{
|
}{
|
||||||
{3, false, []string{"v1.76", "v1.78", "v1.80"}},
|
{3, false, []string{"v1.76", "v1.78", "v1.80"}},
|
||||||
{2, true, []string{"1.78", "1.80"}},
|
{2, true, []string{"1.78", "1.80"}},
|
||||||
|
// Lazy way to see all supported versions
|
||||||
|
{10, true, []string{
|
||||||
|
"1.62",
|
||||||
|
"1.64",
|
||||||
|
"1.66",
|
||||||
|
"1.68",
|
||||||
|
"1.70",
|
||||||
|
"1.72",
|
||||||
|
"1.74",
|
||||||
|
"1.76",
|
||||||
|
"1.78",
|
||||||
|
"1.80",
|
||||||
|
}},
|
||||||
{0, false, nil},
|
{0, false, nil},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -150,12 +150,8 @@ func (ns *noiseServer) earlyNoise(protocolVersion int, writer io.Writer) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
|
||||||
MinimumCapVersion tailcfg.CapabilityVersion = 82
|
|
||||||
)
|
|
||||||
|
|
||||||
func isSupportedVersion(version tailcfg.CapabilityVersion) bool {
|
func isSupportedVersion(version tailcfg.CapabilityVersion) bool {
|
||||||
return version >= MinimumCapVersion
|
return version >= capver.MinSupportedCapabilityVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
func rejectUnsupported(
|
func rejectUnsupported(
|
||||||
|
@ -168,9 +164,9 @@ func rejectUnsupported(
|
||||||
if !isSupportedVersion(version) {
|
if !isSupportedVersion(version) {
|
||||||
log.Error().
|
log.Error().
|
||||||
Caller().
|
Caller().
|
||||||
Int("minimum_cap_ver", int(MinimumCapVersion)).
|
Int("minimum_cap_ver", int(capver.MinSupportedCapabilityVersion)).
|
||||||
Int("client_cap_ver", int(version)).
|
Int("client_cap_ver", int(version)).
|
||||||
Str("minimum_version", capver.TailscaleVersion(MinimumCapVersion)).
|
Str("minimum_version", capver.TailscaleVersion(capver.MinSupportedCapabilityVersion)).
|
||||||
Str("client_version", capver.TailscaleVersion(version)).
|
Str("client_version", capver.TailscaleVersion(version)).
|
||||||
Str("node_key", nkey.ShortString()).
|
Str("node_key", nkey.ShortString()).
|
||||||
Str("machine_key", mkey.ShortString()).
|
Str("machine_key", mkey.ShortString()).
|
||||||
|
|
|
@ -34,19 +34,6 @@ const (
|
||||||
|
|
||||||
var usePostgresForTest = envknob.Bool("HEADSCALE_INTEGRATION_POSTGRES")
|
var usePostgresForTest = envknob.Bool("HEADSCALE_INTEGRATION_POSTGRES")
|
||||||
|
|
||||||
func enabledVersions(vs map[string]bool) []string {
|
|
||||||
var ret []string
|
|
||||||
for version, enabled := range vs {
|
|
||||||
if enabled {
|
|
||||||
ret = append(ret, version)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sort.Sort(sort.Reverse(sort.StringSlice(ret)))
|
|
||||||
|
|
||||||
return ret
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
errNoHeadscaleAvailable = errors.New("no headscale available")
|
errNoHeadscaleAvailable = errors.New("no headscale available")
|
||||||
errNoUserAvailable = errors.New("no user available")
|
errNoUserAvailable = errors.New("no user available")
|
||||||
|
|
Loading…
Reference in a new issue