From 00c128f0a4deff119f93d02de03fa3fc47c54ec1 Mon Sep 17 00:00:00 2001 From: Simon Zolin Date: Tue, 2 Apr 2019 17:21:12 +0300 Subject: [PATCH] * control: /install/get_addresses: don't check if ports are available * always use port 80 --- control.go | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/control.go b/control.go index 8ded7372..7fd78cde 100644 --- a/control.go +++ b/control.go @@ -970,15 +970,9 @@ func handleSafeSearchStatus(w http.ResponseWriter, r *http.Request) { } } -type ipport struct { - IP string `json:"ip,omitempty"` - Port int `json:"port"` - Warning string `json:"warning"` -} - type firstRunData struct { - Web ipport `json:"web"` - DNS ipport `json:"dns"` + WebPort int `json:"web_port"` + DNSPort int `json:"dns_port"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` Interfaces map[string]interface{} `json:"interfaces"` @@ -987,19 +981,8 @@ type firstRunData struct { func handleInstallGetAddresses(w http.ResponseWriter, r *http.Request) { log.Tracef("%s %v", r.Method, r.URL) data := firstRunData{} - - // find out if port 80 is available -- if not, fall back to 3000 - if checkPortAvailable("", 80) == nil { - data.Web.Port = 80 - } else { - data.Web.Port = 3000 - } - - // find out if port 53 is available -- if not, show a big warning - data.DNS.Port = 53 - if checkPacketPortAvailable("", 53) != nil { - data.DNS.Warning = "Port 53 is not available for binding -- this will make DNS clients unable to contact AdGuard Home." - } + data.WebPort = 80 + data.DNSPort = 53 ifaces, err := getValidNetInterfacesForWeb() if err != nil {