Showing posts with label Tailscale. Show all posts

Tailscale battery life instrumentation #

I wrote a valedictory blog post about the instrumentation we're adding to the Tailscale client to get a handle on battery life issues. It's been an interesting "full-stack" project, involving thinking about cell phone internals, hacking on the Go standard library, and exploring visualization options.

You won't believe what this one weird ioctl will do #

Darwin was one of the first things Apple open-sourced (24 years ago). It's been mostly a "throw it over the wall" approach, but being able to peek under the hood has been very handy.

I wrote a short tailscale.dev blog post showing how we've been able to improve Tailscale's macOS and iOS apps by seeing how things are implemented.

Reducing Tailscale’s Binary Size on macOS #

Tailscale iOS and macOS Shortcuts #

I worked on adding iOS and macOS Shortcuts support for Tailscale's latest release. I wrote a blog post with examples of shortcuts and automations that the Tailscale actions could be combined with. One that didn't make the cut was using sound recognition, for things like “In case of an emergency, break glass to activate Tailscale”.

iOS Shortcuts automation that connects Tailscale when the sound of breaking glass is detected Shortcut automation sound triggers: baby crying, shouting, kettle, and others

Other possibilities include "Cry/shout/scream to connect" and "Let your pet control your connection state".

Places Mihai Has Committed Code From #

I've been running lolcommits for 10 years, and it's captured some interesting moments from my time at Quip and Tailscale.

I've put together a gallery, it was a fun nostalgia trip to revisit so many places and coworkers.

Tailscale Fast User Switching #

Account switching is one of the less fun parts of modern computing -- for a while I had registered giveupandusemultiplebrowsers.com. Even when software tries to accomodate these scenarios, the heuristics for when to switch can be tricky, and in some cases require the user to maintain a complex mental model of what state they're in and where they're trying to get to.

Tailscale did not distinguish itself in this regard -- fast user switching was one of our most requested features for the last couple of years. Besides being generally a good thing to do, user switching also plays into the business model – if enthusisast users bring Tailscale to work, they're going to want to be able to quickly switch between their personal and work accounts.

Tailscale fast user switching UI in the Mac app menu barWith version 1.34 (released today), we now have the first step: fast-user switching support. Maisem did most of the hard parts (making the Tailscale backend profile-aware, data migration, and untangling what should be global vs. per-account state). I worked mostly on the Mac side, implementing Alessandro's designs but also modernizing our use of the Keychain (where account data is persisted).

I spent a lot of quality time with WWDC sessions from 2010, trying to make custom NSMenuItem views behave just like the real thing, even when using keyboard navigation or VoiceOver. The ironic thing is that Apple itself appears to have given up on this. On modern macOS versions the Wi-Fi and related "menu" controls are actually custom (SwiftUI?) views that don't behave quite like real menus (e.g. they don't highlight items with menu color).

While I was in this part of the codebase, I also cleaned up how the Mac app handles custom coordination servers. Though not officially supported, it's now possible to have profiles on different servers by using the debug menu (finding out how to trigger that is left as an exercise for the reader).

If you wish to make a web SSH client from scratch, you must first invent the network stack #

It was a lot of fun turning Brad's Taiscale-on-Wasm prototype into Tailscale SSH Console. I wrote a post for the Tailscale blog with more details (you can tell it wasn't ghost-written because it has my link-heavy style).

Almost all of the development was in the open-source repo, and started to land a few months ago. It was rather funny to have WebVM notice and start using it a few weeks ago, sort of scooping our own announcement. Their use-case (as a way to get a browser-based VM online) is something I've considered for Infinite Mac.

Brad and I did sneak in an easter egg. I spent a lot of time studying the product spec, and landed it with the commit message "add alternate progress display for SSH sessions". It was very satisfying to have it be discovered without prompting.

There was reasonable discussion of the feature on Hacker News. My favorite comment was "Having an SSH client in your browser join your VPN violates all the principles of modern computing." While not intended as a compliment, it did remind me of the rethinking best practices approach from the early days of React.

The Case of the Spiky File Descriptors #