Skip to content

Commit 7a43460

Browse files
feat(ci): bump to upstream 1.74.0 (#11)
https://tailscale.com/changelog#2024-09-12
2 parents 8c409a3 + 2da2083 commit 7a43460

File tree

271 files changed

+22733
-2228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

271 files changed

+22733
-2228
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,8 @@ client/web/build/assets
4444
/gocross
4545
/dist
4646

47-
.DS_Store
47+
# Ignore xcode userstate and workspace data
48+
*.xcuserstate
49+
*.xcworkspacedata
50+
/tstest/tailmac/bin
51+
/tstest/tailmac/build

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# $ docker exec tailscaled tailscale status
2828

2929

30-
FROM golang:1.22-alpine AS build-env
30+
FROM golang:1.23-alpine AS build-env
3131

3232
WORKDIR /go/src/tailscale
3333

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ sshintegrationtest: ## Run the SSH integration tests in various Docker container
117117
echo "Testing on ubuntu:focal" && docker build --build-arg="BASE=ubuntu:focal" -t ssh-ubuntu-focal ssh/tailssh/testcontainers && \
118118
echo "Testing on ubuntu:jammy" && docker build --build-arg="BASE=ubuntu:jammy" -t ssh-ubuntu-jammy ssh/tailssh/testcontainers && \
119119
echo "Testing on ubuntu:mantic" && docker build --build-arg="BASE=ubuntu:mantic" -t ssh-ubuntu-mantic ssh/tailssh/testcontainers && \
120-
echo "Testing on ubuntu:noble" && docker build --build-arg="BASE=ubuntu:noble" -t ssh-ubuntu-noble ssh/tailssh/testcontainers
120+
echo "Testing on ubuntu:noble" && docker build --build-arg="BASE=ubuntu:noble" -t ssh-ubuntu-noble ssh/tailssh/testcontainers && \
121+
echo "Testing on alpine:latest" && docker build --build-arg="BASE=alpine:latest" -t ssh-alpine-latest ssh/tailssh/testcontainers
121122

122123
help: ## Show this help
123124
@echo "\nSpecify a command. The choices are:\n"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ not open source.
3737

3838
## Building
3939

40-
We always require the latest Go release, currently Go 1.22. (While we build
40+
We always require the latest Go release, currently Go 1.23. (While we build
4141
releases with our [Go fork](https://github.com/tailscale/go/), its use is not
4242
required.)
4343

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.72.1
1+
1.74.0

client/tailscale/acl.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
// Only one of Src/Dst or Users/Ports may be specified.
2020
type ACLRow struct {
2121
Action string `json:"action,omitempty"` // valid values: "accept"
22+
Proto string `json:"proto,omitempty"` // protocol
2223
Users []string `json:"users,omitempty"` // old name for src
2324
Ports []string `json:"ports,omitempty"` // old name for dst
2425
Src []string `json:"src,omitempty"`
@@ -31,6 +32,7 @@ type ACLRow struct {
3132
type ACLTest struct {
3233
Src string `json:"src,omitempty"` // source
3334
User string `json:"user,omitempty"` // old name for source
35+
Proto string `json:"proto,omitempty"` // protocol
3436
Accept []string `json:"accept,omitempty"` // expected destination ip:port that user can access
3537
Deny []string `json:"deny,omitempty"` // expected destination ip:port that user cannot access
3638

client/tailscale/apitype/apitype.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,11 @@ type ExitNodeSuggestionResponse struct {
5757
Name string
5858
Location tailcfg.LocationView `json:",omitempty"`
5959
}
60+
61+
// DNSOSConfig mimics dns.OSConfig without forcing us to import the entire dns package
62+
// into the CLI.
63+
type DNSOSConfig struct {
64+
Nameservers []string
65+
SearchDomains []string
66+
MatchDomains []string
67+
}

client/tailscale/localclient.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,12 @@ func (lc *LocalClient) DaemonMetrics(ctx context.Context) ([]byte, error) {
353353
return lc.get200(ctx, "/localapi/v0/metrics")
354354
}
355355

356+
// UserMetrics returns the user metrics in
357+
// the Prometheus text exposition format.
358+
func (lc *LocalClient) UserMetrics(ctx context.Context) ([]byte, error) {
359+
return lc.get200(ctx, "/localapi/v0/usermetrics")
360+
}
361+
356362
// IncrementCounter increments the value of a Tailscale daemon's counter
357363
// metric by the given delta. If the metric has yet to exist, a new counter
358364
// metric is created and initialized to delta.
@@ -807,6 +813,18 @@ func (lc *LocalClient) EditPrefs(ctx context.Context, mp *ipn.MaskedPrefs) (*ipn
807813
return decodeJSON[*ipn.Prefs](body)
808814
}
809815

816+
func (lc *LocalClient) GetDNSOSConfig(ctx context.Context) (*apitype.DNSOSConfig, error) {
817+
body, err := lc.get200(ctx, "/localapi/v0/dns-osconfig")
818+
if err != nil {
819+
return nil, err
820+
}
821+
var osCfg apitype.DNSOSConfig
822+
if err := json.Unmarshal(body, &osCfg); err != nil {
823+
return nil, fmt.Errorf("invalid dns.OSConfig: %w", err)
824+
}
825+
return &osCfg, nil
826+
}
827+
810828
// StartLoginInteractive starts an interactive login.
811829
func (lc *LocalClient) StartLoginInteractive(ctx context.Context) error {
812830
_, err := lc.send(ctx, "POST", "/localapi/v0/login-interactive", http.StatusNoContent, nil)

client/tailscale/required_version.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Copyright (c) Tailscale Inc & AUTHORS
22
// SPDX-License-Identifier: BSD-3-Clause
33

4-
//go:build !go1.21
4+
//go:build !go1.23
55

66
package tailscale
77

88
func init() {
9-
you_need_Go_1_21_to_compile_Tailscale()
9+
you_need_Go_1_23_to_compile_Tailscale()
1010
}

client/web/web.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,12 @@ func (s *Server) serve(w http.ResponseWriter, r *http.Request) {
283283
}
284284
}
285285

286+
if r.URL.Path == "/metrics" {
287+
r.URL.Path = "/api/local/v0/usermetrics"
288+
s.proxyRequestToLocalAPI(w, r)
289+
return
290+
}
291+
286292
if strings.HasPrefix(r.URL.Path, "/api/") {
287293
switch {
288294
case r.URL.Path == "/api/auth" && r.Method == httpm.GET:

client/web/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5382,9 +5382,9 @@ wrappy@1:
53825382
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==
53835383

53845384
ws@^8.14.2:
5385-
version "8.14.2"
5386-
resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.2.tgz#6c249a806eb2db7a20d26d51e7709eab7b2e6c7f"
5387-
integrity sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==
5385+
version "8.17.1"
5386+
resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b"
5387+
integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==
53885388

53895389
xml-name-validator@^5.0.0:
53905390
version "5.0.0"

cmd/cloner/cloner.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func main() {
4747
it := codegen.NewImportTracker(pkg.Types)
4848
buf := new(bytes.Buffer)
4949
for _, typeName := range typeNames {
50-
typ, ok := namedTypes[typeName]
50+
typ, ok := namedTypes[typeName].(*types.Named)
5151
if !ok {
5252
log.Fatalf("could not find type %s", typeName)
5353
}
@@ -115,7 +115,7 @@ func gen(buf *bytes.Buffer, it *codegen.ImportTracker, typ *types.Named) {
115115
if !codegen.ContainsPointers(ft) || codegen.HasNoClone(t.Tag(i)) {
116116
continue
117117
}
118-
if named, _ := ft.(*types.Named); named != nil {
118+
if named, _ := codegen.NamedTypeOf(ft); named != nil {
119119
if codegen.IsViewType(ft) {
120120
writef("dst.%s = src.%s", fname, fname)
121121
continue
@@ -161,7 +161,7 @@ func gen(buf *bytes.Buffer, it *codegen.ImportTracker, typ *types.Named) {
161161
case *types.Pointer:
162162
base := ft.Elem()
163163
hasPtrs := codegen.ContainsPointers(base)
164-
if named, _ := base.(*types.Named); named != nil && hasPtrs {
164+
if named, _ := codegen.NamedTypeOf(base); named != nil && hasPtrs {
165165
writef("dst.%s = src.%s.Clone()", fname, fname)
166166
continue
167167
}

cmd/containerboot/kube.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ import (
1515
"net/netip"
1616
"os"
1717

18-
"tailscale.com/kube"
18+
"tailscale.com/kube/kubeapi"
19+
"tailscale.com/kube/kubeclient"
1920
"tailscale.com/tailcfg"
2021
)
2122

2223
// storeDeviceID writes deviceID to 'device_id' data field of the named
2324
// Kubernetes Secret.
2425
func storeDeviceID(ctx context.Context, secretName string, deviceID tailcfg.StableNodeID) error {
25-
s := &kube.Secret{
26+
s := &kubeapi.Secret{
2627
Data: map[string][]byte{
2728
"device_id": []byte(deviceID),
2829
},
@@ -42,7 +43,7 @@ func storeDeviceEndpoints(ctx context.Context, secretName string, fqdn string, a
4243
return err
4344
}
4445

45-
s := &kube.Secret{
46+
s := &kubeapi.Secret{
4647
Data: map[string][]byte{
4748
"device_fqdn": []byte(fqdn),
4849
"device_ips": deviceIPs,
@@ -55,14 +56,14 @@ func storeDeviceEndpoints(ctx context.Context, secretName string, fqdn string, a
5556
// secret. No-op if there is no authkey in the secret.
5657
func deleteAuthKey(ctx context.Context, secretName string) error {
5758
// m is a JSON Patch data structure, see https://jsonpatch.com/ or RFC 6902.
58-
m := []kube.JSONPatch{
59+
m := []kubeclient.JSONPatch{
5960
{
6061
Op: "remove",
6162
Path: "/data/authkey",
6263
},
6364
}
6465
if err := kc.JSONPatchSecret(ctx, secretName, m); err != nil {
65-
if s, ok := err.(*kube.Status); ok && s.Code == http.StatusUnprocessableEntity {
66+
if s, ok := err.(*kubeapi.Status); ok && s.Code == http.StatusUnprocessableEntity {
6667
// This is kubernetes-ese for "the field you asked to
6768
// delete already doesn't exist", aka no-op.
6869
return nil
@@ -72,7 +73,7 @@ func deleteAuthKey(ctx context.Context, secretName string) error {
7273
return nil
7374
}
7475

75-
var kc kube.Client
76+
var kc kubeclient.Client
7677

7778
// setupKube is responsible for doing any necessary configuration and checks to
7879
// ensure that tailscale state storage and authentication mechanism will work on
@@ -88,12 +89,12 @@ func (cfg *settings) setupKube(ctx context.Context) error {
8889
cfg.KubernetesCanPatch = canPatch
8990

9091
s, err := kc.GetSecret(ctx, cfg.KubeSecret)
91-
if err != nil && kube.IsNotFoundErr(err) && !canCreate {
92+
if err != nil && kubeclient.IsNotFoundErr(err) && !canCreate {
9293
return fmt.Errorf("Tailscale state Secret %s does not exist and we don't have permissions to create it. "+
9394
"If you intend to store tailscale state elsewhere than a Kubernetes Secret, "+
9495
"you can explicitly set TS_KUBE_SECRET env var to an empty string. "+
9596
"Else ensure that RBAC is set up that allows the service account associated with this installation to create Secrets.", cfg.KubeSecret)
96-
} else if err != nil && !kube.IsNotFoundErr(err) {
97+
} else if err != nil && !kubeclient.IsNotFoundErr(err) {
9798
return fmt.Errorf("Getting Tailscale state Secret %s: %v", cfg.KubeSecret, err)
9899
}
99100

@@ -128,10 +129,10 @@ func initKubeClient(root string) {
128129
if root != "/" {
129130
// If we are running in a test, we need to set the root path to the fake
130131
// service account directory.
131-
kube.SetRootPathForTesting(root)
132+
kubeclient.SetRootPathForTesting(root)
132133
}
133134
var err error
134-
kc, err = kube.New()
135+
kc, err = kubeclient.New()
135136
if err != nil {
136137
log.Fatalf("Error creating kube client: %v", err)
137138
}

0 commit comments

Comments
 (0)