-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from NordSecurity/neptun_renaming
Rename BoringTun to NepTUN
- Loading branch information
Showing
44 changed files
with
167 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Contributing | ||
We happily accept both issues and pull requests for bug reports, bug fixes, feature requests, features implementations and documentation improvements. | ||
|
||
For new features we recommend that you create an issue first so the feature can be discussed and to prevent unnecessary work in case it's not a feature we want to support. Although, we do realize that sometimes code needs to be in place to allow for a meaningful discussion so creating an issue upfront is not a requirement. | ||
|
||
## Building and testing | ||
The steps for how to build and test NepTUN are described in the [README](README.md) | ||
|
||
## PR workflow | ||
We want to get your changes merged as fast as possible, and we know you want that too. To help with this there are a few things you can do to speed up the process: | ||
|
||
### Build, test and lint locally | ||
The local feedback cycle is faster than waiting for the CI. Make sure your changes can be built locally and that tests, rustfmt and clippy all pass locally. A green CI is a happy CI. | ||
|
||
### PR Hygiene | ||
On top of the CI being green, every PR will go through code review, and you can help us speed up the review process by making your PR easier to review. Here are some guidelines: | ||
|
||
**Small PRs are easier to review than big PRs**, so try to keep your PRs small and focused. To achieve that, try to make sure you PR doesn't contain multiple unrelated changes and if you are doing some bigger feature work, try to split the work into multiple smaller PRs that solve the problem together. | ||
|
||
**A clean history can make things easier**. Some PRs are easier to review commit-by-commit, rather than looking at the full changelist in one go. To enable that, prefer `rebase` over `merge` when updating your branch. Keeping PRs small and short-lived will also help keep your history clean since there's less time for upstream to change that much. | ||
|
||
## Licensing | ||
NepTUN is released under 3-Clause BSD License. For more details please refer to [LICENSE.md](LICENSE.md). | ||
|
||
## Contributing Documents | ||
Before we can accept your pull request we may need you to submit documents (e.g., DCO, CLA) that either be provided automatically or manually by us. | ||
In any case, we will guide you through and provide you with the support, if needed. | ||
|
||
## Code of conduct | ||
Nord Security and all of it's projects adhere to the [Contributor Covenant Code of Conduct](https://github.com/NordSecurity/.github/blob/master/CODE_OF_CONDUCT.md). When participating, you are expected to honor this code. | ||
|
||
## Thank you! |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
[package] | ||
name = "boringtun-cli" | ||
name = "neptun-cli" | ||
description = "an implementation of the WireGuard® protocol designed for portability and speed" | ||
version = "0.6.0" | ||
authors = ["Noah Kennedy <[email protected]>", "Andy Grover <[email protected]>", "Jeff Hiner <[email protected]>"] | ||
license = "BSD-3-Clause" | ||
repository = "https://github.com/cloudflare/boringtun" | ||
documentation = "https://docs.rs/boringtun/0.5.2/boringtun/" | ||
repository = "https://github.com/nordsecurity/neptun" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
|
@@ -15,7 +14,7 @@ tracing = "0.1.31" | |
tracing-subscriber = "0.3.18" | ||
tracing-appender = "0.2.1" | ||
|
||
[dependencies.boringtun] | ||
[dependencies.neptun] | ||
version = "0.6.0" | ||
path = "../boringtun" | ||
path = "../neptun" | ||
features = ["device"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
// Copyright (c) 2019 Cloudflare, Inc. All rights reserved. | ||
// Copyright (c) 2024 Nord Security. All rights reserved. | ||
// Copyright (c) 2019-2024 Cloudflare, Inc. All rights reserved. | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
|
||
use boringtun::device::drop_privileges::drop_privileges; | ||
use boringtun::device::{DeviceConfig, DeviceHandle}; | ||
use clap::{value_parser, Arg, Command}; | ||
use daemonize::{Daemonize, Outcome, Parent}; | ||
use neptun::device::drop_privileges::drop_privileges; | ||
use neptun::device::{DeviceConfig, DeviceHandle}; | ||
use std::fs::File; | ||
use std::os::unix::net::UnixDatagram; | ||
use std::path::PathBuf; | ||
|
@@ -15,7 +16,7 @@ use tracing::Level; | |
fn check_tun_name(name: &str) -> Result<String, String> { | ||
#[cfg(any(target_os = "macos", target_os = "ios"))] | ||
{ | ||
if boringtun::device::tun::parse_utun_name(name).is_ok() { | ||
if neptun::device::tun::parse_utun_name(name).is_ok() { | ||
Ok(name.to_owned()) | ||
} else { | ||
Err("Tunnel name must have the format 'utun[0-9]+', use 'utun' for automatic assignment".to_owned()) | ||
|
@@ -28,7 +29,7 @@ fn check_tun_name(name: &str) -> Result<String, String> { | |
} | ||
|
||
fn main() { | ||
let matches = Command::new("boringtun") | ||
let matches = Command::new("neptun") | ||
.version(env!("CARGO_PKG_VERSION")) | ||
.author("Vlad Krasnov <[email protected]>") | ||
.args(&[ | ||
|
@@ -77,7 +78,7 @@ fn main() { | |
.env("WG_LOG_FILE") | ||
.value_parser(value_parser!(PathBuf)) | ||
.help("Log file") | ||
.default_value("/tmp/boringtun.out"), | ||
.default_value("/tmp/neptun.out"), | ||
Arg::new("disable-drop-privileges") | ||
.long("disable-drop-privileges") | ||
.env("WG_SUDO") | ||
|
@@ -136,18 +137,18 @@ fn main() { | |
})) => { | ||
let mut b = [0u8; 1]; | ||
if sock2.recv(&mut b).is_ok() && b[0] == 1 { | ||
println!("BoringTun started successfully"); | ||
println!("NepTUN started successfully"); | ||
exit(first_child_exit_code) | ||
} else { | ||
eprintln!("BoringTun failed to start"); | ||
eprintln!("NepTUN failed to start"); | ||
exit(1); | ||
}; | ||
} | ||
Outcome::Parent(Err(err)) => { | ||
eprintln!("Failed to fork process: {err}"); | ||
exit(1); | ||
} | ||
Outcome::Child(Ok(_)) => tracing::info!("BoringTun started successfully"), | ||
Outcome::Child(Ok(_)) => tracing::info!("NepTUN started successfully"), | ||
Outcome::Child(Err(err)) => { | ||
tracing::error!(error = ?err); | ||
exit(1); | ||
|
@@ -168,7 +169,7 @@ fn main() { | |
#[cfg(target_os = "linux")] | ||
use_multi_queue: !matches.get_flag("disable-multi-queue"), | ||
open_uapi_socket: false, | ||
protect: Arc::new(boringtun::device::MakeExternalBoringtunNoop), | ||
protect: Arc::new(neptun::device::MakeExternalNeptunNoop), | ||
firewall_process_inbound_callback: None, | ||
firewall_process_outbound_callback: None, | ||
}; | ||
|
@@ -195,7 +196,7 @@ fn main() { | |
sock1.send(&[1]).unwrap(); | ||
drop(sock1); | ||
|
||
tracing::info!("BoringTun started successfully"); | ||
tracing::info!("NepTUN started successfully"); | ||
|
||
device_handle.wait(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[package] | ||
name = "boringtun" | ||
name = "neptun" | ||
description = "an implementation of the WireGuard® protocol designed for portability and speed" | ||
version = "0.6.0" | ||
authors = [ | ||
|
@@ -8,7 +8,6 @@ authors = [ | |
"Jeff Hiner <[email protected]>", | ||
] | ||
license = "BSD-3-Clause" | ||
documentation = "https://docs.rs/boringtun/0.5.2/boringtun/" | ||
edition = "2018" | ||
|
||
[features] | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.