Documentation
¶
Index ¶
- func CreateEncryptedArchive(ctx context.Context, dataDir, snapshotDB string, masterKey []byte, ...) error
- func CreateEncryptedArchiveWithRecipient(ctx context.Context, dataDir, snapshotDB string, masterKey []byte, ...) error
- func RestoreEncryptedArchive(ctx context.Context, src io.Reader, identities []age.Identity, ...) error
- func RunCLI(args []string, out io.Writer) error
- type ArchiveInfo
- type Config
- type RestoreRequest
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEncryptedArchive ¶
func CreateEncryptedArchive(ctx context.Context, dataDir, snapshotDB string, masterKey []byte, appVersion, recipientText string, created time.Time, dst io.Writer) error
CreateEncryptedArchive snapshots the panel's durable data into an age-encrypted, versioned tar.gz stream. The files of the data directory are streamed into it, not copied first: their hashes are taken in a first pass (the manifest leads the archive), and a file that changes before it is written fails the backup.
func CreateEncryptedArchiveWithRecipient ¶ added in v0.1.80
func CreateEncryptedArchiveWithRecipient(ctx context.Context, dataDir, snapshotDB string, masterKey []byte, appVersion string, recipient age.Recipient, created time.Time, dst io.Writer) error
CreateEncryptedArchiveWithRecipient snapshots the panel's durable data into an age-encrypted, versioned tar.gz stream using a prepared age recipient. CreateEncryptedArchive is the recovery-recipient form used by scheduled backups.
func RestoreEncryptedArchive ¶
func RestoreEncryptedArchive(ctx context.Context, src io.Reader, identities []age.Identity, destination string) error
RestoreEncryptedArchive decrypts and validates a v1 backup into a new data directory. It refuses any existing target and never follows archive paths or archive links.
Types ¶
type ArchiveInfo ¶ added in v0.1.80
ArchiveInfo is the public, non-secret summary carried by a verified archive manifest.
func RestoreEncryptedArchiveWithInfo ¶ added in v0.1.80
func RestoreEncryptedArchiveWithInfo(ctx context.Context, src io.Reader, identities []age.Identity, destination string) (ArchiveInfo, error)
RestoreEncryptedArchiveWithInfo is RestoreEncryptedArchive plus the verified manifest's public metadata.
type Config ¶
type Config struct {
Store *store.Store
Vault *vault.Vault
DataDir string
MasterKey []byte
StepUp func(context.Context) error
// Edge is the edge edition: no scheduled or manual backup runs there yet (R2), so those RPCs refuse.
Edge bool
// RestorePanelData hands a prepared stage to the update service's privileged helper.
RestorePanelData func(context.Context, RestoreRequest, func() error) error
// DeleteKeptData delegates deletion beside the data directory to the privileged panel-update helper.
DeleteKeptData func(context.Context, string) error
// RestoreHelperRunning reports the shared panel-update helper's in-progress state.
RestoreHelperRunning func() bool
// OnResult is told how every backup ended: "" when it worked, else the error code (backup_storage_failed, ...). The
// Telegram alerts hang on it. It must not block.
OnResult func(code string)
Log *slog.Logger
}
type RestoreRequest ¶ added in v0.1.80
type RestoreRequest struct {
StageDir string
Source string
FileName string
MadeByVersion string
RequestedUnix int64
}
RestoreRequest is the public metadata passed to the VPS restore helper. It contains no recovery key.