aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorShav Kinderlehrer <[email protected]>2024-05-01 12:32:28 -0400
committerShav Kinderlehrer <[email protected]>2024-05-01 12:32:28 -0400
commita4cfb64155c7505f32fed0a579d41101e544fa7c (patch)
tree98e3d76fb06b8e71c545c4a17c6a4c4e9f61f4df /src/main.rs
parent84f5f57adea7f28e2f445f088779fa78ecfb1733 (diff)
downloadchela-main.tar.gz
chela-main.zip
Add CHELA_USES_HTTPS as an optionHEADv1.4.0main
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 83731fa..b3e8abb 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -29,6 +29,7 @@ pub struct ServerState {
pub sqids: Sqids,
pub main_page_redirect: Option<Url>,
pub behind_proxy: bool,
+ pub uses_https: bool,
}
#[derive(Debug, Clone, sqlx::FromRow, PartialEq, Eq)]
@@ -87,12 +88,14 @@ async fn main() -> eyre::Result<()> {
.build()?;
let main_page_redirect = env::var("CHELA_MAIN_PAGE_REDIRECT").unwrap_or_default();
let behind_proxy = env::var("CHELA_BEHIND_PROXY").is_ok();
+ let uses_https = env::var("CHELA_USES_HTTPS").is_ok();
let server_state = ServerState {
db_pool,
host,
sqids,
main_page_redirect: Url::parse(&main_page_redirect).ok(),
behind_proxy,
+ uses_https
};
serve(server_state).await?;