Skip to content

envknob: generalize Windows tailscaled-env.txt support - #5665

Merged
bradfitz merged 1 commit into
mainfrom
bradfitz/env_windows
Sep 16, 2022
Merged

bradfitz merged 1 commit into
mainfrom
bradfitz/env_windows

Conversation

@bradfitz

Copy link
Copy Markdown
Member

ipnserver previously had support for a Windows-only environment variable mechanism that further only worked when Windows was running as a service, not from a console.

But we want it to work from tailscaed too, and we want it to work on macOS and Synology. So move it to envknob, now that envknob can change values at runtime post-init.

A future change will wire this up for more platforms, and do something more for CLI flags like --port, which the bug was originally about.

Updates #5114

@bradfitz
bradfitz requested review from andrew-d and maisem September 16, 2022 21:16
@bradfitz

Copy link
Copy Markdown
Member Author

2:16pm and this is like my first code of the day 🤦‍♂️

@bradfitz
bradfitz force-pushed the bradfitz/env_windows branch from fe900db to 1d19ffb Compare September 16, 2022 21:58
Comment on lines +200 to +202
if diskConfigErr != nil {
log.Printf("Error reading environment config: %v", diskConfigErr)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this only printing on Windows because it only does things on Windows? Are you planning on moving this to the non-Windows codepath when adding macOS / Synology support?

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.

Windows has two start-up paths for ... reasons. The foreground tailscaled vs service paths.

These three lines are already in two places, the other being the generic tailscaled foreground (all platforms including Windows) case.

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.

OH! it would be if I'd saved that buffer. So good catch.

Comment thread envknob/envknob.go Resolved
ipnserver previously had support for a Windows-only environment
variable mechanism that further only worked when Windows was running
as a service, not from a console.

But we want it to work from tailscaed too, and we want it to work on
macOS and Synology. So move it to envknob, now that envknob can change
values at runtime post-init.

A future change will wire this up for more platforms, and do something
more for CLI flags like --port, which the bug was originally about.

Updates #5114

Change-Id: I9fd69a9a91bb0f308fc264d4a6c33e0cbe352d71
Signed-off-by: Brad Fitzpatrick <[email protected]>
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.

3 participants