summaryrefslogtreecommitdiff
path: root/src/client.rs
AgeCommit message (Collapse)AuthorFilesLines
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.
2021-01-05refactor: move policy on whether to back up a file into a moduleLars Wirzenius1-3/+3
This commit also splits up the src/cmd/backup.rs module into other, smaller, more cohesive modules that are easier to understand and use.
2021-01-04refactor: use fetch_chunk to fetch generationLars Wirzenius1-13/+3
Also, add GenerationChunk::from_data_chunk function.
2021-01-04feat: verify checksum of chunks downloaded from serverLars Wirzenius1-1/+18
2020-12-31feat: incremental backupLars Wirzenius1-1/+0
This uses the previous, latest generation as a guideline to see what is new or changed.
2020-12-31refactor: add LocalGeneration type for read-only operationsLars Wirzenius1-6/+25
This splits the use of NascentGeneration to more cohesive "new generation being built" versus "existing generation being restored".
2020-12-30debugLars Wirzenius1-0/+1
2020-12-30fix: actually use nanosecond timestampsLars Wirzenius1-1/+1
2020-12-30feat: add GenerationListLars Wirzenius1-2/+3
Various part of Obnam will need to deal with lists of generations. Abstract this.
2020-12-30feat! store and show timestamp for each backup generationLars Wirzenius1-3/+14
This changes the output format of "obnam list".
2020-12-26refactor: rename FileSystemEntry::path to pathbufLars Wirzenius1-3/+3
This is a step towards changing how filenames are stored in FileSystemEntry.
2020-12-23feat! only specify base URL of server, without /chunksLars Wirzenius1-6/+10
2020-12-23feat: add log file to clientLars Wirzenius1-0/+1
2020-12-12feat: back up and restore symlinksLars Wirzenius1-0/+2
2020-11-22feat! use temporary files for SQLite databasesLars Wirzenius1-1/+0
The user should not have to specify filenames for the databases, since they don't actually care where they're stored.
2020-11-18feat! change client config to take a base URL instead of host, portLars Wirzenius1-5/+6
2020-11-09fetch gen sqlite file when restoringLars Wirzenius1-0/+36