9583 Commits

Author SHA1 Message Date
Mike O'Driscoll
5edabb81ec
.github/Makefile/flake: update nix flake support
Cleanup nix support, make flake easier to read with nix-systems.
This also harmonizes with golinks flake setup and reduces an input
dependency by 1.

Update deps test to ensure the vendor hash stays harmonized
with go.mod.

Update make tidy to ensure vendor hash stays current.

Updates #16637

Signed-off-by: Mike O'Driscoll <mikeo@tailscale.com>

WIP

Signed-off-by: Mike O'Driscoll <mikeo@tailscale.com>

WIP

Signed-off-by: Mike O'Driscoll <mikeo@tailscale.com>

Add tailscale module.
2025-09-23 09:49:14 -04:00
Will Norris
e582fb9b53 client/web: use network profile for displaying tailnet info
Also update to use the new DisplayNameOrDefault.

Updates tailscale/corp#30456

Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d
Signed-off-by: Will Norris <will@tailscale.com>
2025-09-22 11:22:38 -07:00
Will Norris
15b3876c2c client/systray: use new tailnet display name is profile title
Updates tailscale/corp#30456

Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d
Signed-off-by: Will Norris <will@tailscale.com>
2025-09-22 11:22:27 -07:00
M. J. Fromberger
daad5c2b5c
wgengine/router: use eventbus.Monitor in linuxRouter (#17232)
This commit does not change the order or meaning of any eventbus activity, it
only updates the way the plumbing is set up.

Updates #15160

Change-Id: I61b863f9c05459d530a4c34063a8bad9046c0e27
Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
2025-09-22 10:49:28 -07:00
Mahyar Mirrashed
5e79e497d3
cmd/tailscale/cli: show last seen time on status command (#16588)
Add a last seen time on the cli's status command, similar to the web
portal.

Before:
```
100.xxx.xxx.xxx    tailscale-operator   tagged-devices linux   offline
```

After:
```
100.xxx.xxx.xxx    tailscale-operator   tagged-devices linux   offline, last seen 20d ago
```

Fixes #16584

Signed-off-by: Mahyar Mirrashed <mah.mirr@gmail.com>
2025-09-22 10:37:27 -07:00
Claus Lensbøl
f67ad67c6f
control/controlclient: switch ID to be incrementing instead of random (#17230)
Also cleans up a a few comments.

Updates #15160

Signed-off-by: Claus Lensbøl <claus@tailscale.com>
2025-09-22 13:14:55 -04:00
M. J. Fromberger
1b5201023f
ipn/ipnlocal: use eventbus.Monitor in LocalBackend (#17225)
This commit does not change the order or meaning of any eventbus activity, it
only updates the way the plumbing is set up.

Updates #15160

Change-Id: I06860ac4e43952a9bb4d85366138c9d9a17fd9cd
Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
2025-09-22 08:43:39 -07:00
M. J. Fromberger
e59fbaab64
util/eventbus: give a nicer error when attempting to use a closed client (#17208)
It is a programming error to Publish or Subscribe on a closed Client, but now
the way you discover that is by getting a panic from down in the machinery of
the bus after the client state has been cleaned up.

To provide a more helpful error, let's panic explicitly when that happens and
say what went wrong ("the client is closed"), by preventing subscriptions from
interleaving with closure of the client. With this change, either an attachment
fails outright (because the client is already closed) or completes and then
shuts down in good order in the normal course.

This does not change the semantics of the client, publishers, or subscribers,
it's just making the failure more eager so we can attach explanatory text.

Updates #15160

Change-Id: Ia492f4c1dea7535aec2cdcc2e5ea5410ed5218d2
Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
2025-09-22 07:07:57 -07:00
Claus Lensbøl
6e128498a7
controlclient/auto: switch eventbus to using a monitor (#17205)
Only changes how the go routine consuming the events starts and stops,
not what it does.

Updates #15160

Signed-off-by: Claus Lensbøl <claus@tailscale.com>
2025-09-22 09:16:13 -04:00
David Bond
cc1761e8d2
cmd/k8s-operator: send operator logs to tailscale (#17110)
This commit modifies the k8s operator to wrap its logger using the logtail
logger provided via the tsnet server. This causes any logs written by
the operator to make their way to Tailscale in the same fashion as
wireguard logs to be used by support.

This functionality can also be opted-out of entirely using the
"TS_NO_LOGS_NO_SUPPORT" environment variable.

Updates https://github.com/tailscale/corp/issues/32037

Signed-off-by: David Bond <davidsbond93@gmail.com>
2025-09-22 13:55:16 +01:00
Kristoffer Dalby
986b4d1b0b control/controlclient: fix tka godoc
Updates #cleanup

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2025-09-22 08:32:42 +02:00
Brad Fitzpatrick
8ec07b5f7f ipn/ipnauth: don't crash on OpenBSD trying to log username of unknown peer
We never implemented the peercred package on OpenBSD (and I just tried
again and failed), but we've always documented that the creds pointer
can be nil for operating systems where we can't map the unix socket
back to its UID. On those platforms, we set the default unix socket
permissions such that only the admin can open it anyway and we don't
have a read-only vs read-write distinction. OpenBSD was always in that
camp, where any access to Tailscale's unix socket meant full access.

But during some refactoring, we broke OpenBSD in that we started
assuming during one logging path (during login) that Creds was non-nil
when looking up an ipnauth.Actor's username, which wasn't relevant (it
was called from a function "maybeUsernameOf" anyway, which threw away
errors).

Verified on an OpenBSD VM. We don't have any OpenBSD integration tests yet.

Fixes #17209
Updates #17221

Change-Id: I473c5903dfaa645694bcc75e7f5d484f3dd6044d
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-21 16:59:59 -07:00
Brad Fitzpatrick
db048e905d control/controlhttp: simplify, fix race dialing, remove priority concept
controlhttp has the responsibility of dialing a set of candidate control
endpoints in a way that minimizes user facing latency. If one control
endpoint is unavailable we promptly dial another, racing across the
dimensions of: IPv6, IPv4, port 80, and port 443, over multiple server
endpoints.

In the case that the top priority endpoint was not available, the prior
implementation would hang waiting for other results, so as to try to
return the highest priority successful connection to the rest of the
client code. This hang would take too long with a large dialplan and
sufficient client to endpoint latency as to cause the server to timeout
the connection due to inactivity in the intermediate state.

Instead of trying to prioritize non-ideal candidate connections, the
first successful connection is now used unconditionally, improving user
facing latency and avoiding any delays that would encroach on the
server-side timeout.

The tests are converted to memnet and synctest, running on all
platforms.

Fixes #8442
Fixes tailscale/corp#32534

Co-authored-by: James Tucker <james@tailscale.com>
Change-Id: I4eb57f046d8b40403220e40eb67a31c41adb3a38
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Signed-off-by: James Tucker <james@tailscale.com>
2025-09-20 20:37:14 -07:00
Brad Fitzpatrick
1b6bc37f28 net/dnscache: fix case where Resolver could return zero IP with single IPv6 address
The controlhttp dialer with a ControlDialPlan IPv6 entry was hitting a
case where the dnscache Resolver was returning an netip.Addr zero
value, where it should've been returning the IPv6 address.

We then tried to dial "invalid IP:80", which would immediately fail,
at least locally.

Mostly this was causing spammy logs when debugging other stuff.

Updates tailscale/corp#32534

Change-Id: If8b9a20f10c1a6aa8a662c324151d987fe9bd2f8
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-20 16:49:57 -07:00
Brad Fitzpatrick
d7ec043306 cmd/tailscale/cli: add ts2021 debug flag to set a dial plan
Updates tailscale/corp#32534

Change-Id: Ief4ee0a263ea1edbf652b74d8c335c1e5ee209d7
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-20 16:09:45 -07:00
Brad Fitzpatrick
798fddbe5c feature/linuxdnsfight: move inotify watching of /etc/resolv.conf out to a feature
tsnet apps in particular never use the Linux DNS OSManagers, so they don't need
DBus, etc. I started to pull that all out into separate features so tsnet doesn't
need to bring in DBus, but hit this first.

Here you can see that tsnet (and the k8s-operator) no longer pulls in inotify.

Updates #17206

Change-Id: I7af0f391f60c5e7dbeed7a080346f83262346591
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-19 21:09:55 -07:00
M. J. Fromberger
f9c699812a
ipn/ipnlocal: use eventbus.Monitor in expiryManager (#17204)
This commit does not change the order or meaning of any eventbus activity, it
only updates the way the plumbing is set up.

Updates #15160

Change-Id: I0a175e67e867459daaedba0731bf68bd331e5ebc
Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
2025-09-19 14:31:55 -07:00
M. J. Fromberger
2b6bc11586
wgengine: use eventbus.Client.Monitor to simplify subscriber maintenance (#17203)
This commit does not change the order or meaning of any eventbus activity, it
only updates the way the plumbing is set up.

Updates #15160

Change-Id: I40c23b183c2a6a6ea3feec7767c8e5417019fc07
Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
2025-09-19 13:20:50 -07:00
M. J. Fromberger
ca9d795006
util/eventbus: add a Monitor type to manage subscriber goroutines (#17127)
A common pattern in event bus usage is to run a goroutine to service a
collection of subscribers on a single bus client. To have an orderly shutdown,
however, we need a way to wait for such a goroutine to be finished.

This commit adds a Monitor type that makes this pattern easier to wire up:
rather than having to track all the subscribers and an extra channel, the
component need only track the client and the monitor.  For example:

   cli := bus.Client("example")
   m := cli.Monitor(func(c *eventbus.Client) {
     s1 := eventbus.Subscribe[T](cli)
     s2 := eventbus.Subscribe[U](cli)
     for {
       select {
       case <-c.Done():
         return
       case t := <-s1.Events():
          processT(t)
       case u := <-s2.Events():
          processU(u)
       }
     }
   })

To shut down the client and wait for the goroutine, the caller can write:

   m.Close()

which closes cli and waits for the goroutine to finish. Or, separately:

   cli.Close()
   // do other stuff
   m.Wait()

While the goroutine management is not explicitly tied to subscriptions, it is a
common enough pattern that this seems like a useful simplification in use.

Updates #15160

Change-Id: I657afda1cfaf03465a9dce1336e9fd518a968bca
Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
2025-09-19 12:34:06 -07:00
Claus Lensbøl
009d702adf
health: remove direct callback and replace with eventbus (#17199)
Pulls out the last callback logic and ensures timers are still running.

The eventbustest package is updated support the absence of events.

Updates #15160

Signed-off-by: Claus Lensbøl <claus@tailscale.com>
2025-09-19 14:58:37 -04:00
Brad Fitzpatrick
d559a21418 util/eventbus/eventbustest: fix typo of test name
And another case of the same typo in a comment elsewhere.

Updates #cleanup

Change-Id: Iaa9d865a1cf83318d4a30263c691451b5d708c9c
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-19 11:25:10 -07:00
Brad Fitzpatrick
5e698a81b6 cmd/tailscaled: make the outbound HTTP/SOCKS5 proxy modular
Updates #12614

Change-Id: Icba6f1c0838dce6ee13aa2dc662fb551813262e4
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-19 11:22:08 -07:00
Brad Fitzpatrick
ecfdd86fc9 net/ace, control/controlhttp: start adding ACE dialing support
Updates tailscale/corp#32227

Change-Id: I38afc668f99eb1d6f7632e82554b82922f3ebb9f
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-19 09:52:29 -07:00
Naman Sood
b9cda4bca5
tsnet,internal/client/tailscale: resolve OAuth into authkeys in tsnet (#17191)
* tsnet,internal/client/tailscale: resolve OAuth into authkeys in tsnet

Updates #8403.

* internal/client/tailscale: omit OAuth library via build tag

Updates #12614.

Signed-off-by: Naman Sood <mail@nsood.in>
2025-09-19 12:31:44 -04:00
Anton Tolchanov
2351cc0d0e ipn/ipnlocal: make the redactNetmapPrivateKeys test recursive
Expand TestRedactNetmapPrivateKeys to cover all sub-structs of
NetworkMap and confirm that a) all fields are annotated as private or
public, and b) all private fields are getting redacted.

Updates tailscale/corp#32095

Signed-off-by: Anton Tolchanov <anton@tailscale.com>
2025-09-19 17:28:49 +01:00
Anton Tolchanov
4a04161828 ipn/ipnlocal: add a C2N endpoint for fetching a netmap
For debugging purposes, add a new C2N endpoint returning the current
netmap. Optionally, coordination server can send a new "candidate" map
response, which the client will generate a separate netmap for.
Coordination server can later compare two netmaps, detecting unexpected
changes to the client state.

Updates tailscale/corp#32095

Signed-off-by: Anton Tolchanov <anton@tailscale.com>
2025-09-19 17:28:49 +01:00
Anton Tolchanov
394718a4ca tstest/integration: support multiple C2N handlers in testcontrol
Instead of a single hard-coded C2N handler, add support for calling
arbitrary C2N endpoints via a node roundtripper.

Updates tailscale/corp#32095

Signed-off-by: Anton Tolchanov <anton@tailscale.com>
2025-09-19 17:28:49 +01:00
M. J. Fromberger
fc9a74a405
util/eventbus: fix flakes in eventbustest tests (#17198)
When tests run in parallel, events from multiple tests on the same bus can
intercede with each other. This is working as intended, but for the test cases
we want to control exactly what goes through the bus.

To fix that, allocate a fresh bus for each subtest.

Fixes #17197

Change-Id: I53f285ebed8da82e72a2ed136a61884667ef9a5e
Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
2025-09-19 07:56:45 -07:00
Brad Fitzpatrick
78035fb9d2 feature/featuretags,cmd/omitsize: support feature dependencies
This produces the following omitsizes output:

    Starting with everything and removing a feature...

    tailscaled tailscale combined (linux/amd64)
     27005112  18153656  39727288
    - 7696384 - 7282688 -19607552 .. remove *
    -  167936 -  110592 -  245760 .. remove acme
    - 1925120 -       0 - 7340032 .. remove aws
    -    4096 -       0 -    8192 .. remove bird
    -   20480 -   12288 -   32768 .. remove capture
    -       0 -   57344 -   61440 .. remove completion
    -  249856 -  696320 -  692224 .. remove debugeventbus
    -   12288 -    4096 -   24576 .. remove debugportmapper
    -       0 -       0 -       0 .. remove desktop_sessions
    -  815104 -    8192 -  544768 .. remove drive
    -   65536 -  356352 -  425984 .. remove kube
    -  233472 -  286720 -  311296 .. remove portmapper (and debugportmapper)
    -   90112 -       0 -  110592 .. remove relayserver
    -  655360 -  712704 -  598016 .. remove serve (and webclient)
    -  937984 -       0 -  950272 .. remove ssh
    -  708608 -  401408 -  344064 .. remove syspolicy
    -       0 - 4071424 -11132928 .. remove systray
    -  159744 -   61440 -  225280 .. remove taildrop
    -  618496 -  454656 -  757760 .. remove tailnetlock
    -  122880 -       0 -  131072 .. remove tap
    -  442368 -       0 -  483328 .. remove tpm
    -   16384 -       0 -   20480 .. remove wakeonlan
    -  278528 -  368640 -  286720 .. remove webclient

    Starting at a minimal binary and adding one feature back...

    tailscaled tailscale combined (linux/amd64)
     19308728  10870968  20119736 omitting everything
    +  352256 +  454656 +  643072 .. add acme
    + 2035712 +       0 + 2035712 .. add aws
    +    8192 +       0 +    8192 .. add bird
    +   20480 +   12288 +   36864 .. add capture
    +       0 +   57344 +   61440 .. add completion
    +  262144 +  274432 +  266240 .. add debugeventbus
    +  344064 +  118784 +  360448 .. add debugportmapper (and portmapper)
    +       0 +       0 +       0 .. add desktop_sessions
    +  978944 +    8192 +  991232 .. add drive
    +   61440 +  364544 +  425984 .. add kube
    +  331776 +  110592 +  335872 .. add portmapper
    +  122880 +       0 +  102400 .. add relayserver
    +  598016 +  155648 +  737280 .. add serve
    + 1142784 +       0 + 1142784 .. add ssh
    +  708608 +  860160 +  720896 .. add syspolicy
    +       0 + 4079616 + 6221824 .. add systray
    +  180224 +   65536 +  237568 .. add taildrop
    +  647168 +  393216 +  720896 .. add tailnetlock
    +  122880 +       0 +  126976 .. add tap
    +  446464 +       0 +  454656 .. add tpm
    +   20480 +       0 +   24576 .. add wakeonlan
    + 1011712 + 1011712 + 1138688 .. add webclient (and serve)

Fixes #17139

Change-Id: Ia91be2da00de8481a893243d577d20e988a0920a
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-19 07:04:57 -07:00
M. J. Fromberger
4f211ea5c5
util/eventbus: add a LogAllEvents helper for testing (#17187)
When developing (and debugging) tests, it is useful to be able to see all the
traffic that transits the event bus during the execution of a test.

Updates #15160

Change-Id: I929aee62ccf13bdd4bd07d786924ce9a74acd17a
Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
2025-09-18 12:44:06 -07:00
Andrew Lytvynov
70dfdac609
prober: allow custom tls.Config for TLS probes (#17186)
Updates https://github.com/tailscale/corp/issues/28569

Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2025-09-18 09:10:33 -07:00
Brad Fitzpatrick
73bbd7caca build_dist.sh: add -trimpath
Saves 81KB (20320440 to 20238520 bytes for linux/amd64)

Updates #1278

Change-Id: Id607480c76220c74c8854ef1a2459aee650ad7b6
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-18 07:52:19 -07:00
Erisa A
61751a0c9a
scripts/installer.sh: add Siemens Industrial OS (#17185)
Fixes #17179

Signed-off-by: Erisa A <erisa@tailscale.com>
2025-09-18 15:50:01 +01:00
Alex Chan
cd153aa644 control, ipn, tailcfg: enable seamless key renewal by default
Previously, seamless key renewal was an opt-in feature.  Customers had
to set a `seamless-key-renewal` node attribute in their policy file.

This patch enables seamless key renewal by default for all clients.

It includes a `disable-seamless-key-renewal` node attribute we can set
in Control, so we can manage the rollout and disable the feature for
clients with known bugs.  This new attribute makes the feature opt-out.

Updates tailscale/corp#31479

Signed-off-by: Alex Chan <alexc@tailscale.com>
2025-09-18 09:59:46 +01:00
Esteban-Bermudez
1c9aaa444d cmd/tailscale/cli: use helper function for matching profiles
This makes the `switch` command use the helper `matchProfile` function
that was introduced in the `remove` sub command.

Signed-off-by: Esteban-Bermudez <esteban@bermudezaguirre.com>
2025-09-17 15:06:19 -07:00
Esteban-Bermudez
5e3e536c2d cmd/tailscale/cli: add remove subcommand
Fixes #12255

Add a new subcommand to `switch` for removing a profile from the local
client. This does not delete the profile from the Tailscale account, but
removes it from the local machine. This functionality is available on
the GUI's, but not yet on the CLI.

Signed-off-by: Esteban-Bermudez <esteban@bermudezaguirre.com>
2025-09-17 15:06:19 -07:00
Brad Fitzpatrick
55d0e6d3a8 net/dns/recursive: remove recursive DNS resolver
It doesn't really pull its weight: it adds 577 KB to the binary and
is rarely useful.

Also, we now have static IPs and other connectivity paths coming
soon enough.

Updates #5853
Updates #1278
Updates tailscale/corp#32168

Change-Id: If336fed00a9c9ae9745419e6d81f7de6da6f7275
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-17 13:09:26 -07:00
Brad Fitzpatrick
73c371f784 cmd/derper: permit port 80 in ACE targets
Updates tailscale/corp#32168
Updates tailscale/corp#32226

Change-Id: Iddc017b060c76e6eab8f6d0c989a775bcaae3518
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-17 13:06:05 -07:00
Tom Proctor
bb38bf7414
docker: bump alpine v3.19 -> 3.22 (#17155)
Updates #15328

Change-Id: Ib33baf8756b648176dce461b25169e079cbd5533

Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
2025-09-17 20:22:24 +01:00
Remy Guercio
9d661663f3
cmd/tsidp: update README with new repo location warning
Fixes: #17170

Signed-off-by: Remy Guercio <remy@tailscale.com>
2025-09-17 14:05:22 -05:00
M. J. Fromberger
6992f958fc
util/eventbus: add an EqualTo helper for testing (#17178)
For a common case of events being simple struct types with some exported
fields, add a helper to check (reflectively) for equal values using cmp.Diff so
that a failed comparison gives a useful diff in the test output.

More complex uses will still want to provide their own comparisons; this
(intentionally) does not export diff options or other hooks from the cmp
package.

Updates #15160

Change-Id: I86bee1771cad7debd9e3491aa6713afe6fd577a6
Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
2025-09-17 08:39:29 -07:00
Elliot Blackburn
8a4b1eb6a3
words: add some more (#17177)
Updates #words

Signed-off-by: Elliot Blackburn <elliot@sunbeam.cx>
2025-09-17 16:18:25 +01:00
Claus Lensbøl
df362d0a08
net/netmon: make ChangeDelta event not a pointer (#17112)
This makes things work slightly better over the eventbus.

Also switches ipnlocal to use the event over the eventbus instead of the
direct callback.

Updates #15160

Signed-off-by: Claus Lensbøl <claus@tailscale.com>
2025-09-17 10:49:41 -04:00
M. J. Fromberger
48029a897d
util/eventbus: allow test expectations reporting only an error (#17146)
Extend the Expect method of a Watcher to allow filter functions that report
only an error value, and which "pass" when the reported error is nil.

Updates #15160

Change-Id: I582d804554bd1066a9e499c1f3992d068c9e8148
Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
2025-09-17 07:20:34 -07:00
Alex Chan
db0b9a361c net/dns: don't timeout if inotify sends multiple events
This fixes a flaky test which has been occasionally timing out in CI.

In particular, this test times out if `watchFile` receives multiple
notifications from inotify before we cancel the test context. We block
processing the second notification, because we've stopped listening to
the `callbackDone` channel.

This patch changes the test so we only send on the first notification.

Testing this locally with `stress` confirms that the test is no longer
flaky.

Fixes #17172
Updates #14699

Signed-off-by: Alex Chan <alexc@tailscale.com>
2025-09-17 14:51:17 +01:00
James Sanderson
ddc0cd7e1e ipn/ipnlocal: disconnect and block when key expires even when using seamless
Updates tailscale/corp#31478

Signed-off-by: James Sanderson <jsanderson@tailscale.com>
2025-09-17 12:09:09 +01:00
Alex Chan
312582bdbf ssh/tailssh: mark TestSSHRecordingCancelsSessionsOnUploadFailure as flaky
Updates https://github.com/tailscale/tailscale/issues/7707

Signed-off-by: Alex Chan <alexc@tailscale.com>
2025-09-17 11:27:00 +01:00
Brad Fitzpatrick
697098ed6c ipn/ipnlocal: fix a case where ts_omit_ssh was still linking in x/crypto/ssh
And add a test.

Updates #12614

Change-Id: Icb1c77f5890def794a4938583725c1a0886b197d
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-16 18:37:46 -07:00
Simon Law
6db30a10f7
cmd/tailscale: shrink QR codes using half blocks (#17084)
When running `tailscale up --qr`, the QR code is rendered using
two full blocks ██ to form a square pixel. This is a problem for
people with smaller terminals, because the output is 37 lines high.
All modern terminals support half block characters, like ▀ and ▄,
which only takes 19 lines and can easily fit in a regular terminal
window.

For example, https://login.tailscale.com/a/0123456789 is now rendered:

```
user@host:~$ tailscale up --qr
█████████████████████████████████████
█████████████████████████████████████
████ ▄▄▄▄▄ █ ▀▀   █▄▀▀ ▄ █ ▄▄▄▄▄ ████
████ █   █ █▀ ▄▄▄█▀█▄▀  ▄█ █   █ ████
████ █▄▄▄█ ██▄ ▄▀▀▄▄ ▀▀ ▀█ █▄▄▄█ ████
████▄▄▄▄▄▄▄█ ▀▄▀ █▄▀▄▀▄█ █▄▄▄▄▄▄▄████
████▄█▄ ▀▄▄▄█▀▄█▀ ▀▄ ▄  ▀▀ ▀▀▄█▄ ████
████▄▀▄▀▄█▄ █ ▄▄▄▄█▀██▀██▄▄█▀█▄▄▀████
████▄█▀ ▀ ▄█▄▄▀▄▀█ ▄ ▄█▀█▄▀██▄ ▀▀████
█████▀ ▀  ▄▀▀▀▀▄▀▄▀▀ ▄▄ ▄ ▀  █▄ ▄████
██████ ▄▄█▄▄▄▄▄▀ █ ▄▀▀▄█▀ █ ▄ ▀ █████
████▄█▄▄  ▄▀ ▀██▀  ▄█▀▀████▄▀█ ██████
█████▄▄▄█▄▄▄▀▀ █▄▄▄▄▄ ▀█ ▄▄▄   ▀▀████
████ ▄▄▄▄▄ █ ██▄ ▀ █▀█ ▄ █▄█  █▄█████
████ █   █ █▀  █ ▀█▄▄ █▀  ▄  ▀▄▀▄████
████ █▄▄▄█ █▄█▀█▄▀██▀██▄ ▀█▄▀▀▄▀▄████
████▄▄▄▄▄▄▄█▄▄███▄▄▄███▄▄▄██▄██▄█████
█████████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
```

To render a QR code with full blocks, like we did in the past, use the
new `--qr-format` flag:

```
user@host:~$ tailscale up --qr --qr-format=large
██████████████████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████████████
████████              ██  ████      ██  ████      ██              ████████
████████  ██████████  ██            ████      ██  ██  ██████████  ████████
████████  ██      ██  ████        ██████  ██      ██  ██      ██  ████████
████████  ██      ██  ██    ████████  ████      ████  ██      ██  ████████
████████  ██      ██  ████      ████      ████  ████  ██      ██  ████████
████████  ██████████  ██████  ██    ████          ██  ██████████  ████████
████████              ██  ██  ██  ██  ██  ██  ██  ██              ████████
████████████████████████    ██    ████  ██  ████  ████████████████████████
████████  ██    ██      ████  ████  ██          ████  ████  ██    ████████
██████████████    ████████  ████      ██  ██              ██████  ████████
████████  ██  ██  ██    ██          ██████████████    ██████    ██████████
██████████  ██  ██████  ██  ██████████  ████  ██████████  ██████  ████████
████████  ████  ██    ██    ██  ████        ██████  ██████    ████████████
████████████        ████████  ██  ██  ██  ████  ████  ██████      ████████
████████████  ██      ████████  ██  ████            ██    ██      ████████
██████████          ██        ██  ██      ████  ██        ████  ██████████
████████████      ██          ██  ██    ████  ████  ██      ██  ██████████
████████████  ████████████████    ██  ██    ████    ██  ██      ██████████
████████  ██          ██  ████████      ██████████████  ████  ████████████
████████████████    ██      ████      ████    ██████████  ██  ████████████
██████████      ██      ████  ██            ████              ████████████
████████████████████████      ████████████    ██  ██████          ████████
████████              ██  ████    ██  ██████      ██  ██    ██  ██████████
████████  ██████████  ██  ██████      ██  ██  ██  ██████    ██████████████
████████  ██      ██  ████    ██  ████      ████          ██  ██  ████████
████████  ██      ██  ██      ██    ██████  ██      ██      ██  ██████████
████████  ██      ██  ██  ██████  ████████████    ████  ████  ██  ████████
████████  ██████████  ██████  ████  ████  ██████    ████    ██  ██████████
████████              ██    ██████      ██████      ████  ████  ██████████
██████████████████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████████████
```

Fixes #17083

Signed-off-by: Simon Law <sfllaw@tailscale.com>
2025-09-16 15:49:03 -07:00
Brad Fitzpatrick
e180fc267b feature/featuretags, all: add ts_omit_acme to disable TLS cert support
I'd started to do this in the earlier ts_omit_server PR but
decided to split it into this separate PR.

Updates #17128

Change-Id: Ief8823a78d1f7bbb79e64a5cab30a7d0a5d6ff4b
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-16 14:11:15 -07:00