-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove feature flag for VNet launch daemon #44923
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9f8a7f1
Do not execute vnet-admin-setup if tsh was built with daemon support
ravicious 15187ea
Remove feature flag
ravicious 51caae9
Don't show background item notification when launch daemon is not sup…
ravicious 949c9ad
Update docs
ravicious 24c0939
Fix typo
ravicious File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,9 +32,10 @@ have `tcp://` as the protocol in their addresses. | |
Click "Connect" next to the TCP app. This starts VNet if it's not already running. Alternatively, | ||
you can start VNet through the connection list in the top left. | ||
|
||
VNet needs to set up a network device and configure DNS on your device, so it'll ask for admin | ||
permissions. For now your password is needed each time you start VNet, but we're working on showing | ||
the prompt only once. | ||
During the first launch, macOS will prompt you to enable a background item for tsh.app. VNet needs | ||
this background item in order to configure DNS on your device. To enable the background item, either | ||
interact with the system notification or go to System Settings > General > Login Items and look for | ||
tsh.app under "Allow in the Background". | ||
|
||
![VNet starting up](../../img/use-teleport/[email protected]) | ||
|
||
|
80 changes: 43 additions & 37 deletions
80
gen/proto/go/teleport/lib/teleterm/vnet/v1/vnet_service.pb.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Teleport | ||
// Copyright (C) 2024 Gravitational, Inc. | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
//go:build vnetdaemon | ||
// +build vnetdaemon | ||
|
||
package common | ||
|
||
import ( | ||
"log/slog" | ||
|
||
"github.com/gravitational/trace" | ||
|
||
"github.com/gravitational/teleport/lib/utils" | ||
"github.com/gravitational/teleport/lib/vnet" | ||
) | ||
|
||
func (c *vnetDaemonCommand) run(cf *CLIConf) error { | ||
if cf.Debug { | ||
utils.InitLogger(utils.LoggingForDaemon, slog.LevelDebug) | ||
} else { | ||
utils.InitLogger(utils.LoggingForDaemon, slog.LevelInfo) | ||
} | ||
|
||
return trace.Wrap(vnet.DaemonSubcommand(cf.Context)) | ||
} | ||
|
||
func (c *vnetAdminSetupCommand) run(cf *CLIConf) error { | ||
return trace.NotImplemented("tsh was built with support for VNet daemon, use %s instead", vnetDaemonSubCommand) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Teleport | ||
// Copyright (C) 2024 Gravitational, Inc. | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
//go:build !vnetdaemon | ||
// +build !vnetdaemon | ||
|
||
package common | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/gravitational/trace" | ||
|
||
"github.com/gravitational/teleport/api/types" | ||
"github.com/gravitational/teleport/lib/vnet" | ||
"github.com/gravitational/teleport/lib/vnet/daemon" | ||
) | ||
|
||
func (c *vnetDaemonCommand) run(cf *CLIConf) error { | ||
return trace.NotImplemented("tsh was built without support for VNet daemon") | ||
} | ||
|
||
func (c *vnetAdminSetupCommand) run(cf *CLIConf) error { | ||
homePath := os.Getenv(types.HomeEnvVar) | ||
if homePath == "" { | ||
// This runs as root so we need to be configured with the user's home path. | ||
return trace.BadParameter("%s must be set", types.HomeEnvVar) | ||
} | ||
|
||
config := daemon.Config{ | ||
SocketPath: c.socketPath, | ||
IPv6Prefix: c.ipv6Prefix, | ||
DNSAddr: c.dnsAddr, | ||
HomePath: homePath, | ||
ClientCred: daemon.ClientCred{ | ||
Valid: true, | ||
Egid: c.egid, | ||
Euid: c.euid, | ||
}, | ||
} | ||
|
||
return trace.Wrap(vnet.AdminSetup(cf.Context, config)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Negative values for enum are supported but not recommended, so I just used
5
instead. On top of that,BackgroundItemStatus
in protos already doesn't map 1:1 to the actual status returned by macOS, because0
returned by macOS means "not registered", whereas in protos 0 should be reserved "unspecified".