Documentation ¶
Index ¶
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 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, *netstack.Impl, 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.
Types ¶
type Options ¶
type Options struct { // VarRoot is 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 // LoginFlags specifies the LoginFlags to pass to the client. LoginFlags controlclient.LoginFlags }
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)