diff --git a/Cargo.toml b/Cargo.toml index c4227c5..7d3a86b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,8 +20,8 @@ once_cell = "1.4" rustls = { version = "0.19", optional = true, features = ["dangerous_configuration"] } structopt = "0.3" thiserror = "1" -tokio-rustls = { version = "0.21", features = ["dangerous_configuration"], optional = true } -tokio = { version = "0.3", features = ["full"], optional = true } +tokio-rustls = { version = "0.21", features = ["dangerous_configuration"] } +tokio = { version = "0.3", features = ["full"] } url = "2" webpki-roots = { version = "0.20", optional = true } webpki = { version = "0.21.0", optional = true } @@ -35,10 +35,8 @@ pretty_env_logger = "0.4" default = ["client", "server"] client = [ - "tokio-rustls", "webpki", "webpki-roots", - "tokio", ] server = [ diff --git a/majc/Cargo.toml b/majc/Cargo.toml index d5b75c9..fc3c021 100644 --- a/majc/Cargo.toml +++ b/majc/Cargo.toml @@ -11,7 +11,7 @@ cursive = "0.15" log = "0.4" url = "2" webpki = "0.21.0" -rustls = { version = "0.18", features = ["dangerous_configuration"] } +rustls = { version = "0.19", features = ["dangerous_configuration"] } smol = { version = "0.3", features = ["tokio02"] } maj = { path = ".." } diff --git a/pilno/karnycukta/Cargo.toml b/pilno/karnycukta/Cargo.toml index 5a75a51..5c1c53d 100644 --- a/pilno/karnycukta/Cargo.toml +++ b/pilno/karnycukta/Cargo.toml @@ -8,15 +8,14 @@ edition = "2018" [dependencies] anyhow = "1" -async-std = "1.5" async-trait = "0" atom_syndication = "0.9" chrono = "*" log = "0" pretty_env_logger = "0.4" webpki = "0.21.0" -rustls = { version = "0.18", features = ["dangerous_configuration"] } +rustls = { version = "0.19", features = ["dangerous_configuration"] } structopt = "0.3" -tokio = { version = "0.2", features = ["full"] } +tokio = { version = "0.3", features = ["full"] } maj = { path = "../..", features = ["server", "client"], default-features = false } diff --git a/site/Cargo.toml b/site/Cargo.toml index 87b29b7..5c42166 100644 --- a/site/Cargo.toml +++ b/site/Cargo.toml @@ -9,7 +9,6 @@ build = "build.rs" [dependencies] anyhow = "1" -async-std = "1.5" async-trait = "0" dnd_dice_roller = "0.3" env_logger = "0" @@ -17,13 +16,14 @@ log = "0" mime = "0.3.0" percent-encoding = "2" rand = "0" -rustls = { version = "0.18", features = ["dangerous_configuration"] } +rustls = { version = "0.19", features = ["dangerous_configuration"] } serde = { version = "1", features = ["derive"] } serde_json = "1" smol = { version = "0.3", features = ["tokio02"] } structopt = "0.3" url = "2" warp = "0.2" +tokio = { version = "0.3", features = ["rt"] } maj = { path = "..", features = ["server"], default-features = false } diff --git a/site/src/main.rs b/site/src/main.rs index 229d07f..2270953 100644 --- a/site/src/main.rs +++ b/site/src/main.rs @@ -1,8 +1,8 @@ -use async_std::task; use rustls::{ internal::pemfile::{certs, pkcs8_private_keys}, AllowAnyAnonymousOrAuthenticatedClient, Certificate, PrivateKey, RootCertStore, ServerConfig, }; + use std::{ fs::File, io::{self, BufReader}, @@ -64,7 +64,8 @@ fn load_keys(path: &Path) -> io::Result> { .map_err(|_| io::Error::new(io::ErrorKind::InvalidInput, "invalid key")) } -fn main() -> Result<(), maj::server::Error> { +#[tokio::main] +async fn main() -> Result<(), maj::server::Error> { env_logger::init(); let opts = Options::from_args(); let certs = load_certs(&opts.cert).unwrap(); @@ -96,7 +97,7 @@ fn main() -> Result<(), maj::server::Error> { thread::spawn(move || http::run(h.clone(), port)); } - task::block_on(maj::server::serve(h.clone(), config, opts.host, opts.port))?; + maj::server::serve(h.clone(), config, opts.host, opts.port).await?; Ok(()) }