wizard

package
v0.11.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAgeSetupCancelled is returned when the user aborts the AGE setup wizard.
	ErrAgeSetupCancelled = errors.New("encryption setup aborted by user")
)
View Source
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

func ConfirmNewInstall(baseDir string, buildSig string) (bool, error)

ConfirmNewInstall shows a TUI confirmation before wiping baseDir for --new-install.

func ConfirmRecipientOverwrite

func ConfirmRecipientOverwrite(recipientPath, configPath, buildSig string) (bool, error)

ConfirmRecipientOverwrite shows a TUI modal to confirm overwriting an existing AGE recipient.

func SaveAgeRecipient

func SaveAgeRecipient(recipientPath, recipient string) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL