This is needed for authenticated log uploads (see #20482).
Add a noop declaration now, so that we can call it from
client implementations on other platforms (e.g., Android or iOS).
Updates tailscale/corp#39092
Signed-off-by: Joe Tsai <[email protected]>
This uses the same notification delivery logic for policy changes and regular ipn bus updates. Previously, sysPolicyChangedForSession silnetly dropped policy notifications when a watcher's channel was full, potentially leaving clients with stale policy and gui visibility state. Now lagging watchers follow the existing block, suspend, or close behavior, allowing them to recover the latest policy when they resume or reconnect.
Updates tailscale/corp#44104
Signed-off-by: kari-ts <[email protected]>
Use ControlContext for production net.Dialer socket hooks:
PeerAPI and debug peer dialing, captive-portal probes, stunstamp TCP
measurements, and the test agent connection.
Update the PeerDialControlFunc callback signature and Apple extension
implementation together with both consumers. Preserve namespace binding,
socket settings, timeout values, and existing error handling. Listener
Control and RawConn.Control are separate APIs and remain unchanged.
Add coverage for platform hook forwarding and errors, debug and captive
portal dialing, cancellation, SO_REUSEADDR, and test-agent hook selection
and keepalive configuration. Cover the Apple missing-interface error and
non-Linux bypass no-op in their platform-specific tests.
Updates tailscale/corp#50948
Change-Id: I4fb162666724f307f2d3d0beba6ed1b0ed15bb4f
Signed-off-by: James Tucker <[email protected]>
The eventbus routes events by exact type, and these three subscribers
took a pointer to an event type that is only ever published by value,
so they never ran. logtail could not detect the network coming back up
after an upload failure, LocalBackend never recorded or announced the
latest client version, and the magicsock portmapper log limiter never
reset after a major link change.
Updates #22307
Signed-off-by: Nick Khyl <[email protected]>
tsnet called the serve LocalAPI client and LocalBackend methods
unconditionally, so it didn't build with ts_omit_serve, which every
minimal feature set includes. Make those methods return
feature.ErrUnavailable when serve is omitted, as ListenFunnel and
ListenService now do too.
Declare tsnet's minimum feature set (netstack) as
featuretags.TSNetMin, add cmd/featuretags --tsnet to keep it, and add
a test that type-checks tsnet with it and a few other small feature
sets.
Fixes#22282
Updates #22283
Change-Id: I866fa34d052bfd437b1c9d3309063999d7ebb02c
Co-Authored-By: Fredrik Fornwall <[email protected]>
Signed-off-by: Brad Fitzpatrick <[email protected]>
This moves HiddenNetworkDvice policy out of ipnlocal and into an optional ipnext.
This adds a per-session notification hook that uses each watcher's effective policy snapshot to populate NodeGUIVisibility.
A full visibility snapshot is sent on initialization and policy changes, and on subsequent peer updates, only changed peers are evaluated.
The extension populates Notify.NodeGUIVisibility with the hidden peers
among the nodes the Notify covers: all peers when it carries Policy
(initially and on policy change), or the PeersChanged peers otherwise.
Absent means visible, so a Policy-bearing Notify replaces the client's
visibility state and a peer-change Notify updates only the changed peers.
No NodeGUIVisibilityChanges/Removed fields and no per-session node state
are needed: removed peers simply leave the client's peer set, and full
netmap updates already resend every peer alongside SelfChange.
When the feature isn't linked, the hook slice is empty and the fast path
in notifyForSessionLocked is unchanged. When the policy isn't configured,
the hook costs a snapshot lookup per session per Notify and sends nothing.
Updates tailscale/corp#44104
Signed-off-by: kari <[email protected]>
Signed-off-by: Nick Khyl <[email protected]>
Tests that the localapi cert-status/ handler checks read access and returns
the status as JSON, that LocalBackend.CertStatus goes through the hook, and
that feature/acme's hook reports the same missing, valid and expired results
as the C2N /tls-cert-status handler. Also tests that Client.CertStatus
returns ErrCertStatusUnsupported for a 404 and not for other errors.
Updates tailscale/corp#38175
Signed-off-by: chaosinthecrd <[email protected]>
The localapi cert/ endpoint fetches a cert when none is cached, so polling it
triggers issuance. feature/acme can already report a cached cert without
contacting the CA, but only over the C2N /tls-cert-status path. This moves
that check into an extension method and serves it as localapi cert-status/,
with a matching Client.CertStatus, reporting Missing on a cache miss instead
of issuing. Client.CertStatus returns ErrCertStatusUnsupported (wrapping
errors.ErrUnsupported) when tailscaled has no cert-status endpoint.
Updates tailscale/corp#38175
Signed-off-by: chaosinthecrd <[email protected]>
Funnel can't be on without serve. With the HasServe check, the
compiler reduces the method to a constant and inlines it, so the
linker drops it from those builds.
Updates #22283
Change-Id: Idd5da9c1e4f8f41a828a3774f5c4d44872eb1dda
Signed-off-by: Brad Fitzpatrick <[email protected]>
setControlClientStatusLocked releases b.mu around tkaSyncIfNeeded. If
Logout replaced the control client meanwhile, the old client's netmap
was applied to the new profile, leaving it Stopped with the old IPs.
Fixes#22274
Change-Id: If4e9fdd5477db7f97b0362c5632c280dba4c18f5
Signed-off-by: Fredrik Fornwall <[email protected]>
feature/acme uses LocalBackend.ServeConfig to find hostnames needing
cert refresh, which broke builds with ts_omit_serve but not
ts_omit_acme. The serveConfig field it reads exists in all builds, so
move the method out of the serve-only file rather than making acme
depend on serve, and skip the refresh loop hook when serve is omitted
so the linker can drop it.
Updates #22283
Change-Id: I2cef6683cd6e6144306ddec95255d606f7a539ae
Signed-off-by: Brad Fitzpatrick <[email protected]>
Apple and Android both implement their own login orchestration, coordinating preference updates, backend startup, and interative login. This requires the clients to understand details about the backend lifecycle and has led to duplicated logic and ordering issues.
Android needs to avoid setting WantRunning=true via EditPrefs before calling Start, because doing so triggers Login on the existing control client, which Start then tears down, potentially canceling an in-flight registration before an authentication URL is returned (see https://github.com/tailscale/tailscale-android/commit/83057865e13b8f116a0871a3c6d6adf46f5c3d32). Apple has similar orchestration, including separate handling for auth keys, custom control servers, and reauth.
This adds a LocalBackend helper that accepts optional masked prefs and an auth key, prepares the desired startup prefs, and initiates or resumes auth. This avoids unnecessary control client resets, preserves the existing control client and auth url when the login configuration hasn't changed, and ensures WantRunning is applied as part of Start when restarting the backend. This can be used for:
-first time login with a custom control url or auth key
-resuming an existing interactive login without losing auth url
-retrying login without unnecessarily resetting the control client
-reauth without restarting the backend
A followup will expose this through localapi.
Updates tailscale/tailscale#18304
Signed-off-by: kari-ts <[email protected]>
When a Serve or Funnel handler serves a path, serveFileOrDirectory
used os.Stat and os.Open on it, and http.FileServer(http.Dir(dir)) for
a directory. All of these follow symlinks, so a symlink in place of a
served file or directory, or inside a served directory, could make
tailscaled serve any file it can read from elsewhere on the host.
Those directories may be writable by local users who can't configure
Serve, and a symlink placed there is followed at request time.
Resolve the configured path through an os.Root of its parent
directory, and serve a directory through an os.Root of its own.
os.Root refuses symlinks whose target leaves the root, and absolute
symlinks, and still follows relative symlinks that stay inside it. A
refused path inside a served directory is reported as not found, like
a missing file. A refused configured path is logged and reported as a
server error, like other errors reading it.
This changes behavior for setups that serve such symlinks on purpose,
including absolute symlinks and Windows junctions: a configured file
or directory that is one, or that points out of its parent directory,
now fails, and such links inside a served directory now return 404.
Symlinks higher up the configured path are still followed, and a
filesystem root can still be served. Opening the parent directory
needs read permission on it, where os.Stat only needed search
permission. Hardlinks are not covered, since os.Root can't tell them
apart from regular files.
RELNOTE: tailscale serve stops following symlinks out of served directories
Updates tailscale/corp#51116
Signed-off-by: Aditya Merchant <[email protected]>
Avoid a startup panic when no log directory is available and the
sockstat logger is disabled by ts_omit_logtail.
Fixes#22246
Change-Id: I06efea76cdaf6cda4b454dbede8cf2e69bbd588d
Signed-off-by: Fredrik Fornwall <[email protected]>
The test resumed a live session, so notifications already
on the wire (notably, spurious health change notifications)
could arrive ahead of the initial status.
In this PR, we add LocalBackend.SuspendWatchNotifications,
which suspends a session as if it had fallen behind,
and update the test to suspend the session and drain
pending notifications before resuming it.
Updates tailscale/corp#51067
Updates tailscale/corp#50256
Updates tailscale/corp#50907
Signed-off-by: Nick Khyl <[email protected]>
Since edcc2c94, tailscaled closes the watch when a subscriber falls
behind. That doesn't work well for GUIs where closing the watch has side
effects. On Windows, the last client disconnecting can reset the backend
state unless unattended or always-on mode is enabled. On Android and
Apple platforms, nothing restarts a watch that ended this way, so the
UI silently stops updating.
Add ipn.NotifySuspendWhenBehind. A watcher that sets it stays connected
when it falls behind, but gets a Notify with Suspended set and nothing
else until the client resumes the session via the new resume-ipn-bus
LocalAPI endpoint or LocalBackend.ResumeWatchNotifications. Resuming
replays the initial Notify and new notifications follow from there.
Updates tailscale/corp#51067
Updates tailscale/corp#50256
Updates tailscale/corp#50907
Signed-off-by: Nick Khyl <[email protected]>
Since aa5da2e5f, a peer that control adds to a running client arrives as a
netmap delta rather than a full netmap. The delta path never re-resolved
the exit node prefs. An exit node selected by IP before it was in the
netmap stayed unresolved, and an auto exit node stayed on the blackhole
route, until tailscaled restarted or a full netmap arrived.
Re-resolve the exit node in UpdateNetmapDelta when the delta can change
the result. Any upserted peer qualifies while an ExitNodeIP is set. An
exit node being upserted or coming online qualifies while an auto exit
node is unresolved. The selected auto exit node going offline, losing its
exit routes, or being removed qualifies once one is selected. The last
case replaces the separate offline check, so the exit node is resolved
once per delta. The auto exit node check walks every peer, so it only
runs in those cases.
On the delta path, the resolved prefs ride in the same Notify as the peer
changes, sent while b.mu is held. resolveExitNodeLocked no longer sends a
Notify; its callers do. The full-netmap path still sends the prefs in a
separate Notify after the netmap.
Fixes#22012
Updates #22206
Signed-off-by: Brendan Creane <[email protected]>
ipn/ipnlocal: resolve serve file redirects against the request path
http.FileServer sends a Location relative to the request URL, such as
"nested/" or "../file". fixLocationHeaderResponseWriter prefixed that
value with the mount point, which dropped every directory between the
mount point and the target. A request for /doc/subdir/nested was
redirected to /doc/nested/.
Resolve the relative Location against the original request path
instead. Collapse leading slashes in the result so a request path like
//host/dir cannot produce a protocol-relative Location.
Fixes#22049
Signed-off-by: Alex Castillo González <[email protected]>
Serve looked up its config with the name exactly as the client sent
it. Config keys are lowercase with no trailing dot, so a plain HTTP
request for "svelte.example.ts.net." or "Svelte.Example.TS.net" got a
404. HTTPS had the same gap for case. TLS rejects a trailing dot in
SNI but does not lowercase it, so a client that sent mixed-case SNI
failed the handshake with "no webserver configured". Browsers and curl
lowercase the hostname before connecting, which hid that path.
Lowercase the name and trim the trailing dot in both branches of
getServeHandler, and lowercase the SNI in the cert callback.
Fixes#21538Fixes#21986
Signed-off-by: Brendan Creane <[email protected]>
The operator user could serve a path or Unix socket if tailscaled
found a sudo rule for them, but the check used the GECOS display name
and so failed for most users with a 401. The check cannot be repaired
safely: listing another user's sudo rules never prompts, so it proves
a rule exists, not that the user has authenticated. An operator who
had not entered their sudo password could serve any root-readable file
or root-only socket. Require root instead and say so in the error.
Fixes#21204Fixes#21985Fixes#21988
Signed-off-by: Brendan Creane <[email protected]>
Serve deletes client-supplied `Tailscale-User-Login` (and similar) headers
before setting its own. However, `http.Header.Del` only matches the exact
canonical name. A client could send Tailscale_User_Login instead, which
was passed through to the backend.
For Go (and some other) backends, that's not an issue, but backends that
map headers to CGI-style variables (HTTP_TAILSCALE_USER_LOGIN) treat
both names the same. Thus, for Funnel requests (or tagged nodes), where
serve sets no identity headers, the backend could trust the spoofed
value. The same applies to Tailscale-App-Capabilities.
This fixes the issue by also deleting any header whose name matches
case-insensitively after replacing '_' with '-'.
This is similar to how other projects do this:
- Django drops them: https://www.djangoproject.com/weblog/2015/jan/13/security/
- nginx does not allow them by default: https://nginx.org/en/docs/http/ngx_http_core_module.html#underscores_in_headers
- Puma had a CVE and now drops them: https://nvd.nist.gov/vuln/detail/cve-2024-45614Fixestailscale/corp#50821
Signed-off-by: Andrew Dunham <[email protected]>
Go's HTTP/1 server closes the request body once the handler starts
writing the response. The proxy's Transport may still be reading that
body, and when its final read fails it closes the backend connection
under the response it is copying. The client gets a truncated response.
Fixes#21894
Signed-off-by: Brendan Creane <[email protected]>
Co-authored-by: Sam Jean <[email protected]>
Add an ipn.Prefs.Tailnet field, passed through controlclient.Options
into tailcfg.RegisterRequest.Tailnet, so a client can recommend or
require a tailnet at registration (e.g. to skip the tailnet picker when
the intent is already known) without impersonating MDM.
Previously this value could only come from the "Tailnet" syspolicy
setting. That setting still takes precedence as an administrative
override; the prefs value is used only when no policy is set.
Updates #22093
Signed-off-by: Adriano Sela Aviles <[email protected]>
A retained legacy cert may have been issued by a different account even when no pre-adoption local key is available. Require a matching fingerprint before claiming a shared-account renewal replaces it.
Fixes#22041
Signed-off-by: Jaron Kramer <[email protected]>
Logging is quite aggressive and most of the logs can be hidden behind
component logging. A few logs are instead gated on if they changed or if
the original state was zero.
Updates #cleanup
Signed-off-by: Claus Lensbøl <[email protected]>
Similar to #20866 for 4via6, conn25 needs to block host-scoped
destinations. Due to the similarity between the two situations, the
matching is no longer in a 4via6-specific location. Since there is no
backwards compatibility to satisfy, there is no exception list for
conn25.
ipn/ipnlocal (for 4via6) and feature/conn25 now both use the new
package.
Updates tailscale/corp#50118
Updates tailscale/corp#46169
Change-Id: Ic3f9cccd2f5823a2ca48bd78607792b0fd6d7db9
Signed-off-by: Adrian Dewhurst <[email protected]>
Allocate a fresh 16-bit ID for each QueryDNS request instead of using the
constant ID 1.
Updates tailscale/corp#48187
Change-Id: I9b47a3fbbef70f0462f1da4f3b29eb77cf31f9f0
Signed-off-by: James Tucker <[email protected]>
Accept a caller context in LocalBackend.QueryDNS and pass it to the
internal resolver. Use the HTTP request context for localapi DNS queries
so cancellation and deadlines bound the lookup.
Updates #8338
Change-Id: I1bb8ec0b779c883ec40d52063adf25ff36cf43e3
Signed-off-by: James Tucker <[email protected]>
The unix-socket reverse proxy checked its backend against the tailscaled
socket only when the handler was built, but each backend connection
re-resolved the path from scratch. A backend that was benign at config
time could later be replaced with a symlink to the tailscaled socket by
anyone able to write to its directory, and the next dial followed it.
The proxy dials as root, so the same swap could redirect a serve or
funnel backend at any root-only unix socket on the host.
Move the check to the dial itself, in a dialServeUnixSocket method
shared by the HTTP transport, the h2c transport and the TCP-forward
handler, all of which previously dialed unix on their own. It refuses
tailscaled's socket with ErrProxyToTailscaledSocket immediately before
connecting.
On Linux 5.6 and newer, the dial pins the resolved socket inode with
openat2(2): an O_PATH descriptor opened with RESOLVE_NO_MAGICLINKS,
and RESOLVE_BENEATH under the socket's parent directory where the path
allows it, or by whole path otherwise. The pinned file is checked
against the tailscaled socket, and the connection is made to the pinned
file through /proc/self/fd, so replacing the path cannot retarget the
connect. On kernels without openat2(2), and on other platforms, the
path is dialed directly.
The connected peer is re-checked after the dial on every platform. The
peer address of a path-bound listener is the path the socket was bound
to, not the path that was dialed, so a symlink swapped in before the
dial is identified after the connect. This check is best-effort:
connections that have no determinable peer name are allowed.
Fixestailscale/corp#50481
Change-Id: Iae5db207519db9c139a512c0427dce3dfa3ca672
Co-authored-by: James Tucker <[email protected]>
Signed-off-by: Sam Jean <[email protected]>
Signed-off-by: James Tucker <[email protected]>
tailscale serve --tcp=<port> unix:<path> dialed the target socket with
no check, so pointing it at tailscaled's own LocalAPI socket proxied a
tailnet peer straight into the LocalAPI. The LocalAPI authorizes a
unix-socket caller by the peer credentials of the dialing process --
tailscaled itself, as root -- so the peer got a write-capable LocalAPI
and could change the node's settings.
The HTTP proxy path already refused this via isTailscaledSocket; the
TCP-forward path, added later, did not. Reject it at config-set time in
setServeConfigLocked so "tailscale serve" fails up front, and keep a
dial-site guard returning ErrProxyToTailscaledSocket as a backstop for
configs set by other means.
RELNOTE: tailscale serve no longer proxies to tailscaled's own socket
Fixestailscale/corp#50425
Change-Id: I5ed02e83d32bdfb09c8164907bf38cabcc406169
Signed-off-by: Sam Jean <[email protected]>
ListenSSH now documents its session trust model and takes an
authorization callback. A session is accepted from any peer that the
tailnet ACL's TCP rules allow and that resolves with WhoIs. The server
performs no SSH client authentication, does not map the peer to a local
user, and does not record the session. The application is responsible
for what each session does. Set Server.SSHAuthCallback to reject
unwanted sessions before they reach Accept. A rejected session is
refused at open with exit status 1 and is never yielded to Accept. The
callback is plumbed through LocalBackend.ListenSSH and HookListenSSH.
With no callback, behavior is unchanged.
The listener's SSH server runs session channels only, with no port
forwarding. Closing the listener closes the accepted connections.
- DisablePTYEmulation runs on every session, so a PTY session passes
data through unchanged instead of translating "\n" to "\r\n". The
translation corrupted binary data read through the net.Conn
interface. Window changes are drained for every session, even when
the application never calls Pty, because gliderssh writes window
changes from the session request loop and an undrained channel
blocks the session's requests. Pty drops window changes when the
application is not reading them.
- The handshake is bounded by TS_SSH_LOGIN_GRACE_TIME, default 120
seconds, the same as sshd's LoginGraceTime.
- TS_SSH_IDLE_TIMEOUT bounds connections with no SSH traffic. It is 0
by default, and zero applies no bound, so quiet but live sessions
are not closed by default. Both timeout knobs accept a Go duration
such as "90s" or a bare number of seconds.
- Accepted sessions wait for Accept in a bounded queue. When the queue
is full, further sessions are refused, so an application that stops
calling Accept parks only a bounded number of sessions.
Updates tailscale/corp#50380
Signed-off-by: James Tucker <[email protected]>
`serveWebHandler` wrote each mount's accepted app capabilities into the connection-scoped serveHTTPContext. Concurrent h2 streams of one TLS serve connection share that struct, so a request to a mount accepting no capabilities could be proxied carrying another mount's `Tailscale-App-Capabilities` header, letting backends that trust the header authorize the wrong mount.
This change fixes that issue by storing accepted capabilities per-request via a context value instead of a field on the shared struct.
Updates tailscale/corp#50380
Change-Id: I5d0a4a02266018f342ba75a1b3291176738ce05b
Signed-off-by: Mike Jensen <[email protected]>
This interprets HiddenNetworkDevices per watch session and sends GUI visibility metadata for peers (without filtering them). We refresh the visibility snapshot when policy or peer membership changes.
Updates tailscale/corp#44104
Signed-off-by: kari-ts <[email protected]>
The immediate use case is feature/conn25 identifying the connector peer
node that responds to a DoH request.
Updates tailscale/corp#46169
Signed-off-by: Michael Ben-Ami <[email protected]>
Adds tests that only a 404 map response wraps ErrNodeRemoved, that the
node-removed warning and NeedsLogin state are cleared by a new netmap or
a profile switch, and that a node restarted after it was deleted shows
the warning and reaches NeedsLogin.
Updates #18700
Signed-off-by: chaosinthecrd <[email protected]>
When a node is deleted, control answers its map requests with a 404 and
the client keeps retrying in its current state, so watchers like
containerboot can't tell a deleted node from a lost connection. This
wraps that error in ErrNodeRemoved, and LocalBackend then moves to
NeedsLogin and sets a node-removed health warning, both cleared on the
next netmap or profile switch. It repurposes #18701 as a stopgap until a
broader fix, such as structured errors from control, exists.
Updates #18700
Signed-off-by: chaosinthecrd <[email protected]>
Updates tailscale/corp#49775
Track authoritative NXDOMAINs for at least 60 seconds on macOS and iOS (where our short SOA ttls are not properly respected), and flush when a cached name becomes resolvable. Compile a no-op tracker elsewhere and avoid duplicate VPN reconfiguration on link changes.
On a fresh install the first netmap arrives before the first netcheck
report, so auto exit node resolution installed the blackhole
ipn.UnresolvedExitNodeID and nothing re-resolved it once the report
arrived. Refresh in setNetInfo while the exit node is still unresolved.
Fixes#18199
Signed-off-by: Brendan Creane <[email protected]>
Since 7e609b258 (v1.102), quad-100 looks up MagicDNS names in
nodeBackend.nodeByName, which also holds short-name keys for in-process
dials. So a query for "foo." matched peer "foo.tail-scale.ts.net" and
was answered with its Tailscale IP. 1ec348784 fixed that for MagicDNS
off; this fixes it for MagicDNS on, too, matching pre-1.102 behavior.
The OS applies the search domain to short names before they reach
quad-100, so a single-label query is a root zone name, not a tailnet
name, and must be forwarded (e.g. to LAN mDNS/LLMNR or a global
nameserver). Short names still work for in-process dials via
NodeByName.
Updates #20789
Signed-off-by: Brad Fitzpatrick <[email protected]>
Change-Id: Ic8199a96cf79178210c9a85e0cebfb46567a894a
Injected packets now arrive on a queue of their own rather than being
multiplexed onto queue 0. Wrapper.Read is deprecated. It still reads the
first kernel-backed queue, but from now on no single queue of a Wrapper
sees every packet.
Deletes the poll goroutine, the bufferConsumed token, the vectorOutbound
channel, tunVectorReadResult, a full-size slab, and the copy of every
accepted packet between the two slabs.
wireguard-go now runs an extra TUN reader goroutine, a net wash compared
to running our poll routine.
Measured on c8gn.2xlarge, Ubuntu 24.04, Kernel v6.14, tailscaled under
load from two peers, each running iperf3 -P8.
tx mean rx mean cores
main 7.00 8.84 3.49
branch 8.94 8.86 3.95
Bumps wireguard-go pin to tailscale/wireguard-go@e61b6b7811.
Updates tailscale/corp#37878
Change-Id: Ide0e8a9f345371b2747fad59dd2bf963c8af5b63
Signed-off-by: Alex Valiushko <[email protected]>
This resolves unscoped policy requests to the connected user's effective
policy instead of the default scope.
Tested by changing the device-scoped AlwaysOn policy at runtime and
running tailscale syspolicy reload. Cofnirmed tailscaled immediately
enforced the updated policy with tailscale down
Updates tailscale/corp#41463
Signed-off-by: kari <[email protected]>
This fetches the effective policy snapshot for the user scope instead of
using the default policy scope, ensuring that policy change
notifications reflect the correct user-scoped effective policy.
Updates tailscale/corp#41463t
Signed-off-by: kari <[email protected]>
LocalBackend named appc.AppConnector in its appConnector field, in the
field's constructor call, and in the AppConnector accessor, so even
builds with ts_omit_appconnectors linked the appc package and its
dependencies. The buildfeatures.HasAppConnectors checks let the linker
drop the code but could not remove the import.
Add a build-tag-gated type for the field: appcAppConnector is an alias
for appc.AppConnector by default, and in ts_omit_appconnectors builds it
is an empty struct with no-op versions of the methods local.go calls, so
the shared code still type checks. The constructor call moves behind a
newAppConnector helper in the same gated file, and the AppConnector
accessor keeps its *appc.AppConnector signature there, with a nil-
returning version in the omitted build.
This takes tailscale.com/appc out of depaware-min.txt and
depaware-minbox.txt. Add a DepChecker test to keep it out; it also sets
ts_omit_conn25, since conn25 uses appc as well.
Updates #12614
Signed-off-by: Brad Fitzpatrick <[email protected]>
Change-Id: Ia7e2d9c4f1b8e6a3d5c0f2b7e9a1c4d6f8b0e2a5
A JSON null for a service or for an endpoint target unmarshals as a nil
pointer, and loadConfigV0 dereferenced it without a check. This made
"tailscale serve set-config" panic. Return an error that names the
service or endpoint instead.
Fixes#21534
Signed-off-by: Brendan Creane <[email protected]>