|
|
@ -400,6 +400,8 @@ func (s *Server) AllNodes() (nodes []*tailcfg.Node) {
|
|
|
|
return nodes
|
|
|
|
return nodes
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const domain = "fake-control.example.net"
|
|
|
|
|
|
|
|
|
|
|
|
func (s *Server) getUser(nodeKey key.NodePublic) (*tailcfg.User, *tailcfg.Login) {
|
|
|
|
func (s *Server) getUser(nodeKey key.NodePublic) (*tailcfg.User, *tailcfg.Login) {
|
|
|
|
s.mu.Lock()
|
|
|
|
s.mu.Lock()
|
|
|
|
defer s.mu.Unlock()
|
|
|
|
defer s.mu.Unlock()
|
|
|
@ -413,7 +415,6 @@ func (s *Server) getUser(nodeKey key.NodePublic) (*tailcfg.User, *tailcfg.Login)
|
|
|
|
return u, s.logins[nodeKey]
|
|
|
|
return u, s.logins[nodeKey]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
id := tailcfg.UserID(len(s.users) + 1)
|
|
|
|
id := tailcfg.UserID(len(s.users) + 1)
|
|
|
|
domain := "fake-control.example.net"
|
|
|
|
|
|
|
|
loginName := fmt.Sprintf("user-%d@%s", id, domain)
|
|
|
|
loginName := fmt.Sprintf("user-%d@%s", id, domain)
|
|
|
|
displayName := fmt.Sprintf("User %d", id)
|
|
|
|
displayName := fmt.Sprintf("User %d", id)
|
|
|
|
login := &tailcfg.Login{
|
|
|
|
login := &tailcfg.Login{
|
|
|
@ -422,13 +423,11 @@ func (s *Server) getUser(nodeKey key.NodePublic) (*tailcfg.User, *tailcfg.Login)
|
|
|
|
LoginName: loginName,
|
|
|
|
LoginName: loginName,
|
|
|
|
DisplayName: displayName,
|
|
|
|
DisplayName: displayName,
|
|
|
|
ProfilePicURL: "https://tailscale.com/static/images/marketing/team-carney.jpg",
|
|
|
|
ProfilePicURL: "https://tailscale.com/static/images/marketing/team-carney.jpg",
|
|
|
|
Domain: domain,
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
user := &tailcfg.User{
|
|
|
|
user := &tailcfg.User{
|
|
|
|
ID: id,
|
|
|
|
ID: id,
|
|
|
|
LoginName: loginName,
|
|
|
|
LoginName: loginName,
|
|
|
|
DisplayName: displayName,
|
|
|
|
DisplayName: displayName,
|
|
|
|
Domain: domain,
|
|
|
|
|
|
|
|
Logins: []tailcfg.LoginID{login.ID},
|
|
|
|
Logins: []tailcfg.LoginID{login.ID},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
s.users[nodeKey] = user
|
|
|
|
s.users[nodeKey] = user
|
|
|
@ -829,7 +828,7 @@ func (s *Server) MapResponse(req *tailcfg.MapRequest) (res *tailcfg.MapResponse,
|
|
|
|
res = &tailcfg.MapResponse{
|
|
|
|
res = &tailcfg.MapResponse{
|
|
|
|
Node: node,
|
|
|
|
Node: node,
|
|
|
|
DERPMap: s.DERPMap,
|
|
|
|
DERPMap: s.DERPMap,
|
|
|
|
Domain: string(user.Domain),
|
|
|
|
Domain: domain,
|
|
|
|
CollectServices: "true",
|
|
|
|
CollectServices: "true",
|
|
|
|
PacketFilter: packetFilterWithIngressCaps(),
|
|
|
|
PacketFilter: packetFilterWithIngressCaps(),
|
|
|
|
DNSConfig: dns,
|
|
|
|
DNSConfig: dns,
|
|
|
|