-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ipn/ipnlocal: add support for multiple profiles
Currently all user state is stored in ipn.Prefs, which is then peristed into the specified ipn.StateStore under a single key "_daemon" except in the case of Windows. Windows kind of already supports multiple profiles as multiple users can log in the node and go into "Unattended" mode. It does this by storing another object (under "server-mode-start-key") in the store which points to the current loaded profile. We reuse the same mechanism to support multiple profiles on other platforms. However, we do that behind a new key "_current-profile" which now points to "profile-<name>" like ("profile-work"). This helps us not accidentally start the profile at Tailscaled startup on Windows. By adding a new ProfileManager we also simplify some of the state machine from LocalBackend as it no longer needs ot own prefs. We also only expose PrefsView from the ProfileManager so as to simplify the ownership even further. Signed-off-by: Maisem Ali <maisem@tailscale.com>
- Loading branch information
Showing
27 changed files
with
839 additions
and
307 deletions.
There are no files selected for viewing
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
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
Oops, something went wrong.