Documentation
¶
Overview ¶
Package protocol defines the signed, versioned managed-release contract. It contains no host execution or caller-selected commands and paths.
Index ¶
- Constants
- Variables
- func SafeVersion(s string) bool
- func ValidDigest(s string) bool
- func ValidVersion(c Component, s string) bool
- type Artifact
- type Component
- type Manifest
- func (m Manifest) Admit(source Versions, network, failedRelease string) error
- func (m Manifest) AdmitInstalled(source Versions, network, failedRelease string) error
- func (m Manifest) Affected(source Versions) []Component
- func (m Manifest) Artifact(c Component) Artifact
- func (m Manifest) Target(source Versions) Versions
- func (m Manifest) Validate() error
- type Review
- type Status
- type Versions
Constants ¶
const Protocol = 1
const WorkerUnit = "vpn-update.service"
WorkerUnit is the systemd unit that runs an update. Its journal holds the full text of a worker failure.
Variables ¶
var Components = []Component{Bitcoin, LND, Syncthing}
Functions ¶
func SafeVersion ¶
SafeVersion accepts a version in a format this build may not know. Such text is only shown, stored and compared for equality, so it must be short and free of control and path characters.
func ValidDigest ¶
func ValidVersion ¶
Types ¶
type Artifact ¶
Artifact hashes bind upstream downloads to the maintainer's tested bytes. Upstream signatures are also checked before any service is stopped.
type Manifest ¶
type Manifest struct {
Protocol int `json:"protocol"`
Version string `json:"version"`
Platform string `json:"platform"`
Summary string `json:"summary"`
MinimumFreeMiB int64 `json:"minimum_free_mib"`
Sources []Versions `json:"sources"`
Networks []string `json:"networks"`
Bitcoin Artifact `json:"bitcoin"`
LND Artifact `json:"lnd"`
Syncthing Artifact `json:"syncthing"`
HostSteps []string `json:"host_steps"`
HostServices []Component `json:"host_services,omitempty"`
// RecoveryFrom identifies exact failed VPN archive digests. A corrective
// release must explicitly acknowledge the interrupted release as well as
// the observed executable combination in Sources.
RecoveryFrom []string `json:"recovery_from,omitempty"`
// Bridge optionally names one earlier release. A node this plan does not
// admit is told to install that release first.
Bridge string `json:"bridge,omitempty"`
}
func Admission ¶
func Admission(data []byte, selected, current string, source Versions, network, failed string) (Manifest, string, error)
Admission is how an installed helper reads a signed plan. The helper stays in service for later releases, so it ignores fields it does not know; the target worker reads the same plan in full with Decode. Admission returns either a plan that admits this node, or the release to install first.
func (Manifest) AdmitInstalled ¶
AdmitInstalled is Admit for a plan the installed helper read with Admission.
type Review ¶
type Review struct {
Token string `json:"token"`
Digest string `json:"digest"`
Manifest Manifest `json:"manifest"`
Source Versions `json:"source"`
Network string `json:"network"`
// UpdateFirst is guidance instead of a review: the selected release does
// not admit this node, and its plan names this release to install first.
// Such an answer has no token and cannot be approved.
UpdateFirst string `json:"update_first,omitempty"`
// KeyServerUnreachable tells the operator that the release key was
// checked without the key server, so a revocation published only there
// was not seen. It belongs to the review and is not kept in a job.
KeyServerUnreachable bool `json:"key_server_unreachable,omitempty"`
}
type Status ¶
type Status struct {
ID string `json:"id"`
Version string `json:"version"`
Phase string `json:"phase"`
Step string `json:"step"`
Error string `json:"error,omitempty"`
Active bool `json:"active"`
Running bool `json:"running"`
Cancellable bool `json:"cancellable"`
WalletNetwork string `json:"wallet_network,omitempty"`
}
Status deliberately excludes local paths, credentials and raw command output.