Documentation
¶
Overview ¶
Package backup writes and restores password-encrypted archives of nerdui's own data: the database, the managed stacks and the Git stacks (#89, ADR-0047).
Index ¶
Constants ¶
const ( // Format is the archive layout version. Format = 1 // MinPasswordLen of a backup password; the archive holds credentials. MinPasswordLen = 12 )
Variables ¶
var ErrWrongPassword = errors.New("wrong password, or not a nerdui backup")
ErrWrongPassword means the archive could not be decrypted with the password.
Functions ¶
func ValidatePassword ¶
ValidatePassword checks a backup password.
Types ¶
type Manifest ¶
type Manifest struct {
Format int `json:"format"`
Created time.Time `json:"created"`
Nerdui string `json:"nerdui"`
Schema int64 `json:"schema"`
// DataDir and StacksDir of the source host: stack paths below them are moved to the
// directories of the host that restores the archive.
DataDir string `json:"dataDir"`
StacksDir string `json:"stacksDir"`
}
Manifest describes an archive.
type Source ¶
type Source struct {
Store *store.Store
DataDir string
StacksDir string
// KeyFile encrypts secrets in the database (#35); it is included when it exists.
KeyFile string
}
Source is what a backup contains.
type Target ¶
type Target struct {
DataDir string
StacksDir string
// KeyFile is where the key of secrets in the database is restored (#35).
KeyFile string
// Force replaces an existing database, stacks and Git stacks; they are kept next to
// their place as <name>.before-restore-<time>.
Force bool
// Logf reports progress.
Logf func(format string, args ...any)
}
Target is where an archive is restored.