From 132cf45dfeb7f43bb279e0dc3f5f06028f3c94bc Mon Sep 17 00:00:00 2001 From: Ara Sadoyan Date: Wed, 10 Jun 2026 11:29:35 +0200 Subject: [PATCH] cleanup, minor fix --- src/utils/structs.rs | 1 + src/web/start.rs | 11 ++--------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/utils/structs.rs b/src/utils/structs.rs index a6507f7..d183686 100644 --- a/src/utils/structs.rs +++ b/src/utils/structs.rs @@ -112,6 +112,7 @@ pub struct AppConfig { pub hc_method: String, pub upstreams_conf: String, pub log_level: String, + pub pid_file: Option, pub master_key: Option, pub config_address: String, pub proxy_address_http: String, diff --git a/src/web/start.rs b/src/web/start.rs index d4cf7ca..aad2043 100644 --- a/src/web/start.rs +++ b/src/web/start.rs @@ -79,7 +79,7 @@ pub fn run() { let mut to = TcpSocketOptions::default(); to.tcp_keepalive = Some(TcpKeepalive { idle: Duration::from_secs(idle), - interval: Duration::from_secs(cfg.tcp_keepalive_interval.unwrap_or(60)), + interval: Duration::from_secs(cfg.tcp_keepalive_interval.unwrap_or(10)), user_timeout: Default::default(), count: cfg.tcp_keepalive_count.unwrap_or(5usize), }); @@ -121,13 +121,6 @@ pub fn run() { proxy.add_tls_with_settings(&bind_address_tls, tcp_options.clone(), tls_settings); - // if let Some(to) = tcp_options.clone() { - // proxy.add_tls_with_settings(&bind_address_tls, Some(to.clone()), tls_settings); - // } else { - // proxy.add_tls_with_settings(&bind_address_tls, None, tls_settings); - // } - // proxy.add_tls_with_settings(&bind_address_tls, None, tls_settings); - let certs_for_watcher = certificates.clone(); thread::spawn(move || { while let Ok(new_configs) = rx.recv() { @@ -153,7 +146,7 @@ pub fn run() { drop_priv(user, group, cfg.proxy_address_http.clone(), cfg.proxy_address_tls.clone()); } let _ = sd_notify::notify(&[NotifyState::Ready]); - let _ = fs::write("/tmp/aralez.pid", process::id().to_string()); + let _ = fs::write(cfg.pid_file.clone().unwrap_or("/tmp/aralez.pid".to_string()), process::id().to_string()); let mut signals = Signals::new(&[SIGINT, SIGTERM, SIGQUIT]).unwrap(); for sig in signals.forever() {