mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-02 14:32:26 +00:00
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>
This commit is contained in:
parent
9c66dce8e0
commit
cfbbcf6d07
@ -75,12 +75,7 @@ func main() {
|
|||||||
log.Printf("can't extract tailnet name from hostname %q", info.Node.Name)
|
log.Printf("can't extract tailnet name from hostname %q", info.Node.Name)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
tailnet, _, ok = strings.Cut(tailnet, ".beta.tailscale.net")
|
tailnet = strings.TrimSuffix(tailnet, ".beta.tailscale.net")
|
||||||
if !ok {
|
|
||||||
w.WriteHeader(http.StatusUnauthorized)
|
|
||||||
log.Printf("can't extract tailnet name from hostname %q", info.Node.Name)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if expectedTailnet := r.Header.Get("Expected-Tailnet"); expectedTailnet != "" && expectedTailnet != tailnet {
|
if expectedTailnet := r.Header.Get("Expected-Tailnet"); expectedTailnet != "" && expectedTailnet != tailnet {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user