mirror of
https://github.com/profullstack/agentbbs.git
synced 2026-11-29 15:31:53 +00:00
fix: allow tailnet peers through loopback sidecar
This commit is contained in:
parent
0fa4ec1fc1
commit
c7a9c963d1
2 changed files with 3 additions and 3 deletions
|
|
@ -221,8 +221,8 @@ func TestAllowedPeerMatchesBindScope(t *testing.T) {
|
|||
loop, _ := net.ResolveTCPAddr("tcp", "127.0.0.1:5000")
|
||||
tail, _ := net.ResolveTCPAddr("tcp", "100.100.10.5:5000")
|
||||
lan, _ := net.ResolveTCPAddr("tcp", "192.168.1.5:5000")
|
||||
if !allowedPeer("127.0.0.1:2223", loop) || allowedPeer("127.0.0.1:2223", tail) {
|
||||
t.Fatal("loopback peer scope incorrect")
|
||||
if !allowedPeer("127.0.0.1:2223", loop) || !allowedPeer("127.0.0.1:2223", tail) || allowedPeer("127.0.0.1:2223", lan) {
|
||||
t.Fatal("loopback-bind peer scope incorrect")
|
||||
}
|
||||
if !allowedPeer("100.100.10.2:2223", tail) || allowedPeer("100.100.10.2:2223", lan) {
|
||||
t.Fatal("tailnet peer scope incorrect")
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ func allowedPeer(bindAddress string, remote net.Addr) bool {
|
|||
return false
|
||||
}
|
||||
if bind.IsLoopback() {
|
||||
return peer.IsLoopback()
|
||||
return peer.IsLoopback() || inTailnetRange(peer)
|
||||
}
|
||||
return inTailnetRange(peer)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue