Skip to content

ipn/ipnserver: provide means of setting debug env vars on Windows - #3692

Merged
bradfitz merged 1 commit into
mainfrom
bradfitz/winenv
Jan 10, 2022
Merged

bradfitz merged 1 commit into
mainfrom
bradfitz/winenv

Conversation

@bradfitz

Copy link
Copy Markdown
Member

Fixes #3688

Fixes #3688

Change-Id: I2f88ca32bf764e2b084fe544d821c43b6a20ffa5
Signed-off-by: Brad Fitzpatrick <[email protected]>
@bradfitz
bradfitz requested a review from crawshaw January 10, 2022 18:00

@crawshaw crawshaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that we have this and registry keys on windows is a bit confusing. What's the logic for what goes where?

Comment thread ipn/ipnserver/server.go
if runtime.GOOS != "windows" {
return nil, nil
}
name := filepath.Join(os.Getenv("ProgramData"), "Tailscale", "tailscaled-env.txt")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than an absolute path can we find this relative to the executable, for debug setups that run from a directory rather than using the installer?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not worth it. If you're using a debug setup and running a custom binary from cmd.exe, you can set the environment variable by hand already in cmd.exe or powershell. You don't need this mechanism for that.

This is purely for running as a service.

@bradfitz

Copy link
Copy Markdown
Member Author

The fact that we have this and registry keys on windows is a bit confusing. What's the logic for what goes where?

Supported things can go in the registry.

Debug crap that's debug-portable between Linux/Windows/etc can continue to go in the environment. (We have dozens already... this just makes it usable on Windows when running as a service.... you can already set them by hand on Windows but only for tailscaled in the foreground in an admin cmd.exe)

@bradfitz
bradfitz merged commit b03170b into main Jan 10, 2022
@bradfitz
bradfitz deleted the bradfitz/winenv branch January 10, 2022 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide easy means of setting environment variables on Windows

2 participants