Skip to content

Commit

Permalink
add docs for building from source
Browse files Browse the repository at this point in the history
add fuse3 deps for cargo aur
  • Loading branch information
radumarias committed Apr 22, 2024
1 parent 60e6381 commit a967a92
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 20 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ strum = "0.26.2"
strum_macros = "0.26.2"
rpassword = "7.3.1"
cryptostream = "0.3.2"

[package.metadata.aur]
depends = ["fuse3"]
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
##### Builder
FROM alpine:3.16.0 as builder

RUN apk add binutils build-base ca-certificates curl file g++ gcc libressl-dev make patch postgresql rust
RUN apk add binutils build-base ca-certificates curl file g++ gcc libressl-dev make patch rust

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

Expand Down
60 changes: 44 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,33 @@ You can use it as a command line tool to mount an encrypted file system, or dire

## Command Line Tool

To use the encrypted file system, you need to have FUSE installed on your system. You can install it by running the following command (or based on your distribution)

Arch
```bash
sudo pacman -Syu && sudo pacman -S fuse3
```
Ubuntu
```bash
sudo apt-get update && sudo apt-get -y install fuse3
```

### Install from AUR

You can install the encrypted file system binary using the following command:
You can install the encrypted file system binary using the following command
```bash
yay -Syu
yay -S encryptedfs
```

### Install with cargo

You can install the encrypted file system binary using the following command:
You can install the encrypted file system binary using the following command
```bash
cargo install encryptedfs
```

To use the encrypted file system, you need to have FUSE installed on your system. You can install it by running the following command (or based on your distribution):

Arch
```bash
sudo pacman -Syu && sudo pacman -S fuse3
```
Ubuntu
```bash
sudo apt-get update && sudo apt-get -y install fuse3
```

A basic example of how to use the encrypted file system is shown below:
A basic example of how to use the encrypted file system is shown below

```
encryptedfs --mount-point MOUNT_POINT --data-dir DATA_DIR
Expand All @@ -57,7 +57,7 @@ The encryption key is stored in a file and encrypted with a key derived from the
This offers the possibility to change the password without needing to decrypt and re-encrypt the whole data.
This is done by decrypting the key with the old password and re-encrypting it with the new password.

To change the password, you can run the following command:
To change the password, you can run the following command
```bash
encryptedfs --change-password --data-dir DATA_DIR
```
Expand All @@ -66,7 +66,7 @@ It will prompt you to enter the old password and then the new password.

### Encryption info

You can specify the encryption algorithm and derive key hash rounds adding these arguments to the command line:
You can specify the encryption algorithm and derive key hash rounds adding these arguments to the command line

```bash
--cipher CIPHER --derive-key-hash-rounds ROUNDS
Expand Down Expand Up @@ -117,3 +117,31 @@ ls
echo "test" > 1/test
cat 1/test
```

# Building from source
You need to have openssl adn fuse3 packages installed

Arch
```bash
sudo pacman -Syu && sudo pacman -S openssl lib32-openssl fuse3
```

Ubuntu
```bash
sudo apg-get uupdate && sudo apt-get install libssl-dev openssl fuse3
```

Build for debug
```bash
cargo build
```

Or for release
```bash
cargo build --release
```

Run
```bash
cargo run -- --mount-point MOUNT_POINT --data-dir DATA_DIR
```
2 changes: 1 addition & 1 deletion src/encryptedfs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{fs, io, process};
use std::{fs, io};
use std::cmp::{max, min};
use std::collections::HashMap;
use std::fmt::Debug;
Expand Down
3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ use clap::{Arg, ArgAction, ArgMatches, Command, crate_version};
use ctrlc::set_handler;
use fuse3::MountOptions;
use fuse3::raw::prelude::*;
use libc::system;
use rpassword::read_password;
use strum::IntoEnumIterator;
use tokio::{fs, task};
use tracing::{error, info, Level};

use encryptedfs::encryptedfs::{Cipher, EncryptedFs, FsError, FsResult};
use encryptedfs::encryptedfs::{Cipher, EncryptedFs, FsError};
use encryptedfs::encryptedfs_fuse3::EncryptedFsFuse3;

#[tokio::main]
Expand Down

0 comments on commit a967a92

Please sign in to comment.