(&mut self)
| 1068 | } |
| 1069 | |
| 1070 | pub(crate) fn reconfigure(&mut self) -> Result<()> { |
| 1071 | let wg_config = self.generate_wg_config()?; |
| 1072 | safe_write(&self.config.wg.config_path, wg_config).context("Failed to write wg config")?; |
| 1073 | // wg setconf <interface_name> <config_path> |
| 1074 | let ifname = &self.config.wg.interface; |
| 1075 | let config_path = &self.config.wg.config_path; |
| 1076 | |
| 1077 | match cmd!(wg syncconf $ifname $config_path) { |
| 1078 | Ok(_) => info!("wg config updated"), |
| 1079 | Err(err) => error!("failed to set wg config: {err:?}"), |
| 1080 | } |
| 1081 | Ok(()) |
| 1082 | } |
| 1083 | |
| 1084 | pub(crate) fn select_top_n_hosts(&mut self, id: &str) -> Result<AddressGroup> { |
| 1085 | if self.config.proxy.localhost_enabled && id == "localhost" { |
no test coverage detected