summaryrefslogtreecommitdiff
path: root/src/error.rs
AgeCommit message (Collapse)AuthorFilesLines
2022-04-16feat: use one checksum for all chunks in a backupLars Wirzenius1-0/+5
When making a backup, use the same checksum for any chunks it re-uses or creates. This is for performance: if we allowed two checksums to be used, we would have to compute the checksum for a chunk twice, and potentially look up both on the server. This is just a lot of work. Instead, we use only one. The trade-off here is that when (not if) the user wants to switch to a new checksum type, they'll have to do a full backup, uploading all their data to the server, even when it's already there, just with a different checksum. Hopefully this will be rare. Full backups always use the built-in, hardcoded default checksum, and incremental backups use whatever the previous backup used. The default is still SHA256, but this commit add code to support BLAKE2 if we decide to switch that as a default. It's also easy to add support for others, now. BLAKE2 was added to verify that Obnam can actually handle the checksum changing (manual test: not in the test suite). I don't think users need to be offered even the option of choosing a checksum algorithm to use. When one cares about both security and performance, choosing a checksum requires specialist, expert knowledge. Obnam developers should choose the default. Giving users a knob they can twiddle just makes it that much harder to configure and use Obnam. If the choice Obnam developers have made is shown to be sub-optimal, it seems better to change the default for everyone, rather than hope that every user changes their configuration to gain the benefit. Experience has shown that people mostly don't change the default configuration, and that they are especially bad at choosing well when security is a concern. (Obnam is free software. Expert users can choose their checksum by changing the source code. I'm not fundamentally limiting anyone's freedom or choice here.) Users can switch to a new default algorithm by triggering a full backup with the new "obnam backup --full". Sponsored-by: author
2022-03-22feat! store list of generations in a "client trust root" chunkLars Wirzenius1-0/+5
Backups made with this version can't be restored with old clients, and vice version. Sponsored-by: author
2022-03-20feat: allow user to choose backup schema version for new backupsLars Wirzenius1-0/+5
The way this is currently implemented resulted in a lot of code duplication in src/generation.rs. This should be refactored later. My first attempt to do it by adding a trait for a schema variant failed. Sponsored-by: author
2022-03-06refactor: add a low level SQLite wrapperLars Wirzenius1-0/+5
This makes the code clearer and allows for catching more errors, albeit at runtime, such as using the wrong column name. Sponsored-by: author
2021-12-31docs: add documentation comments to crateLars Wirzenius1-0/+19
Also, make it an error for a public symbol to not be documented. Sponsored-by: author
2021-07-28Backup: exit non-zero if new tags are foundAlexander Batischev1-0/+5
2021-05-31feat: add chunk encryptionLars Wirzenius1-0/+4
2021-04-10refactor: move ClientConfig into its own moduleLars Wirzenius1-1/+2
2021-04-09feat: add "obnam init" subcommandLars Wirzenius1-0/+5
This reads a passphrase and derives two passwords from that, and stores them next to the configuration file. The passwords aren't yet used for anything, that will come later.
2021-03-12feat: handle files in directories that can be read but not executedLars Wirzenius1-2/+1
2021-02-04feat: add obnam config subcommandLars Wirzenius1-0/+3
2021-02-04refactor: have per-module error enumsLars Wirzenius1-15/+33
This means that a function that parses step bindings can't return an error that the document is missing a title. Such an error return would be nonsensical, and we use the Rust type system to prevent it, at a small cost of being a bit verbose. Additional benefit is that the library portion of Obnam doesn't return anyhow::Result values anymore.
2021-01-19refactor: use ChunkId directly in errors, instead of StringLars Wirzenius1-4/+5
2021-01-10feat! use SQLite db for chunk index on serverLars Wirzenius1-2/+8
This speeds startup a lot. However, the backup repository needs to be re-created from scratch and internal APIs have change in incompatible ways.
2021-01-04feat: verify checksum of chunks downloaded from serverLars Wirzenius1-0/+6
2020-12-31feat: incremental backupLars Wirzenius1-0/+4
This uses the previous, latest generation as a guideline to see what is new or changed.
2020-12-30fix: add missing source filesLars Wirzenius1-0/+8