Documentation
¶
Overview ¶
Package coordinator implements the http backend for Tailscale 2021 Noise-based REST protocol
Index ¶
- Constants
- func MachineMap(peer key.MachinePublic, pool *sqlitex.Pool) util.StreamingHandlerFunc[tailcfg.MapRequest]
- func MachineRegister(peer key.MachinePublic, pool *sqlitex.Pool) util.HandlerFunc[tailcfg.RegisterRequest, tailcfg.RegisterResponse]
- func NewAccessLog(peer key.MachinePublic) func(next http.Handler) http.Handler
- func Upgrade(serverKey key.MachinePrivate, pool *sqlitex.Pool) http.HandlerFunc
- type Config
- type DnsConfig
Constants ¶
const ( SupportedCapabilityVersion = 68 NoiseCapabilityVersion = 28 UnsupportedClientVersionMessage = "wirefire only support client version >= 1.48.0, please upgrade your client" )
Variables ¶
This section is empty.
Functions ¶
func MachineMap ¶
func MachineMap(peer key.MachinePublic, pool *sqlitex.Pool) util.StreamingHandlerFunc[tailcfg.MapRequest]
MachineMap implements handler for the /machine/map endpoint served over the Noise channel.
The /machine/map endpoint is used to the node to update its status and also to start a long-polling session to receive status updates from other nodes in the tailnet.
func MachineRegister ¶
func MachineRegister(peer key.MachinePublic, pool *sqlitex.Pool) util.HandlerFunc[tailcfg.RegisterRequest, tailcfg.RegisterResponse]
MachineRegister implements handler for the /machine/register endpoint served over Noise channel.
The /machine/register endpoint is the first endpoint that the node talks to start the authentication process. This endpoint is used by the node to register its Noise public-key and Node public-key and kick-off a user authentication process.
Upon successful authentication, the machine registration request is marked as successful and the node is added to the selected tailnet.
func NewAccessLog ¶
NewAccessLog returns a new middleware that sends its log output to the provided zerolog sink.
The log is sent at the start of the request itself as /machine endpoints can engage in long-running operations, and we don't want to wait till the end to emit a log.
func Upgrade ¶
func Upgrade(serverKey key.MachinePrivate, pool *sqlitex.Pool) http.HandlerFunc
Upgrade returns a new http.Handler that implement Tailscale's 2021 Noise-based REST protocol
Types ¶
type Config ¶
type Config struct {
// BaseUrl is the url (optionally public) on which the coordinator is available
BaseUrl *url.URL `viper:"server.url" validation:"required"`
}
Config is the subset of configuration relevant to the coordinator server