Add STALWART_HTTPS_PORT variable

This commit is contained in:
Maurus Decimus
2026-04-22 08:41:46 +02:00
parent 04b673587d
commit 2fd3f208bd
11 changed files with 32 additions and 58 deletions

View File

@@ -275,6 +275,11 @@ impl RegistryStore {
&self.0.env_hostname
}
#[inline(always)]
pub fn https_port(&self) -> Option<u16> {
self.0.env_https_port
}
#[inline(always)]
pub fn is_recovery_mode(&self) -> bool {
self.0.env_recovery_mode
@@ -318,6 +323,7 @@ impl RegistryStore {
env_cluster_role: cluster_role,
env_push_shard_id: push_shard_id,
env_hostname: hostname,
env_https_port: None,
id_generator: utils::snowflake::SnowflakeIdGenerator::new(),
})
.await

View File

@@ -217,6 +217,7 @@ pub struct RegistryStoreInner {
pub(crate) env_cluster_role: Option<String>,
pub(crate) env_push_shard_id: u32,
pub(crate) env_hostname: String,
pub(crate) env_https_port: Option<u16>,
pub(crate) id_generator: SnowflakeIdGenerator,
}

View File

@@ -52,6 +52,9 @@ impl RegistryStoreInner {
"localhost".to_string()
}
}),
env_https_port: std::env::var("STALWART_HTTPS_PORT")
.ok()
.and_then(|p| p.parse::<u16>().ok()),
}
}