installer

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package installer is stackr-install: the form, the checks on every answer, and the docker commands that create the panel on a fresh host (docs/plans/49-installer-binary.md).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDataDir

func CheckDataDir(s string) (string, error)

CheckDataDir accepts an absolute path that can go into a --mount spec, where a comma would split it.

func CheckEmail

func CheckEmail(s string) (string, error)

CheckEmail accepts an address Let's Encrypt can write to.

func CheckHTTPSPort

func CheckHTTPSPort(s, httpPort string, busy func(string) bool) error

CheckHTTPSPort is CheckPort that also refuses the HTTP port.

func CheckHost

func CheckHost(s, root string) (string, error)

CheckHost accepts a name at or under root.

func CheckPort

func CheckPort(s string, busy func(string) bool) error

CheckPort accepts 1-65535; busy refuses a port already in use.

func CheckProxies

func CheckProxies(s string) (string, error)

CheckProxies accepts addresses or ranges separated by commas or spaces, blank for none, and returns them comma joined without repeats.

func CheckRoot

func CheckRoot(s string) (string, error)

CheckRoot accepts a domain name Let's Encrypt can issue for.

func Install

func Install(ctx context.Context, a *Answers, img Images, dry bool, out io.Writer) error

Install creates the panel on this box from checked answers.

func Main

func Main(args []string) int

Main runs stackr-install and returns the exit code.

func Preflight

func Preflight(ctx context.Context) error

Preflight refuses a box that cannot be installed on. Skipped in a dry run, which is usually on another machine.

Types

type Answers

type Answers struct {
	// Apps get names under Root (app.stack.org.example.com), the panel its
	// own Host under it. Blank Host means stkr.<Root>.
	Root       string
	Host       string
	Cloudflare bool
	Proxies    string
	HTTPS      bool
	Email      string
	HTTPPort   string
	HTTPSPort  string
	DataDir    string
}

Answers is everything the install needs from the operator. The form and the flags both fill it; Check is the one place that decides it is usable. A domain is not optional: apps are reached by name through traefik, and so is the panel. An install on a bare IP would have no names, no certificates and no route to the panel but a published port, which is a different product, not a flag.

func (*Answers) BaseURL

func (a *Answers) BaseURL() string

BaseURL is how the operator reaches the panel after the install.

func (*Answers) Check

func (a *Answers) Check(busy func(string) bool) error

Check normalises every answer in place and returns the first problem. busy reports a port something already listens on; nil skips that check.

func (*Answers) PanelHost

func (a *Answers) PanelHost() string

PanelHost is the host the panel answers on.

func (*Answers) TLS

func (a *Answers) TLS() bool

TLS reports whether Let's Encrypt is on. Off for a name the ACME challenge cannot reach, or when something in front already terminates HTTPS.

type Choice

type Choice string

Choice is what the summary screen returns.

const (
	ChoiceInstall Choice = "install"
	ChoiceBack    Choice = "back"
	ChoiceCancel  Choice = "cancel"
)

type Images

type Images struct {
	Panel, Relay string
}

Images is what the install pulls and runs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL