diff --git a/lib/c-api/Cargo.toml b/lib/c-api/Cargo.toml index d508a2e910d..b22a6c79801 100644 --- a/lib/c-api/Cargo.toml +++ b/lib/c-api/Cargo.toml @@ -42,7 +42,7 @@ libc.workspace = true thiserror = "1" typetag = { version = "0.1", optional = true } paste = "1.0" -tokio = { version = "1", features = [ "rt", "rt-multi-thread", "io-util", "sync", "macros"], default_features = false } +tokio = { version = "1", features = [ "rt", "rt-multi-thread", "io-util", "sync", "macros"], default-features = false } tracing = { version = "0.1" } tracing-subscriber = { version = "0.3", features = [ "env-filter", diff --git a/lib/cli/src/commands/app/create.rs b/lib/cli/src/commands/app/create.rs index 54e166e7e2c..eb4e25ab16c 100644 --- a/lib/cli/src/commands/app/create.rs +++ b/lib/cli/src/commands/app/create.rs @@ -149,6 +149,7 @@ impl CmdAppCreate { debug: None, scaling: None, locality: None, + redirect: None, extra: HashMap::new(), } } diff --git a/lib/config/src/app/mod.rs b/lib/config/src/app/mod.rs index edacabd143e..be4525e1100 100644 --- a/lib/config/src/app/mod.rs +++ b/lib/config/src/app/mod.rs @@ -92,6 +92,9 @@ pub struct AppConfigV1 { #[serde(default, skip_serializing_if = "Option::is_none")] pub scaling: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub redirect: Option, + /// Capture extra fields for forwards compatibility. #[serde(flatten)] pub extra: HashMap, @@ -265,6 +268,16 @@ pub struct AppConfigCapabilityInstaBootV1 { pub max_age: Option, } +/// App redirect configuration. +#[derive( + serde::Serialize, serde::Deserialize, schemars::JsonSchema, Clone, Debug, PartialEq, Eq, +)] +pub struct Redirect { + /// Force https by redirecting http requests to https automatically. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub force_https: Option, +} + #[cfg(test)] mod tests { use pretty_assertions::assert_eq; @@ -287,6 +300,8 @@ cli_args: locality: regions: - eu-rome +redirect: + force_https: true scheduled_tasks: - name: backup schedule: 1day @@ -331,6 +346,9 @@ scheduled_tasks: .into_iter() .collect(), debug: Some(true), + redirect: Some(Redirect { + force_https: Some(true) + }), locality: Some(Locality { regions: vec!["eu-rome".to_string()] }) diff --git a/lib/virtual-fs/Cargo.toml b/lib/virtual-fs/Cargo.toml index f4bb156211f..f6db418f880 100644 --- a/lib/virtual-fs/Cargo.toml +++ b/lib/virtual-fs/Cargo.toml @@ -26,7 +26,7 @@ replace_with = "0.1.7" shared-buffer = { workspace = true } slab = { version = "0.4" } thiserror = "1" -tokio = { version = "1", features = ["io-util", "sync", "macros"], default_features = false } +tokio = { version = "1", features = ["io-util", "sync", "macros"], default-features = false } tracing = { version = "0.1" } typetag = { version = "0.1", optional = true } webc = { workspace = true, optional = true, features = ["v1"] } @@ -42,7 +42,7 @@ getrandom = { version = "0.2", features = [ "js" ] } pretty_assertions = "1.3.0" tempfile = "3.6.0" tracing-test = "0.2.4" -tokio = { version = "1", features = ["io-util", "rt"], default_features = false } +tokio = { version = "1", features = ["io-util", "rt"], default-features = false } [features] default = ["host-fs", "webc-fs", "static-fs"] diff --git a/lib/virtual-net/Cargo.toml b/lib/virtual-net/Cargo.toml index ef104941286..2d7c3ce76b3 100644 --- a/lib/virtual-net/Cargo.toml +++ b/lib/virtual-net/Cargo.toml @@ -14,7 +14,7 @@ thiserror = "1" bytes = "1.1" async-trait = { version = "^0.1" } tracing = "0.1" -tokio = { version = "1", default_features = false, features = ["io-util"] } +tokio = { version = "1", default-features = false, features = ["io-util"] } libc = { workspace = true, optional = true } mio = { version = "0.8", optional = true } socket2 = { version = "0.4", optional = true } @@ -41,7 +41,7 @@ default-features = false features = ["proto-ipv4", "std", "alloc"] [dev-dependencies] -tokio = { version = "1", default_features = false, features = [ "macros", "rt-multi-thread" ] } +tokio = { version = "1", default-features = false, features = [ "macros", "rt-multi-thread" ] } tracing-test = { version = "0.2" } serial_test = "2.0.0" diff --git a/lib/wasix/Cargo.toml b/lib/wasix/Cargo.toml index 9b4098d56f1..ff1da6ed517 100644 --- a/lib/wasix/Cargo.toml +++ b/lib/wasix/Cargo.toml @@ -49,7 +49,7 @@ tokio = { version = "1", features = [ "macros", "time", "rt", -], default_features = false } +], default-features = false } tokio-stream = { version = "0.1", features = [ "sync" ] } futures = { version = "0.3" } # used by feature='os' @@ -130,7 +130,7 @@ terminal_size = { version = "0.3.0" } [dev-dependencies] wasmer = { path = "../api", version = "=4.3.5", default-features = false, features = ["wat", "js-serializable-module"] } -tokio = { version = "1", features = [ "sync", "macros", "rt" ], default_features = false } +tokio = { version = "1", features = [ "sync", "macros", "rt" ], default-features = false } pretty_assertions = "1.3.0" tracing-test = "0.2.4" wasm-bindgen-test = "0.3.0" diff --git a/tests/lib/wast/Cargo.toml b/tests/lib/wast/Cargo.toml index ff8e91763fe..a4c9a32b9d8 100644 --- a/tests/lib/wast/Cargo.toml +++ b/tests/lib/wast/Cargo.toml @@ -25,7 +25,7 @@ futures = "0.3" tokio = { version = "1", features = [ "io-util", "rt", -], default_features = false } +], default-features = false } [features] default = ["wat"]