From 0796c53404d9eee6e37550c10116151828a69c63 Mon Sep 17 00:00:00 2001 From: Denton Gentry Date: Sun, 8 Aug 2021 15:46:30 -0700 Subject: [PATCH] tsnet: add AuthKey support. Set a TS_AUTHKEY environment variable to "tskey-01234..." Signed-off-by: Denton Gentry --- tsnet/tsnet.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tsnet/tsnet.go b/tsnet/tsnet.go index ccf29a94e..b9db88aa2 100644 --- a/tsnet/tsnet.go +++ b/tsnet/tsnet.go @@ -177,11 +177,12 @@ func (s *Server) start() error { err = lb.Start(ipn.Options{ StateKey: ipn.GlobalDaemonStateKey, UpdatePrefs: prefs, + AuthKey: os.Getenv("TS_AUTHKEY"), }) if err != nil { return fmt.Errorf("starting backend: %w", err) } - if os.Getenv("TS_LOGIN") == "1" { + if os.Getenv("TS_LOGIN") == "1" || os.Getenv("TS_AUTHKEY") != "" { s.lb.StartLoginInteractive() } return nil