ipn: move Options.ServerURL into Prefs.

We can't rely on a frontend to provide a control
server URL, so this naturally belongs in server-persisted
state.

Signed-off-by: David Anderson <dave@natulte.net>
This commit is contained in:
David Anderson
2020-02-18 21:03:22 -08:00
committed by Dave Anderson
parent 45d687e213
commit cf1e386cbd
10 changed files with 37 additions and 28 deletions
+1 -10
View File
@@ -29,14 +29,6 @@ import (
"tailscale.com/wgengine"
)
// defaultLoginServer is the login URL used by an auto-starting
// server.
//
// TODO(danderson): the reason this is hardcoded is that the server
// URL is currently not stored in state, but passed in by the
// frontend. This needs to be fixed.
const defaultLoginServer = "https://login.tailscale.com"
// Options is the configuration of the Tailscale node agent.
type Options struct {
// SocketPath, on unix systems, is the unix socket path to listen
@@ -122,8 +114,7 @@ func Run(rctx context.Context, logf logger.Logf, logid string, opts Options, e w
Version: version.LONG,
Start: &ipn.StartArgs{
Opts: ipn.Options{
ServerURL: defaultLoginServer,
StateKey: opts.AutostartStateKey,
StateKey: opts.AutostartStateKey,
},
},
})