server: Add http_url to the configuration

This commit is contained in:
Valentin Tolmer
2021-11-21 18:30:24 +01:00
committed by nitnelave
parent a13bfc3575
commit db2b5cbae0
3 changed files with 14 additions and 0 deletions

View File

@@ -64,6 +64,8 @@ pub struct Configuration {
pub key_file: String,
#[builder(default)]
pub smtp_options: MailOptions,
#[builder(default = r#"String::from("http://localhost")"#)]
pub http_url: String,
#[serde(skip)]
#[builder(field(private), setter(strip_option))]
server_setup: Option<ServerSetup>,
@@ -152,6 +154,10 @@ impl ConfigOverrider for RunOpts {
if let Some(port) = self.http_port {
config.http_port = port;
}
if let Some(url) = self.http_url.as_ref() {
config.http_url = url.to_string();
}
self.smtp_opts.override_config(config);
}
}