From a200a23f97c535b14fa23685d3453dc3f48487ef Mon Sep 17 00:00:00 2001 From: Denton Gentry Date: Sun, 20 Nov 2022 13:32:19 -0800 Subject: [PATCH] Revert "cmd/tailscale: access QNAP via localhost" When running `tailscale web` as a standalone process, it was necessary to send auth requests to QTS using localhost to avoid hitting the proxy recursively. However running `tailscale web` as a process means it is consuming RAM all the time even when it isn't actively doing anything. After switching back to the `tailscale web` CGI mode, we don't need to specifically use localhost for QNAP auth. This reverts commit e0cadc54968519eae7e37e0e65ab9a7052bd54e8. Signed-off-by: Denton Gentry --- cmd/tailscale/cli/web.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/tailscale/cli/web.go b/cmd/tailscale/cli/web.go index 1bf319dc7..ea55d1b0b 100644 --- a/cmd/tailscale/cli/web.go +++ b/cmd/tailscale/cli/web.go @@ -223,8 +223,8 @@ func qnapAuthnQtoken(r *http.Request, user, token string) (string, *qnapAuthResp "user": []string{user}, } u := url.URL{ - Scheme: "http", - Host: "127.0.0.1:8080", + Scheme: r.URL.Scheme, + Host: r.URL.Host, Path: "/cgi-bin/authLogin.cgi", RawQuery: query.Encode(), } @@ -237,8 +237,8 @@ func qnapAuthnSid(r *http.Request, user, sid string) (string, *qnapAuthResponse, "sid": []string{sid}, } u := url.URL{ - Scheme: "http", - Host: "127.0.0.1:8080", + Scheme: r.URL.Scheme, + Host: r.URL.Host, Path: "/cgi-bin/authLogin.cgi", RawQuery: query.Encode(), }