meta: cargo update && cargo fmt
parent
42eb0a7589
commit
c618d7949b
|
@ -1183,9 +1183,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tinyvec"
|
name = "tinyvec"
|
||||||
version = "1.3.1"
|
version = "1.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "848a1e1181b9f6753b5e96a092749e29b11d19ede67dfbbd6c7dc7e0f49b5338"
|
checksum = "5241dd6f21443a3606b432718b166d3cedc962fd4b8bea54a8bc7f514ebda986"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"tinyvec_macros",
|
"tinyvec_macros",
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
use crate::Error;
|
use crate::Error;
|
||||||
use anyhow::bail;
|
use anyhow::bail;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use shared::{CLIENT_DATA_DIR, Cidr, IoErrorContext, Peer, WrappedIoError, chmod, ensure_dirs_exist};
|
use shared::{
|
||||||
|
chmod, ensure_dirs_exist, Cidr, IoErrorContext, Peer, WrappedIoError, CLIENT_DATA_DIR,
|
||||||
|
};
|
||||||
use std::{
|
use std::{
|
||||||
fs::{File, OpenOptions},
|
fs::{File, OpenOptions},
|
||||||
io::{self, Read, Seek, SeekFrom, Write},
|
io::{self, Read, Seek, SeekFrom, Write},
|
||||||
|
|
|
@ -384,7 +384,8 @@ fn install(
|
||||||
interface = iface.to_string().yellow(),
|
interface = iface.to_string().yellow(),
|
||||||
daemon_mode = "innernet up -d --interval 60".yellow());
|
daemon_mode = "innernet up -d --interval 60".yellow());
|
||||||
} else {
|
} else {
|
||||||
eprintdoc!("
|
eprintdoc!(
|
||||||
|
"
|
||||||
It's recommended to now keep the interface automatically refreshing via whatever service
|
It's recommended to now keep the interface automatically refreshing via whatever service
|
||||||
system your distribution provides.
|
system your distribution provides.
|
||||||
|
|
||||||
|
@ -393,7 +394,8 @@ fn install(
|
||||||
{daemon_mode} {interface}
|
{daemon_mode} {interface}
|
||||||
",
|
",
|
||||||
interface = iface.to_string().yellow(),
|
interface = iface.to_string().yellow(),
|
||||||
daemon_mode = "innernet up -d --interval 60".yellow());
|
daemon_mode = "innernet up -d --interval 60".yellow()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,10 @@ impl DatabasePeer {
|
||||||
}
|
}
|
||||||
|
|
||||||
if !cidr.cidr.is_assignable(*ip) {
|
if !cidr.cidr.is_assignable(*ip) {
|
||||||
println!("Peer IP {} is not unicast assignable in CIDR {}", ip, cidr.cidr);
|
println!(
|
||||||
|
"Peer IP {} is not unicast assignable in CIDR {}",
|
||||||
|
ip, cidr.cidr
|
||||||
|
);
|
||||||
return Err(ServerError::InvalidQuery);
|
return Err(ServerError::InvalidQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -191,13 +191,10 @@ impl Server {
|
||||||
} else {
|
} else {
|
||||||
format!("http://{}{}", WG_MANAGE_PEER_IP, path)
|
format!("http://{}{}", WG_MANAGE_PEER_IP, path)
|
||||||
};
|
};
|
||||||
Request::builder()
|
Request::builder().uri(path).method(verb).header(
|
||||||
.uri(path)
|
shared::INNERNET_PUBKEY_HEADER,
|
||||||
.method(verb)
|
HeaderValue::from_str(&self.public_key.to_base64()).unwrap(),
|
||||||
.header(
|
)
|
||||||
shared::INNERNET_PUBKEY_HEADER,
|
|
||||||
HeaderValue::from_str(&self.public_key.to_base64()).unwrap(),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn request(&self, ip_str: &str, verb: &str, path: &str) -> Response<Body> {
|
pub async fn request(&self, ip_str: &str, verb: &str, path: &str) -> Response<Body> {
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
pub use anyhow::Error;
|
pub use anyhow::Error;
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
use std::{fs::{self, File, Permissions}, io, os::unix::fs::PermissionsExt, path::Path, time::Duration};
|
use std::{
|
||||||
|
fs::{self, File, Permissions},
|
||||||
|
io,
|
||||||
|
os::unix::fs::PermissionsExt,
|
||||||
|
path::Path,
|
||||||
|
time::Duration,
|
||||||
|
};
|
||||||
|
|
||||||
pub mod interface_config;
|
pub mod interface_config;
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
|
|
Loading…
Reference in New Issue