From 07f8e0763cbb6b5dc8a34a51cc1cd7e9fb197a74 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Sun, 26 Jul 2020 17:47:22 -0400 Subject: [PATCH] start ideas for majd --- Cargo.toml | 1 + majd/Cargo.toml | 18 ++++++++++++++++++ majd/config.dhall | 25 +++++++++++++++++++++++++ majd/src/main.rs | 3 +++ 4 files changed, 47 insertions(+) create mode 100644 majd/Cargo.toml create mode 100644 majd/config.dhall create mode 100644 majd/src/main.rs diff --git a/Cargo.toml b/Cargo.toml index 11a890b..1444137 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,5 +48,6 @@ server = ["rustls", "webpki", "webpki-roots", "tokio", "async-trait", "tokio-rus [workspace] members = [ "./majc", + "./majd", "./site" ] diff --git a/majd/Cargo.toml b/majd/Cargo.toml new file mode 100644 index 0000000..6095c12 --- /dev/null +++ b/majd/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "majd" +version = "0.1.0" +authors = ["Christine Dodrill "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +structopt = "0.3" +tokio = { version = "0.2", features = ["rt-threaded", "macros"] } +tokio-rustls = { version = "0.14", features = ["dangerous_configuration"] } +async-trait = "0" +pretty_env_logger = "0.4" +log = "0" +anyhow = "1" + +maj = { path = ".." } diff --git a/majd/config.dhall b/majd/config.dhall new file mode 100644 index 0000000..aab1e25 --- /dev/null +++ b/majd/config.dhall @@ -0,0 +1,25 @@ +let Host = + { Type = { name : Text, certPath : Text, keyPath : Text, proxyTo : Text } + , default = + { name = "misconfigured.server" + , certPath = "./misconfigured.server/cert.pem" + , keyPath = "./misconfigured.server/key.pem" + , proxyTo = "127.0.0.1:1965" + } + } + +let Config = + { Type = { hosts : List Host.Type } + , default = { hosts = [] : List Host.Type } + } + +in Config::{ + , hosts = + [ Host::{ + , name = "maj.cetacean.club" + , certPath = "./certs/maj/cert.pem" + , keyPath = "./certs/maj/key.pem" + , proxyTo = "127.0.0.1:43833" + } + ] + } diff --git a/majd/src/main.rs b/majd/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/majd/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}