blob: 5fa3c44daddd13f145cdd8f1215d91698203e03b [file] [log] [blame]
Skyler Greyd7e1acd2024-06-22 14:42:11 +00001From 74a12f91542ee1323b69675b0480168a22ad5b17 Mon Sep 17 00:00:00 2001
2From: Skyler Grey <minion@clicks.codes>
3Date: Sat, 29 Jun 2024 14:16:46 +0000
4Subject: [PATCH] fix(nginx): Continue if node Name is ComputedName
5
6In the headscale case, the node Name ends up the same as the
7ComputedName. This causes tailscale-nginx-auth to fail extracting the
8tailnet name and 403 all devices.
9
10This patch skips tailnet extraction in this case.
11
12Signed-off-by: Skyler Grey <minion@clicks.codes>
13---
14 cmd/nginx-auth/nginx-auth.go | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/cmd/nginx-auth/nginx-auth.go b/cmd/nginx-auth/nginx-auth.go
18index d2e9468e558ea..c6a8ff30fbb8a 100644
19--- a/cmd/nginx-auth/nginx-auth.go
20+++ b/cmd/nginx-auth/nginx-auth.go
21@@ -66,7 +66,7 @@ func main() {
22 // will be empty because the tailnet of the sharee is not exposed.
23 var tailnet string
24
25- if !info.Node.Hostinfo.ShareeNode() {
26+ if !info.Node.Hostinfo.ShareeNode() && info.Node.Name != info.Node.ComputedName {
27 var ok bool
28 _, tailnet, ok = strings.Cut(info.Node.Name, info.Node.ComputedName+".")
29 if !ok {
30