Update logs and variable names
This commit is contained in:
+7
-7
@@ -77,7 +77,7 @@ async fn main() -> Result<()> {
|
||||
.install_default()
|
||||
.map_err(|e| anyhow!("could not install crypto provider {e:?}"))?;
|
||||
|
||||
let mut client_config = ProxyOverides {
|
||||
let mut proxy_overides = ProxyOverides {
|
||||
proxy_url: match &server_config.proxy_url {
|
||||
Some(url) => Some(url.to_string()),
|
||||
None => None,
|
||||
@@ -102,7 +102,7 @@ async fn main() -> Result<()> {
|
||||
let cert = cert_params.self_signed(&key_pair)?;
|
||||
|
||||
let hash = hmac_sha256::Hash::hash(cert.der().as_ref());
|
||||
client_config.cert_hash = Some(hash.into());
|
||||
proxy_overides.cert_hash = Some(hash.into());
|
||||
|
||||
(cert.pem().into(), key_pair.serialize_pem().into())
|
||||
}
|
||||
@@ -123,13 +123,13 @@ async fn main() -> Result<()> {
|
||||
let rustls_config = RustlsConfig::new(Keycert::new().cert(cert.as_slice()).key(key.as_slice()));
|
||||
|
||||
info!(
|
||||
"client config:\n{}",
|
||||
toml::to_string_pretty(&client_config)?
|
||||
"proxy overides:\n{}",
|
||||
toml::to_string_pretty(&proxy_overides)?
|
||||
);
|
||||
|
||||
let config_craft = ConfigCraft {
|
||||
server_config: server_config.clone(),
|
||||
client_config,
|
||||
proxy_overides,
|
||||
};
|
||||
|
||||
let status_craft = StatusCraft {
|
||||
@@ -252,14 +252,14 @@ impl StatusCraft {
|
||||
#[derive(Clone)]
|
||||
pub struct ConfigCraft {
|
||||
server_config: Arc<Config>,
|
||||
client_config: ProxyOverides,
|
||||
proxy_overides: ProxyOverides,
|
||||
}
|
||||
|
||||
#[craft]
|
||||
impl ConfigCraft {
|
||||
#[craft(handler)]
|
||||
async fn get_config(&self) -> Json<ProxyOverides> {
|
||||
Json(self.client_config.clone())
|
||||
Json(self.proxy_overides.clone())
|
||||
}
|
||||
|
||||
#[craft(handler)]
|
||||
|
||||
Reference in New Issue
Block a user