fix nightly build (#304)
* fix nightly build * update toml dep in server for consistency * cargo update * fix clippy errorsreorganize-docker-tests
parent
4fb77f8eda
commit
15602388f6
File diff suppressed because it is too large
Load Diff
13
Cargo.toml
13
Cargo.toml
|
@ -1,8 +1,17 @@
|
||||||
[workspace]
|
[workspace]
|
||||||
members = ["server", "client", "hostsfile", "shared", "publicip", "netlink-request"]
|
resolver = "2"
|
||||||
|
|
||||||
|
members = [
|
||||||
|
"server",
|
||||||
|
"client",
|
||||||
|
"hostsfile",
|
||||||
|
"shared",
|
||||||
|
"publicip",
|
||||||
|
"netlink-request",
|
||||||
|
]
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
opt-level = "s"
|
|
||||||
lto = "fat"
|
lto = "fat"
|
||||||
|
opt-level = "s"
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
|
|
|
@ -29,7 +29,12 @@ clap = { version = "4.3", features = ["derive", "wrap_help"] }
|
||||||
clap_complete = "4.3"
|
clap_complete = "4.3"
|
||||||
colored = "2"
|
colored = "2"
|
||||||
dialoguer = { version = "0.10", default-features = false }
|
dialoguer = { version = "0.10", default-features = false }
|
||||||
hyper = { version = "0.14", default-features = false, features = ["http1", "server", "runtime", "stream"] }
|
hyper = { version = "0.14", default-features = false, features = [
|
||||||
|
"http1",
|
||||||
|
"server",
|
||||||
|
"runtime",
|
||||||
|
"stream",
|
||||||
|
] }
|
||||||
indoc = "2.0.1"
|
indoc = "2.0.1"
|
||||||
ipnet = { version = "2.4", features = ["serde"] }
|
ipnet = { version = "2.4", features = ["serde"] }
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
|
@ -47,7 +52,7 @@ shared = { path = "../shared" }
|
||||||
subtle = "2"
|
subtle = "2"
|
||||||
thiserror = "1"
|
thiserror = "1"
|
||||||
tokio = { version = "1.28.0", features = ["macros", "rt-multi-thread", "time"] }
|
tokio = { version = "1.28.0", features = ["macros", "rt-multi-thread", "time"] }
|
||||||
toml = "0.7.4"
|
toml = "0.8.10"
|
||||||
url = "2"
|
url = "2"
|
||||||
wireguard-control = { path = "../wireguard-control" }
|
wireguard-control = { path = "../wireguard-control" }
|
||||||
|
|
||||||
|
@ -64,18 +69,42 @@ tempfile = "3"
|
||||||
|
|
||||||
[package.metadata.deb]
|
[package.metadata.deb]
|
||||||
assets = [
|
assets = [
|
||||||
["target/release/innernet-server", "usr/bin/", "755"],
|
[
|
||||||
["innernet-server@.service", "usr/lib/systemd/system/", "644"],
|
"target/release/innernet-server",
|
||||||
["../doc/innernet-server.8.gz", "usr/share/man/man8/", "644"],
|
"usr/bin/",
|
||||||
["../doc/innernet-server.completions.zsh", "usr/share/zsh/site-functions/_innernet-server", "644"],
|
"755",
|
||||||
["../doc/innernet-server.completions.bash", "etc/bash_completion.d/innernet-server", "644"],
|
],
|
||||||
["../doc/innernet-server.completions.fish", "usr/share/fish/vendor_completions.d/innernet-server.fish", "644"],
|
[
|
||||||
|
"innernet-server@.service",
|
||||||
|
"usr/lib/systemd/system/",
|
||||||
|
"644",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"../doc/innernet-server.8.gz",
|
||||||
|
"usr/share/man/man8/",
|
||||||
|
"644",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"../doc/innernet-server.completions.zsh",
|
||||||
|
"usr/share/zsh/site-functions/_innernet-server",
|
||||||
|
"644",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"../doc/innernet-server.completions.bash",
|
||||||
|
"etc/bash_completion.d/innernet-server",
|
||||||
|
"644",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"../doc/innernet-server.completions.fish",
|
||||||
|
"usr/share/fish/vendor_completions.d/innernet-server.fish",
|
||||||
|
"644",
|
||||||
|
],
|
||||||
]
|
]
|
||||||
depends = "libc6, libgcc1, libsqlite3-0, zlib1g, systemd"
|
depends = "libc6, libgcc1, libsqlite3-0, zlib1g, systemd"
|
||||||
recommends = "wireguard"
|
|
||||||
maintainer = "tonari <hey@tonari.no>"
|
maintainer = "tonari <hey@tonari.no>"
|
||||||
name = "innernet-server"
|
name = "innernet-server"
|
||||||
priority = "optional"
|
priority = "optional"
|
||||||
|
recommends = "wireguard"
|
||||||
section = "net"
|
section = "net"
|
||||||
|
|
||||||
[package.metadata.rpm]
|
[package.metadata.rpm]
|
||||||
|
@ -86,10 +115,10 @@ buildflags = ["--release"]
|
||||||
|
|
||||||
[package.metadata.rpm.files]
|
[package.metadata.rpm.files]
|
||||||
"../../doc/innernet-server.8.gz" = { path = "/usr/share/man/man8/innernet-server.8.gz" }
|
"../../doc/innernet-server.8.gz" = { path = "/usr/share/man/man8/innernet-server.8.gz" }
|
||||||
"../innernet-server@.service" = { path = "/usr/lib/systemd/system/innernet-server@.service" }
|
|
||||||
"../../doc/innernet-server.completions.bash" = { path = "/etc/bash_completion.d/innernet-server" }
|
"../../doc/innernet-server.completions.bash" = { path = "/etc/bash_completion.d/innernet-server" }
|
||||||
"../../doc/innernet-server.completions.fish" = { path = "/usr/share/fish/vendor_completions.d/innernet-server.fish" }
|
"../../doc/innernet-server.completions.fish" = { path = "/usr/share/fish/vendor_completions.d/innernet-server.fish" }
|
||||||
"../../doc/innernet-server.completions.zsh" = { path = "/usr/share/zsh/site-functions/_innernet-server" }
|
"../../doc/innernet-server.completions.zsh" = { path = "/usr/share/zsh/site-functions/_innernet-server" }
|
||||||
|
"../innernet-server@.service" = { path = "/usr/lib/systemd/system/innernet-server@.service" }
|
||||||
|
|
||||||
[package.metadata.rpm.targets]
|
[package.metadata.rpm.targets]
|
||||||
innernet-server = { path = "/usr/bin/innernet-server" }
|
innernet-server = { path = "/usr/bin/innernet-server" }
|
||||||
|
|
|
@ -25,15 +25,15 @@ once_cell = "1.17.1"
|
||||||
publicip = { path = "../publicip" }
|
publicip = { path = "../publicip" }
|
||||||
regex = "1"
|
regex = "1"
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
toml = "0.7.4"
|
toml = "0.8.10"
|
||||||
url = "2"
|
url = "2"
|
||||||
wireguard-control = { path = "../wireguard-control" }
|
wireguard-control = { path = "../wireguard-control" }
|
||||||
|
|
||||||
[target.'cfg(target_os = "linux")'.dependencies]
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
netlink-sys = "0.8.5"
|
|
||||||
netlink-packet-core = "0.7"
|
netlink-packet-core = "0.7"
|
||||||
netlink-packet-route = "0.17"
|
netlink-packet-route = "0.17"
|
||||||
netlink-request = { path = "../netlink-request" }
|
netlink-request = { path = "../netlink-request" }
|
||||||
|
netlink-sys = "0.8.5"
|
||||||
|
|
||||||
[target.'cfg(target_os = "macos")'.dependencies]
|
[target.'cfg(target_os = "macos")'.dependencies]
|
||||||
nix = "0.26"
|
nix = "0.26"
|
||||||
|
|
|
@ -26,9 +26,11 @@ fn if_nametoindex(interface: &InterfaceName) -> Result<u32, io::Error> {
|
||||||
|
|
||||||
pub fn set_up(interface: &InterfaceName, mtu: u32) -> Result<(), io::Error> {
|
pub fn set_up(interface: &InterfaceName, mtu: u32) -> Result<(), io::Error> {
|
||||||
let index = if_nametoindex(interface)?;
|
let index = if_nametoindex(interface)?;
|
||||||
let mut header = LinkHeader::default();
|
let header = LinkHeader {
|
||||||
header.index = index;
|
index,
|
||||||
header.flags = IFF_UP;
|
flags: IFF_UP,
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
let mut message = LinkMessage::default();
|
let mut message = LinkMessage::default();
|
||||||
message.header = header;
|
message.header = header;
|
||||||
message.nlas = vec![link::nlas::Nla::Mtu(mtu)];
|
message.nlas = vec![link::nlas::Nla::Mtu(mtu)];
|
||||||
|
@ -55,11 +57,13 @@ pub fn set_addr(interface: &InterfaceName, addr: IpNet) -> Result<(), io::Error>
|
||||||
vec![address::Nla::Address(network.addr().octets().to_vec())],
|
vec![address::Nla::Address(network.addr().octets().to_vec())],
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
let mut header = AddressHeader::default();
|
let header = AddressHeader {
|
||||||
header.index = index;
|
index,
|
||||||
header.family = family;
|
family,
|
||||||
header.prefix_len = addr.prefix_len();
|
prefix_len: addr.prefix_len(),
|
||||||
header.scope = RT_SCOPE_UNIVERSE;
|
scope: RT_SCOPE_UNIVERSE,
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
|
||||||
let mut message = AddressMessage::default();
|
let mut message = AddressMessage::default();
|
||||||
message.header = header;
|
message.header = header;
|
||||||
|
@ -78,13 +82,15 @@ pub fn add_route(interface: &InterfaceName, cidr: IpNet) -> Result<bool, io::Err
|
||||||
IpNet::V4(network) => (AF_INET as u8, network.network().octets().to_vec()),
|
IpNet::V4(network) => (AF_INET as u8, network.network().octets().to_vec()),
|
||||||
IpNet::V6(network) => (AF_INET6 as u8, network.network().octets().to_vec()),
|
IpNet::V6(network) => (AF_INET6 as u8, network.network().octets().to_vec()),
|
||||||
};
|
};
|
||||||
let mut header = RouteHeader::default();
|
let header = RouteHeader {
|
||||||
header.table = RT_TABLE_MAIN;
|
table: RT_TABLE_MAIN,
|
||||||
header.protocol = RTPROT_BOOT;
|
protocol: RTPROT_BOOT,
|
||||||
header.scope = RT_SCOPE_LINK;
|
scope: RT_SCOPE_LINK,
|
||||||
header.kind = RTN_UNICAST;
|
kind: RTN_UNICAST,
|
||||||
header.destination_prefix_length = cidr.prefix_len();
|
destination_prefix_length: cidr.prefix_len(),
|
||||||
header.address_family = address_family;
|
address_family,
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
let mut message = RouteMessage::default();
|
let mut message = RouteMessage::default();
|
||||||
message.header = header;
|
message.header = header;
|
||||||
message.nlas = vec![route::Nla::Destination(dst), route::Nla::Oif(if_index)];
|
message.nlas = vec![route::Nla::Destination(dst), route::Nla::Oif(if_index)];
|
||||||
|
|
|
@ -15,13 +15,13 @@ hex = "0.4.3"
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
rand_core = { version = "0.6", features = ["getrandom"] }
|
rand_core = { version = "0.6", features = ["getrandom"] }
|
||||||
x25519-dalek = { version = "=2.0.0-rc.3", features = ["static_secrets"] }
|
x25519-dalek = { version = "2.0.1", features = ["static_secrets"] }
|
||||||
|
|
||||||
[target.'cfg(target_os = "linux")'.dependencies]
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
netlink-request = { path = "../netlink-request" }
|
|
||||||
netlink-sys = "0.8"
|
|
||||||
netlink-packet-core = "0.7"
|
netlink-packet-core = "0.7"
|
||||||
netlink-packet-generic = "0.3.3"
|
netlink-packet-generic = "0.3.3"
|
||||||
netlink-packet-route = "0.17"
|
netlink-packet-route = "0.17"
|
||||||
netlink-packet-utils = "0.5.2"
|
netlink-packet-utils = "0.5.2"
|
||||||
netlink-packet-wireguard = "0.2.3"
|
netlink-packet-wireguard = "0.2.3"
|
||||||
|
netlink-request = { path = "../netlink-request" }
|
||||||
|
netlink-sys = "0.8"
|
||||||
|
|
Loading…
Reference in New Issue