Advertise tailnet and public routes in server discovery
The mDNS record now carries ts= (tailnet IPv4 addresses) and public= (the installer's HTTPS origin from PIPELINES_WEB_PUBLIC_URL) in TXT, and browse, the discover_servers RPC and /discovery return every route to a machine as addresses with kinds lan, tailscale and public. Endpoint stays the LAN route for older clients. Unsafe ts/public values are dropped.
This commit is contained in:
@@ -6,9 +6,17 @@ const (
|
||||
)
|
||||
|
||||
// DiscoveredServer is one Pipelines DNS-SD advertisement on the serving LAN.
|
||||
// Endpoint is the LAN route; Addresses lists every route to the same machine.
|
||||
type DiscoveredServer struct {
|
||||
Name string `json:"name"`
|
||||
Endpoint string `json:"endpoint"`
|
||||
Auth string `json:"auth"`
|
||||
Version string `json:"version"`
|
||||
Name string `json:"name"`
|
||||
Endpoint string `json:"endpoint"`
|
||||
Auth string `json:"auth"`
|
||||
Version string `json:"version"`
|
||||
Addresses []DiscoveredAddress `json:"addresses"`
|
||||
}
|
||||
|
||||
// DiscoveredAddress is one route: kind "lan", "tailscale" or "public".
|
||||
type DiscoveredAddress struct {
|
||||
Kind string `json:"kind"`
|
||||
Endpoint string `json:"endpoint"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user