Skip to content

Commit

Permalink
rage-mount: Add support for mounting an encrypted file
Browse files Browse the repository at this point in the history
This behaves similarly to `mount --bind source_file target_file`, except
that `source_file` is transparently decrypted, and `target_file` is
created as a symbolic link instead of a bind-mount.

Part of #188.
  • Loading branch information
str4d committed Jan 13, 2021
1 parent 9c56470 commit c0509ca
Show file tree
Hide file tree
Showing 6 changed files with 364 additions and 15 deletions.
89 changes: 84 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion rage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ rust-embed = "5"
secrecy = "0.7"

# rage-mount dependencies
ctrlc = { version = "3.1.7", optional = true }
fuse_mt = { version = "0.5.1", optional = true }
libc = { version = "0.2", optional = true }
nix = { version = "0.18", optional = true }
tar = { version = "0.4", optional = true }
tempfile = { version = "3.2", optional = true }
time = { version = "0.1", optional = true }
zip = { version = "0.5.9", optional = true }

Expand All @@ -71,7 +74,7 @@ man = "0.3"

[features]
default = ["ssh"]
mount = ["fuse_mt", "libc", "tar", "time", "zip"]
mount = ["ctrlc", "fuse_mt", "libc", "nix", "tar", "tempfile", "time", "zip"]
ssh = ["age/ssh"]
unstable = ["age/unstable"]

Expand Down
7 changes: 6 additions & 1 deletion rage/examples/generate-docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ fn rage_mount_page() {
Flag::new()
.short("-t")
.long("--types")
.help("The type of the filesystem (one of \"tar\", \"zip\")."),
.help("The type of the filesystem (one of \"file\", \"tar\", \"zip\")."),
)
.option(
Opt::new("IDENTITY")
Expand All @@ -186,6 +186,11 @@ fn rage_mount_page() {
)
.arg(Arg::new("filename"))
.arg(Arg::new("mountpoint"))
.example(
Example::new()
.text("Mounting an encrypted file to a recipient")
.command("rage-mount -t file -i key.txt encrypted.txt.age decrypted.txt"),
)
.example(
Example::new()
.text("Mounting an archive encrypted to a recipient")
Expand Down
1 change: 1 addition & 0 deletions rage/i18n/en-US/rage.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ info-mounting-as-fuse = Mounting as FUSE filesystem
err-mnt-missing-filename = Missing filename.
err-mnt-missing-mountpoint = Missing mountpoint.
err-mnt-missing-types = Missing {-flag-mnt-types}.
err-mnt-must-be-file = Mountpoint must be a file.
err-mnt-unknown-type = Unknown filesystem type "{$fs_type}"
## Unstable features
Expand Down
Loading

0 comments on commit c0509ca

Please sign in to comment.