oetiker / znapzend

zfs backup with remote capabilities and mbuffer integration.
www.znapzend.org
GNU General Public License v3.0
613 stars 137 forks source link

Support raw sends of encrypted datasets #323

Closed aarononeal closed 4 years ago

aarononeal commented 6 years ago

An additional 'on|off' parameter can now be set on a destination to indicate that a 'raw' send should be used to transmit an encrypted dataset. This is useful for remote backup scenarios to an untrusted destination since data is not decrypted before transmitting. Unlike unencrypted datasets, the destination dataset must not exist prior to the initial send, so this commit also disables such checks when raw send is enabled.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.2%) to 86.969% when pulling ac7995cc75162a8e8aca12064465710c744f22a1 on aarononeal:feature/raw into 1d266cf24eee397f9a792b8ccd7fbd1ee8ed79e5 on oetiker:master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.2%) to 86.969% when pulling 54358b803943d64fd380615f4f80b9af9158540a on aarononeal:feature/raw into 1d266cf24eee397f9a792b8ccd7fbd1ee8ed79e5 on oetiker:master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.2%) to 86.969% when pulling 54358b803943d64fd380615f4f80b9af9158540a on aarononeal:feature/raw into 1d266cf24eee397f9a792b8ccd7fbd1ee8ed79e5 on oetiker:master.

oetiker commented 6 years ago

could you add a bit more documentation about the purpose of the raw switch ?

oetiker commented 6 years ago

reading your PR I get the impression that [raw] is not really optional ... and would break existing syntax

aarononeal commented 6 years ago

I can revise the PR if you can suggest a preferred way to make the syntax optional. Easiest fix may be to move it after post-command.

aarononeal commented 6 years ago

I just pushed an update that moves raw to the end and adds a doc entry.

oetiker commented 6 years ago

I think we have API design issue here ... positional arguments in this structure are not really sustainable if more of them come. I would suggest the following:

only mandatory arguments are positional (plus the two optional ones added earlier for backward compatibility).

all optional argument follow the classic cli design principle where optional argument are written as --key[=value] so the syntax would look like this:

[ DST[:key] plan [[user@]host:]dataset [--pre-send-command=cmd] [--post-send-command=cmd] [--raw]

the optional arguments can appear in any order AFTER the DST: argument.

@hadfl what do you think?

aarononeal commented 6 years ago

I prefer that approach but am not familiar with how to modify that option parsing code.

On a related note, I think recvu might also have made a good option as it seems something destination specific.

tgerczei commented 5 years ago

Could this one be revived? I'd have use for this feature.

oetiker commented 4 years ago

I think we got this now