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 Config
- 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 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
// 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
}