MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / reconfigure

Method reconfigure

gateway/src/main_service.rs:1070–1082  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

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" {

Callers 5

mainFunction · 0.80
do_register_cvmMethod · 0.80
start_wavekv_watch_taskFunction · 0.80
recycleMethod · 0.80

Calls 1

generate_wg_configMethod · 0.80

Tested by

no test coverage detected