Documentation ¶
Overview ¶
Package tailscale contains Tailscale client code.
Index ¶
- Variables
- func BugReport(ctx context.Context, note string) (string, error)
- func CertPair(ctx context.Context, domain string) (certPEM, keyPEM []byte, err error)
- func CheckIPForwarding(ctx context.Context) error
- func CurrentDERPMap(ctx context.Context) (*tailcfg.DERPMap, error)
- func DaemonMetrics(ctx context.Context) ([]byte, error)
- func DebugAction(ctx context.Context, action string) error
- func DeleteWaitingFile(ctx context.Context, baseName string) error
- func DoLocalRequest(req *http.Request) (*http.Response, error)
- func EditPrefs(ctx context.Context, mp *ipn.MaskedPrefs) (*ipn.Prefs, error)
- func ExpandSNIName(ctx context.Context, name string) (fqdn string, ok bool)
- func FileTargets(ctx context.Context) ([]apitype.FileTarget, error)
- func GetCertificate(hi *tls.ClientHelloInfo) (*tls.Certificate, error)
- func GetPrefs(ctx context.Context) (*ipn.Prefs, error)
- func GetWaitingFile(ctx context.Context, baseName string) (rc io.ReadCloser, size int64, err error)
- func Goroutines(ctx context.Context) ([]byte, error)
- func IsAccessDeniedError(err error) bool
- func Logout(ctx context.Context) error
- func Profile(ctx context.Context, pprofType string, sec int) ([]byte, error)
- func PushFile(ctx context.Context, target tailcfg.StableNodeID, size int64, name string, ...) error
- func SetDNS(ctx context.Context, name, value string) error
- func SetVersionMismatchHandler(f func(clientVer, serverVer string))
- func Status(ctx context.Context) (*ipnstate.Status, error)
- func StatusWithoutPeers(ctx context.Context) (*ipnstate.Status, error)
- func WaitingFiles(ctx context.Context) ([]apitype.WaitingFile, error)
- func WhoIs(ctx context.Context, remoteAddr string) (*apitype.WhoIsResponse, error)
- type AccessDeniedError
Constants ¶
This section is empty.
Variables ¶
var ( // TailscaledSocket is the tailscaled Unix socket. It's used by the TailscaledDialer. TailscaledSocket = paths.DefaultTailscaledSocket() // TailscaledSocketSetExplicitly reports whether the user explicitly set TailscaledSocket. TailscaledSocketSetExplicitly bool // TailscaledDialer is the DialContext func that connects to the local machine's // tailscaled or equivalent. TailscaledDialer = defaultDialer )
Functions ¶
func BugReport ¶ added in v1.8.0
BugReport logs and returns a log marker that can be shared by the user with support.
func CertPair ¶ added in v1.14.0
CertPair returns a cert and private key for the provided DNS domain.
It returns a cached certificate from disk if it's still valid.
func CheckIPForwarding ¶ added in v1.8.0
func CurrentDERPMap ¶ added in v1.12.0
CurrentDERPMap returns the current DERPMap that is being used by the local tailscaled. It is intended to be used with netcheck to see availability of DERPs.
func DaemonMetrics ¶ added in v1.18.0
DaemonMetrics returns the Tailscale daemon's metrics in the Prometheus text exposition format.
func DebugAction ¶ added in v1.20.0
DebugAction invokes a debug action, such as "rebind" or "restun". These are development tools and subject to change or removal over time.
func DeleteWaitingFile ¶ added in v1.8.0
func DoLocalRequest ¶
DoLocalRequest makes an HTTP request to the local machine's Tailscale daemon.
URLs are of the form http://local-tailscaled.sock/localapi/v0/whois?ip=1.2.3.4.
The hostname must be "local-tailscaled.sock", even though it doesn't actually do any DNS lookup. The actual means of connecting to and authenticating to the local Tailscale daemon vary by platform.
DoLocalRequest may mutate the request to add Authorization headers.
func ExpandSNIName ¶ added in v1.14.0
ExpandSNIName expands bare label name into the the most likely actual TLS cert name.
func FileTargets ¶ added in v1.8.0
func FileTargets(ctx context.Context) ([]apitype.FileTarget, error)
func GetCertificate ¶ added in v1.14.0
func GetCertificate(hi *tls.ClientHelloInfo) (*tls.Certificate, error)
GetCertificate fetches a TLS certificate for the TLS ClientHello in hi.
It returns a cached certificate from disk if it's still valid.
It's the right signature to use as the value of tls.Config.GetCertificate.
func GetWaitingFile ¶ added in v1.8.0
func Goroutines ¶
Goroutines returns a dump of the Tailscale daemon's current goroutines.
func IsAccessDeniedError ¶ added in v1.14.6
IsAccessDeniedError reports whether err is or wraps an AccessDeniedError.
func PushFile ¶ added in v1.20.0
func PushFile(ctx context.Context, target tailcfg.StableNodeID, size int64, name string, r io.Reader) error
PushFile sends Taildrop file r to target.
A size of -1 means unknown. The name parameter is the original filename, not escaped.
func SetDNS ¶ added in v1.10.0
SetDNS adds a DNS TXT record for the given domain name, containing the provided TXT value. The intended use case is answering LetsEncrypt/ACME dns-01 challenges.
The control plane will only permit SetDNS requests with very specific names and values. The name should be "_acme-challenge." + your node's MagicDNS name. It's expected that clients cache the certs from LetsEncrypt (or whichever CA is providing them) and only request new ones as needed; the control plane rate limits SetDNS requests.
This is a low-level interface; it's expected that most Tailscale users use a higher level interface to getting/using TLS certificates.
func SetVersionMismatchHandler ¶ added in v1.16.0
func SetVersionMismatchHandler(f func(clientVer, serverVer string))
SetVersionMismatchHandler sets f as the version mismatch handler to be called when the client (the current process) has a version number that doesn't match the server's declared version.
func StatusWithoutPeers ¶ added in v1.8.0
StatusWithoutPeers returns the Tailscale daemon's status, without the peer info.
func WaitingFiles ¶ added in v1.8.0
func WaitingFiles(ctx context.Context) ([]apitype.WaitingFile, error)
Types ¶
type AccessDeniedError ¶ added in v1.14.6
type AccessDeniedError struct {
// contains filtered or unexported fields
}
AccessDeniedError is an error due to permissions.
func (*AccessDeniedError) Error ¶ added in v1.14.6
func (e *AccessDeniedError) Error() string
func (*AccessDeniedError) Unwrap ¶ added in v1.14.6
func (e *AccessDeniedError) Unwrap() error
Directories ¶
Path | Synopsis |
---|---|
Package apitype contains types for the Tailscale local API.
|
Package apitype contains types for the Tailscale local API. |
example
|
|
servetls
The servetls program shows how to run an HTTPS server using a Tailscale cert via LetsEncrypt.
|
The servetls program shows how to run an HTTPS server using a Tailscale cert via LetsEncrypt. |