cmd/tsidp: add --dir flag

To better control where the tsnet state is being stored.

Updates #10263

Signed-off-by: Maisem Ali <maisem@tailscale.com>
pull/13624/head
Maisem Ali 2 months ago committed by Maisem Ali
parent 096b090caf
commit fb0f8fc0ae

@ -64,6 +64,7 @@ var (
flagLocalPort = flag.Int("local-port", -1, "allow requests from localhost") flagLocalPort = flag.Int("local-port", -1, "allow requests from localhost")
flagUseLocalTailscaled = flag.Bool("use-local-tailscaled", false, "use local tailscaled instead of tsnet") 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") 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() { func main() {
@ -120,6 +121,7 @@ func main() {
} else { } else {
ts := &tsnet.Server{ ts := &tsnet.Server{
Hostname: "idp", Hostname: "idp",
Dir: *flagDir,
} }
if *flagVerbose { if *flagVerbose {
ts.Logf = log.Printf ts.Logf = log.Printf

Loading…
Cancel
Save