Documentation
¶
Overview ¶
Package golive turns the platform's separate checks (app readiness, ports, host firewall, DNS, certificate, end-to-end HTTPS) into one ordered checklist for an app and a domain, each step with a status, evidence and one primary action. It does no I/O of its own except SelfCheck.
Index ¶
- Constants
- func HashBody(r io.Reader) string
- type Action
- type AppInput
- type CertInput
- type CertStatus
- type Checklist
- type Evidence
- type Failure
- type FirewallInput
- type FixPreview
- type Input
- type Match
- type PortInput
- type PortProbe
- type Reference
- type Seen
- type SelfCheckInput
- type SelfCheckResult
- type State
- type Status
- type Step
- type TimelineEvent
Constants ¶
const ( KindDNS = "dns" KindPort = "port" KindChallenge = "challenge" KindCert = "certificate" KindRenewal = "renewal" KindFailure = "failure" KindLive = "live" )
Timeline event kinds.
const ( StepApp = "app" StepPort = "port" StepFirewall = "firewall" StepDNS = "dns" StepCertificate = "certificate" StepLive = "live" )
Step ids, in checklist order.
const ( ActionFix = "fix" ActionRequest = "request" ActionRecheck = "recheck" ActionLink = "link" ActionCopy = "copy" )
Action kinds.
const ScopeControlPlane = "control_plane_host"
ScopeControlPlane labels a probe that ran on this server: it cannot prove the wider internet can reach it.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action struct {
Kind string `json:"kind"`
Label string `json:"label"`
// FixID names a typed fix applied through the fixit endpoints.
FixID string `json:"fix_id,omitempty"`
// API is "METHOD /path" for a request action.
API string `json:"api,omitempty"`
Body map[string]any `json:"body,omitempty"`
Href string `json:"href,omitempty"`
Value string `json:"value,omitempty"`
// Blocked, when set, is why the action cannot run yet.
Blocked string `json:"blocked,omitempty"`
}
Action is the one primary thing a step offers.
type CertInput ¶
type CertInput struct {
Ready bool
Blocker string
BlockerFix string
NextSafeAt *time.Time
Status CertStatus
CertAPI string
}
CertInput is what the certificate step decides from.
type CertStatus ¶
type CertStatus struct {
State string
Staging bool
Trusted bool
Issuer string
NotBefore time.Time
NotAfter time.Time
RenewalAt time.Time
Error string
Explanation string
Hint string
NextSafeAt *time.Time
}
CertStatus is the certificate progress for the domain.
type Checklist ¶
type Checklist struct {
App string `json:"app"`
Domain string `json:"domain"`
State State `json:"state"`
Live bool `json:"live"`
Next string `json:"next,omitempty"`
URL string `json:"url,omitempty"`
Steps []Step `json:"steps"`
Timeline []TimelineEvent `json:"timeline"`
CheckedAt time.Time `json:"checked_at"`
}
Checklist is the whole guided flow for one app and domain.
type Evidence ¶
type Evidence struct {
Label string `json:"label"`
Value string `json:"value"`
Copy bool `json:"copy,omitempty"`
}
Evidence is one fact behind a step status.
type FirewallInput ¶
type FirewallInput struct {
Host hostfw.Status
Plan hostfw.Plan
FixID string
FixKind fixit.Kind
Provider *hostprovider.Guidance
}
FirewallInput is the host firewall state and the typed fix for it.
type FixPreview ¶
type FixPreview struct {
FixID string `json:"fix_id"`
Kind string `json:"kind"`
Commands []string `json:"commands"`
Undo []string `json:"undo"`
Persistent bool `json:"persistent"`
Note string `json:"note,omitempty"`
Refusal string `json:"refusal,omitempty"`
}
FixPreview is what an automatic fix would do, shown before it runs.
type Input ¶
type Input struct {
App string
Domain string
Now time.Time
PollEvery time.Duration
AppState AppInput
Port PortInput
Firewall FirewallInput
Report *domaindoctor.Report
Cert CertInput
Live *SelfCheckResult
Seen *Seen
// ChallengeStartedAt is when the certificate request began, zero when none.
ChallengeStartedAt time.Time
// Failure is the CA's last recorded error for the domain.
Failure *Failure
CLIName string
}
Input is everything Build decides from.
type PortInput ¶
type PortInput struct {
ZeroConfigURL string
DirectURL string
// DirectAllowed is true when the app exposure feature can publish a direct port.
DirectAllowed bool
Probe *PortProbe
NetworkHref string
}
PortInput is how the app is reachable before any domain exists.
type Reference ¶
Reference is what the app itself answers when asked directly, used to tell it apart from another server behind the same address.
type Seen ¶
type Seen struct {
// contains filtered or unexported fields
}
Seen remembers when each milestone was first observed, for the lifetime of the process, so the timeline keeps its times across page reloads.
type SelfCheckInput ¶
type SelfCheckInput struct {
Domain string
// Addr is the host:port to dial, normally this server's own address.
Addr string
Path string
Reference *Reference
// RootCAs replaces the system roots; tests only.
RootCAs *x509.CertPool
Timeout time.Duration
}
SelfCheckInput is one end-to-end check of https://domain.
type SelfCheckResult ¶
type SelfCheckResult struct {
Reached bool `json:"reached"`
TLSValid bool `json:"tls_valid"`
TLSError string `json:"tls_error,omitempty"`
Issuer string `json:"issuer,omitempty"`
NotAfter time.Time `json:"not_after,omitzero"`
Status int `json:"status,omitempty"`
Match Match `json:"match"`
Error string `json:"error,omitempty"`
Scope string `json:"scope"`
CheckedAt time.Time `json:"checked_at"`
}
SelfCheckResult is the outcome, with the TLS and HTTP facts behind it.
func SelfCheck ¶
func SelfCheck(ctx context.Context, in SelfCheckInput) SelfCheckResult
SelfCheck dials addr, verifies the certificate chain for domain against the system roots, requests path and compares the answer with the reference.
type State ¶
type State string
State is the one-word summary used by badges.
type Step ¶
type Step struct {
ID string `json:"id"`
Title string `json:"title"`
Status Status `json:"status"`
Summary string `json:"summary"`
Evidence []Evidence `json:"evidence"`
Primary *Action `json:"primary,omitempty"`
// CLI is the secondary, collapsed way to do the same from a terminal.
CLI string `json:"cli,omitempty"`
NextCheckAt *time.Time `json:"next_check_at,omitempty"`
DocsURL string `json:"docs_url,omitempty"`
Records []domaindoctor.Record `json:"records,omitempty"`
FirewallFix *FixPreview `json:"firewall_fix,omitempty"`
Provider *hostprovider.Guidance `json:"provider,omitempty"`
// Scope says where a probe ran, so a control plane check is never read as proof from the internet.
Scope string `json:"scope,omitempty"`
}
Step is one checklist row.
type TimelineEvent ¶
type TimelineEvent struct {
ID string `json:"id"`
At time.Time `json:"at"`
Kind string `json:"kind"`
Title string `json:"title"`
Detail string `json:"detail,omitempty"`
Failed bool `json:"failed,omitempty"`
// Future marks something scheduled, such as a renewal.
Future bool `json:"future,omitempty"`
}
TimelineEvent is one entry in a domain's go live history.