Skip to content

feat(ci): Bump to upstream v1.78.3 #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 180 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
180 commits
Select commit Hold shift + click to select a range
acb4a22
VERSION.txt: this is v1.77.0 (#13779)
barnstar Oct 10, 2024
33029d4
net/netcheck: fix netcheck cli-triggered nil pointer deref (#13782)
jwhited Oct 10, 2024
f9949cd
client/tailscale,cmd/{cli,get-authkey,k8s-operator}: set distinct Use…
oxtoacart Oct 11, 2024
17335d2
net/dns/resolver: forward SERVFAIL responses over PeerDNS
nickkhyl Oct 4, 2024
e7545f2
net/dns/resolver: translate 5xx DoH server errors into SERVFAIL DNS r…
nickkhyl Oct 4, 2024
c2144c4
net/dns/resolver: update (*forwarder).forwardWithDestChan to always r…
nickkhyl Oct 4, 2024
f07ff47
net/dns/resolver: add tests for using a forwarder with multiple upstr…
nickkhyl Oct 7, 2024
ecc8035
types/bools: add Compare to compare boolean values (#13792)
dsnet Oct 11, 2024
12e6094
ssh/tailssh: calculate passthrough environment at latest possible stage
oxtoacart Oct 11, 2024
adc8368
tstest: avoid Fatal in ResourceCheck to show panic (#13790)
icio Oct 14, 2024
40c991f
wgengine: instrument with usermetrics
kradalby Sep 25, 2024
e0d711c
{net/connstats,wgengine/magicsock}: fix packet counting in connstats
kradalby Sep 23, 2024
a8f9c0d
licenses: update license notices
Oct 14, 2024
5f22f72
hostinfo,build_docker.sh,tailcfg: more reliably detect being in a con…
tomhjp Oct 15, 2024
2aa9125
cmd/derpprobe: add /healthz endpoint
andrew-d Oct 15, 2024
ff5f233
util/syspolicy: add rsop package that provides access to the resultan…
nickkhyl Oct 8, 2024
74dd24c
cmd/tsconnect, logpolicy: fixes for wasm_js.go
cmiller01 Oct 14, 2024
6a885db
wgengine/magicsock: fix CI-only test warning of missing health tracker
bradfitz Oct 16, 2024
d32d742
ipn/ipnlocal: error when trying to use exit node on unsupported platf…
mpminardi Oct 16, 2024
22c89fc
cmd/tailscale,ipn,tailcfg: add `tailscale advertise` subcommand behin…
tendstofortytwo Oct 16, 2024
fa95318
tool/gocross: add support for tvOS Simulator (#13847)
agottardo Oct 17, 2024
c0a9895
scripts/installer.sh: support DNF5
andrew-d Oct 17, 2024
18fc093
derp: give trusted mesh peers longer write timeouts
bradfitz Oct 18, 2024
bb60da2
derp: add sclient write deadline timeout metric (#13831)
jwhited Oct 18, 2024
874db21
ipn/{ipnauth,ipnlocal,ipnserver}: send the auth URL to the user who s…
nickkhyl Oct 13, 2024
877fa50
net/netcheck: remove arbitrary deadlines from GetReport() tests (#13832)
jwhited Oct 18, 2024
e711ee5
release/dist: clamp min / max version for synology package centre (#1…
mpminardi Oct 18, 2024
fd77965
net/tlsdial: call out firewalls blocking Tailscale in health warnings…
agottardo Oct 19, 2024
c76a6e5
derp: track client-advertised non-ideal DERP connections in more places
bradfitz Oct 20, 2024
72587ab
scripts/installer.sh: allow Archcraft for Arch packages (#13870)
Erisa Oct 21, 2024
f8f53bb
health: remove SysDNSOS, add two Warnables for read+set system DNS co…
agottardo Oct 21, 2024
0f4c9c0
cmd/viewer: import types/views when generating a getter for a map field
nickkhyl Oct 21, 2024
d4d21a0
net/tstun: restore tap mode functionality
Oct 21, 2024
85241f8
net/tstun: use /10 as subnet for TAP mode; read IP from netmap
Oct 22, 2024
ae5bc88
health: fix spurious warning about DERP home region '0'
bradfitz Oct 22, 2024
b2665d9
net/netcheck: add a Now field to the netcheck Report
andrew-d Oct 22, 2024
2122704
cmd/testwrapper: add pkg runtime to output (#13894)
icio Oct 24, 2024
7fe6e50
net/dns/resolver: fix test flake
andrew-d Oct 24, 2024
e815ae0
util/syspolicy, ipn/ipnlocal: update syspolicy package to utilize sys…
nickkhyl Oct 8, 2024
6ab39b7
cmd/k8s-operator: validate that tailscale.com/tailnet-ip annotation v…
NRKirby Oct 26, 2024
853fe3b
ipn/store/kubestore: cache state in memory (#13918)
irbekrm Oct 26, 2024
9d1348f
ipn/store/kubestore: don't error if state cannot be preloaded (#13926)
irbekrm Oct 27, 2024
5d07c17
net/dns: fix blank lines being added to resolv.conf on OpenBSD (#13928)
renatoaguiar Oct 28, 2024
41aac26
licenses: update license notices
Oct 28, 2024
c0a1ed8
tstest/natlab: add latency & loss simulation
raggi Sep 13, 2024
0d76d7d
tool/gocross: remove trimpath from test builds
raggi Sep 11, 2024
94fa6d9
ipn/ipnlocal: log errors while fetching serial numbers
knyar Oct 28, 2024
11e9676
wgengine/magicsock: fix stats packet counter on derp egress
knyar Oct 29, 2024
38af62c
ipn/ipnlocal: remove the primary routes gauge for now
knyar Oct 29, 2024
9545e36
cmd/tailscale/cli: add 'tailscale metrics' command
knyar Oct 26, 2024
0f9a054
tstest/tailmac: fix Host.app path generation (#13953)
barnstar Oct 29, 2024
aecb0ab
tstest/tailmac: add support for mounting host directories in the gues…
barnstar Oct 29, 2024
856ea23
wgengine/magicsock: log home DERP changes with latency
timtailscale Oct 23, 2024
1103044
cmd/k8s-operator,k8s-operator: add topology spread constraints to Pro…
irbekrm Oct 30, 2024
2336c34
util/syspolicy: implement a syspolicy store that reads settings from …
nickkhyl Oct 18, 2024
2cc1100
util/syspolicy/source: use errors instead of github.com/pkg/errors
nickkhyl Oct 30, 2024
2a2228f
util/syspolicy/setting: make setting.RawItem JSON-marshallable
nickkhyl Oct 29, 2024
540e4c8
util/syspolicy/setting: make setting.Snapshot JSON-marshallable
nickkhyl Oct 29, 2024
f81348a
util/syspolicy/source: put EnvPolicyStore env keys in their own names…
bradfitz Oct 30, 2024
e1e2278
net/netcheck: ensure prior preferred DERP is always in netchecks
raggi Oct 30, 2024
532b261
wgengine/magicsock: exclude disco from throughput metrics
knyar Oct 29, 2024
b4f46c3
wgengine/magicsock: export packet drop metric for outbound errors
knyar Oct 29, 2024
45354da
ipn,tailcfg: add app connector config knob to conffile (#13942)
irbekrm Oct 31, 2024
3f626c0
cmd/tailscale/cli, client/tailscale, ipn/localapi: add tailscale sysp…
nickkhyl Oct 29, 2024
3477bfd
safeweb: add support for "/" and "/foo" handler distinction (#13980)
awly Oct 31, 2024
6985369
net/sockstats: prevent crash in setNetMon (#13985)
agottardo Oct 31, 2024
ddbc950
safeweb: add support for custom CSP (#13975)
awly Oct 31, 2024
84c8860
util/syspolicy: add policy key for onboarding flow visibility
dblohm7 Oct 31, 2024
49de23c
net/netcheck: add addReportHistoryAndSetPreferredDERP() test case (#1…
jwhited Nov 1, 2024
0ffc7bf
Fix MagicDNS on OpenBSD
renatoaguiar Oct 26, 2024
d09e9d9
ipn/ipnlocal: reload prefs correctly on ReloadConfig
Oct 31, 2024
634cc2b
wgengine/netstack: remove unused taildrive deps
bradfitz Nov 1, 2024
b0626ff
net/socks5: fix UDP relay in userspace-networking mode
vimt Sep 20, 2024
43138c7
net/socks5: optimize UDP relay
vimt Sep 21, 2024
45da3a4
cmd/tsconnect: block after starting esbuild dev server
bradfitz Nov 3, 2024
d4222fa
tsnet: add accessor to get tsd.System
bradfitz Oct 22, 2024
809a6eb
cmd/k8s-operator: allow to optionally configure tailscaled port (#14005)
irbekrm Nov 4, 2024
01185e4
types/result, util/lineiter: add package for a result type, use it
bradfitz Nov 5, 2024
065825e
licenses: update license notices
Nov 4, 2024
8dcbd98
cmd/derper: show more information on home page
oxtoacart Oct 24, 2024
8ba9b55
envknob,kube/kubetypes,cmd/k8s-operator: add app type for ProxyGroup …
irbekrm Nov 7, 2024
3090461
tsweb/varz: optimize some allocs, add helper func for others
bradfitz Nov 7, 2024
2c8859c
client/tailscale,ipn/{ipnlocal,localapi}: add a pre-shutdown localAPI…
irbekrm Nov 7, 2024
23880eb
cmd/tailscaled: support "ts_omit_ssh" build tag to remove SSH
bradfitz Nov 7, 2024
c3306bf
control/controlhttp/controlhttpserver: split out Accept to its own pa…
bradfitz Nov 7, 2024
020cacb
derp/derphttp: don't link websockets other than on GOOS=js
bradfitz Nov 8, 2024
64d70fb
ipn/ipnlocal: log a summary of posture identity response
knyar Nov 8, 2024
6ff8584
safeweb: add a Shutdown method to the Server type (#14048)
creachadair Nov 8, 2024
b9ecc50
cmd/k8s-operator,k8s-operator,kube/kubetypes: add an option to config…
irbekrm Nov 11, 2024
00be176
util/codegen: treat unique.Handle as an opaque value type
bradfitz Nov 11, 2024
4e0fc03
all: use iterators over slice views more
bradfitz Nov 11, 2024
d8a3683
cmd/k8s-operator: restart ProxyGroup pods less (#14045)
tomhjp Nov 12, 2024
e38522c
go.{mod,sum},build_docker.sh: bump mkctr, add ability to set OCI anno…
irbekrm Nov 12, 2024
cf41cec
cmd/{k8s-operator,containerboot},k8s-operator: remove support for pro…
irbekrm Nov 12, 2024
0c6bd9a
words: add a scale
bradfitz Nov 13, 2024
7c6562c
words: scale up our word count (#14082)
tendstofortytwo Nov 13, 2024
1847f26
.github: Bump github/codeql-action from 3.26.11 to 3.27.1 (#14062)
dependabot[bot] Nov 13, 2024
0cfa217
.github: Bump actions/upload-artifact from 4.4.0 to 4.4.3 (#13811)
dependabot[bot] Nov 13, 2024
4474dce
.github: Bump actions/cache from 4.1.0 to 4.1.2 (#13933)
dependabot[bot] Nov 13, 2024
0c9ade4
words: Add scoville to scales.txt (#14084)
WalterHub Nov 13, 2024
bfe5cd8
.github: Bump actions/setup-go from 5.0.2 to 5.1.0 (#13934)
dependabot[bot] Nov 13, 2024
f593d3c
cmd/tailscale/cli: add "help" alias for --help
bradfitz Nov 13, 2024
e73cfd9
go.toolchain.rev: bump from Go 1.23.1 to Go 1.23.3
bradfitz Nov 14, 2024
8fd471c
control/controlclient: disable https on for http://localhost:$port URLs
bradfitz Nov 14, 2024
c3c4c05
tstest/integration/testcontrol: remove a vestigial unused parameter
bradfitz Nov 15, 2024
1355f62
cmd/derpprobe,prober: add ability to restrict derpprobe to a single r…
oxtoacart Nov 14, 2024
aefbed3
ipn,tailcfg: add VIPService struct and c2n to fetch them from client …
tendstofortytwo Nov 15, 2024
3b93fd9
net/captivedetection: replace 10k log lines with ... less
bradfitz Nov 15, 2024
f1e1048
go.mod: bump tailscale/wireguard-go
bradfitz Nov 13, 2024
5cae7c5
ipn: remove unused Notify.BackendLogID
bradfitz Nov 16, 2024
c2a7f17
sessionrecording: implement v2 recording endpoint support (#14105)
awly Nov 18, 2024
93db503
ipn/ipnlocal: add IPN Bus NotifyRateLimit watch bit NotifyRateLimit
bradfitz Nov 15, 2024
da70a84
ipn/ipnlocal: fix build, remove another Notify.BackendLogID reference…
bradfitz Nov 18, 2024
00517c8
kube/{kubeapi,kubeclient},ipn/store/kubestore,cmd/{containerboot,k8s-…
irbekrm Nov 19, 2024
bb3d0ca
licenses: update license notices
Nov 18, 2024
d62baa4
version: validate Long format on Android builds
bradfitz Nov 19, 2024
810da91
version: fix earlier test/wording mistakes
bradfitz Nov 19, 2024
48343ee
util/winutil/s4u: fix token handle leak
dblohm7 Nov 19, 2024
9f33aeb
wgengine/filter: actually use the passed CapTestFunc [capver 109]
knyar Nov 11, 2024
303a4a1
Make the deployment of an IngressClass optional, default to true (#14…
Rumbles Nov 20, 2024
ebeb5da
cmd/k8s-operator,kube/kubeclient,docs/k8s: update rbac to emit events…
irbekrm Nov 20, 2024
ebaf33a
net/tsaddr: extract IsTailscaleIPv4 from IsTailscaleIP (#14169)
scottjab Nov 20, 2024
02cafbe
tsweb: change RequestID format to have a date in it
bradfitz Nov 20, 2024
70d1241
util/fastuuid: delete unused package
bradfitz Nov 21, 2024
af4c3a4
cmd/tailscale/cli: create netmon in debug ts2021
andrew-d Nov 20, 2024
0c8c7c0
net/tsaddr: include test input in test failure output
bradfitz Nov 21, 2024
e3c6ca4
cli: present risk warning when setting up app connector on macOS (#14…
agottardo Nov 21, 2024
c59ab6b
cmd/k8s-operator/deploy: ensure that operator can write kube state Ev…
irbekrm Nov 22, 2024
74d4652
cmd/{containerboot,k8s-operator},k8s-operator: new options to expose …
tomhjp Nov 22, 2024
462e1fc
ipn/{ipnlocal,localapi}, wgengine/netstack: call (*LocalBackend).Shut…
nickkhyl Nov 22, 2024
8e5cfbe
util/syspolicy/rsop: reduce policyReloadMinDelay and policyReloadMaxD…
nickkhyl Nov 22, 2024
50bf32a
cmd/tailscaled: flush DNS if FlushDNSOnSessionUnlock is true upon rec…
nickkhyl Nov 22, 2024
7c8f663
cmd/tailscaled: log SCM interactions if the policy setting is enabled…
nickkhyl Nov 22, 2024
2ab66d9
ipn/ipnlocal: move syspolicy handling from setExitNodeID to applySysP…
nickkhyl Nov 22, 2024
eb3cd32
ipn/ipnlocal: update ipn.Prefs when there's a change in syspolicy set…
nickkhyl Nov 22, 2024
3353f15
control/controlclient: use the most recent syspolicy.MachineCertifica…
nickkhyl Nov 22, 2024
36b7449
ipn/ipnlocal: rebuild allowed suggested exit nodes when syspolicy cha…
nickkhyl Nov 22, 2024
f643118
net/netmon: catch ParseRIB panic to gather buffer data
raggi Nov 22, 2024
ba3523f
cmd/containerboot: preserve headers of metrics endpoints responses (#…
irbekrm Nov 23, 2024
788121f
docs/windows/policy: update ADMX policy definitions to reflect the sy…
nickkhyl Nov 25, 2024
4d33f30
net/netmon: improve panic reporting from #14202
raggi Nov 25, 2024
26de518
ipn/ipnlocal: only check CanUseExitNode if we are attempting to use o…
mpminardi Nov 26, 2024
a62f718
cmd/tailscale/cli: fix format string
nickkhyl Nov 26, 2024
e87b71e
control/controlhttp: set *health.Tracker in tests
andrew-d Nov 26, 2024
bb80f14
ipn/localapi: count localapi requests to metric endpoints
knyar Nov 26, 2024
bac3af0
logtail: avoid bytes.Buffer allocation (#11858)
dsnet Nov 27, 2024
41e56ce
health: move health metrics test to health_test
kradalby Nov 20, 2024
06d929f
tsnet: send less data in metrics integration test
kradalby Nov 25, 2024
e558993
tsnet: split bytes and routes metrics tests
kradalby Nov 25, 2024
225d8f5
tsnet: validate sent data in metrics test
kradalby Nov 25, 2024
caba123
wgengine/magicsock: packet/bytes metrics should not count disco
kradalby Nov 25, 2024
61dd266
tsnet: remove flaky test marker from metrics
kradalby Nov 28, 2024
f8587e3
cmd/k8s-operator: fix port name change bug for egress ProxyGroup prox…
irbekrm Nov 29, 2024
44c8892
Makefile,./build_docker.sh: update kube operator image build target n…
irbekrm Nov 29, 2024
13faa64
cmd/k8s-operator: always set stateful filtering to false (#14216)
irbekrm Nov 29, 2024
a68efe2
cmd/checkmetrics: add command for checking metrics against kb
bradfitz Oct 22, 2024
24095e4
cmd/containerboot: serve health on local endpoint (#14246)
tomhjp Dec 2, 2024
8d0c690
net/netcheck: clean up ICMP probe AddrPort lookup
bradfitz Dec 2, 2024
3f54572
IPN: Update ServeConfig to accept configuration for Services.
KevinLiang10 Nov 28, 2024
eabb424
cmd/k8s-operator,docs/k8s: run tun mode proxies in privileged contain…
irbekrm Dec 3, 2024
9f9063e
cmd/k8s-operator,k8s-operator,go.mod: optionally create ServiceMonito…
irbekrm Dec 3, 2024
efdfd54
cmd/k8s-operator: avoid port collision with metrics endpoint (#14185)
tomhjp Dec 3, 2024
cbf1a4e
cmd/k8s-operator/deploy/chart: allow reading OAuth creds from a CSI d…
oliverrahner Dec 3, 2024
aa43388
cmd/k8s-operator: fix a bunch of status equality checks (#14270)
irbekrm Dec 4, 2024
2aac916
cmd/{containerboot,k8s-operator},kube/kubetypes: kube Ingress L7 prox…
irbekrm Dec 4, 2024
7406977
net/tstun: remove tailscaled_outbound_dropped_packets_total reason=ac…
bradfitz Dec 4, 2024
7f9ebc0
cmd/tailscale,net/netcheck: add debug feature to force preferred DERP
raggi Dec 4, 2024
df94a14
cmd/k8s-operator: don't error for transient failures (#14073)
tomhjp Dec 5, 2024
614c612
net/netcheck: preserve STUN port defaulting to 3478 (#14289)
irbekrm Dec 5, 2024
87546a5
cmd/derper: allow absent SNI when using manual certs and IP literal f…
bradfitz Dec 5, 2024
0267fe8
VERSION.txt: this is v1.78.0
nickkhyl Dec 5, 2024
2690b47
Revert "VERSION.txt: this is v1.78.0"
bradfitz Dec 5, 2024
1aef3e8
health: fix TestHealthMetric to pass on release branch
bradfitz Dec 5, 2024
c80eb69
VERSION.txt: this is v1.78.1
bradfitz Dec 5, 2024
3e3d5d8
hostinfo: fix testing in container (#14330) (#14337)
tomhjp Dec 10, 2024
6e0f168
cmd/containerboot: fix nil pointer exception (cherry-pick of #14357, …
irbekrm Dec 11, 2024
3037dc7
VERSION.txt: this is v1.78.2
nickkhyl Dec 11, 2024
1b41fde
VERSION.txt: this is v1.78.3
nickkhyl Dec 11, 2024
5ba55ed
Merge branch 'release-branch/1.78' into cpierre/coreweave-1.78
ChandonPierre Dec 14, 2024
38bbe01
fix(ci): update makefile target changed in 44c8892
ChandonPierre Dec 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Publish k8s-operator
shell: bash
run: |
REPOS="ghcr.io/${{ github.repository }}/k8s-operator" TARGET="operator" ./build_docker.sh
REPOS="ghcr.io/${{ github.repository }}/k8s-operator" TARGET="k8s-operator" ./build_docker.sh

- name: Publish k8s-nameserver
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ publishdevoperator: ## Build and publish k8s-operator image to location specifie
@test "${REPO}" != "ghcr.io/tailscale/tailscale" || (echo "REPO=... must not be ghcr.io/tailscale/tailscale" && exit 1)
@test "${REPO}" != "tailscale/k8s-operator" || (echo "REPO=... must not be tailscale/k8s-operator" && exit 1)
@test "${REPO}" != "ghcr.io/tailscale/k8s-operator" || (echo "REPO=... must not be ghcr.io/tailscale/k8s-operator" && exit 1)
TAGS="${TAGS}" REPOS=${REPO} PLATFORM=${PLATFORM} PUSH=true TARGET=operator ./build_docker.sh
TAGS="${TAGS}" REPOS=${REPO} PLATFORM=${PLATFORM} PUSH=true TARGET=k8s-operator ./build_docker.sh

publishdevnameserver: ## Build and publish k8s-nameserver image to location specified by ${REPO}
@test -n "${REPO}" || (echo "REPO=... required; e.g. REPO=ghcr.io/${USER}/tailscale" && exit 1)
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.76.6
1.78.3
15 changes: 14 additions & 1 deletion build_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,20 @@ eval "$(./build_dist.sh shellvars)"
DEFAULT_TARGET="client"
DEFAULT_TAGS="v${VERSION_SHORT},v${VERSION_MINOR}"
DEFAULT_BASE="tailscale/alpine-base:3.18"
# Set a few pre-defined OCI annotations. The source annotation is used by tools such as Renovate that scan the linked
# Github repo to find release notes for any new image tags. Note that for official Tailscale images the default
# annotations defined here will be overriden by release scripts that call this script.
# https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys
DEFAULT_ANNOTATIONS="org.opencontainers.image.source=https://github.com/tailscale/tailscale/blob/main/build_docker.sh,org.opencontainers.image.vendor=Tailscale"

PUSH="${PUSH:-false}"
TARGET="${TARGET:-${DEFAULT_TARGET}}"
TAGS="${TAGS:-${DEFAULT_TAGS}}"
BASE="${BASE:-${DEFAULT_BASE}}"
PLATFORM="${PLATFORM:-}" # default to all platforms
# OCI annotations that will be added to the image.
# https://github.com/opencontainers/image-spec/blob/main/annotations.md
ANNOTATIONS="${ANNOTATIONS:-${DEFAULT_ANNOTATIONS}}"

case "$TARGET" in
client)
Expand All @@ -43,9 +51,10 @@ case "$TARGET" in
--repos="${REPOS}" \
--push="${PUSH}" \
--target="${PLATFORM}" \
--annotations="${ANNOTATIONS}" \
/usr/local/bin/containerboot
;;
operator)
k8s-operator)
DEFAULT_REPOS="tailscale/k8s-operator"
REPOS="${REPOS:-${DEFAULT_REPOS}}"
go run github.com/tailscale/mkctr \
Expand All @@ -56,9 +65,11 @@ case "$TARGET" in
-X tailscale.com/version.gitCommitStamp=${VERSION_GIT_HASH}" \
--base="${BASE}" \
--tags="${TAGS}" \
--gotags="ts_kube,ts_package_container" \
--repos="${REPOS}" \
--push="${PUSH}" \
--target="${PLATFORM}" \
--annotations="${ANNOTATIONS}" \
/usr/local/bin/operator
;;
k8s-nameserver)
Expand All @@ -72,9 +83,11 @@ case "$TARGET" in
-X tailscale.com/version.gitCommitStamp=${VERSION_GIT_HASH}" \
--base="${BASE}" \
--tags="${TAGS}" \
--gotags="ts_kube,ts_package_container" \
--repos="${REPOS}" \
--push="${PUSH}" \
--target="${PLATFORM}" \
--annotations="${ANNOTATIONS}" \
/usr/local/bin/k8s-nameserver
;;
*)
Expand Down
50 changes: 50 additions & 0 deletions client/tailscale/localclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (
"tailscale.com/types/dnstype"
"tailscale.com/types/key"
"tailscale.com/types/tkatype"
"tailscale.com/util/syspolicy/setting"
)

// defaultLocalClient is the default LocalClient when using the legacy
Expand Down Expand Up @@ -492,6 +493,17 @@ func (lc *LocalClient) DebugAction(ctx context.Context, action string) error {
return nil
}

// DebugActionBody invokes a debug action with a body parameter, such as
// "debug-force-prefer-derp".
// These are development tools and subject to change or removal over time.
func (lc *LocalClient) DebugActionBody(ctx context.Context, action string, rbody io.Reader) error {
body, err := lc.send(ctx, "POST", "/localapi/v0/debug?action="+url.QueryEscape(action), 200, rbody)
if err != nil {
return fmt.Errorf("error %w: %s", err, body)
}
return nil
}

// DebugResultJSON invokes a debug action and returns its result as something JSON-able.
// These are development tools and subject to change or removal over time.
func (lc *LocalClient) DebugResultJSON(ctx context.Context, action string) (any, error) {
Expand Down Expand Up @@ -814,6 +826,33 @@ func (lc *LocalClient) EditPrefs(ctx context.Context, mp *ipn.MaskedPrefs) (*ipn
return decodeJSON[*ipn.Prefs](body)
}

// GetEffectivePolicy returns the effective policy for the specified scope.
func (lc *LocalClient) GetEffectivePolicy(ctx context.Context, scope setting.PolicyScope) (*setting.Snapshot, error) {
scopeID, err := scope.MarshalText()
if err != nil {
return nil, err
}
body, err := lc.get200(ctx, "/localapi/v0/policy/"+string(scopeID))
if err != nil {
return nil, err
}
return decodeJSON[*setting.Snapshot](body)
}

// ReloadEffectivePolicy reloads the effective policy for the specified scope
// by reading and merging policy settings from all applicable policy sources.
func (lc *LocalClient) ReloadEffectivePolicy(ctx context.Context, scope setting.PolicyScope) (*setting.Snapshot, error) {
scopeID, err := scope.MarshalText()
if err != nil {
return nil, err
}
body, err := lc.send(ctx, "POST", "/localapi/v0/policy/"+string(scopeID), 200, http.NoBody)
if err != nil {
return nil, err
}
return decodeJSON[*setting.Snapshot](body)
}

// GetDNSOSConfig returns the system DNS configuration for the current device.
// That is, it returns the DNS configuration that the system would use if Tailscale weren't being used.
func (lc *LocalClient) GetDNSOSConfig(ctx context.Context) (*apitype.DNSOSConfig, error) {
Expand Down Expand Up @@ -1299,6 +1338,17 @@ func (lc *LocalClient) SetServeConfig(ctx context.Context, config *ipn.ServeConf
return nil
}

// DisconnectControl shuts down all connections to control, thus making control consider this node inactive. This can be
// run on HA subnet router or app connector replicas before shutting them down to ensure peers get told to switch over
// to another replica whilst there is still some grace period for the existing connections to terminate.
func (lc *LocalClient) DisconnectControl(ctx context.Context) error {
_, _, err := lc.sendWithHeaders(ctx, "POST", "/localapi/v0/disconnect-control", 200, nil, nil)
if err != nil {
return fmt.Errorf("error disconnecting control: %w", err)
}
return nil
}

// NetworkLockDisable shuts down network-lock across the tailnet.
func (lc *LocalClient) NetworkLockDisable(ctx context.Context, secret []byte) error {
if _, err := lc.send(ctx, "POST", "/localapi/v0/tka/disable", 200, bytes.NewReader(secret)); err != nil {
Expand Down
17 changes: 10 additions & 7 deletions client/tailscale/tailscale.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ type Client struct {
// HTTPClient optionally specifies an alternate HTTP client to use.
// If nil, http.DefaultClient is used.
HTTPClient *http.Client

// UserAgent optionally specifies an alternate User-Agent header
UserAgent string
}

func (c *Client) httpClient() *http.Client {
Expand Down Expand Up @@ -97,8 +100,9 @@ func (c *Client) setAuth(r *http.Request) {
// and can be changed manually by the user.
func NewClient(tailnet string, auth AuthMethod) *Client {
return &Client{
tailnet: tailnet,
auth: auth,
tailnet: tailnet,
auth: auth,
UserAgent: "tailscale-client-oss",
}
}

Expand All @@ -110,17 +114,16 @@ func (c *Client) Do(req *http.Request) (*http.Response, error) {
return nil, errors.New("use of Client without setting I_Acknowledge_This_API_Is_Unstable")
}
c.setAuth(req)
if c.UserAgent != "" {
req.Header.Set("User-Agent", c.UserAgent)
}
return c.httpClient().Do(req)
}

// sendRequest add the authentication key to the request and sends it. It
// receives the response and reads up to 10MB of it.
func (c *Client) sendRequest(req *http.Request) ([]byte, *http.Response, error) {
if !I_Acknowledge_This_API_Is_Unstable {
return nil, nil, errors.New("use of Client without setting I_Acknowledge_This_API_Is_Unstable")
}
c.setAuth(req)
resp, err := c.httpClient().Do(req)
resp, err := c.Do(req)
if err != nil {
return nil, resp, err
}
Expand Down
26 changes: 3 additions & 23 deletions client/web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"tailscale.com/client/tailscale/apitype"
"tailscale.com/clientupdate"
"tailscale.com/envknob"
"tailscale.com/envknob/featureknob"
"tailscale.com/hostinfo"
"tailscale.com/ipn"
"tailscale.com/ipn/ipnstate"
Expand Down Expand Up @@ -960,37 +961,16 @@ func (s *Server) serveGetNodeData(w http.ResponseWriter, r *http.Request) {
}

func availableFeatures() map[string]bool {
env := hostinfo.GetEnvType()
features := map[string]bool{
"advertise-exit-node": true, // available on all platforms
"advertise-routes": true, // available on all platforms
"use-exit-node": canUseExitNode(env) == nil,
"ssh": envknob.CanRunTailscaleSSH() == nil,
"use-exit-node": featureknob.CanUseExitNode() == nil,
"ssh": featureknob.CanRunTailscaleSSH() == nil,
"auto-update": version.IsUnstableBuild() && clientupdate.CanAutoUpdate(),
}
if env == hostinfo.HomeAssistantAddOn {
// Setting SSH on Home Assistant causes trouble on startup
// (since the flag is not being passed to `tailscale up`).
// Although Tailscale SSH does work here,
// it's not terribly useful since it's running in a separate container.
features["ssh"] = false
}
return features
}

func canUseExitNode(env hostinfo.EnvType) error {
switch dist := distro.Get(); dist {
case distro.Synology, // see https://github.com/tailscale/tailscale/issues/1995
distro.QNAP,
distro.Unraid:
return fmt.Errorf("Tailscale exit nodes cannot be used on %s.", dist)
}
if env == hostinfo.HomeAssistantAddOn {
return errors.New("Tailscale exit nodes cannot be used on Home Assistant.")
}
return nil
}

// aclsAllowAccess returns whether tailnet ACLs (as expressed in the provided filter rules)
// permit any devices to access the local web client.
// This does not currently check whether a specific device can connect, just any device.
Expand Down
131 changes: 131 additions & 0 deletions cmd/checkmetrics/checkmetrics.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause

// checkmetrics validates that all metrics in the tailscale client-metrics
// are documented in a given path or URL.
package main

import (
"context"
"flag"
"fmt"
"io"
"log"
"net/http"
"net/http/httptest"
"os"
"strings"
"time"

"tailscale.com/ipn/store/mem"
"tailscale.com/tsnet"
"tailscale.com/tstest/integration/testcontrol"
"tailscale.com/util/httpm"
)

var (
kbPath = flag.String("kb-path", "", "filepath to the client-metrics knowledge base")
kbUrl = flag.String("kb-url", "", "URL to the client-metrics knowledge base page")
)

func main() {
flag.Parse()
if *kbPath == "" && *kbUrl == "" {
log.Fatalf("either -kb-path or -kb-url must be set")
}

var control testcontrol.Server
ts := httptest.NewServer(&control)
defer ts.Close()

td, err := os.MkdirTemp("", "testcontrol")
if err != nil {
log.Fatal(err)
}
defer os.RemoveAll(td)

// tsnet is used not used as a Tailscale client, but as a way to
// boot up Tailscale, have all the metrics registered, and then
// verifiy that all the metrics are documented.
tsn := &tsnet.Server{
Dir: td,
Store: new(mem.Store),
UserLogf: log.Printf,
Ephemeral: true,
ControlURL: ts.URL,
}
if err := tsn.Start(); err != nil {
log.Fatal(err)
}
defer tsn.Close()

log.Printf("checking that all metrics are documented, looking for: %s", tsn.Sys().UserMetricsRegistry().MetricNames())

if *kbPath != "" {
kb, err := readKB(*kbPath)
if err != nil {
log.Fatalf("reading kb: %v", err)
}
missing := undocumentedMetrics(kb, tsn.Sys().UserMetricsRegistry().MetricNames())

if len(missing) > 0 {
log.Fatalf("found undocumented metrics in %q: %v", *kbPath, missing)
}
}

if *kbUrl != "" {
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()

kb, err := getKB(ctx, *kbUrl)
if err != nil {
log.Fatalf("getting kb: %v", err)
}
missing := undocumentedMetrics(kb, tsn.Sys().UserMetricsRegistry().MetricNames())

if len(missing) > 0 {
log.Fatalf("found undocumented metrics in %q: %v", *kbUrl, missing)
}
}
}

func readKB(path string) (string, error) {
b, err := os.ReadFile(path)
if err != nil {
return "", fmt.Errorf("reading file: %w", err)
}

return string(b), nil
}

func getKB(ctx context.Context, url string) (string, error) {
req, err := http.NewRequestWithContext(ctx, httpm.GET, url, nil)
if err != nil {
return "", fmt.Errorf("creating request: %w", err)
}

resp, err := http.DefaultClient.Do(req)
if err != nil {
return "", fmt.Errorf("getting kb page: %w", err)
}

if resp.StatusCode != http.StatusOK {
return "", fmt.Errorf("unexpected status code: %d", resp.StatusCode)
}

b, err := io.ReadAll(resp.Body)
if err != nil {
return "", fmt.Errorf("reading body: %w", err)
}
return string(b), nil
}

func undocumentedMetrics(b string, metrics []string) []string {
var missing []string
for _, metric := range metrics {
if !strings.Contains(b, metric) {
missing = append(missing, metric)
}
}
return missing
}
Loading