summaryrefslogtreecommitdiff
path: root/src/client.rs
AgeCommit message (Collapse)AuthorFilesLines
2022-11-12fix: unnecessary borrows, other things found by clippyLars Wirzenius1-1/+1
Sponsored-by: author
2022-10-26change put to take a vector of bytesLars Wirzenius1-1/+2
Sponsored-by: author
2022-10-26use new chunk store for all of client.rsLars Wirzenius1-39/+4
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 Wirzenius1-15/+9
Sponsored-by: author
2022-04-16feat! change how chunk labels are serializedLars Wirzenius1-1/+1
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 Wirzenius1-2/+2
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 Wirzenius1-1/+3
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 Wirzenius1-1/+1
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-03-22feat! store list of generations in a "client trust root" chunkLars Wirzenius1-10/+42
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-13feat! rename metadata field "sha256" to "label"Lars Wirzenius1-1/+1
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-01-16refactor: combine the chunk client into BackupClientLars Wirzenius1-69/+36
The split doesn't seem to make sense any more. Sponsored-by: author
2022-01-16refactor: rename AsyncBackupClient to just BackupClientLars Wirzenius1-8/+6
There is only async. Sponsored-by: author
2021-12-31docs: add documentation comments to crateLars Wirzenius1-0/+38
Also, make it an error for a public symbol to not be documented. Sponsored-by: author
2021-08-16refactor: move file reading, etc, for backups to backup_runLars Wirzenius1-75/+1
Move code to read a file as chunks during a backup, and upload any new chunks to the chunk server, into `src/backup_run.rs`. Previously they were mostly in `src/client.rs`, which is meant to provide an abstraction for using the chunk server API. Sponsored-by: author
2021-08-09refactor: use async for "obnam backup"Lars Wirzenius1-197/+50
This changes things so that "obnam backup" uses async for everything. The old non-async BackupClient and ChunkClient are dropped. This does NOT move the chunking, and checksum computation, to its own function. This will happen later. Sponsored-by: author
2021-08-01refactor: use a struct for GenIdLars Wirzenius1-2/+2
This means a ChunkId can't be used instead. Sponsored-by: author
2021-08-01refactor: add a type alias for generation idsLars Wirzenius1-9/+7
This will make it harder to accidentally use a string. Can still be confused with a chunk id. Sponsored-by: author
2021-07-23refactor: use async for "obnam list-files"Lars Wirzenius1-0/+29
Sponsored-by: author
2021-07-23refactor: use async for "obnam list"Lars Wirzenius1-0/+17
Sponsored-by: author
2021-07-23refactor: use async for "obnam get-chunk"Lars Wirzenius1-0/+114
Sponsored-by: author
2021-07-22Merge branch 'feature/114-replace-string-with-chunkid' into 'main'Lars Wirzenius1-2/+2
In errors, store chunk ids as `ChunkId`, not `String` Closes #114 See merge request obnam/obnam!165
2021-07-21Replace ClientResult with plain ResultAlexander Batischev1-20/+22
2021-07-21In errors, store chunk ids as `ChunkId`, not `String`Alexander Batischev1-2/+2
Fixes #114.
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-29refactor: make metadata be part of datachunkLars Wirzenius1-18/+12
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 Wirzenius1-39/+78
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-10refactor: move ClientConfig into its own moduleLars Wirzenius1-120/+2
2021-04-09feat: add "obnam init" subcommandLars Wirzenius1-3/+44
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-27refactor: drop unnecessary conversions to the same typeLars Wirzenius1-5/+5
2021-03-27refactor: use Option::or_else to avoid unnecessary allocationLars Wirzenius1-1/+4
2021-03-27refactor: rename ChunkId::from_str to ChunkId::recreateLars Wirzenius1-1/+1
Less confusion with FromStr::from_str this way.
2021-03-03refactor: drop unnecessary derives for config structsLars Wirzenius1-2/+2
We never serialize TentativeClientConfig or de-serialize ClientConfig, so those derives are unnecessary.
2021-03-03fix: don't allow unknown fields in configuration filesLars Wirzenius1-0/+1
2021-02-19feat: backup and restore named pipes (FIFOs)Lars Wirzenius1-0/+1
2021-02-19feat: back up and restore Unix domain socketsLars Wirzenius1-4/+7
2021-02-16refactor: use bytesize::MIB constant for clearer sizeLars Wirzenius1-1/+2
2021-02-06feat! back up multiple rootsLars Wirzenius1-5/+5
This changes the client configuration file "root" field (with a single string) to "roots" (a list of strings).
2021-02-06feat: make client config fields be optional, have defaultsLars Wirzenius1-2/+36
We don't want to require the user to have to specify every possible setting in client configuration files. Having reasonable defaults when possible is a better way.
2021-02-06feat: client verifies server's TLS certificate by defaultLars Wirzenius1-3/+5
Configuration setting can disable it.
2021-02-06feat: client requires an HTTPS URL for serverLars Wirzenius1-1/+12
2021-02-04feat: add obnam config subcommandLars Wirzenius1-2/+2
2021-02-04refactor: have per-module error enumsLars Wirzenius1-26/+62
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-3/+3
2021-01-17feat: add a default configuration fileLars Wirzenius1-1/+3
The ~/.config/obnam/obnam.yaml file will be used as the configuration file by default. The ~/.config directory can be overridden by setting the XDG variable (XDG_CONFIG_HOME), or the whole file can be overridden with the --config option to obnam.
2021-01-10feat! use SQLite db for chunk index on serverLars Wirzenius1-11/+27
This speeds startup a lot. However, the backup repository needs to be re-created from scratch and internal APIs have change in incompatible ways.