diff --git a/Cargo.toml b/Cargo.toml index 4edd13b..2fd6a7d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,3 +5,7 @@ members = [ "rustcryptfs-fuse", "rustcryptfs-mount" ] + +[profile.release] +lto = true +codegen-units = 1 \ No newline at end of file diff --git a/README.md b/README.md index 8878b24..f9f1b75 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,10 @@ An implementation of [gocryptfs](https://github.com/rfjakob/gocryptfs) in Rust. - [ ] read - [ ] write +## Features +- mount\ + Allow to mount a virtual filesystem on linux or windows (unimplemented). This feature is no-op on other targets. + ## License Licensed under either of diff --git a/rustcryptfs/src/args.rs b/rustcryptfs/src/args.rs index 7cc85e8..b21f2b2 100644 --- a/rustcryptfs/src/args.rs +++ b/rustcryptfs/src/args.rs @@ -19,6 +19,7 @@ pub(crate) enum Commands { Ls(LsCommand), #[cfg(feature = "mount")] + #[cfg(any(target_os = "linux", target_os = "windows"))] /// Mount an encrypted folder Mount(MountCommand), } @@ -52,6 +53,7 @@ pub(crate) struct LsCommand { } #[cfg(feature = "mount")] +#[cfg(any(target_os = "linux", target_os = "windows"))] #[derive(Debug, Parser)] pub(crate) struct MountCommand { /// The directory diff --git a/rustcryptfs/src/main.rs b/rustcryptfs/src/main.rs index 2e70937..f196bfc 100644 --- a/rustcryptfs/src/main.rs +++ b/rustcryptfs/src/main.rs @@ -10,6 +10,7 @@ use args::{DecryptCommand, LsCommand}; use rustcryptfs_lib::GocryptFs; #[cfg(feature = "mount")] +#[cfg(any(target_os = "linux", target_os = "windows"))] use args::MountCommand; mod args; @@ -22,6 +23,7 @@ fn main() -> anyhow::Result<()> { args::Commands::Decrypt(c) => decrypt_file(c), args::Commands::Ls(c) => ls(c), #[cfg(feature = "mount")] + #[cfg(any(target_os = "linux", target_os = "windows"))] args::Commands::Mount(c) => mount(c), } } @@ -135,7 +137,7 @@ fn mount(mount: &MountCommand) -> anyhow::Result<()> { Ok(()) } -#[cfg(not(target_os = "linux"))] +#[cfg(target_os = "windows")] #[cfg(feature = "mount")] fn mount(mount: &MountCommand) -> anyhow::Result<()> { unimplemented!()