Documentation
¶
Overview ¶
Package install sets Zelie up on a fresh server: its users, its services and how the panel is reached. Every step can run again, so an install that stopped halfway is finished by running it once more.
Index ¶
Constants ¶
const ( Binary = "/usr/local/bin/zelie" UnitDir = "/etc/systemd/system" PanelUser = "zelie" ProxyUser = "zelie-proxy" )
Where an installed Zelie lives.
const DefaultTunnelPort = 8480
DefaultTunnelPort is where the proxy listens behind a tunnel. It clashes with neither the usual web ports nor Pterodactyl's and Pelican's 8080.
Variables ¶
var ErrAdminExists = errors.New("an administrator exists already")
ErrAdminExists is what SetupLink returns on a server set up before.
var Services = []string{"zelie-core", "zelie-proxy", "zelie-panel"}
Services are Zelie's own systemd services, in the order they start.
Functions ¶
func TunnelToken ¶
TunnelToken takes the token out of the command Cloudflare shows, pasted whole, with or without sudo and the lines before it.
Types ¶
type Cloudflared ¶
type Cloudflared struct {
Arch string
Client *http.Client
Exec func(ctx context.Context, name string, args ...string) (string, error)
}
Cloudflared installs the connector from Cloudflare's package and runs it as a service with the tunnel's token.
type Installer ¶
type Installer struct {
Opts Options
Out io.Writer
// Root is prepended to every path written; empty on a real server.
Root string
// Exec runs a command and returns its combined output.
Exec func(ctx context.Context, name string, args ...string) (string, error)
// Engine installs containerd and runc.
Engine func(ctx context.Context) error
// Proxy applies the proxy's configuration once it runs.
Proxy func(ctx context.Context, cfg proxy.Config) error
// SetupLink makes the one-time link for the first administrator. It
// returns ErrAdminExists once there is one.
SetupLink func(ctx context.Context) (string, error)
// Cloudflared installs the tunnel's connector; see cloudflared.go.
Cloudflared func(ctx context.Context, token string) error
// Self is the binary running the install.
Self string
// contains filtered or unexported fields
}
Installer does the install. Its fields that touch the machine are replaced in tests.
type Mode ¶
type Mode string
How the panel is reached.
const ( // ModeDomain: the proxy answers on 80 and 443 and gets certificates // from Let's Encrypt. ModeDomain Mode = "domain" // ModeIP: no domain; the proxy serves a self-signed certificate. ModeIP Mode = "ip" // ModeTunnel: a Cloudflare Tunnel brings the traffic; the proxy only // listens on a loopback port. ModeTunnel Mode = "tunnel" )
type Options ¶
type Options struct {
Mode Mode
Host string // the panel's domain, or the server's IP address
Email string // for Let's Encrypt, in domain mode
Port int // loopback port, in tunnel mode
// Cloudflared is the command Cloudflare shows for connecting a new
// tunnel, pasted as it is. Only needed when no connector runs yet.
Cloudflared string
}
Options are the answers the install needs.