Documentation
¶
Overview ¶
Package installer sets up Gophenberg on a Linux server, which it reaches only through one Machine.
Index ¶
- Constants
- func Install(ctx context.Context, machine Machine, call gonsole.Call, request Request) error
- func StopGraces(env gonsole.Env) ([]time.Duration, error)
- func Uninstall(ctx context.Context, machine Machine, call gonsole.Call, deleteData bool) error
- func UploadCapMB(env gonsole.Env) (int, error)
- type Checks
- type Machine
- type Program
- type Prompt
- type Record
- type Request
- type Restarts
- type Settings
Constants ¶
const DatabaseAddress = "postgres:///gophenberg?host=/var/run/postgresql&user=gophenberg"
DatabaseAddress is the address the site's .env names, the gophenberg role signing in by peer over the local socket.
const DatabaseWait = "60s"
DatabaseWait is the database wait the site's .env gets while it names none, the one serve waits by default.
Variables ¶
This section is empty.
Functions ¶
func Install ¶
Install checks machine for server:install as request asks, then prints the steps of a dry run or takes them.
func StopGraces ¶
StopGraces returns the five graces serve waits through as it stops under env, read as serve reads them.
Types ¶
type Checks ¶
type Checks struct {
MemoryFloorMB int
DiskFloorMB int
AptLockWait time.Duration
DomainCheckTimeout time.Duration
HTTPSWait time.Duration
PollInterval time.Duration
StartWait time.Duration
}
Checks is how server:install checks the machine and how long each of its waits lasts.
type Machine ¶
type Machine struct {
Run func(ctx context.Context, program Program) (string, error)
Root string
Lstat func(path string) (fs.FileInfo, error)
Free func(path string) (uint64, error)
Listen func(network, address string) (net.Listener, error)
ListenPacket func(network, address string) (net.PacketConn, error)
Fetch func(request *http.Request) (*http.Response, error)
FetchHTTPS func(request *http.Request, roots *x509.CertPool) (*http.Response, error)
Resolve func(ctx context.Context, network, host string) ([]netip.Addr, error)
Addresses func() ([]net.Addr, error)
Terminal func() (Prompt, error)
Executable func() (string, error)
LookupUser func(name string) (*user.User, error)
Euid func() int
}
Machine is everything outside its own process the installer reaches, so that a test can hand in a fake server.
func RealMachine ¶
func RealMachine() Machine
RealMachine returns this server as the installer reaches it for real, fetching through no proxy and no redirect.
type Program ¶
Program is one outside program a step starts, with its arguments, OS user, folder, extra settings and input.
type Prompt ¶
type Prompt interface {
Ask(ctx context.Context, question string) (string, error)
AskUnseen(ctx context.Context, question string) (string, error)
Tell(ctx context.Context, line string) error
Close() error
}
Prompt is the terminal server:install asks its questions on and tells why it asks again, a password typed unseen.
type Record ¶
type Record struct {
Installer string `json:"installer"`
Steps map[string]string `json:"steps,omitempty"`
Installed []string `json:"installed,omitempty"`
Domain string `json:"domain,omitempty"`
Caddyfile string `json:"caddyfile,omitempty"`
}
Record is the install record of the newest installer: its steps, the pieces it installed, its domain and Caddyfile.
type Request ¶
type Request struct {
Domain string
Archive string
AdminEmail string
AdminName string
AdminPasswordFile string
WebServer string
SkipDomainCheck bool
DryRun bool
}
Request is what one run of server:install asks for on its command line.
type Restarts ¶
type Restarts struct {
Delay time.Duration
LimitInterval time.Duration
LimitBurst int
StopMargin time.Duration
RetryAfter time.Duration
ProxyRetry time.Duration
}
Restarts is how the units restart the site and how Caddy holds its visitors meanwhile.
type Settings ¶
type Settings struct {
Root string
Domain string
Addr netip.AddrPort
WebServer string
CertificateEmail string
Restarts Restarts
Checks Checks
// contains filtered or unexported fields
}
Settings is what one run of server:install acts on, as GOPHENBERG_ names it, with the text server.env gets.