mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-11-04 10:01:05 +01:00 
			
		
		
		
	Fixed getAPIURLs method
This commit is contained in:
		
							parent
							
								
									ada40960bd
								
							
						
					
					
						commit
						eb87fc9215
					
				@ -647,27 +647,13 @@ func getIPs(tailscales map[string]dockertest.Resource) (map[string]netaddr.IP, e
 | 
				
			|||||||
func getAPIURLs(tailscales map[string]dockertest.Resource) (map[netaddr.IP]string, error) {
 | 
					func getAPIURLs(tailscales map[string]dockertest.Resource) (map[netaddr.IP]string, error) {
 | 
				
			||||||
	fts := make(map[netaddr.IP]string)
 | 
						fts := make(map[netaddr.IP]string)
 | 
				
			||||||
	for _, tailscale := range tailscales {
 | 
						for _, tailscale := range tailscales {
 | 
				
			||||||
		command := []string{"tailscale", "ip"}
 | 
							command := []string{
 | 
				
			||||||
		result, err := executeCommand(
 | 
					 | 
				
			||||||
			&tailscale,
 | 
					 | 
				
			||||||
			command,
 | 
					 | 
				
			||||||
			[]string{},
 | 
					 | 
				
			||||||
		)
 | 
					 | 
				
			||||||
		if err != nil {
 | 
					 | 
				
			||||||
			return nil, err
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		ip, err := netaddr.ParseIP(strings.TrimSuffix(result, "\n"))
 | 
					 | 
				
			||||||
		if err != nil {
 | 
					 | 
				
			||||||
			return nil, err
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		command = []string{
 | 
					 | 
				
			||||||
			"curl",
 | 
								"curl",
 | 
				
			||||||
			"--unix-socket",
 | 
								"--unix-socket",
 | 
				
			||||||
			"/run/tailscale/tailscaled.sock",
 | 
								"/run/tailscale/tailscaled.sock",
 | 
				
			||||||
			"http://localhost/localapi/v0/file-targets",
 | 
								"http://localhost/localapi/v0/file-targets",
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		result, err = executeCommand(
 | 
							result, err := executeCommand(
 | 
				
			||||||
			&tailscale,
 | 
								&tailscale,
 | 
				
			||||||
			command,
 | 
								command,
 | 
				
			||||||
			[]string{},
 | 
								[]string{},
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user