From e0cadc54968519eae7e37e0e65ab9a7052bd54e8 Mon Sep 17 00:00:00 2001 From: Denton Gentry Date: Mon, 14 Nov 2022 17:32:04 -0800 Subject: [PATCH] cmd/tailscale: access QNAP via localhost QNAP 5.x works much better if we let Apache proxy tailscale web, which means the URLs can no longer be relative since apache sends us an internal URL. Access QNAP authentication via http://localhost:8080/ as documented in https://download.qnap.com/dev/API_QNAP_QTS_Authentication.pdf 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 0700bd938..b21cc3e0f 100644 --- a/cmd/tailscale/cli/web.go +++ b/cmd/tailscale/cli/web.go @@ -224,8 +224,8 @@ func qnapAuthnQtoken(r *http.Request, user, token string) (string, *qnapAuthResp "user": []string{user}, } u := url.URL{ - Scheme: r.URL.Scheme, - Host: r.URL.Host, + Scheme: "http", + Host: "127.0.0.1:8080", Path: "/cgi-bin/authLogin.cgi", RawQuery: query.Encode(), } @@ -238,8 +238,8 @@ func qnapAuthnSid(r *http.Request, user, sid string) (string, *qnapAuthResponse, "sid": []string{sid}, } u := url.URL{ - Scheme: r.URL.Scheme, - Host: r.URL.Host, + Scheme: "http", + Host: "127.0.0.1:8080", Path: "/cgi-bin/authLogin.cgi", RawQuery: query.Encode(), }