all: store NL keys per profile
This moves the NetworkLock key from a dedicated StateKey to be part of the persist.Persist struct. This struct is stored as part for ipn.Prefs and is also the place where we store the NodeKey. It also moves the ChonkDir from "/tka" to "/tka-profile/<profile-id>". The rename was intentional to be able to delete the "/tka" dir if it exists. This means that we will have a unique key per profile, and a unique directory per profile. Note: `tailscale logout` will delete the entire profile, including any keys. It currently does not delete the ChonkDir. Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
@@ -252,8 +252,8 @@ func (pm *profileManager) loadSavedPrefs(key ipn.StateKey) (ipn.PrefsView, error
|
||||
return savedPrefs.View(), nil
|
||||
}
|
||||
|
||||
// CurrentProfile returns the name and ID of the current profile, or "" if the profile
|
||||
// is not named.
|
||||
// CurrentProfile returns the current LoginProfile.
|
||||
// The value may be zero if the profile is not persisted.
|
||||
func (pm *profileManager) CurrentProfile() ipn.LoginProfile {
|
||||
return *pm.currentProfile
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user