client/web: fill devMode from an env var

Avoids the need to pipe a web client dev flag through the tailscaled
command.

Updates tailscale/corp#14335

Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
This commit is contained in:
Sonia Appasamy
2023-11-02 18:19:16 -04:00
committed by Sonia Appasamy
parent f0bc95a066
commit 0ecfc1d5c3
4 changed files with 8 additions and 16 deletions

View File

@@ -41,7 +41,6 @@ Tailscale, as opposed to a CLI or a native app.
webf := newFlagSet("web")
webf.StringVar(&webArgs.listen, "listen", "localhost:8088", "listen address; use port 0 for automatic")
webf.BoolVar(&webArgs.cgi, "cgi", false, "run as CGI script")
webf.BoolVar(&webArgs.dev, "dev", false, "run web client in developer mode [this flag is in development, use is unsupported]")
webf.StringVar(&webArgs.prefix, "prefix", "", "URL prefix added to requests (for cgi or reverse proxies)")
return webf
})(),
@@ -51,7 +50,6 @@ Tailscale, as opposed to a CLI or a native app.
var webArgs struct {
listen string
cgi bool
dev bool
prefix string
}
@@ -104,7 +102,6 @@ func runWeb(ctx context.Context, args []string) error {
webServer, err := web.NewServer(web.ServerOpts{
Mode: cliServerMode,
DevMode: webArgs.dev,
CGIMode: webArgs.cgi,
PathPrefix: webArgs.prefix,
LocalClient: &localClient,