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 -1
View File
@@ -149,13 +149,13 @@ func (b *LocalBackend) Start(opts Options) error {
hi.Services = b.hiCache.Services // keep any previous session
b.hiCache = hi
b.state = NoState
b.serverURL = opts.ServerURL
if err := b.loadStateWithLock(opts.StateKey, opts.Prefs); err != nil {
b.mu.Unlock()
return fmt.Errorf("loading requested state: %v", err)
}
b.serverURL = b.prefs.ControlURL
hi.RoutableIPs = append(hi.RoutableIPs, b.prefs.AdvertiseRoutes...)
b.notify = opts.Notify