Add STALWART_HTTPS_PORT variable
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
@@ -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()),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user