coordinator

package
v0.0.0-...-0eb8f9d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2024 License: BSD-3-Clause Imports: 33 Imported by: 0

Documentation

Overview

Package coordinator implements the http backend for Tailscale 2021 Noise-based REST protocol

Index

Constants

View Source
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

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

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

func NewAccessLog(peer key.MachinePublic) func(next http.Handler) http.Handler

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

type DnsConfig

type DnsConfig struct {
	MagicDns       bool   `viper:"dns.magic_dns" default:"true"`
	MagicDnsSuffix string `viper:"dns.magic_dns_suffix" default:"wirefire.net"`
}

func (*DnsConfig) Adapt

func (c *DnsConfig) Adapt(tailnet *domain.Tailnet) *tailcfg.DNSConfig

Adapt adapts the global DNS config for use with the given tailnet

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL