Expanding feature rita_client/dev_env for ops tools
Part of an update to ops tools dev env to add a rita tower
instance, this feature now points the dev tower to the correct
heartbeat server key and sends it dummy exit info
@@ -64,13 +64,13 @@ pub struct HeartbeatCache {
exit_neighbor_rita: RitaNeighbor,
}
-#[cfg(not(feature = "operator_debug"))]
+#[cfg(not(any(feature = "operator_debug", feature = "dev_env")))]
lazy_static! {
pub static ref HEARTBEAT_SERVER_KEY: WgKey = "hizclQFo/ArWY+/9+AJ0LBY2dTiQK4smy5icM7GA5ng="
.parse()
.unwrap();
}
-#[cfg(feature = "operator_debug")]
+#[cfg(any(feature = "operator_debug", feature = "dev_env"))]
lazy_static! {
pub static ref HEARTBEAT_SERVER_KEY: WgKey = "RECW5xQfDzo3bzaZtzepM/+qWRuFTohChKKzUqGA0n4="
.parse()
@@ -140,8 +140,13 @@ fn send_udp_heartbeat() {
// Check for the basics first, before doing any of the hard futures work
let mut our_id: Identity = if settings::get_rita_client().get_identity().is_some() {
+ trace!(
+ "Got identity: {} ",
+ settings::get_rita_client().get_identity().unwrap()
+ );
settings::get_rita_client().get_identity().unwrap()
} else {
+ trace!("Could not get identity!");
return;
};
let mut selected_exit_details: ExitDetails = dummy_selected_exit_details();
@@ -156,8 +161,12 @@ fn send_udp_heartbeat() {
Some(details) => {
our_id = id;
selected_exit_details = details.clone();
+ trace!("got exit details for id: {}", id);
+ }
+ None => {
+ trace!("got no exit details!");
+ return;
}
- None => return,
}
} else {
return;
@@ -180,7 +189,8 @@ fn send_udp_heartbeat() {
match dns_request {
Ok(dnsres) => {
let dnsresult = VecDeque::from_iter(dnsres);
- let selected_exit_route = if cfg!(feature = "operator_debug") {
+ let selected_exit_route =
+ if cfg!(feature = "operator_debug") || cfg!(feature = "dev_env") {
Ok(dummy_route())
} else {
get_selected_exit_route(&network_info.babel_routes)
@@ -188,7 +198,8 @@ fn send_udp_heartbeat() {
match selected_exit_route {
Ok(route) => {
- let neigh_option = if cfg!(feature = "operator_debug") {
+ let neigh_option =
+ if cfg!(feature = "operator_debug") || cfg!(feature = "dev_env") {
Some((dummy_neigh_babel(), dummy_neigh_tunnel()))
} else {
let neigh_option1 =
