Documentation
¶
Overview ¶
Package doctor diagnoses the install: deps, perms, agent, known_hosts, manifest-vs-disk drift, and dangling keys.
It no longer mirrors v1 check for check. The dangling-key section comes from the keyaudit service and, unlike the orphan list it replaced, decides the verdict; --strict escalates every state for CI.
Index ¶
Constants ¶
const DefaultOldKeyMaxAge = 90 * 24 * time.Hour
DefaultOldKeyMaxAge is how long an archived predecessor is considered useful. Past that, the rotation it belongs to has long since been verified in practice and the file is just an unencrypted private key nobody is watching.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Report ¶
type Report struct {
Preflight preflight.Report
Home string
State string // the state home, when it is not Home
SSHDir string
PermIssues []string
AgentStatus string
KnownHosts bool
OldKeys map[string]int // key_name -> archived count
StaleOldKeys []string // archived predecessors past the retention window
ConfigInSync bool
OrphanKeys []string
Dangling keyaudit.Report
DuplicateKeys []string
UnpinnedHosts []string
AliasCollisions []string
ProvidersSource string // "user file" | "shipped default"
StrandedLegacyHome string
// OnePassword lists what stops a 1Password profile from working: no op
// CLI, or no agent socket. Empty when no profile uses 1Password.
OnePassword []string
// StaleProxy lists rendered VM ProxyCommands whose authama binary no longer exists (an upgrade
// moved it); `authama ssh config render` rewrites them.
StaleProxy []string
// ShadowedHosts lists managed aliases a foreign block above the managed
// block overrides: ssh reads it first, so the manifest's values never
// apply. authama does not edit that content, so the user has to.
ShadowedHosts []string
// RawOptionOverlaps lists raw_options keys that duplicate a managed line.
// The rendered config already resolves the managed value; this is advice.
RawOptionOverlaps []string
// NeededTools lists commands the manifest relies on that are not on PATH: a
// VM host's hypervisor CLI (its address comes from it at connect time), and
// git once defaults.git configures `authama ssh git`.
NeededTools []string
// Clipboard is set when no clipboard tool is found. Advice only: `termius
// keys` then needs --print.
Clipboard string
// Strict is set by Run(strict=true), the CI mode: every warning then counts
// against the verdict, so `doctor --strict` never says clean over one.
Strict bool
}
Report is the full doctor diagnosis.
func (Report) Format ¶
Format renders the human-readable report (mirrors DoctorReport.format; the preflight block carries the Go runtime line in place of an interpreter version).
func (Report) JSON ¶
JSON returns the machine-readable view (mirrors DoctorReport.as_dict key order), with empty lists/maps as []/{} and unset paths as null.
func (Report) OK ¶
OK is the overall verdict.
Dangling keys count. They used to be printed and then ignored by the verdict, so doctor could list an orphaned key and still say "clean" - a check whose result nothing acts on is not a check. Which states are fatal is keyaudit's call, not this one's (--strict makes all of them fatal).
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service runs doctor over a resolved home + (optional) manifest.