Documentation
¶
Index ¶
- Variables
- func ApplyInstallData(baseTemplate string, data *InstallWizardData) (string, error)
- func ConfirmNewInstall(baseDir string, buildSig string) (bool, error)
- func ConfirmRecipientOverwrite(recipientPath, configPath, buildSig string) (bool, error)
- func SaveAgeRecipient(recipientPath, recipient string) error
- type AgeSetupData
- type ExistingConfigAction
- type InstallWizardData
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAgeSetupCancelled is returned when the user aborts the AGE setup wizard. ErrAgeSetupCancelled = errors.New("encryption setup aborted by user") )
var ( // ErrInstallCancelled is returned when the user aborts the install wizard. ErrInstallCancelled = errors.New("installation aborted by user") )
Functions ¶
func ApplyInstallData ¶
func ApplyInstallData(baseTemplate string, data *InstallWizardData) (string, error)
ApplyInstallData applies the collected data to the config template. If baseTemplate is empty, the embedded default template is used.
func ConfirmNewInstall ¶
ConfirmNewInstall shows a TUI confirmation before wiping baseDir for --new-install.
func ConfirmRecipientOverwrite ¶
ConfirmRecipientOverwrite shows a TUI modal to confirm overwriting an existing AGE recipient.
func SaveAgeRecipient ¶
SaveAgeRecipient saves the AGE recipient to the file
Types ¶
type AgeSetupData ¶
type AgeSetupData struct {
SetupType string // "existing", "passphrase", "privatekey"
PublicKey string // For "existing" type
Passphrase string // For "passphrase" type
PrivateKey string // For "privatekey" type
RecipientKey string // The final recipient key to save
}
AgeSetupData holds the collected AGE encryption setup data
func RunAgeSetupWizard ¶
func RunAgeSetupWizard(ctx context.Context, recipientPath, configPath, buildSig string) (*AgeSetupData, error)
RunAgeSetupWizard runs the TUI-based AGE encryption setup wizard
type ExistingConfigAction ¶
type ExistingConfigAction int
ExistingConfigAction represents how to handle an already-present configuration file.
const ( ExistingConfigOverwrite ExistingConfigAction = iota // Start from embedded template (overwrite) ExistingConfigEdit // Keep existing file as base and edit ExistingConfigSkip // Leave the file untouched and skip wizard )
func CheckExistingConfig ¶
func CheckExistingConfig(configPath string, buildSig string) (ExistingConfigAction, error)
CheckExistingConfig checks if config file exists and asks how to proceed
type InstallWizardData ¶
type InstallWizardData struct {
BaseDir string
ConfigPath string
EnableSecondaryStorage bool
SecondaryPath string
SecondaryLogPath string
EnableCloudStorage bool
RcloneBackupRemote string
RcloneLogRemote string
NotificationMode string // "none", "telegram", "email", "both"
CronTime string // HH:MM
EnableEncryption bool
}
InstallWizardData holds the collected installation data
func RunInstallWizard ¶
func RunInstallWizard(ctx context.Context, configPath string, baseDir string, buildSig string) (*InstallWizardData, error)
RunInstallWizard runs the TUI-based installation wizard