ipn: add/move some constants, update a comment

And make the StateStore implementations be Stringers, for error messages.
This commit is contained in:
Brad Fitzpatrick
2020-09-29 20:51:25 -07:00
parent 1fecf87363
commit 90b7293b3b
3 changed files with 23 additions and 18 deletions

View File

@@ -28,15 +28,6 @@ import (
"tailscale.com/wgengine/router"
)
// globalStateKey is the ipn.StateKey that tailscaled loads on
// startup.
//
// We have to support multiple state keys for other OSes (Windows in
// particular), but right now Unix daemons run with a single
// node-global state. To keep open the option of having per-user state
// later, the global state key doesn't look like a username.
const globalStateKey = "_daemon"
var upCmd = &ffcli.Command{
Name: "up",
ShortUsage: "up [flags]",
@@ -239,7 +230,7 @@ func runUp(ctx context.Context, args []string) error {
bc.SetPrefs(prefs)
opts := ipn.Options{
StateKey: globalStateKey,
StateKey: ipn.GlobalDaemonStateKey,
AuthKey: upArgs.authKey,
Notify: func(n ipn.Notify) {
if n.ErrMessage != nil {