Skip to content

Commit 834630f

Browse files
committed
cmd/tailscale: add systray subcommand on Linux builds
This will start including the sytray app in unstable builds for Linux, unless the `ts_omit_systray` build flag is specified. If we decide not to include it in the v1.88 release, we can pull it back out or restrict it to unstable builds. Updates tailscale#1708 Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d Signed-off-by: Will Norris <[email protected]>
1 parent 0f15e44 commit 834630f

File tree

5 files changed

+81
-4
lines changed

5 files changed

+81
-4
lines changed

build_dist.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ while [ "$#" -gt 1 ]; do
4141
fi
4242
shift
4343
ldflags="$ldflags -w -s"
44-
tags="${tags:+$tags,}ts_omit_aws,ts_omit_bird,ts_omit_tap,ts_omit_kube,ts_omit_completion,ts_omit_ssh,ts_omit_wakeonlan,ts_omit_capture,ts_omit_relayserver,ts_omit_taildrop,ts_omit_tpm"
44+
tags="${tags:+$tags,}ts_omit_aws,ts_omit_bird,ts_omit_tap,ts_omit_kube,ts_omit_completion,ts_omit_ssh,ts_omit_wakeonlan,ts_omit_capture,ts_omit_relayserver,ts_omit_systray,ts_omit_taildrop,ts_omit_tpm"
4545
;;
4646
--box)
4747
if [ ! -z "${TAGS:-}" ]; then

cmd/tailscale/cli/cli.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ change in the future.
261261
driveCmd,
262262
idTokenCmd,
263263
configureHostCmd(),
264+
systrayCmd,
264265
),
265266
FlagSet: rootfs,
266267
Exec: func(ctx context.Context, args []string) error {

cmd/tailscale/cli/systray.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright (c) Tailscale Inc & AUTHORS
2+
// SPDX-License-Identifier: BSD-3-Clause
3+
4+
//go:build linux && !ts_omit_systray
5+
6+
package cli
7+
8+
import (
9+
"context"
10+
11+
"github.com/peterbourgon/ff/v3/ffcli"
12+
"tailscale.com/client/systray"
13+
)
14+
15+
var systrayCmd = &ffcli.Command{
16+
Name: "systray",
17+
ShortUsage: "tailscale systray",
18+
ShortHelp: "Run a systray application to manage Tailscale",
19+
Exec: func(_ context.Context, _ []string) error {
20+
// TODO(will): pass localClient to menu to use the global --socket flag
21+
new(systray.Menu).Run()
22+
return nil
23+
},
24+
}

cmd/tailscale/cli/systray_omit.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright (c) Tailscale Inc & AUTHORS
2+
// SPDX-License-Identifier: BSD-3-Clause
3+
4+
//go:build !linux || ts_omit_systray
5+
6+
package cli
7+
8+
import (
9+
"context"
10+
"fmt"
11+
"strings"
12+
13+
"github.com/peterbourgon/ff/v3/ffcli"
14+
)
15+
16+
// TODO(will): update URL to KB article when available
17+
var systrayHelp = strings.TrimSpace(`
18+
The Tailscale systray app is not included in this client build.
19+
To run it manually, see https://github.com/tailscale/tailscale/tree/main/cmd/systray
20+
`)
21+
22+
var systrayCmd = &ffcli.Command{
23+
Name: "systray",
24+
ShortUsage: "tailscale systray",
25+
ShortHelp: "Not available in this client build",
26+
LongHelp: hidden + systrayHelp,
27+
Exec: func(_ context.Context, _ []string) error {
28+
fmt.Println(systrayHelp)
29+
return nil
30+
},
31+
}

cmd/tailscale/depaware.txt

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,34 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep
22

33
filippo.io/edwards25519 from github.com/hdevalence/ed25519consensus
44
filippo.io/edwards25519/field from filippo.io/edwards25519
5+
L fyne.io/systray from tailscale.com/client/systray
6+
L fyne.io/systray/internal/generated/menu from fyne.io/systray
7+
L fyne.io/systray/internal/generated/notifier from fyne.io/systray
8+
L github.com/Kodeworks/golang-image-ico from tailscale.com/client/systray
59
W 💣 github.com/alexbrainman/sspi from github.com/alexbrainman/sspi/internal/common+
610
W github.com/alexbrainman/sspi/internal/common from github.com/alexbrainman/sspi/negotiate
711
W 💣 github.com/alexbrainman/sspi/negotiate from tailscale.com/net/tshttpproxy
12+
L github.com/atotto/clipboard from tailscale.com/client/systray
813
github.com/coder/websocket from tailscale.com/util/eventbus
914
github.com/coder/websocket/internal/errd from github.com/coder/websocket
1015
github.com/coder/websocket/internal/util from github.com/coder/websocket
1116
github.com/coder/websocket/internal/xsync from github.com/coder/websocket
1217
L github.com/coreos/go-iptables/iptables from tailscale.com/util/linuxfw
1318
W 💣 github.com/dblohm7/wingoes from github.com/dblohm7/wingoes/pe+
1419
W 💣 github.com/dblohm7/wingoes/pe from tailscale.com/util/winutil/authenticode
20+
L github.com/fogleman/gg from tailscale.com/client/systray
1521
github.com/fxamacker/cbor/v2 from tailscale.com/tka
1622
github.com/go-json-experiment/json from tailscale.com/types/opt+
1723
github.com/go-json-experiment/json/internal from github.com/go-json-experiment/json+
1824
github.com/go-json-experiment/json/internal/jsonflags from github.com/go-json-experiment/json+
1925
github.com/go-json-experiment/json/internal/jsonopts from github.com/go-json-experiment/json+
2026
github.com/go-json-experiment/json/internal/jsonwire from github.com/go-json-experiment/json+
2127
github.com/go-json-experiment/json/jsontext from github.com/go-json-experiment/json+
28+
L 💣 github.com/godbus/dbus/v5 from fyne.io/systray+
29+
L github.com/godbus/dbus/v5/introspect from fyne.io/systray+
30+
L github.com/godbus/dbus/v5/prop from fyne.io/systray
31+
L github.com/golang/freetype/raster from github.com/fogleman/gg+
32+
L github.com/golang/freetype/truetype from github.com/fogleman/gg
2233
github.com/golang/groupcache/lru from tailscale.com/net/dnscache
2334
L github.com/google/nftables from tailscale.com/util/linuxfw
2435
L 💣 github.com/google/nftables/alignedbuff from github.com/google/nftables/xt
@@ -59,7 +70,7 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep
5970
L 💣 github.com/tailscale/netlink from tailscale.com/util/linuxfw
6071
L 💣 github.com/tailscale/netlink/nl from github.com/tailscale/netlink
6172
github.com/tailscale/web-client-prebuilt from tailscale.com/client/web
62-
github.com/toqueteos/webbrowser from tailscale.com/cmd/tailscale/cli
73+
github.com/toqueteos/webbrowser from tailscale.com/cmd/tailscale/cli+
6374
L github.com/vishvananda/netns from github.com/tailscale/netlink+
6475
github.com/x448/float16 from github.com/fxamacker/cbor/v2
6576
💣 go4.org/mem from tailscale.com/client/local+
@@ -73,6 +84,7 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep
7384
tailscale.com from tailscale.com/version
7485
💣 tailscale.com/atomicfile from tailscale.com/cmd/tailscale/cli+
7586
tailscale.com/client/local from tailscale.com/client/tailscale+
87+
L tailscale.com/client/systray from tailscale.com/cmd/tailscale/cli
7688
tailscale.com/client/tailscale from tailscale.com/cmd/tailscale/cli+
7789
tailscale.com/client/tailscale/apitype from tailscale.com/client/tailscale+
7890
tailscale.com/client/web from tailscale.com/cmd/tailscale/cli
@@ -178,6 +190,7 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep
178190
tailscale.com/util/set from tailscale.com/derp+
179191
tailscale.com/util/singleflight from tailscale.com/net/dnscache+
180192
tailscale.com/util/slicesx from tailscale.com/net/dns/recursive+
193+
L tailscale.com/util/stringsx from tailscale.com/client/systray
181194
tailscale.com/util/syspolicy from tailscale.com/ipn
182195
tailscale.com/util/syspolicy/internal from tailscale.com/util/syspolicy/setting+
183196
tailscale.com/util/syspolicy/internal/loggerx from tailscale.com/util/syspolicy/internal/metrics+
@@ -213,6 +226,11 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep
213226
golang.org/x/crypto/salsa20/salsa from golang.org/x/crypto/nacl/box+
214227
golang.org/x/exp/constraints from github.com/dblohm7/wingoes/pe+
215228
golang.org/x/exp/maps from tailscale.com/util/syspolicy/internal/metrics+
229+
L golang.org/x/image/draw from github.com/fogleman/gg
230+
L golang.org/x/image/font from github.com/fogleman/gg+
231+
L golang.org/x/image/font/basicfont from github.com/fogleman/gg
232+
L golang.org/x/image/math/f64 from github.com/fogleman/gg+
233+
L golang.org/x/image/math/fixed from github.com/fogleman/gg+
216234
golang.org/x/net/bpf from github.com/mdlayher/netlink+
217235
golang.org/x/net/dns/dnsmessage from net+
218236
golang.org/x/net/http/httpguts from net/http+
@@ -339,7 +357,10 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep
339357
html/template from tailscale.com/util/eventbus
340358
image from github.com/skip2/go-qrcode+
341359
image/color from github.com/skip2/go-qrcode+
342-
image/png from github.com/skip2/go-qrcode
360+
L image/draw from github.com/Kodeworks/golang-image-ico+
361+
L image/internal/imageutil from image/draw+
362+
L image/jpeg from github.com/fogleman/gg
363+
image/png from github.com/skip2/go-qrcode+
343364
internal/abi from crypto/x509/internal/macos+
344365
internal/asan from internal/runtime/maps+
345366
internal/bisect from internal/godebug
@@ -409,7 +430,7 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep
409430
net/url from crypto/x509+
410431
os from crypto/internal/sysrand+
411432
os/exec from github.com/coreos/go-iptables/iptables+
412-
os/signal from tailscale.com/cmd/tailscale/cli
433+
os/signal from tailscale.com/cmd/tailscale/cli+
413434
os/user from archive/tar+
414435
path from archive/tar+
415436
path/filepath from archive/tar+

0 commit comments

Comments
 (0)