Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(iroh-net)!: Move relay implemention in iroh-net behind iroh-relay cfg flag #2516

Merged
merged 4 commits into from
Jul 17, 2024

Conversation

matheus23
Copy link
Contributor

@matheus23 matheus23 commented Jul 16, 2024

Description

We had an iroh-relay cfg flag, but it was unused.

Enabling it is useful for working towards building iroh-net for Wasm (we won't be able to compile the server bits to Wasm, sorry 😛 )

This moves the axum and tokio-rustls-acme dependencies behind that feature flag as well as the modules iroh_net::relay::http::server and iroh_net::relay::iroh_relay.

I also had to move the relay::http::server::Protocol one module up.

Breaking Changes

  • iroh-relay implementation-specific features are now behind an iroh-relay feature flag in iroh-net.

Notes & open questions

LMK!

Change checklist

  • Self-review.
  • [ ] Documentation updates following the style guide, if relevant.
  • [ ] Tests if relevant. I ran cargo test -p iroh-net. That enables the iroh-relay feature and runs successfully.
  • All breaking changes documented.

@matheus23 matheus23 self-assigned this Jul 16, 2024
iroh-net/Cargo.toml Outdated Show resolved Hide resolved
iroh-net/src/relay/http.rs Outdated Show resolved Hide resolved
iroh-net/src/relay/http/server.rs Outdated Show resolved Hide resolved
matheus23 and others added 3 commits July 17, 2024 10:41
Co-authored-by: Floris Bruynooghe <flub@n0.computer>
Co-authored-by: Floris Bruynooghe <flub@n0.computer>
@matheus23 matheus23 enabled auto-merge July 17, 2024 08:43
@matheus23 matheus23 added this pull request to the merge queue Jul 17, 2024
Merged via the queue into main with commit f37d9f9 Jul 17, 2024
26 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Jul 31, 2024
… flag (#2566)

## Description

<!-- A summary of what this pull request achieves and a rough list of
changes. -->

This moves more relay server code behind the `iroh-relay` feature flag.

This is a continuation of #2516 

Unfortunately I didn't quite catch "all server things".

I'm fairly confident I do have all covered now, because this is
extracted from a branch where server-side code wouldn't compile (to
Wasm).

Also:
- Makes use of `MaybeTlsStream` instead of the `MaybeTlsStreamServer`
alias. Using the original definition instead of the alias confuses
rust-analyzer a lot less. And the aliasing back-and-forth was silly.

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->
None

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## 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.
- ~~[ ] Tests if relevant.~~
- [x] All breaking changes documented.
matheus23 added a commit that referenced this pull request Nov 14, 2024
…oh-relay` cfg flag (#2516)

## Description

We had an `iroh-relay` cfg flag, but it was unused.

Enabling it is useful for working towards building iroh-net for Wasm (we
won't be able to compile the server bits to Wasm, sorry
:stuck_out_tongue: )

This moves the `axum` and `tokio-rustls-acme` dependencies behind that
feature flag as well as the modules `iroh_net::relay::http::server` and
`iroh_net::relay::iroh_relay`.

I also had to move the `relay::http::server::Protocol` one module up.

## Breaking Changes

- iroh-relay *implementation*-specific features are now behind an
`iroh-relay` feature flag in iroh-net.

## Notes & open questions

LMK!

## Change checklist

- [X] Self-review.
- ~~[ ] 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.~~
- ~~[ ] Tests if relevant.~~ I ran `cargo test -p iroh-net`. That
enables the `iroh-relay` feature and runs successfully.
- [X] All breaking changes documented.

---------

Co-authored-by: Floris Bruynooghe <flub@n0.computer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants