Compare commits

...

3 Commits

Author SHA1 Message Date
Jon Häggblad b7f445a330 Delete wireguard feature flag altogether 2023-11-17 09:41:02 +01:00
Jon Häggblad 360c7fda57 Update ci-build 2023-11-17 09:37:21 +01:00
Jon Häggblad 2cbb2d8327 gateway: enable wireguard at runtime 2023-11-17 09:35:23 +01:00
3 changed files with 19 additions and 21 deletions
+6 -7
View File
@@ -75,29 +75,28 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: build
# Enable wireguard by default on linux only
args: --workspace --features wireguard
args: --workspace
- name: Build all examples
if: matrix.os == 'custom-linux'
uses: actions-rs/cargo@v1
with:
command: build
args: --workspace --examples --features wireguard
args: --workspace --examples
- name: Run all tests
if: matrix.os == 'custom-linux'
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --features wireguard
args: --workspace
- name: Run expensive tests
if: (github.ref == 'refs/heads/develop' || github.event.pull_request.base.ref == 'develop' || github.event.pull_request.base.ref == 'master') && matrix.os == 'custom-linux'
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --features wireguard -- --ignored
args: --workspace -- --ignored
- name: Annotate with clippy checks
if: matrix.os == 'custom-linux'
@@ -105,10 +104,10 @@ jobs:
continue-on-error: true
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --features wireguard
args: --workspace
- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --all-targets --features wireguard -- -D warnings
args: --workspace --all-targets -- -D warnings
+1 -4
View File
@@ -76,7 +76,7 @@ nym-statistics-common = { path = "../common/statistics" }
nym-task = { path = "../common/task" }
nym-types = { path = "../common/types" }
nym-validator-client = { path = "../common/client-libs/validator-client" }
nym-wireguard = { path = "../common/wireguard", optional = true }
nym-wireguard = { path = "../common/wireguard" }
nym-ip-packet-router = { path = "../service-providers/ip-packet-router" }
[dev-dependencies]
@@ -92,6 +92,3 @@ sqlx = { version = "0.5", features = [
"macros",
"migrate",
] }
[features]
wireguard = ["nym-wireguard"]
+12 -10
View File
@@ -200,7 +200,6 @@ impl<St> Gateway<St> {
mixnet_handling::Listener::new(listening_address, shutdown).start(connection_handler);
}
#[cfg(feature = "wireguard")]
async fn start_wireguard(
&self,
shutdown: TaskClient,
@@ -520,15 +519,18 @@ impl<St> Gateway<St> {
Arc::new(coconut_verifier),
);
// Once this is a bit more mature, make this a commandline flag instead of a compile time
// flag
#[cfg(feature = "wireguard")]
if let Err(err) = self
.start_wireguard(shutdown.subscribe().named("wireguard"))
.await
{
// that's a nasty workaround, but anyhow errors are generally nicer, especially on exit
bail!("{err}")
// TODO: later we'll make this a commandline flag
let wireguard_enabled = std::env::var("NYM_ENABLE_WIREGUARD")
.map(|v| v == "1")
.unwrap_or(false);
if wireguard_enabled {
if let Err(err) = self
.start_wireguard(shutdown.subscribe().named("wireguard"))
.await
{
// that's a nasty workaround, but anyhow errors are generally nicer, especially on exit
bail!("{err}")
}
}
info!("Finished nym gateway startup procedure - it should now be able to receive mix and client traffic!");