From 1502f819749491d212486afcc75bfb8f8f4662bf Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 7 Feb 2023 14:35:54 -0800 Subject: [PATCH] ipn/ipnlocal: return error on missing --unattended on CLI up on Windows Maybe not the best long-term fix, but better than letting the user start the server for a millisecond just to have it all torn down as their CLI command finishes running. Updates #7055 Signed-off-by: Brad Fitzpatrick --- ipn/ipnlocal/local.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index 6a8ab8f1c..1ef441e74 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -2498,6 +2498,9 @@ func (b *LocalBackend) checkPrefsLocked(p *ipn.Prefs) error { if err := b.checkExitNodePrefsLocked(p); err != nil { errs = append(errs, err) } + if runtime.GOOS == "windows" && p.WantRunning && !p.ForceDaemon && len(b.notifyWatchers) == 0 { + errs = append(errs, errors.New("Use 'tailscale up --unattended' on Windows without GUI")) + } return multierr.New(errs...) }