From 335a2dbe37603c4e0e4d83ed5f19b3a50ca8729c Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 13 Jul 2026 13:15:37 +0200 Subject: [PATCH] Reapply "Merge pull request #265 from code0-tech/#263-add-https-configured-env" This reverts commit a8a7d39349110ef66b7cae11dfe0cd8596952eb0. --- Cargo.lock | 10 +++++----- Cargo.toml | 4 ++-- adapter/rest/src/config.rs | 2 ++ adapter/rest/src/main.rs | 6 ++++++ 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 333acff..6f3b1e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -282,9 +282,9 @@ dependencies = [ [[package]] name = "code0-flow" -version = "0.0.40" +version = "0.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bac81931da426429ac4ca93b80ff246900d64e8190ec2c4e0382ff35157857" +checksum = "a5373ac809b37ed939f2fd9094d20cc8534a87d18ac5551ee7dfc69c6a7596ea" dependencies = [ "async-nats", "dotenv", @@ -2194,9 +2194,9 @@ dependencies = [ [[package]] name = "tucana" -version = "0.0.75" +version = "0.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a58d33f2013edc52c4d782b3bdcdccff2b6b7f2233b91fc833e2f69df2277b" +checksum = "473db4c6dff2f83d8275b92abe90873a5e68b5ca5cf02e2aa0154fdd69bc925a" dependencies = [ "pbjson", "pbjson-build", @@ -2456,7 +2456,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index b037030..46cffc2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,8 +7,8 @@ version = "0.0.0" edition = "2024" [workspace.dependencies] -code0-flow = { version = "0.0.40", features = ["flow_health", "flow_config", "flow_service"] } -tucana = { version = "0.0.75", features = ["aquila"] } +code0-flow = { version = "0.0.41", features = ["flow_health", "flow_config", "flow_service"] } +tucana = { version = "0.0.76", features = ["aquila"] } serde_json = { version = "1.0.138" } log = "0.4.27" env_logger = "0.11.8" diff --git a/adapter/rest/src/config.rs b/adapter/rest/src/config.rs index 1530037..a4e1835 100644 --- a/adapter/rest/src/config.rs +++ b/adapter/rest/src/config.rs @@ -7,6 +7,7 @@ pub struct HttpServerConfig { pub external_port: u16, pub host: String, pub external_host: String, + pub https_configured: bool, } impl LoadConfig for HttpServerConfig { @@ -19,6 +20,7 @@ impl LoadConfig for HttpServerConfig { port, external_port: env_with_default("EXTERNAL_HTTP_SERVER_PORT", port), external_host: env_with_default("EXTERNAL_HTTP_SERVER_HOST", host), + https_configured: env_with_default("HTTPS_CONFIGURED", false), } } } diff --git a/adapter/rest/src/main.rs b/adapter/rest/src/main.rs index 59459a3..629bd63 100644 --- a/adapter/rest/src/main.rs +++ b/adapter/rest/src/main.rs @@ -33,6 +33,11 @@ async fn main() { let external_addr = runner.get_server_config().external_port; let external_host = runner.get_server_config().external_host.clone(); + let protocol = match runner.get_server_config().https_configured { + true => String::from("https"), + false => String::from("http"), + }; + let configs = vec![ModuleDefinitionAppendix { module_identifier: String::from("draco-rest"), definitions: vec![ModuleDefinition { @@ -42,6 +47,7 @@ async fn main() { host: external_host, port: external_addr as i64, endpoint: String::from(r"/${{project_slug}}${{httpURL}}"), + protocol: protocol, }, )), }],