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 -4
View File
@@ -5,7 +5,6 @@
package ipn
import (
"strings"
"sync"
"time"
@@ -14,7 +13,6 @@ import (
)
type Handle struct {
serverURL string
frontendLogID string
b Backend
xnotify func(n Notify)
@@ -43,7 +41,6 @@ func NewHandle(b Backend, logf logger.Logf, opts Options) (*Handle, error) {
}
func (h *Handle) Start(opts Options) error {
h.serverURL = strings.TrimRight(opts.ServerURL, "/")
h.frontendLogID = opts.FrontendLogID
h.xnotify = opts.Notify
h.netmapCache = nil
@@ -148,7 +145,7 @@ func (h *Handle) Expiry() time.Time {
}
func (h *Handle) AdminPageURL() string {
return h.serverURL + "/admin/machines"
return h.prefsCache.ControlURL + "/admin/machines"
}
func (h *Handle) StartLoginInteractive() {