Documentation ¶
Index ¶
- func BabysitProc(ctx context.Context, args []string, logf logger.Logf)
- func FixedEngine(eng wgengine.Engine) func() (wgengine.Engine, error)
- func Run(ctx context.Context, logf logger.Logf, ln net.Listener, store ipn.StateStore, ...) errordeprecated
- func StateStore(path string, logf logger.Logf) (ipn.StateStore, error)
- type Options
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BabysitProc ¶
BabysitProc runs the current executable as a child process with the provided args, capturing its output, writing it to files, and restarting the process on any crashes.
It's only currently (2020-10-29) used on Windows.
func FixedEngine ¶ added in v1.0.0
FixedEngine returns a func that returns eng and a nil error.
func Run
deprecated
func Run(ctx context.Context, logf logger.Logf, ln net.Listener, store ipn.StateStore, linkMon *monitor.Mon, dialer *tsdial.Dialer, logid string, getEngine func() (wgengine.Engine, error), opts Options) error
Run runs a Tailscale backend service. The getEngine func is called repeatedly, once per connection, until it returns an engine successfully.
Deprecated: use New and Server.Run instead.
func StateStore ¶ added in v1.18.0
StateStore returns a StateStore from path.
The path should be an absolute path to a file.
Special cases:
- empty string means to use an in-memory store
- if the string begins with "kube:", the suffix is a Kubernetes secret name
- if the string begins with "arn:", the value is an AWS ARN for an SSM.
Types ¶
type Options ¶
type Options struct { // VarRoot is the the Tailscale daemon's private writable // directory (usually "/var/lib/tailscale" on Linux) that // contains the "tailscaled.state" file, the "certs" directory // for TLS certs, and the "files" directory for incoming // Taildrop files before they're moved to a user directory. // If empty, Taildrop and TLS certs don't function. VarRoot string // AutostartStateKey, if non-empty, immediately starts the agent // using the given StateKey. If empty, the agent stays idle and // waits for a frontend to start it. AutostartStateKey ipn.StateKey // SurviveDisconnects specifies how the server reacts to its // frontend disconnecting. If true, the server keeps running on // its existing state, and accepts new frontend connections. If // false, the server dumps its state and becomes idle. // // This is effectively whether the platform is in "server // mode" by default. On Linux, it's true; on Windows, it's // false. But on some platforms (currently only Windows), the // "server mode" can be overridden at runtime with a change in // Prefs.ForceDaemon/WantRunning. // // To support CLI connections (notably, "tailscale status"), // the actual definition of "disconnect" is when the // connection count transitions from 1 to 0. SurviveDisconnects bool }
Options is the configuration of the Tailscale node agent.
type Server ¶ added in v1.18.0
type Server struct {
// contains filtered or unexported fields
}
Server is an IPN backend and its set of 0 or more active localhost TCP or unix socket connections talking to that backend.
func New ¶ added in v1.18.0
func New(logf logger.Logf, logid string, store ipn.StateStore, eng wgengine.Engine, dialer *tsdial.Dialer, serverModeUser *user.User, opts Options) (*Server, error)
New returns a new Server.
To start it, use the Server.Run method.
func (*Server) LocalBackend ¶ added in v1.18.0
func (s *Server) LocalBackend() *ipnlocal.LocalBackend
LocalBackend returns the server's LocalBackend.
func (*Server) Run ¶ added in v1.18.0
Run runs the server, accepting connections from ln forever.
If the context is done, the listener is closed.
func (*Server) ServeHTMLStatus ¶ added in v1.18.0
func (s *Server) ServeHTMLStatus(w http.ResponseWriter, r *http.Request)