tailscale/ssh/tailssh
Simon Law 92bfda580c
cmd/tailscale/cli: fix time in tailscale routecheck (#19956)
When running `tailscale netcheck`, the reported timestamp used to be
in UTC and formatted according to RFC 3339 with a `T` to separate the
date from the time:

	sfllaw@h2co3:~$ tailscale netcheck | head -n3

	Report:
		* Time: 2026-06-01T21:12:32.252620138Z

This is machine-readable time leaking out to the user interface. Times
in normal commands are formatted for humans to read:

	sfllaw@h2co3:~$ date
	Mon 01 Jun 2026 02:39:14 PM PDT
	sfllaw@h2co3:~$ journalctl -t tailscaled | tail -n1
	Jun 01 14:35:21 h2co3 tailscaled[3328921]: wgengine: sending TSMP disco key advertisement to 100.90.144.102
	sfllaw@h2co3:~$ timedatectl show
	Timezone=America/Los_Angeles
	LocalRTC=no
	CanNTP=yes
	NTP=yes
	NTPSynchronized=yes
	TimeUSec=Mon 2026-06-01 14:38:32 PDT
	RTCTimeUSec=Mon 2026-06-01 14:38:32 PDT
	sfllaw@h2co3:~$ uptime --since
	2026-05-15 07:37:45

This PR makes the times printed by the CLI commands consistent:

- For `tailscale routecheck`, it now prints local time as
  `2026-05-15 07:37:45-07:00`.
- For `netlogfmt`, it has always printed local time with a space,
  but now includes the time zone.
- All machine-readable outputs continue to be standard RFC 3339 in
  UTC, i.e. `--format=json`.

As part of a general cleanup, this PR also adds standard common
time.Format layouts as tstime constants.

Fixes #19928

Signed-off-by: Simon Law <sfllaw@tailscale.com>
2026-06-01 16:12:08 -07:00
..
testcontainers ssh/tailssh: speed up SSH integration tests 2026-04-13 14:18:27 -07:00
accept_env_test.go ssh/tailssh: reject dangerous LD_/DYLD_ env vars in acceptEnv filtering (#19914) 2026-06-01 09:19:27 -07:00
accept_env.go ssh/tailssh: reject dangerous LD_/DYLD_ env vars in acceptEnv filtering (#19914) 2026-06-01 09:19:27 -07:00
auditd_linux_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
auditd_linux.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
c2n.go ipn/ipnlocal, feature/ssh: move SSH code out of LocalBackend to feature 2026-03-10 17:27:17 -07:00
hostkeys_test.go ipn/ipnlocal, feature/ssh: move SSH code out of LocalBackend to feature 2026-03-10 17:27:17 -07:00
hostkeys.go ssh: replace tempfork with tailscale/gliderssh 2026-04-07 11:59:38 +01:00
incubator_linux.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
incubator_plan9.go ipn/ipnlocal, all: split LocalBackend.NetMap into NetMapNoPeers / NetMapWithPeers 2026-04-30 11:14:06 -07:00
incubator.go ipn/ipnlocal, all: split LocalBackend.NetMap into NetMapNoPeers / NetMapWithPeers 2026-04-30 11:14:06 -07:00
listen.go tsnet: add opt-in SSH support (Server.ListenSSH) 2026-05-30 14:17:50 -07:00
privs_test.go tstest: add RequireRoot helper 2026-04-10 10:48:50 -07:00
session.go tsnet: add opt-in SSH support (Server.ListenSSH) 2026-05-30 14:17:50 -07:00
tailssh_integration_test.go ipn/ipnlocal, all: split LocalBackend.NetMap into NetMapNoPeers / NetMapWithPeers 2026-04-30 11:14:06 -07:00
tailssh_test.go ipn/ipnlocal, all: split LocalBackend.NetMap into NetMapNoPeers / NetMapWithPeers 2026-04-30 11:14:06 -07:00
tailssh.go cmd/tailscale/cli: fix time in tailscale routecheck (#19956) 2026-06-01 16:12:08 -07:00
user.go ssh/tailssh: fix default PATH for Debian 2026-04-09 11:57:40 -04:00