setupguide

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package setupguide derives the Get started checklist from real instance state. It is pure: callers gather an Input, Derive returns the guide.

Index

Constants

View Source
const (
	ReasonTLSUpstream  = "tls_terminated_upstream"
	ReasonProxyMode    = "proxy_mode"
	ReasonUnavailable  = "unavailable"
	ReasonHTTPOnly     = "http_only"
	ReasonNoRules      = "no_alert_rule"
	ReasonCertsPending = "certificates_pending"
	ReasonACMEOff      = "acme_disabled"
	ReasonManual       = "marked_done"
)

Reason codes explain why a step is not applicable or only partly done.

View Source
const (
	OverrideSkipped = "skipped"
	OverrideDone    = "done"
)

Override values an operator can record.

Variables

This section is empty.

Functions

func ValidStep

func ValidStep(id string) bool

ValidStep reports whether id names a known step.

Types

type DomainTLS

type DomainTLS struct {
	Name        string
	CertHealthy bool
}

DomainTLS is one attached app domain and whether it has a healthy cert.

type Guide

type Guide struct {
	Steps         []Step `json:"steps"`
	ReadyPercent  int    `json:"ready_percent"`
	Done          int    `json:"done"`
	Total         int    `json:"total"`
	NextStep      StepID `json:"next_step,omitempty"`
	Complete      bool   `json:"complete"`
	Hidden        bool   `json:"hidden"`
	ServerAddress string `json:"server_address,omitempty"`
}

Guide is the derived checklist.

func Derive

func Derive(in Input) Guide

Derive computes the guide. Derived "done" always wins over an override, so a skipped step that later completes shows as done.

type Input

type Input struct {
	SecuredAdmin bool
	// EmailConfigured and SignInApprover say a new browser can be approved
	// without a dashboard that is already open: email can be sent, or a CLI
	// token holds signin:approve.
	EmailConfigured      bool
	SignInApprover       bool
	DashboardURL         string
	ServerAddress        string
	BehindProxy          bool
	ACMEEnabled          bool
	GitConnected         bool
	Apps                 int
	Domains              []DomainTLS
	DNSProviderConnected bool
	BackupTargets        int
	ControlPlaneBackups  int
	VerifiedBackups      int
	Channels             int
	AlertRules           int
	Users                int
	PendingInvites       int
	AutomaticUpgrades    bool

	// Unavailable lists steps whose source data could not be read.
	Unavailable map[StepID]bool
	// Overrides holds operator overrides keyed by step id.
	Overrides map[StepID]string
	Hidden    bool
}

Input is everything Derive needs. Zero values mean "nothing set up yet".

type Progress

type Progress struct {
	Done  int `json:"done"`
	Total int `json:"total"`
}

Progress counts done items of a multi-item step.

type State

type State string

State is a step's current state.

const (
	StateTodo          State = "todo"
	StateInProgress    State = "in_progress"
	StateDone          State = "done"
	StateSkipped       State = "skipped"
	StateNotApplicable State = "not_applicable"
)

Step states.

type Step

type Step struct {
	ID              StepID    `json:"id"`
	Title           string    `json:"title"`
	State           State     `json:"state"`
	Optional        bool      `json:"optional"`
	EstimateMinutes int       `json:"estimate_minutes"`
	Href            string    `json:"href"`
	BlockedBy       []StepID  `json:"blocked_by,omitempty"`
	Reason          string    `json:"reason,omitempty"`
	Progress        *Progress `json:"progress,omitempty"`
	Manual          bool      `json:"manual,omitempty"`
}

Step is one derived checklist entry.

type StepID

type StepID string

StepID names one checklist step.

const (
	StepSecureAdmin    StepID = "secure_admin"
	StepSignInRecovery StepID = "sign_in_recovery"
	StepPublicAddress  StepID = "public_address"
	StepGitProvider    StepID = "git_provider"
	StepFirstApp       StepID = "first_app"
	StepAppDomain      StepID = "app_domain"
	StepDNS            StepID = "dns"
	StepTLS            StepID = "tls"
	StepBackupTarget   StepID = "backup_target"
	StepFirstBackup    StepID = "first_backup"
	StepVerifiedBackup StepID = "verified_restore"
	StepNotifications  StepID = "notifications"
	StepTeammate       StepID = "teammate"
	StepUpgrades       StepID = "upgrades"
)

Step identifiers, in presentation order.

func StepIDs

func StepIDs() []StepID

StepIDs returns every step id in presentation order.

Jump to

Keyboard shortcuts

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