From 35424ee77cbbe9f7af1d204db6c352bac5eaee1d Mon Sep 17 00:00:00 2001 From: Armin Widegreen Date: Sun, 14 Oct 2018 16:28:54 +0200 Subject: [PATCH] Add Licence, readme and fix dependency --- Cargo.lock | 4 +- LICENSE | 15 ++++++ README.md | 109 +++++++++++++++++++++++++++++++++++++++++++ vmail-cli/Cargo.toml | 2 +- 4 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 LICENSE create mode 100644 README.md diff --git a/Cargo.lock b/Cargo.lock index 0d827d6..bd4afe0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -403,6 +403,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "sha-crypt" version = "0.1.0" +source = "git+https://github.com/awidegreen/password-hashing.git?branch=add_sha-crypt#f07641e7b27951e4fe6c1362298f4707c561ba79" dependencies = [ "constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -582,7 +583,7 @@ dependencies = [ "failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "rpassword 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sha-crypt 0.1.0", + "sha-crypt 0.1.0 (git+https://github.com/awidegreen/password-hashing.git?branch=add_sha-crypt)", "vmail-lib 0.1.0", ] @@ -678,6 +679,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" "checksum rpassword 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d127299b02abda51634f14025aec43ae87a7aa7a95202b6a868ec852607d1451" "checksum rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "bcfe5b13211b4d78e5c2cadfebd7769197d95c639c35a50057eb4c05de811395" +"checksum sha-crypt 0.1.0 (git+https://github.com/awidegreen/password-hashing.git?branch=add_sha-crypt)" = "" "checksum sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9eb6be24e4c23a84d7184280d2722f7f2731fcdd4a9d886efbfe4413e4847ea0" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b3be2ef --- /dev/null +++ b/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2018, Armin Widegreen + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d795962 --- /dev/null +++ b/README.md @@ -0,0 +1,109 @@ +# vmail-rs + +[![license](https://img.shields.io/badge/license-ISC-brightgreen.svg)](https://www.isc.org/downloads/software-support-policy/isc-license/) + +`vmail-rs` is a command line tool and libary for managing a mail-server database +based on the great [HowTo](https://thomas-leister.de/en/mailserver-debian-stretch) ([german version](https://thomas-leister.de/mailserver-debian-stretch/)) +from [Thomas Leister](https://thomas-leister.de) written in Rust. + +## Prerequisites + +Make sure you have a working setup as described in the tutorial as `vmail-rs` +relies on the described database scheme (MySQL or MariaDB). + +Further, as `vmail-rs` is written in Rust, you should have a working +rustup/cargo setup. + +# Installation + +vmail-rs contains the cli tools `vmail-cli` + + +## Install from github + +``` +cargo install --git https://github.com/awidegreen/vmail-rs +``` + +## Build from sources + +Clone the repo and run + +``` +cargo install +``` +or the release version + +``` +cargo install --release +``` + +# Usage + +vmail-rs uses Rust's [dotenv](https://docs.rs/crate/dotenv/) crate to create +environment configuration from a `.env` file. + +Create a `.env` in the current directory containing the `DATABASE_URL` +configuration parameter. + +``` +DATABASE_URL=mysql://vmail:vmailpassword@localhost +``` +Use the command help to get started, and see which subcommands exists. + +```shell +vmail-cli --help +``` + +NOTE: all subcommands can also be shortcut'd. vmail-cli will automatically defer +the correct command: `vmail-cli u s` equals `vmail-cli user show` + +## Subcommand `domain` + +Available subcommands are: + +* add +* help +* remove +* show + +## Subcommand `user` + +As the name suggests, this subcommand is used to mange the users/accounts within +the database. In order to add a new user, the associated domain need to exist. + +Available subcommands are: + +* add +* edit +* help +* password +* remove +* show + +Use help for more information. + + +## Subcommand `alias` + +In order to add a new alias, the associated user and domain need to exist. + +Available subcommands are: + +* add +* help +* remove +* show + +Use help for more information. + +# How to contribute + +Create new issues if you find bugs or want to a new features. Pull requests are +very welcomed. + +# License + +Copyright (C) 2018 by Armin Widegreen + +This is free software, licensed under the [ISC License](LICENSE). diff --git a/vmail-cli/Cargo.toml b/vmail-cli/Cargo.toml index 869caa5..720b98a 100644 --- a/vmail-cli/Cargo.toml +++ b/vmail-cli/Cargo.toml @@ -10,4 +10,4 @@ vmail-lib = { path = "../vmail-lib" } failure = "0.1" failure_derive = "0.1" rand = "0.5" -sha-crypt = { path = "../../password-hashing/sha-crypt", features = ["include_simple"] } +sha-crypt = { git = "https://github.com/awidegreen/password-hashing.git", branch = "add_sha-crypt", features = ["include_simple"] }