From fb0f8fc0aecbf93546b6f037d91f156a8b093258 Mon Sep 17 00:00:00 2001 From: Maisem Ali Date: Thu, 26 Sep 2024 06:18:15 -0700 Subject: [PATCH] cmd/tsidp: add --dir flag To better control where the tsnet state is being stored. Updates #10263 Signed-off-by: Maisem Ali --- cmd/tsidp/tsidp.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/tsidp/tsidp.go b/cmd/tsidp/tsidp.go index 3e077f9fd..1bdca8919 100644 --- a/cmd/tsidp/tsidp.go +++ b/cmd/tsidp/tsidp.go @@ -64,6 +64,7 @@ type ctxConn struct{ flagLocalPort = flag.Int("local-port", -1, "allow requests from localhost") flagUseLocalTailscaled = flag.Bool("use-local-tailscaled", false, "use local tailscaled instead of tsnet") flagFunnel = flag.Bool("funnel", false, "use Tailscale Funnel to make tsidp available on the public internet") + flagDir = flag.String("dir", "", "tsnet state directory; a default one will be created if not provided") ) func main() { @@ -120,6 +121,7 @@ func main() { } else { ts := &tsnet.Server{ Hostname: "idp", + Dir: *flagDir, } if *flagVerbose { ts.Logf = log.Printf