Age | Commit message (Collapse) | Author | Files | Lines |
|
Sponsored-by: author
|
|
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
|
|
Sponsored-by: author
|
|
This is more friendly towards anyone wanting to use the output in a script.
Sponsored-by: author
|
|
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
|
|
Log the complete run-time of the program, and the time spent
downloading the previous generation, and uploading the new generation.
Sponsored-by: author
|
|
|
|
Backups made with this version can't be restored with old clients, and
vice version.
Sponsored-by: author
|
|
Sponsored-by: author
|
|
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
|
|
Sponsored-by: author
|
|
This is clearer and less error prone.
Sponsored-by: author
|
|
There is only async.
Sponsored-by: author
|
|
Also, make it an error for a public symbol to not be documented.
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Add a new mandatory database table "meta" to the SQLite database the
stores information about the files in a backup generation. The idea is
for future versions of the Obnam client to be able to be able to
restore from backups made by older -- or newer -- versions of Obnam,
as far as is reasonable.
Add the `obnam gen-info` command to show information about the
generation metadata.
Sponsored-by: author
|
|
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
|
|
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
|
|
For chmod() we need to cast mode parameter from u32 to u16 because
MacOS has 16 bit mode_t while Linux is using 32 bits.
|
|
This means a ChunkId can't be used instead.
Sponsored-by: author
|
|
This will make it harder to accidentally use a string. Can still be
confused with a chunk id.
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Mostly
https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow.
Sponsored-by: author
|
|
|
|
|
|
|
|
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Sponsored-by: author
|
|
|
|
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
|
|
Sponsored-by: author
|
|
This should make it easier to introduce async, later.
|
|
Change calls to set_message to pass ownership of the message, rather
than just letting it borrow the message.
Sponsored-by: author
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
|
|
|
|
`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).
|
|
Fixes #78.
|
|
This allows Init::run to not need to be given it as an argument.
|
|
|
|
|
|
|
|
|
|
|