cmd/tailscaled: make the outbound HTTP/SOCKS5 proxy modular

Updates #12614

Change-Id: Icba6f1c0838dce6ee13aa2dc662fb551813262e4
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2025-09-17 09:44:50 -07:00
committed by Brad Fitzpatrick
parent ecfdd86fc9
commit 5e698a81b6
9 changed files with 207 additions and 86 deletions
@@ -0,0 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_netstack
package buildfeatures
// HasNetstack is whether the binary was built with support for modular feature "gVisor netstack (userspace networking) support (TODO; not yet omittable)".
// Specifically, it's whether the binary was NOT built with the "ts_omit_netstack" build tag.
// It's a const so it can be used for dead code elimination.
const HasNetstack = false
@@ -0,0 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_netstack
package buildfeatures
// HasNetstack is whether the binary was built with support for modular feature "gVisor netstack (userspace networking) support (TODO; not yet omittable)".
// Specifically, it's whether the binary was NOT built with the "ts_omit_netstack" build tag.
// It's a const so it can be used for dead code elimination.
const HasNetstack = true
@@ -0,0 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_outboundproxy
package buildfeatures
// HasOutboundProxy is whether the binary was built with support for modular feature "Outbound localhost HTTP/SOCK5 proxy support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_outboundproxy" build tag.
// It's a const so it can be used for dead code elimination.
const HasOutboundProxy = false
@@ -0,0 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_outboundproxy
package buildfeatures
// HasOutboundProxy is whether the binary was built with support for modular feature "Outbound localhost HTTP/SOCK5 proxy support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_outboundproxy" build tag.
// It's a const so it can be used for dead code elimination.
const HasOutboundProxy = true
+25 -11
View File
@@ -106,17 +106,31 @@ var Features = map[FeatureTag]FeatureMeta{
"drive": {"Drive", "Tailscale Drive (file server) support", nil},
"kube": {"Kube", "Kubernetes integration", nil},
"oauthkey": {"OAuthKey", "OAuth secret-to-authkey resolution support", nil},
"portmapper": {"PortMapper", "NAT-PMP/PCP/UPnP port mapping support", nil},
"relayserver": {"RelayServer", "Relay server", nil},
"serve": {"Serve", "Serve and Funnel support", nil},
"ssh": {"SSH", "Tailscale SSH support", nil},
"syspolicy": {"SystemPolicy", "System policy configuration (MDM) support", nil},
"systray": {"SysTray", "Linux system tray", nil},
"taildrop": {"Taildrop", "Taildrop (file sending) support", nil},
"tailnetlock": {"TailnetLock", "Tailnet Lock support", nil},
"tap": {"Tap", "Experimental Layer 2 (ethernet) support", nil},
"tpm": {"TPM", "TPM support", nil},
"wakeonlan": {"WakeOnLAN", "Wake-on-LAN support", nil},
"outboundproxy": {
Sym: "OutboundProxy",
Desc: "Outbound localhost HTTP/SOCK5 proxy support",
Deps: []FeatureTag{"netstack"},
},
"portmapper": {"PortMapper", "NAT-PMP/PCP/UPnP port mapping support", nil},
"netstack": {"Netstack", "gVisor netstack (userspace networking) support (TODO; not yet omittable)", nil},
"relayserver": {"RelayServer", "Relay server", nil},
"serve": {
Sym: "Serve",
Desc: "Serve and Funnel support",
Deps: []FeatureTag{"netstack"},
},
"ssh": {
Sym: "SSH",
Desc: "Tailscale SSH support",
Deps: []FeatureTag{"netstack"},
},
"syspolicy": {"SystemPolicy", "System policy configuration (MDM) support", nil},
"systray": {"SysTray", "Linux system tray", nil},
"taildrop": {"Taildrop", "Taildrop (file sending) support", nil},
"tailnetlock": {"TailnetLock", "Tailnet Lock support", nil},
"tap": {"Tap", "Experimental Layer 2 (ethernet) support", nil},
"tpm": {"TPM", "TPM support", nil},
"wakeonlan": {"WakeOnLAN", "Wake-on-LAN support", nil},
"webclient": {
Sym: "WebClient", Desc: "Web client support",
Deps: []FeatureTag{"serve"},
+4 -4
View File
@@ -11,7 +11,7 @@ import (
"tailscale.com/util/set"
)
func TestRequires(t *testing.T) {
func TestKnownDeps(t *testing.T) {
for tag, meta := range Features {
for _, dep := range meta.Deps {
if _, ok := Features[dep]; !ok {
@@ -26,7 +26,7 @@ func TestRequires(t *testing.T) {
}
}
func TestDepSet(t *testing.T) {
func TestRequires(t *testing.T) {
var setOf = set.Of[FeatureTag]
tests := []struct {
in FeatureTag
@@ -38,11 +38,11 @@ func TestDepSet(t *testing.T) {
},
{
in: "serve",
want: setOf("serve"),
want: setOf("serve", "netstack"),
},
{
in: "webclient",
want: setOf("webclient", "serve"),
want: setOf("webclient", "serve", "netstack"),
},
}
for _, tt := range tests {