This commit is contained in:
naskya 2024-07-01 10:56:04 +09:00
parent 5dd9697fe3
commit 988688c8d9
Signed by: naskya
GPG key ID: 712D413B3A9FED5C

View file

@ -389,7 +389,19 @@ fn create_new_server_config(
.as_str() .as_str()
.ok_or(Error::InvalidConfig("`proxyUrl` is not a string"))? .ok_or(Error::InvalidConfig("`proxyUrl` is not a string"))?
.to_string(), .to_string(),
bypass_hosts: http_proxy_bypass_hosts, bypass_hosts: http_proxy_bypass_hosts.clone(),
}),
None => None,
};
let media_proxy = match default_yml.get("mediaProxy") {
Some(url) => Some(server::Proxy {
enabled: true,
url: url
.as_str()
.ok_or(Error::InvalidConfig("`mediaProxy` is not a string"))?
.to_string(),
bypass_hosts: http_proxy_bypass_hosts.clone(),
}), }),
None => None, None => None,
}; };
@ -397,9 +409,21 @@ fn create_new_server_config(
let summaly_proxy = meta.summaly_proxy.as_ref().map(|url| server::Proxy { let summaly_proxy = meta.summaly_proxy.as_ref().map(|url| server::Proxy {
enabled: true, enabled: true,
url: url.to_owned(), url: url.to_owned(),
bypass_hosts: None, bypass_hosts: http_proxy_bypass_hosts.clone(),
}); });
let smtp_proxy = match default_yml.get("proxySmtp") {
Some(url) => Some(server::Proxy {
enabled: true,
url: url
.as_str()
.ok_or(Error::InvalidConfig("`proxySmtp` is not a string"))?
.to_string(),
bypass_hosts: http_proxy_bypass_hosts,
}),
None => None,
};
let mut server_config = server::Config { let mut server_config = server::Config {
config_revision: Revision::V1, config_revision: Revision::V1,
server_info: Some(server::ServerInfo { server_info: Some(server::ServerInfo {
@ -435,9 +459,9 @@ fn create_new_server_config(
.ok_or(Error::InvalidConfig("port"))? as u16, .ok_or(Error::InvalidConfig("port"))? as u16,
}, },
http_proxy, http_proxy,
media_proxy: todo!(), media_proxy,
summaly_proxy: summaly_proxy, summaly_proxy,
smtp_proxy: todo!(), smtp_proxy,
}, },
database: server::Database { database: server::Database {
host: db host: db