aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-05-30 11:50:07 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-05-30 11:50:07 +0200
commitc98fc77ca0d8b7a5b1ca44e5e389bd89e60043ae (patch)
tree9121cd87bfdcf19703cfc99622e68bc71a1f28e8
parentaf25c853b9ca57ad4bc2ff65813f8a5167bd95d9 (diff)
downloadaerogramme-c98fc77ca0d8b7a5b1ca44e5e389bd89e60043ae.tar.gz
aerogramme-c98fc77ca0d8b7a5b1ca44e5e389bd89e60043ae.zip
Add some doc
-rw-r--r--Cargo.toml4
-rw-r--r--README.md51
-rw-r--r--src/server.rs2
3 files changed, 56 insertions, 1 deletions
diff --git a/Cargo.toml b/Cargo.toml
index df484d9..912c10d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -37,3 +37,7 @@ k2v-client = { git = "https://git.deuxfleurs.fr/Deuxfleurs/garage.git", branch =
[[bin]]
name = "test"
path = "src/test.rs"
+
+[[bin]]
+name = "main"
+path = "src/main.rs"
diff --git a/README.md b/README.md
index 48d1088..bf5e3d2 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,56 @@
# Mailrage - Encrypted e-mail storage over Garage
+## Usage
+
+Start by running:
+
+```
+$ cargo run --bin main -- first-login --region garage --k2v-endpoint http://127.0.0.1:3904 --s3-endpoint http://127.0.0.1:3900 --aws-access-key-id GK... --aws-secret-access-key c0ffee... --bucket mailrage-quentin --user-secret poupou
+Please enter your password for key decryption.
+If you are using LDAP login, this must be your LDAP password.
+If you are using the static login provider, enter any password, and this will also become your password for local IMAP access.
+Enter password:
+Confirm password:
+
+Cryptographic key setup is complete.
+
+If you are using the static login provider, add the following section to your .toml configuration file:
+
+[login_static.users.<username>]
+password = "$argon2id$v=19$m=4096,t=3,p=1$..."
+aws_access_key_id = "GK..."
+aws_secret_access_key = "c0ffee..."
+```
+
+Next create the config file `mailrage.toml`:
+
+```
+s3_endpoint = "http://127.0.0.1:3900"
+k2v_endpoint = "http://127.0.0.1:3904"
+aws_region = "garage"
+
+[login_static]
+default_bucket = "mailrage"
+[login_static.users.quentin]
+bucket = "mailrage-quentin"
+user_secret = "poupou"
+alternate_user_secrets = []
+password = "$argon2id$v=19$m=4096,t=3,p=1$..."
+aws_access_key_id = "GK..."
+aws_secret_access_key = "c0ffee..."
+```
+
+You can dump your keys with:
+
+```
+$ cargo run --bin main -- show-keys --region garage --k2v-endpoint http://127.0.0.1:3904 --s3-endpoint http://127.0.0.1:3900 --aws-access-key-id GK... --aws-secret-access-key c0ffee... --bucket mailrage-quentin --user-secret poupou
+Enter key decryption password:
+master_key = "..."
+secret_key = "..."
+```
+
+
+
## Bayou storage module
Checkpoints are stored in S3 at `<path>/checkpoint/<timestamp>`. Example:
diff --git a/src/server.rs b/src/server.rs
index e1ab599..ed751de 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -32,7 +32,7 @@ impl Server {
}
pub async fn run(self: &Arc<Self>) -> Result<()> {
- let creds = self.login_provider.login("lx", "plop").await?;
+ let creds = self.login_provider.login("quentin", "poupou").await?;
let mut mailbox = Mailbox::new(&creds, "TestMailbox".to_string()).await?;