You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/cmd/tailscaled
Nick Khyl 892f8a9582 various: allow tailscaled shutdown via LocalAPI
A customer wants to allow their employees to restart tailscaled at will, when access rights and MDM policy allow it,
as a way to fully reset client state and re-create the tunnel in case of connectivity issues.

On Windows, the main tailscaled process runs as a child of a service process. The service restarts the child
when it exits (or crashes) until the service itself is stopped. Regular (non-admin) users can't stop the service,
and allowing them to do so isn't ideal, especially in managed or multi-user environments.

In this PR, we add a LocalAPI endpoint that instructs ipnserver.Server, and by extension the tailscaled process,
to shut down. The service then restarts the child tailscaled. Shutting down tailscaled requires LocalAPI write access
and an enabled policy setting.

Updates tailscale/corp#32674
Updates tailscale/corp#32675

Signed-off-by: Nick Khyl <nickk@tailscale.com>
3 months ago
..
childproc all: update copyright and license headers 3 years ago
tailscaledhooks feature/taildrop, ipn/ipnlocal: remove leftover dup calls to osshare 8 months ago
debug.go health,ipn/ipnlocal: introduce eventbus in heath.Tracker (#17085) 3 months ago
debug_forcereflect.go cmd/tailscaled: add disabled debug file to force reflect for binary size experiments 4 months ago
depaware.txt feature/portlist: pull portlist service porting into extension, use eventbus 3 months ago
deps_test.go feature/portlist: pull portlist service porting into extension, use eventbus 3 months ago
generate.go cmd/mkmanifest, cmd/tailscale, cmd/tailscaled: remove Windows arm32 resources from OSS 3 years ago
install_darwin.go all: update copyright and license headers 3 years ago
install_windows.go cmd/tailscaled: add Dnscache as a service dependency 4 months ago
manifest_windows_386.syso cmd/{tailscale,tailscaled}: embed manifest into Windows binaries 3 years ago
manifest_windows_amd64.syso cmd/{tailscale,tailscaled}: embed manifest into Windows binaries 3 years ago
manifest_windows_arm64.syso cmd/{tailscale,tailscaled}: embed manifest into Windows binaries 3 years ago
proxy.go cmd/tailscaled: make the outbound HTTP/SOCKS5 proxy modular 3 months ago
required_version.go all: switch to and require Go 1.23 1 year ago
sigpipe.go all: adjust some build tags for plan9 2 years ago
ssh.go ssh/tailssh: add Plan 9 support for Tailscale SSH 9 months ago
tailscaled.defaults cmd/tailscaled: rename relaynode reference in defaults file comment 6 years ago
tailscaled.go various: allow tailscaled shutdown via LocalAPI 3 months ago
tailscaled.openrc tstest/integration/vms: use an in-process logcatcher (#2360) 5 years ago
tailscaled.service cmd/tailscaled: move cleanup to an implicit action during startup 2 years ago
tailscaled_bird.go all: update copyright and license headers 3 years ago
tailscaled_drive.go feature/drive: start factoring out Taildrive, add ts_omit_drive build tag 4 months ago
tailscaled_notwindows.go all: update copyright and license headers 3 years ago
tailscaled_test.go control/controlclient,tempfork/httprec: don't link httptest, test certs for c2n 11 months ago
tailscaled_windows.go util/syspolicy: finish plumbing policyclient, add feature/syspolicy, move global impl 4 months ago
webclient.go derp/derpserver: split off derp.Server out of derp into its own package 3 months ago
windows-manifest.xml cmd/{tailscale,tailscaled}: embed manifest into Windows binaries 3 years ago
with_cli.go all: update copyright and license headers 3 years ago