Documentation
¶
Overview ¶
Package preflight runs read-only checks before a migration: versions, SSH reachability, DB connectivity, disk space, and the SECRET_KEY warning.
Output is a go/no-go `preflight-report.md` written into work_dir, plus a non-zero exit if any hard-fail check fails.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OfferRemediations ¶
func OfferRemediations(cfg *config.Config, r *Result, configPath string, srcSSH *remote.Client) bool
OfferRemediations walks the preflight Result looking for WARN/FAIL findings that have a well-defined auto-fix. If stdin is a TTY, it prompts the operator with the real impact data and applies the chosen fix to configPath, returning true if any fix was applied.
No-op on non-TTY stdin so CI / scripted runs aren't blocked.
func OfferRemediationsFromResult ¶
func OfferRemediationsFromResult(cfg *config.Config, r *Result, configPath string, log interface{ Warn(string, ...any) }) bool
OfferRemediationsFromResult is the entrypoint callers should use from a cobra command — it re-opens the source SSH connection if needed (the one used during checks has been closed by the time we get here).
Types ¶
type Result ¶
type SecretKeyImpact ¶
type SecretKeyImpact struct {
TOTP int // two_factor rows — TOTP codes
OAuth2Active int // user-owned app with a non-empty client_secret (will not decrypt)
OAuth2DeadUser int // user-owned app with empty client_secret (already broken on source)
OAuth2BuiltIn int // uid=0 system apps (tea/GCM/git-credential-oauth; PKCE, safe)
PushMirrors int // push_mirror rows with stored credentials
ActionsSecrets int // org/repo Actions secrets (value encrypted with SECRET_KEY)
LDAPSources int // login_source rows whose cfg blob includes a bind password
Webauthn int // webauthn_credential rows (always SAFE; counted for context)
}
SecretKeyImpact counts the DB rows that actually depend on SECRET_KEY. Built from real source data at preflight time, so the operator sees "0 TOTP users, 3 DEAD OAuth2 apps" instead of vague "secrets will be lost" warnings.
func (*SecretKeyImpact) Lossless ¶
func (i *SecretKeyImpact) Lossless() bool
Lossless returns true if migrating without SECRET_KEY actually loses nothing.
func (*SecretKeyImpact) Summary ¶
func (i *SecretKeyImpact) Summary() string
Summary returns a human-friendly one-line summary.