Skip to content

Commit 871d7b3

Browse files
Merge pull request #267 from code0-tech/reapply-https-configured-env
HTTPS configuration support
2 parents 06fe183 + 335a2db commit 871d7b3

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ version = "0.0.0"
77
edition = "2024"
88

99
[workspace.dependencies]
10-
code0-flow = { version = "0.0.40", features = ["flow_health", "flow_config", "flow_service"] }
11-
tucana = { version = "0.0.75", features = ["aquila"] }
10+
code0-flow = { version = "0.0.41", features = ["flow_health", "flow_config", "flow_service"] }
11+
tucana = { version = "0.0.76", features = ["aquila"] }
1212
serde_json = { version = "1.0.138" }
1313
log = "0.4.27"
1414
env_logger = "0.11.8"

adapter/rest/src/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub struct HttpServerConfig {
77
pub external_port: u16,
88
pub host: String,
99
pub external_host: String,
10+
pub https_configured: bool,
1011
}
1112

1213
impl LoadConfig for HttpServerConfig {
@@ -19,6 +20,7 @@ impl LoadConfig for HttpServerConfig {
1920
port,
2021
external_port: env_with_default("EXTERNAL_HTTP_SERVER_PORT", port),
2122
external_host: env_with_default("EXTERNAL_HTTP_SERVER_HOST", host),
23+
https_configured: env_with_default("HTTPS_CONFIGURED", false),
2224
}
2325
}
2426
}

adapter/rest/src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ async fn main() {
3333
let external_addr = runner.get_server_config().external_port;
3434
let external_host = runner.get_server_config().external_host.clone();
3535

36+
let protocol = match runner.get_server_config().https_configured {
37+
true => String::from("https"),
38+
false => String::from("http"),
39+
};
40+
3641
let configs = vec![ModuleDefinitionAppendix {
3742
module_identifier: String::from("draco-rest"),
3843
definitions: vec![ModuleDefinition {
@@ -42,6 +47,7 @@ async fn main() {
4247
host: external_host,
4348
port: external_addr as i64,
4449
endpoint: String::from(r"/${{project_slug}}${{httpURL}}"),
50+
protocol: protocol,
4551
},
4652
)),
4753
}],

0 commit comments

Comments
 (0)