Skip to content

Commit c0509ca

Browse files
committed
rage-mount: Add support for mounting an encrypted file
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.
1 parent 9c56470 commit c0509ca

File tree

6 files changed

+364
-15
lines changed

6 files changed

+364
-15
lines changed

Cargo.lock

Lines changed: 84 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rage/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,12 @@ rust-embed = "5"
5757
secrecy = "0.7"
5858

5959
# rage-mount dependencies
60+
ctrlc = { version = "3.1.7", optional = true }
6061
fuse_mt = { version = "0.5.1", optional = true }
6162
libc = { version = "0.2", optional = true }
63+
nix = { version = "0.18", optional = true }
6264
tar = { version = "0.4", optional = true }
65+
tempfile = { version = "3.2", optional = true }
6366
time = { version = "0.1", optional = true }
6467
zip = { version = "0.5.9", optional = true }
6568

@@ -71,7 +74,7 @@ man = "0.3"
7174

7275
[features]
7376
default = ["ssh"]
74-
mount = ["fuse_mt", "libc", "tar", "time", "zip"]
77+
mount = ["ctrlc", "fuse_mt", "libc", "nix", "tar", "tempfile", "time", "zip"]
7578
ssh = ["age/ssh"]
7679
unstable = ["age/unstable"]
7780

rage/examples/generate-docs.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ fn rage_mount_page() {
176176
Flag::new()
177177
.short("-t")
178178
.long("--types")
179-
.help("The type of the filesystem (one of \"tar\", \"zip\")."),
179+
.help("The type of the filesystem (one of \"file\", \"tar\", \"zip\")."),
180180
)
181181
.option(
182182
Opt::new("IDENTITY")
@@ -186,6 +186,11 @@ fn rage_mount_page() {
186186
)
187187
.arg(Arg::new("filename"))
188188
.arg(Arg::new("mountpoint"))
189+
.example(
190+
Example::new()
191+
.text("Mounting an encrypted file to a recipient")
192+
.command("rage-mount -t file -i key.txt encrypted.txt.age decrypted.txt"),
193+
)
189194
.example(
190195
Example::new()
191196
.text("Mounting an archive encrypted to a recipient")

rage/i18n/en-US/rage.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ info-mounting-as-fuse = Mounting as FUSE filesystem
134134
err-mnt-missing-filename = Missing filename.
135135
err-mnt-missing-mountpoint = Missing mountpoint.
136136
err-mnt-missing-types = Missing {-flag-mnt-types}.
137+
err-mnt-must-be-file = Mountpoint must be a file.
137138
err-mnt-unknown-type = Unknown filesystem type "{$fs_type}"
138139
139140
## Unstable features

0 commit comments

Comments
 (0)