diff options
| author | nyghtowl <warrick@tailscale.com> | 2022-08-31 17:44:22 -0700 |
|---|---|---|
| committer | Melanie Warrick <3422837+nyghtowl@users.noreply.github.com> | 2022-08-31 20:18:13 -0700 |
| commit | cfbbcf6d071dd13addbc1b38ef993a08d557ba22 (patch) | |
| tree | 61f690d5bf6678f9cbeb699631c00dd2071042b0 /cmd | |
| parent | 9c66dce8e0f6780ec649f0df020a98b3c952310d (diff) | |
| download | tailscale-cfbbcf6d071dd13addbc1b38ef993a08d557ba22.tar.xz tailscale-cfbbcf6d071dd13addbc1b38ef993a08d557ba22.zip | |
cmd/nginx-auth/nginx-auth: update auth to allow for new domains
With MagicDNS GA, we are giving every tailnet a tailnet-<hex>.ts.net name.
We will only parse out if legacy domains include beta.tailscale.net; otherwise,
set tailnet to the full domain format going forward.
Signed-off-by: nyghtowl <warrick@tailscale.com>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/nginx-auth/nginx-auth.go | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/cmd/nginx-auth/nginx-auth.go b/cmd/nginx-auth/nginx-auth.go index ee55ca74f..53dcb9596 100644 --- a/cmd/nginx-auth/nginx-auth.go +++ b/cmd/nginx-auth/nginx-auth.go @@ -75,12 +75,7 @@ func main() { log.Printf("can't extract tailnet name from hostname %q", info.Node.Name) return } - tailnet, _, ok = strings.Cut(tailnet, ".beta.tailscale.net") - if !ok { - w.WriteHeader(http.StatusUnauthorized) - log.Printf("can't extract tailnet name from hostname %q", info.Node.Name) - return - } + tailnet = strings.TrimSuffix(tailnet, ".beta.tailscale.net") } if expectedTailnet := r.Header.Get("Expected-Tailnet"); expectedTailnet != "" && expectedTailnet != tailnet { |
