Skip to content

Commit

Permalink
exit refactor wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranay Tulugu committed Aug 18, 2023
1 parent 058b6c8 commit 23d29a9
Show file tree
Hide file tree
Showing 15 changed files with 327 additions and 2,137 deletions.
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 8 additions & 10 deletions althea_kernel_interface/src/exit_server_tunnel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ use std::collections::HashSet;
use std::net::IpAddr;
use KernelInterfaceError as Error;

#[derive(Debug, Clone, Eq, PartialEq, Hash, Serialize, Deserialize)]
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, Serialize, Deserialize)]
pub struct ExitClient {
pub internal_ip: IpAddr,
pub internet_ipv6_list: Vec<IpNetwork>,
pub internet_ipv6: Option<IpNetwork>,
pub public_key: WgKey,
pub mesh_ip: IpAddr,
pub port: u16,
Expand Down Expand Up @@ -39,15 +39,13 @@ impl dyn KernelInterface {

for c in clients.iter() {
// For the allowed IPs, we appends the clients internal ip as well
// as the client ipv6 assigned list and add this to wireguards allowed ips
// internet_ipv6_list is already in the form of "<subnet1>,<subnet2>.."
let i_ipv6 = &c.internet_ipv6_list;
// as the client ipv6 assigned ip and add this to wireguards allowed ips
// internet_ipv6 is already in the form of "<subnet1>,<subnet2>.."
let i_ipv6 = &c.internet_ipv6;
let mut allowed_ips = c.internal_ip.to_string().to_owned();
if !i_ipv6.is_empty() {
for ip_net in i_ipv6 {
allowed_ips.push(',');
allowed_ips.push_str(&ip_net.to_string());
}
if let Some(i_ipv6) = i_ipv6 {
allowed_ips.push(',');
allowed_ips.push_str(&i_ipv6.to_string());
}

args.push("peer".into());
Expand Down
3 changes: 0 additions & 3 deletions rita_bin/src/exit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@ fn main() {

send_admin_notification_sms("Exit restarted");

// Initialize db pool
initialize_db_pool();

let system = actix_async::System::new();

start_rita_common_loops();
Expand Down
2 changes: 0 additions & 2 deletions rita_exit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ phonenumber = "0.3"
arrayvec = {version= "0.7", features = ["serde"]}
log = { version = "0.4", features = ["release_max_level_info"] }
reqwest = { version = "0.11", features = ["blocking", "json"] }
exit_db = { path = "../exit_db" }
actix-web-async = {package="actix-web", version = "4.3", default_features = false, features= ["openssl"] }
diesel = { version = "1.4", features = ["postgres", "r2d2"] }
deep_space = {version = "2", features = ["althea"]}

[features]
Expand Down
Loading

0 comments on commit 23d29a9

Please sign in to comment.