Skip to content

Commit

Permalink
dont show loopback in whois, remove libtor feature from CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sdbondi committed Oct 16, 2024
1 parent ce09dc0 commit 64f960c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env:
PROTOC: protoc
TERM: unknown
## Must be a JSon string
TS_FEATURES: '["default","safe","grpc","ledger","libtor","metrics","miner_input"]'
TS_FEATURES: '["default","safe","grpc","ledger","metrics","miner_input"]'

concurrency:
# https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix
Expand All @@ -32,7 +32,7 @@ concurrency:
jobs:
clippy:
name: clippy
runs-on: [ubuntu-latest]
runs-on: [ ubuntu-latest ]
steps:
- name: checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
machete:
# Checks for unused dependencies.
name: machete
runs-on: [ubuntu-latest]
runs-on: [ ubuntu-latest ]
steps:
- name: checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
# Runs cargo check with stable toolchain to determine whether the codebase is likely to build
# on stable Rust.
name: cargo check with stable
runs-on: [self-hosted, ubuntu-high-cpu]
runs-on: [ self-hosted, ubuntu-high-cpu ]
env:
RUSTUP_PERMIT_COPY_RENAME: true
steps:
Expand Down Expand Up @@ -183,7 +183,7 @@ jobs:

licenses:
name: file licenses
runs-on: [ubuntu-20.04]
runs-on: [ ubuntu-20.04 ]
steps:
- name: checkout
uses: actions/checkout@v4
Expand All @@ -198,7 +198,7 @@ jobs:

test:
name: test
runs-on: [self-hosted, ubuntu-high-cpu]
runs-on: [ self-hosted, ubuntu-high-cpu ]
permissions:
checks: write
pull-requests: write
Expand Down Expand Up @@ -263,7 +263,7 @@ jobs:
# Allows other workflows to know the PR number
artifacts:
name: pr_2_artifact
runs-on: [ubuntu-latest]
runs-on: [ ubuntu-latest ]
steps:
- name: Save the PR number in an artifact
shell: bash
Expand All @@ -280,7 +280,7 @@ jobs:
# needed for test results
event_file:
name: "Upload Event File for Test Results"
runs-on: [ubuntu-latest]
runs-on: [ ubuntu-latest ]
steps:
- name: Upload
uses: actions/upload-artifact@v4
Expand Down
10 changes: 10 additions & 0 deletions applications/minotari_node/src/commands/command/whoami.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use anyhow::Error;
use async_trait::async_trait;
use clap::Parser;
use qrcode::{render::unicode, QrCode};
use tari_network::multiaddr::{Multiaddr, Protocol};

use super::{CommandContext, HandleCommand};

Expand All @@ -49,6 +50,7 @@ impl CommandContext {
peer_info
.listen_addrs
.iter()
.filter(|addr| !is_loopback(addr))
.map(|addr| addr.to_string())
.collect::<Vec<_>>()
.join("::")
Expand All @@ -74,3 +76,11 @@ impl CommandContext {
Ok(())
}
}

fn is_loopback(addr: &Multiaddr) -> bool {
match addr.iter().next() {
Some(Protocol::Ip4(ip)) => ip.is_loopback(),
Some(Protocol::Ip6(ip)) => ip.is_loopback(),
_ => false,
}
}

0 comments on commit 64f960c

Please sign in to comment.