mirror of
https://github.com/octoleo/restic.git
synced 2024-11-21 20:35:12 +00:00
rename --no-verify-pack
to --no-extra-verify
This commit is contained in:
parent
7d31180fe6
commit
86b38a0b17
@ -8,7 +8,7 @@ To prevent the upload of corrupted data to the repository, restic now
|
|||||||
additionally verifies that files can be decoded and contain the correct data
|
additionally verifies that files can be decoded and contain the correct data
|
||||||
beforehand. This increases the CPU usage during backups. If absolutely
|
beforehand. This increases the CPU usage during backups. If absolutely
|
||||||
necessary, you can disable the verification using the option
|
necessary, you can disable the verification using the option
|
||||||
`--no-verify-pack`.
|
`--no-extra-verify`.
|
||||||
|
|
||||||
https://github.com/restic/restic/issues/4529
|
https://github.com/restic/restic/issues/4529
|
||||||
https://github.com/restic/restic/pull/4681
|
https://github.com/restic/restic/pull/4681
|
||||||
|
@ -67,7 +67,7 @@ type GlobalOptions struct {
|
|||||||
CleanupCache bool
|
CleanupCache bool
|
||||||
Compression repository.CompressionMode
|
Compression repository.CompressionMode
|
||||||
PackSize uint
|
PackSize uint
|
||||||
NoVerifyPack bool
|
NoExtraVerify bool
|
||||||
|
|
||||||
backend.TransportOptions
|
backend.TransportOptions
|
||||||
limiter.Limits
|
limiter.Limits
|
||||||
@ -140,7 +140,7 @@ func init() {
|
|||||||
f.BoolVar(&globalOptions.InsecureTLS, "insecure-tls", false, "skip TLS certificate verification when connecting to the repository (insecure)")
|
f.BoolVar(&globalOptions.InsecureTLS, "insecure-tls", false, "skip TLS certificate verification when connecting to the repository (insecure)")
|
||||||
f.BoolVar(&globalOptions.CleanupCache, "cleanup-cache", false, "auto remove old cache directories")
|
f.BoolVar(&globalOptions.CleanupCache, "cleanup-cache", false, "auto remove old cache directories")
|
||||||
f.Var(&globalOptions.Compression, "compression", "compression mode (only available for repository format version 2), one of (auto|off|max) (default: $RESTIC_COMPRESSION)")
|
f.Var(&globalOptions.Compression, "compression", "compression mode (only available for repository format version 2), one of (auto|off|max) (default: $RESTIC_COMPRESSION)")
|
||||||
f.BoolVar(&globalOptions.NoVerifyPack, "no-verify-pack", false, "skip verification of data before upload")
|
f.BoolVar(&globalOptions.NoExtraVerify, "no-extra-verify", false, "skip verification of data before upload")
|
||||||
f.IntVar(&globalOptions.Limits.UploadKb, "limit-upload", 0, "limits uploads to a maximum `rate` in KiB/s. (default: unlimited)")
|
f.IntVar(&globalOptions.Limits.UploadKb, "limit-upload", 0, "limits uploads to a maximum `rate` in KiB/s. (default: unlimited)")
|
||||||
f.IntVar(&globalOptions.Limits.DownloadKb, "limit-download", 0, "limits downloads to a maximum `rate` in KiB/s. (default: unlimited)")
|
f.IntVar(&globalOptions.Limits.DownloadKb, "limit-download", 0, "limits downloads to a maximum `rate` in KiB/s. (default: unlimited)")
|
||||||
f.UintVar(&globalOptions.PackSize, "pack-size", 0, "set target pack `size` in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE)")
|
f.UintVar(&globalOptions.PackSize, "pack-size", 0, "set target pack `size` in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE)")
|
||||||
@ -455,9 +455,9 @@ func OpenRepository(ctx context.Context, opts GlobalOptions) (*repository.Reposi
|
|||||||
}
|
}
|
||||||
|
|
||||||
s, err := repository.New(be, repository.Options{
|
s, err := repository.New(be, repository.Options{
|
||||||
Compression: opts.Compression,
|
Compression: opts.Compression,
|
||||||
PackSize: opts.PackSize * 1024 * 1024,
|
PackSize: opts.PackSize * 1024 * 1024,
|
||||||
NoVerifyPack: opts.NoVerifyPack,
|
NoExtraVerify: opts.NoExtraVerify,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Fatal(err.Error())
|
return nil, errors.Fatal(err.Error())
|
||||||
|
@ -337,7 +337,7 @@ func TestRepackWrongBlob(t *testing.T) {
|
|||||||
|
|
||||||
func testRepackWrongBlob(t *testing.T, version uint) {
|
func testRepackWrongBlob(t *testing.T, version uint) {
|
||||||
// disable verification to allow adding corrupted blobs to the repository
|
// disable verification to allow adding corrupted blobs to the repository
|
||||||
repo := repository.TestRepositoryWithBackend(t, nil, version, repository.Options{NoVerifyPack: true})
|
repo := repository.TestRepositoryWithBackend(t, nil, version, repository.Options{NoExtraVerify: true})
|
||||||
|
|
||||||
seed := time.Now().UnixNano()
|
seed := time.Now().UnixNano()
|
||||||
rand.Seed(seed)
|
rand.Seed(seed)
|
||||||
@ -363,7 +363,7 @@ func TestRepackBlobFallback(t *testing.T) {
|
|||||||
|
|
||||||
func testRepackBlobFallback(t *testing.T, version uint) {
|
func testRepackBlobFallback(t *testing.T, version uint) {
|
||||||
// disable verification to allow adding corrupted blobs to the repository
|
// disable verification to allow adding corrupted blobs to the repository
|
||||||
repo := repository.TestRepositoryWithBackend(t, nil, version, repository.Options{NoVerifyPack: true})
|
repo := repository.TestRepositoryWithBackend(t, nil, version, repository.Options{NoExtraVerify: true})
|
||||||
|
|
||||||
seed := time.Now().UnixNano()
|
seed := time.Now().UnixNano()
|
||||||
rand.Seed(seed)
|
rand.Seed(seed)
|
||||||
|
@ -103,7 +103,7 @@ func testRepairBrokenPack(t *testing.T, version uint) {
|
|||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
t.Run(test.name, func(t *testing.T) {
|
t.Run(test.name, func(t *testing.T) {
|
||||||
// disable verification to allow adding corrupted blobs to the repository
|
// disable verification to allow adding corrupted blobs to the repository
|
||||||
repo := repository.TestRepositoryWithBackend(t, nil, version, repository.Options{NoVerifyPack: true})
|
repo := repository.TestRepositoryWithBackend(t, nil, version, repository.Options{NoExtraVerify: true})
|
||||||
|
|
||||||
seed := time.Now().UnixNano()
|
seed := time.Now().UnixNano()
|
||||||
rand.Seed(seed)
|
rand.Seed(seed)
|
||||||
|
@ -59,9 +59,9 @@ type Repository struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Options struct {
|
type Options struct {
|
||||||
Compression CompressionMode
|
Compression CompressionMode
|
||||||
PackSize uint
|
PackSize uint
|
||||||
NoVerifyPack bool
|
NoExtraVerify bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// CompressionMode configures if data should be compressed.
|
// CompressionMode configures if data should be compressed.
|
||||||
@ -444,7 +444,7 @@ func (r *Repository) saveAndEncrypt(ctx context.Context, t restic.BlobType, data
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *Repository) verifyCiphertext(buf []byte, uncompressedLength int, id restic.ID) error {
|
func (r *Repository) verifyCiphertext(buf []byte, uncompressedLength int, id restic.ID) error {
|
||||||
if r.opts.NoVerifyPack {
|
if r.opts.NoExtraVerify {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -542,7 +542,7 @@ func (r *Repository) SaveUnpacked(ctx context.Context, t restic.FileType, buf []
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *Repository) verifyUnpacked(buf []byte, t restic.FileType, expected []byte) error {
|
func (r *Repository) verifyUnpacked(buf []byte, t restic.FileType, expected []byte) error {
|
||||||
if r.opts.NoVerifyPack {
|
if r.opts.NoExtraVerify {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user