Skip to content

Commit 303dce9

Browse files
cleanup: remove mentions of stun
1 parent 8bc75e8 commit 303dce9

21 files changed

Lines changed: 54 additions & 106 deletions

File tree

docker/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM rust:alpine AS chef
22

33
RUN update-ca-certificates
44
RUN apk add --no-cache musl-dev openssl-dev pkgconfig
5-
RUN cargo install cargo-chef
5+
RUN cargo install cargo-chef
66
WORKDIR /iroh
77

88
FROM chef AS planner
@@ -40,7 +40,7 @@ RUN chmod +x /iroh-relay
4040
WORKDIR /
4141

4242
# expose the default ports
43-
# http, https, stun, metrics
43+
# http, https, metrics
4444
EXPOSE 80 443 3478/udp 9090
4545
ENTRYPOINT ["/iroh-relay"]
4646
CMD [""]
@@ -62,4 +62,4 @@ WORKDIR /
6262
# dns, metrics
6363
EXPOSE 53/udp 9090
6464
ENTRYPOINT ["/iroh-dns-server"]
65-
CMD [""]
65+
CMD [""]

iroh-relay/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ relays, including:
1515
- Relay Protocol: The protocol used to communicate between relay servers and
1616
clients
1717
- Relay Server: A fully-fledged iroh-relay server over HTTP or HTTPS.
18-
Optionally will also expose a stun endpoint and metrics.
18+
Optionally will also expose a QAD endpoint and metrics.
1919
- Relay Client: A client for establishing connections to the relay.
2020
- Server Binary: A CLI for running your own relay server. It can be configured
21-
to also offer STUN support and expose metrics.
21+
to also expose metrics.
2222

2323

2424
Used in [iroh], created with love by the [n0 team](https://n0.computer/).

iroh-relay/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
doc = "- `server`: A fully-fledged iroh-relay server over HTTP or HTTPS."
2121
)]
2222
//!
23-
//! Optionally will also expose a stun endpoint and metrics. (requires the feature flag `server`)
23+
//! Optionally will also expose a QAD endpoint and metrics. (requires the feature flag `server`)
2424
//! - [`client`]: A client for establishing connections to the relay.
2525
//! - *Server Binary*: A CLI for running your own relay server. It can be configured to also offer
26-
//! STUN support and expose metrics.
26+
//! QAD support and expose metrics.
2727
// Based on tailscale/derp/derp.go
2828

2929
#![cfg_attr(iroh_docsrs, feature(doc_auto_cfg))]

iroh-relay/src/relay_map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl FromIterator<RelayNode> for RelayMap {
6868
impl From<RelayUrl> for RelayMap {
6969
/// Creates a [`RelayMap`] from a [`RelayUrl`].
7070
///
71-
/// The [`RelayNode`]s in the [`RelayMap`] will have the default STUN and QUIC address
71+
/// The [`RelayNode`]s in the [`RelayMap`] will have the default QUIC address
7272
/// discovery ports.
7373
fn from(value: RelayUrl) -> Self {
7474
Self {
@@ -88,7 +88,7 @@ impl From<RelayNode> for RelayMap {
8888
impl FromIterator<RelayUrl> for RelayMap {
8989
/// Creates a [`RelayMap`] from an iterator of [`RelayUrl`].
9090
///
91-
/// The [`RelayNode`]s in the [`RelayMap`] will have the default STUN and QUIC address
91+
/// The [`RelayNode`]s in the [`RelayMap`] will have the default QUIC address
9292
/// discovery ports.
9393
fn from_iter<T: IntoIterator<Item = RelayUrl>>(iter: T) -> Self {
9494
Self {

iroh-relay/src/server.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub(crate) mod streams;
5252
pub mod testing;
5353

5454
pub use self::{
55-
metrics::{Metrics, RelayMetrics, StunMetrics},
55+
metrics::{Metrics, RelayMetrics},
5656
resolver::{ReloadingResolver, DEFAULT_CERT_RELOAD_INTERVAL},
5757
};
5858

@@ -67,8 +67,14 @@ const INDEX: &[u8] = br#"<html><body>
6767
</p>
6868
"#;
6969
const TLS_HEADERS: [(&str, &str); 2] = [
70-
("Strict-Transport-Security", "max-age=63072000; includeSubDomains"),
71-
("Content-Security-Policy", "default-src 'none'; frame-ancestors 'none'; form-action 'none'; base-uri 'self'; block-all-mixed-content; plugin-types 'none'")
70+
(
71+
"Strict-Transport-Security",
72+
"max-age=63072000; includeSubDomains",
73+
),
74+
(
75+
"Content-Security-Policy",
76+
"default-src 'none'; frame-ancestors 'none'; form-action 'none'; base-uri 'self'; block-all-mixed-content; plugin-types 'none'",
77+
),
7278
];
7379

7480
type BytesBody = http_body_util::Full<hyper::body::Bytes>;
@@ -228,9 +234,9 @@ pub enum CertConfig<EC: fmt::Debug, EA: fmt::Debug = EC> {
228234
Reloading,
229235
}
230236

231-
/// A running Relay + STUN server.
237+
/// A running Relay + QAD server.
232238
///
233-
/// This is a full Relay server, including STUN, Relay and various associated HTTP services.
239+
/// This is a full Relay server, including QAD, Relay and various associated HTTP services.
234240
///
235241
/// Dropping this will stop the server.
236242
#[derive(Debug)]
@@ -270,9 +276,7 @@ pub struct Server {
270276
pub enum SpawnError {
271277
#[snafu(display("Unable to get local address"))]
272278
LocalAddr { source: std::io::Error },
273-
#[snafu(display("Failed to bind STUN listener"))]
274-
UdpSocketBind { source: std::io::Error },
275-
#[snafu(display("Failed to bind STUN listener"))]
279+
#[snafu(display("Failed to bind QAD listener"))]
276280
QuicSpawn { source: QuicSpawnError },
277281
#[snafu(display("Failed to parse TLS header"))]
278282
TlsHeaderParse { source: InvalidHeaderValue },

iroh-relay/src/server/metrics.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -84,28 +84,10 @@ pub struct Metrics {
8484
// pub average_queue_duration:
8585
}
8686

87-
/// Metrics tracked for the STUN server.
88-
#[derive(Debug, Default, MetricsGroup)]
89-
#[metrics(name = "stun")]
90-
pub struct StunMetrics {
91-
/// Number of STUN requests made to the server.
92-
pub requests: Counter,
93-
/// Number of successful ipv4 STUN requests served.
94-
pub ipv4_success: Counter,
95-
/// Number of successful ipv6 STUN requests served.
96-
pub ipv6_success: Counter,
97-
/// Number of bad requests made to the STUN endpoint.
98-
pub bad_requests: Counter,
99-
/// Number of STUN requests that end in failure.
100-
pub failures: Counter,
101-
}
102-
10387
/// All metrics tracked in the relay server.
10488
#[derive(Debug, Default, Clone, MetricsGroupSet)]
10589
#[metrics(name = "relay")]
10690
pub struct RelayMetrics {
107-
/// Metrics tracked for the STUN server.
108-
pub stun: Arc<StunMetrics>,
10991
/// Metrics tracked for the relay server.
11092
pub server: Arc<Metrics>,
11193
}

iroh/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Iroh is a library to establish direct connectivity between peers.
44
It's built on peer-to-peer [QUIC](https://en.wikipedia.org/wiki/QUIC) using both relays and holepunching.
55
The main structure for connection is the `Endpoint` entrypoint.
66

7-
Peer to peer connectivity is established with the help of a _relay server_. The relay server provides Session Traversal Utilities for NAT [(STUN)](https://en.wikipedia.org/wiki/STUN) for the peers. If no direct connection can be established, the connection is relayed via the server.
7+
Peer to peer connectivity is established with the help of a _relay server_. The relay server provides QUIC NAT traversal (QAD) for the peers. If no direct connection can be established, the connection is relayed via the server.
88

9-
Peers must know and do verify the PeerID of each other before they can connect. When using a relay server to aid the connection establishment they will register with a home relay server using their PublicKey. Other peers which can not establish a direct connection can then establish connection via this relay server. This will try to assist establishing a direct connection using STUN and holepunching but continue relaying if not possible.
9+
Peers must know and do verify the PeerID of each other before they can connect. When using a relay server to aid the connection establishment they will register with a home relay server using their PublicKey. Other peers which can not establish a direct connection can then establish connection via this relay server. This will try to assist establishing a direct connection using QAD and holepunching but continue relaying if not possible.
1010

1111
Peers can also connect directly without using a relay server. For this, however the listening peer must be directly reachable by the connecting peer via one of it's addresses.
1212

iroh/bench/src/bin/bulk.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ pub fn run_iroh(opt: Opt) -> Result<()> {
9595
#[cfg(feature = "local-relay")]
9696
if let Some(relay_server) = relay_server.as_ref() {
9797
collect_and_print("RelayServerMetrics", &*relay_server.metrics().server);
98-
collect_and_print("RelayStunMetrics", &*relay_server.metrics().stun);
9998
}
10099
}
101100

iroh/docs/local_relay_node.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ To connect to this iroh-relay when doing your normal iroh commands, adjust the i
1616
# iroh.config.toml:
1717
[[relay_nodes]]
1818
url = "http://localhost:3340"
19-
stun_only = false
20-
stun_port = 3478
2119
```
2220

2321
If you want to give a specific port for the iroh-relay to bind to, you can create a iroh-relay config file and pass that file in using the `--config_path` flag. You need to retain a `secret_key`, so it is recommended to run `iroh-relay --config-path [PATH]` once to generate a secret key and save it to the config file before doing further edits to the file.
@@ -29,13 +27,10 @@ To change the port you want to listen on, change the port in the `addr` field:
2927
3028
secret_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
3129
addr = "[::]:12345"
32-
stun_port = 3478
3330
hostname = "my.relay.network"
34-
enable_stun = true
3531
enable_relay = true
3632
```
3733

3834
Check [the iroh-relay file's](../src/bin/iroh-relay.rs) `Config` struct for documentation on each configuration field.
3935

4036
If you change the local iroh-relay server's configuration, however, be sure to adjust the associated fields in your iroh config as well.
41-

iroh/docs/relay_nodes.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ RelayNode {
1414
url: format!("https://derp.iroh.network")
1515
.parse()
1616
.unwrap(),
17-
stun_only: false,
18-
stun_port: 3478,
1917
}
2018
```
2119

@@ -26,7 +24,5 @@ RelayNode {
2624
url: format!("https://eu1.derp.iroh.network")
2725
.parse()
2826
.unwrap(),
29-
stun_only: false,
30-
stun_port: 3478,
3127
}
3228
```

0 commit comments

Comments
 (0)