Documentation
¶
Overview ¶
Package dashboard is the local web page behind the tray (design 5): server status, agents, links, adding clients and remotes. It only listens on loopback and only answers the browser that opened its one-time link.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dashboard ¶
type Dashboard struct {
// contains filtered or unexported fields
}
Dashboard serves the local page.
func (*Dashboard) AfterInstall ¶ added in v0.1.1
AfterInstall turns a preset on in the server config once it is installed, and off once it is removed. Agents written by hand are left alone.
type Options ¶
type Options struct {
// Server returns the running server, or nil when this machine runs none (yet).
Server func() *server.Server
// ConfigPath is the --config value ("" for the default); ConfigFile is the
// file the dashboard writes when it sets up a server.
ConfigPath string
ConfigFile string
Version string
// StartServer starts the server after the dashboard wrote its config.
StartServer func() error
// Reload re-reads the config after the dashboard changed tokens.
Reload func() error
// StartTunnel starts the configured tunnel, for example after installing cloudflared.
StartTunnel func() error
// TunnelError returns cloudflared's last error line, if any.
TunnelError func() string
// Listen is the address to serve on; default a random loopback port.
Listen string
// Password switches from one-time links to a login form, for a dashboard
// reached over the network (Docker). Empty means one-time links.
Password string
// Terminal adds a shell in the browser.
Terminal bool
// Installer installs agents from the dashboard; nil hides it.
Installer *installer.Installer
// Env is the environment of terminal shells; nil means os.Environ().
Env []string
Logger *slog.Logger
}
Options configure the dashboard.