summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2024-03-03chore: upgrade dependency on aes-gcmLars Wirzenius1-1/+1
Signed-off-by: Lars Wirzenius <liw@liw.fi> Sponsored-by: author
2024-03-03chore: upgrade dependency on indicatifLars Wirzenius2-11/+31
Signed-off-by: Lars Wirzenius <liw@liw.fi> Sponsored-by: author
2024-03-03chore: upgrade dependency on pbkdf2Lars Wirzenius1-1/+1
Signed-off-by: Lars Wirzenius <liw@liw.fi> Sponsored-by: author
2024-03-03chore: upgrade dependency on rpasswordLars Wirzenius1-1/+1
Signed-off-by: Lars Wirzenius <liw@liw.fi> Sponsored-by: author
2024-01-01chore: fix silliness found by clippyLars Wirzenius1-8/+2
Signed-off-by: Lars Wirzenius <liw@liw.fi> Sponsored-by: author
2023-10-21chore: fix blemishes found by clippyLars Wirzenius4-9/+8
Signed-off-by: Lars Wirzenius <liw@liw.fi> Sponsored-by: author
2023-01-07refactor: implement Default trait, instead just a function defaultLars Wirzenius1-2/+4
Found by clippy. Sponsored-by: author
2023-01-07refactor: use idiom to iterate over keys in HashMapLars Wirzenius1-1/+1
Found by clippy. Sponsored-by: author
2022-11-12fix: unnecessary borrows, other things found by clippyLars Wirzenius5-11/+11
Sponsored-by: author
2022-11-02fix: put back --versionLars Wirzenius1-1/+1
Sponsored-by: author
2022-10-28chore: drop IndexedStore, which wasn't used anywhere, anymoreLars Wirzenius2-78/+0
Sponsored-by: author
2022-10-28feat! finish chunk store abstractionLars Wirzenius2-35/+12
This builds on Alexander's work to show me how to get past the problem I had. There's additional changes to finish off the changes. Drop chunk deletion from server: it's not a good idea to have it until the server API is authenticated. Sponsored-by: author
2022-10-26Make LocalStore Sync (provide interior mutability)Alexander Batischev1-10/+15
2022-10-26stashLars Wirzenius1-11/+8
Sponsored-by: author
2022-10-26change put to take a vector of bytesLars Wirzenius2-12/+7
Sponsored-by: author
2022-10-26use new chunk store for all of client.rsLars Wirzenius3-53/+21
Sponsored-by: author
2022-10-26drop dead codeLars Wirzenius1-58/+0
Sponsored-by: author
2022-10-26impl backup client find client trusts with new chunk storeLars Wirzenius1-9/+3
Sponsored-by: author
2022-10-26use new chnunk store for backup client fetch_chunkLars Wirzenius1-3/+1
Sponsored-by: author
2022-10-26use new ChunkStore for remote has_chunkLars Wirzenius2-16/+14
Sponsored-by: author
2022-10-26feat: add a new ChunkStore to store chunks locally or remotelyLars Wirzenius2-0/+305
Sponsored-by: author
2022-10-23chore: use push_back instead of deprecated pushLars Wirzenius1-1/+1
Sponsored-by: author
2022-10-23refactor: use clap instead of structoptLars Wirzenius16-58/+46
clap version 3 basically replaces structopt entirely. Sponsored-by: author
2022-09-09chore: tidy up things to satisfy clippyLars Wirzenius5-7/+6
Sponsored-by: author
2022-07-17chore: make code more idiomatic, based on clippy warningsLars Wirzenius3-6/+4
Sponsored-by: author
2022-05-03refactor: add a builder for file system entriesLars Wirzenius2-83/+145
The previous commit introduced a function to create FilesystemEntry values from arbitrary data. Previously one could only be created from std::fs::Metadata. This complicated our own testing, which (now) needs to construct an arbitrary entry structure. However, while the function added in the last commit was straightforward, it had 11 arguments, and that's hard to keep track of. Replace that function with an EntryBuilder struct, for clarity. Sponsored-by: author
2022-05-03test: add test for storing, retrieving u64::MAX values in JSONLars Wirzenius3-15/+77
The test passes. We create a FilesystemEntry with a length field containing u64::MAX, store that into a generation, and read it back. This works. The entry is serialised into JSON for storing in SQLite, and this proves we can handle any u64 value in an entry. serde_json deals with it fine, and we don't need to worry about it. Sponsored-by: author
2022-05-03feat! only store signed 64-bit plain integers in databaseLars Wirzenius1-1/+14
This is a breaking change, but allows to store the largest signed 64-bit integers in SQLite and get it back. Sponsored-by: author
2022-05-03refactor: add a type for plain integers we store in a databaseLars Wirzenius4-17/+23
This will make it easier to change later, if need be. We may want to do that for various reasons, such as to save space. We may also want to change things to only use integer types that SQLite can handle: u64 is currently not well handled by our database layer. However, as this is a refactor, there's no change or fix to that. FileId is now explicitly a database integer. This doesn't break anything, for now, as the underlying integer type is still u64. Also, change a couple of places where it will matter if DbInt changes away from u64, and disable warnings for harmless conversions that may cause warnings depending on what type DbInt has. Sponsored-by: author
2022-04-21feat: show-generation shows size of the generation's SQLite dbLars Wirzenius1-0/+9
Sponsored-by: author
2022-04-21feat: change "show-generation" output to JSONLars Wirzenius2-5/+36
This is more friendly towards anyone wanting to use the output in a script. Sponsored-by: author
2022-04-16feat: use one checksum for all chunks in a backupLars Wirzenius8-41/+170
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-04-16feat! change how chunk labels are serializedLars Wirzenius4-18/+55
Serialized labels now start with a type prefix: a character that says what type of label it is. This isn't strictly required: we _can_ just decide to always use a single type of checksum for all chunks in one backup, for one client, or in the whole repository. However, if it's ever possible to have more than one type, it helps debugging if every checksum, when serialized, is explicit about its type. Change things to use the new serialize method instead of the Display trait for Label. We're primarily serializing labels so they can be stored in a database, and used in URLs, only secondarily showing them to users. Sponsored-by: author
2022-04-16refactor: rename Checksum to LabelLars Wirzenius10-39/+39
Label is a clearer and more accurate name for the type now that it is not just a checksum. Also, serialize a Label in tests, rather than using string literals. This is more correct, and we'll be changing serialization later. Sponsored-by: author
2022-04-16refactor: add a Literal variant to ChecksumLars Wirzenius3-6/+16
We've had fake checksums that are just arbitrary literal strings, and this change makes this more explicit. It's a preliminary change for later support for additional checksum algorithms. Sponsored-by: author
2022-04-06feat! add chunk server API version to HTTP pathsLars Wirzenius2-1/+9
What was /chunks is now /v1/chunks. This is the minimal step to start supporting multiple API versions. Also, /v1/chunks/foo/bar is no longer supported. Sponsored-by: author
2022-04-05feat: collect and log some time metricsLars Wirzenius5-32/+32
Log the complete run-time of the program, and the time spent downloading the previous generation, and uploading the new generation. Sponsored-by: author
2022-04-05feat: add data structures for accumulating time measurementsLars Wirzenius3-0/+199
Sponsored-by: author
2022-03-28Remove debug printsAlexander Batischev2-3/+0
2022-03-22feat! drop generation related fields from chunk metadataLars Wirzenius6-127/+17
Sponsored-by: author
2022-03-22feat! store list of generations in a "client trust root" chunkLars Wirzenius12-20/+210
Backups made with this version can't be restored with old clients, and vice version. Sponsored-by: author
2022-03-22fix: old typo in doc commentLars Wirzenius1-1/+1
Sponsored-by: author
2022-03-20feat: add subcommands inspect, list-backup-versionsLars Wirzenius5-1/+80
Sponsored-by: author
2022-03-20feat! on server, store chunk label in column called "label"Lars Wirzenius1-9/+9
Sponsored-by: author
2022-03-20feat: allow user to choose backup schema version for new backupsLars Wirzenius5-186/+509
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-20refactor: put SchemaVersion, GenMeta in their own modulesLars Wirzenius3-0/+232
For clarity, though these aren't yet used anywhere. That will happen soon. Sponsored-by: author
2022-03-13feat! rename metadata field "sha256" to "label"Lars Wirzenius6-31/+36
The field still contains a cleartext SHa256 of the cleartext chunk data, but this makes it clearer that it may contain other data. This is a breaking change: the server API won't work with an old client, and the new client won't work with an old server. To avoid the breakage would require more effort than is warranted at this time, given the very small number of users of Obnam. Sorry. Sponsored-by: author
2022-03-06refactor: add constant for showing/hiding progress reportingLars Wirzenius1-2/+4
This is clearer than editing literal values in the functions. Sponsored-by: author
2022-03-06perf: reduce logging for, for performanceLars Wirzenius2-8/+1
Sponsored-by: author
2022-03-06perf: cache user and group name lookupsLars Wirzenius3-29/+38
Sponsored-by: author