## Description
I ran tests that check for holepunching with one interface working for
holepunching among 16 configured interfaces in a loop 300 times, and
they didn't fail once. We should probably expect this to not regress or
be flaky.
Also added a version of these tests with 32 interfaces. These tests
consistently fail, so they're behind an `#[ignore]` annotation for now.
## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
---------
Co-authored-by: Franz Heinzmann <frando@unbiskant.org>
## Description
This simply fixes the docs to fix#4350.
## Breaking Changes
n/a
## Notes & open questions
The values and interactions of these keep alive and idle timers are
still a bit messy. They need to be cleaned up in noq first though. But
we're also limited now that everything is 1.0.
## Change checklist
- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
The reaper now holds a Weak reference to the pool and exits once the pool
is dropped, instead of holding the connections alive behind an
AbortOnDropHandle. Dropping the pool (e.g. when a network change rebuilds
the resolver) now closes its idle sockets immediately rather than waiting
for the task abort to propagate, and there is no join handle to store.
Plain-TCP and DNS-over-TLS queries previously opened a fresh connection
every time, paying the TCP (and for DoT, TLS) handshake on each lookup.
Add a small per-nameserver connection pool that checks a connection out
for exclusive use and returns it on success, so the handshake is
amortized across repeated queries to the same server.
Idle connections are dropped on checkout once older than IDLE_TIMEOUT and
capped per nameserver; a background task sweeps connections that no
checkout touches, so a nameserver queried once does not pin a socket open.
UDP stays unpooled (a fresh source port per query helps prevent cache
poisoning) and DoH reuses connections inside reqwest already.
A major network change rebuilds the resolver via `reset()` to pick up new
nameservers. It used to start with an empty cache, so lookups went cold
exactly during the transition (e.g. WiFi to 5G) and reconnects stranded
while DNS was still in flux. Make `DnsCache` Arc-backed and carry it into
the rebuilt resolver, so cached records keep serving until the new
nameservers settle.
Closes#4037
## Description
Uses https://github.com/taiki-e/install-action/ instead of binstall
directly. This also passes `--force` which hopefully fixes the
occasional failures we had with binstall apparently not installing for
real.
## Description
- Add a type.
- Skip the redundant "bug: " prefix in the description.
- Ask for trace logs instead of debug.
- Remove the default.md because github already offers the "empty" one
which is the same and is a bit confusing right.
## Breaking Changes
n/a
## Notes & open questions
n/a
## Change checklist
- [x] Self-review.
## Description
The `unstable-custom-transport` feature enables custom transport and
custom path selection. For the latter, we were missing an export of
`FourTuple` used in the then-public `PathSelector` trait.
Also adds a warning that these APIs are unstable.
## Notes & open questions
<!-- Any notes, remarks or open questions you have to make about the PR.
-->
## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.
## Description
We have a `doc_hidden` functions `Endpoint::net_report` and
`Endpoint::last_net_report`. This PR put `iroh::Endpoint::net_report`
behind a new feature `unstable-net-report` instead, together with the
items exposed via these functions (i.e. `NetReport` and contained
items).
Also marked the `NetReport` and `Probe` items as `non_exhaustive`, and
removes `iroh::Endpoint::last_net_report` to keep the unstable API
surface small (you can just call `Endpoint::net_report().get()` to get
the latest net report).
## Breaking Changes
None, because we don't consider the previous `doc(hidden)` API as public
API.
Listing the changes nevertheless here (but not marking the PR as
breaking):
* changed: `iroh::Endpoint::net_report` is now gated behind
`unstable-net-report` feature
* removed: `iroh::Endpoint::last_net_report`. Use
`iroh::Endpoint::net_report().get()` instead.
* removed: `iroh::NetReport`. it is now available only with the
`unstable-net-report` feature under
`iroh::unstable_net_report::NetReport`
## Notes & open questions
<!-- Any notes, remarks or open questions you have to make about the PR.
-->
## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] All breaking changes documented.
## Description
This allows to set `hostname = ["relay.foo.org", "relay.bar.org"]` in
the iroh-relay TOML config.
Setting a single string like previously, `hostname = "relay.foo.org"` ,
is still accepted as well, so this is not a breaking change to config
formats.
It also adds enviroment variables to override the ACME directory URL to
allow using the ACME adaptor with other servers than letsencrypt.
Finally, this adds a test script that tests the setup with a
locally-running `pebble` ACME server. I confirmed locally that it works.
Not sure if we want to run it in CI as well.
## Breaking Changes
<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->
## Notes & open questions
<!-- Any notes, remarks or open questions you have to make about the PR.
-->
## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
On a fresh resolver, fallback nameservers are queried in list order, and the DoH entries sat behind all twelve UDP servers. On a network that silently drops UDP/53 the lookup timed out before DoH was ever tried -- the exact case it exists for.
Move the DoH entries just after the two fastest UDP primaries so they land within the happy-eyeballs first wave (MAX_CONCURRENT_QUERIES). On a working network UDP still answers before the staggered DoH attempts start, so no TLS handshake is wasted; when port 53 is blocked DoH is raced immediately. A test pins a DoH entry within the first wave.
Narrow items that are only reachable within their own module to private: the internal Nameserver type (and its fields and constructor), DnsConfig::from_nameservers, attrs::endpoint_id_from_txt_name, and TxtAttrs::from_strings.
Carry an optional TLS server name per nameserver internally, so DNS-over-TLS and DNS-over-HTTPS can be configured against providers whose certificates cover a hostname rather than the IP.
Add Builder::with_tls_nameserver and Builder::with_https_nameserver; the existing tuple-based with_nameserver/with_nameservers and the DnsProtocol enum are unchanged, so the change is additive. DoT uses the name for SNI; DoH addresses the URL by hostname with the connection pinned to the configured IP via reqwest, avoiding a bootstrap resolution loop.
Confirmed via the live certificates that Cloudflare, Google and Quad9 all carry their anycast IPs as iPAddress SANs, so IP-addressed DNS-over-HTTPS validates for every fallback entry.
Order nameservers by smoothed RTT relative to a neutral baseline so a measured-fast server stays ahead of an idle or recovering one, instead of unprobed or decayed servers sorting as fastest.
Verify the host and query type on a DNS cache hit, so a 64-bit key collision returns a miss rather than another name's records.
Fall back to public resolvers only when neither the system nor the builder provides a nameserver, so explicit servers are no longer mixed behind the fallback set; drop the now-redundant system_with_fallback. Correct the DoH-by-IP certificate comment.
Replace the fixed-stagger fan-out in send_query with a bounded happy-eyeballs loop: try the historically fastest nameserver first, start the next after a short delay or as soon as the in-flight one fails, and cap concurrency so a long nameserver list no longer blasts every server.
Track a per-nameserver smoothed RTT (EWMA on success, penalty on failure, read-time decay) to order servers and re-probe demoted ones, so the list is self-healing.
Expand the fallback to Cloudflare, Google and Quad9 over UDP (v4 and v6, primary and secondary) plus DNS-over-HTTPS when a crypto provider is available, so resolution still works when one provider is down or plain DNS is blocked.
Refactor the system config type to DnsConfig with system, fallback, from_nameservers and system_with_fallback constructors.
Move the per-platform system DNS readers into unix, windows and android submodules under dns::system_config, each exposing read_system_dns().
Android no longer forwards to hickory_resolver: its JNI reader, which reads the active network's DNS servers from LinkProperties.getDnsServers(), is inlined and adapted to return SystemDnsConfig. install_android_jni_context moves alongside it and is re-exported at the crate root unchanged.
Add jni (android) and ipconfig (windows) as platform dependencies.
## Description
The [README of the iroh
crate](https://github.com/n0-computer/iroh/tree/main/iroh) is the first
thing people see on https://crates.io/crates/iroh or
https://lib.rs/iroh, and we should improve it.
Right now it mostly talks about structured events, which is a very minor
thing in the grand scheme of things. And it has no code example.
This PR improves the README. Happy to discuss or iterate.
## Description
Updates to the latest noq main, especially due to this bug fix:
https://github.com/n0-computer/noq/pull/695
That fix makes `switch_client_dual_to_v4` non-flaky.
## Breaking Changes
None
## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
## Description
This is a cleanup pass over all docs of public items. Fixes typos, odd
grammar, non-adherence to doc guidelines, and other minor things.
## Description
This PR adds a new `AccessConfig::SharedToken(Vec<String>)` variant to
the `iroh-relay` configuration,
allowing self-hosted relays to require a shared bearer token from
connecting
clients, without using an external auth service.
- Clients authenticate via `Authorization: Bearer <token>` header or
`?token=` query param,
using the existing `RelayConfig::with_auth_token()` /
`RelayMap::with_auth_token()` API;
- Token can be set via config file (`access.shared_token = ["token-a",
"token-b"]`) or the
`IROH_RELAY_ACCESS_TOKEN` environment variable (**the env var takes
precedence**);
- Empty token is rejected at startup;
- A token set to the empty string, will make the server fail to start.
[See related
discussion](https://github.com/n0-computer/iroh/discussions/4316)
## Breaking Changes
None.
## Notes & open questions
- As we stated in the discussion, using an external service should
always be considered the best choice for production. The static token
variant is still useful for simpler deployments.
- Supported the token list in config, as suggested by fokx
## Change checklist
- [x] Self-review
- [x] Documentation updates
- [x] Tests
Co-authored-by: fokx <36614441+fokx@users.noreply.github.com>
---------
Co-authored-by: Franz Heinzmann <frando@unbiskant.org>
## Description
This test is flaky because QAD fails to establish a connection within
3s due to the packet loss. At that point there's not relay server
until at least the next net-report which only runs after about 30s.
The right fix for this is for net-report to be more streaming instead
of running on a schedule. So iroh can respond to events from changed
network conditions properly.
## Breaking Changes
n/a
## Notes & open questions
See #4321 to track this.
## Change checklist
- [x] Self-review.
---------
Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>