summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2021-07-21Replace FsEntryResult with plain ResultAlexander Batischev1-4/+2
2021-07-21Replace ClientConfigResult with plain ResultAlexander Batischev1-3/+1
2021-07-21Replace RestoreResult with plain ResultAlexander Batischev1-11/+9
2021-07-21Replace ClientResult with plain ResultAlexander Batischev1-20/+22
2021-07-21Replace ChunkerResult with plain ResultAlexander Batischev1-5/+3
2021-07-21Replace GenerationChunkResult with plain ResultAlexander Batischev1-5/+2
2021-07-21backup_run: replace tuple with a structAlexander Batischev2-9/+25
2021-07-21Replace BackupResult with plain ResultAlexander Batischev2-7/+8
2021-07-21In errors, store chunk ids as `ChunkId`, not `String`Alexander Batischev2-4/+6
Fixes #114.
2021-07-18docs: clarify comments in engine.rsLars Wirzenius1-2/+2
As proposed by Alexander Batischev. Sponsored-by: author
2021-07-18fix: use an explicit tokio runtimeLars Wirzenius1-2/+3
Create a tokio runtime so that the non-async function for chunkify can call an async function and have that create and run background tasks. Brown paper bag mistake: I did the development of this in a separate program with an async main function. When I integrated it into Obnam proper, which doesn't have an async main function (yet), I didn't actually test it works, only that it compiles. Stupid, stupid, stupid. I know better. Sponsored-by: author
2021-07-18feat: add "chunkify" subcommandLars Wirzenius3-0/+108
Sponsored-by: author
2021-07-18feat: add Engine and WorkQueue abstractions for async processingLars Wirzenius3-0/+183
Many thanks to Daniel Silverstone for helping me get through this. Sponsored-by: author
2021-07-05refactor: code to run backups to have less repetitionLars Wirzenius3-132/+86
This should make it easier to introduce async, later.
2021-07-05refactor: have main explicitly print error messageLars Wirzenius1-8/+11
This is a little cleaner than having main print an error message by returning an Err value as a Result. For one thing, we can be more sure we log the error. Sponsored-by: author
2021-06-19chore: bump dependency on indicatif to 0.16, and fix what's neededLars Wirzenius2-4/+3
Change calls to set_message to pass ownership of the message, rather than just letting it borrow the message. Sponsored-by: author
2021-06-13feat: restore symlink metadataAlexander Batischev1-7/+14
The weird thing about this commit is that all the tests for it already exist: the subplot compares manifests of "live" and restored data, and that includes the mtime. The subplot passes on CI, and it passed for me too — until today. Today, if I run `./check` on the main branch (which is currently at 481c5d8df21c72db3a3d76e851d25426f3e40647), subplot fails because the symlinks' mtime is wrong. Most often it's just the nsec part that's wrong: tests run fast enough that they finish within a second, and they rarely happen at the edge of the second. I don't understand why this didn't happen to me before, and why it doesn't happen to CI — and to Lars, for that matter. git-bisect points at 755c18a11f87040245964cf411ea8f518b61e0f5, which is a couple months old, so we should've spotted the breakage by now. Needless to say, I didn't do any major overhauls of my system lately, just your usual `apt upgrade` (Debian bullseye/testing amd64). Did some change in Subplot or Summain obfuscate this? It bothers me that I don't understand how we could miss this for so long.
2021-06-04feat: do not panic if chunk nonce is unexpectedly shortAlexander Batischev1-8/+27
Fixes #119.
2021-05-31feat: add subcommands for encrypting, decrypting individual chunksLars Wirzenius2-0/+65
2021-05-31refactor: only send/receive encrypted chunks with serverLars Wirzenius1-65/+65
Also, refactor the client code to split out the HTTP bits more clearly. The refactor should've been separately, but got entangled with other changes during frantic debugging.
2021-05-31feat: add chunk encryptionLars Wirzenius3-0/+205
2021-05-29feat! drop MAC passphrase, fix key derivationLars Wirzenius1-5/+10
Previously we were deriving a key that was of the wrong length for the aead crate. Now we make it the right length.
2021-05-29refactor: make metadata part of a chunkLars Wirzenius2-2/+21
This makes is harder to accidentally use the wrong metadata for a chunk.
2021-05-29refactor: only have client config without passwordsLars Wirzenius6-96/+49
This means the config is always the config, and not sometimes the config or the config and passwords. Also, there's no config option for encrypting, anymore. It will not be optional now.
2021-05-29refactor: count chunks via file system, not via chunk server APILars Wirzenius2-26/+1
2021-05-29refactor: make metadata be part of datachunkLars Wirzenius11-53/+62
This makes it harder to lose the metadata for a chunk, or to use unrelated metadata and chunk. Also, soon I will refactor things for encrypting chunks, which will need metadata embedded in the encrypted chunk. Sponsored-by: author
2021-05-29refactor: split bare chunk server client into its own structLars Wirzenius1-71/+84
This makes the code doing HTTP requests simpler for easier comprehension and debugging.
2021-04-29feat: improve error messagesLars Wirzenius9-97/+161
All unclear error messages should now be clearer. For example, all the ones related to a file mention the file name and the attempted operation that failed.
2021-04-26Port chunkids() to the iterator APIAlexander Batischev3-12/+24
2021-04-26Generalize the machinery to arbitrary result typesAlexander Batischev1-18/+55
2021-04-26Extend the iterator to users of LocalGeneration::files()Alexander Batischev4-7/+8
2021-04-26Use an iterator internally for LocalGenerationAlexander Batischev1-19/+32
This adds the machinery. We have to keep the compiled SQL query while the iterator is in use, so we wrap it in an `SqlResults` struct which the iterator borrows.
2021-04-26Expose fallibility of individual SQL resultsAlexander Batischev4-13/+27
`LocalGeneration::sql::files()` runs an SQL query, iterates over the results and collects the rows into a `Vec`. This can fail at any step: the query might fail to run, or one of the rows might fail to be fetched or processed. Right now, we lump all those failures into a `Result` that wraps the whole return value. This is only possible because we process each row before returning. Once `Vec` is replaced by an iterator, we won't have that luxury anymore, so we now wrap each individual element into its own `Result` (as well as wrapping the whole vector into a `Result` of its own).
2021-04-25feat: expand tilde notation in configuration fileLars Wirzenius1-8/+29
Backup roots and log file can now say ~/foo/bar to refer to files relative to the user's home directory.
2021-04-21feat: add support for CACHEDIR.TAGAlexander Batischev3-13/+93
Fixes #78.
2021-04-10refactor: main function for clarityLars Wirzenius1-13/+14
2021-04-10refactor: have ClientConfigWithoutPasswords know its filenameLars Wirzenius3-9/+5
This allows Init::run to not need to be given it as an argument.
2021-04-10refactor: struct ShowConfig subcommandLars Wirzenius3-11/+15
2021-04-10refactor: struct GetChunk subcommandLars Wirzenius3-17/+22
2021-04-10refactor: struct Restore subcommandLars Wirzenius3-35/+46
2021-04-10refactor: struct ListFiles subcommandLars Wirzenius3-19/+24
2021-04-10refactor: struct ShowGeneration subcommandLars Wirzenius3-29/+34
2021-04-10refactor: struct List subcommandLars Wirzenius3-13/+18
2021-04-10refactor: struct Backup subcommandLars Wirzenius3-19/+24
2021-04-10refactor: struct Init subcommandLars Wirzenius3-34/+33
2021-04-10refactor: move ClientConfig into its own moduleLars Wirzenius14-131/+140
2021-04-09refactor: move function to better placeLars Wirzenius1-13/+13
2021-04-09feat: add "obnam init" subcommandLars Wirzenius10-32/+215
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-04-06refactor: clean up initial and incremental backup code paths a bitLars Wirzenius1-14/+16
2021-04-06fix: finish off and clear the incremental backup progress barLars Wirzenius1-0/+1