Files
firezone/rust/relay
dependabot[bot] 5d246d65ff build(deps): Bump redis from 0.24.0 to 0.25.0 in /rust (#4073)
Bumps [redis](https://github.com/redis-rs/redis-rs) from 0.24.0 to
0.25.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/redis-rs/redis-rs/releases">redis's
releases</a>.</em></p>
<blockquote>
<h2>v0.25.0</h2>
<h3>0.25.0 (2024-03-08)</h3>
<h4>Features</h4>
<ul>
<li><strong>Breaking change</strong>: Add connection timeout to the
cluster client (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/834">#834</a>)</li>
<li><strong>Breaking change</strong>: Deprecate aio::Connection (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/889">#889</a>)</li>
<li>Cluster: fix read from replica &amp; missing slots (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/965">#965</a>)</li>
<li>Async cluster connection: Improve handling of missing connections
(<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/968">#968</a>)</li>
<li>Add support for parsing to/from any sized arrays (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/981">#981</a>)</li>
<li>Upgrade to rustls 0.22 (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1000">#1000</a>
<a href="https://github.com/djc"><code>@​djc</code></a>)</li>
<li>add SMISMEMBER command (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1002">#1002</a>
<a href="https://github.com/Zacaria"><code>@​Zacaria</code></a>)</li>
<li>Add support for some big number types (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1014">#1014</a>
<a
href="https://github.com/AkiraMiyakoda"><code>@​AkiraMiyakoda</code></a>)</li>
<li>Add Support for UUIDs (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1029">#1029</a>
<a
href="https://github.com/Rabbitminers"><code>@​Rabbitminers</code></a>)</li>
<li>Add FromRedisValue::from_owned_redis_value to reduce copies while
parsing response (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1030">#1030</a>
<a
href="https://github.com/Nathan-Fenner"><code>@​Nathan-Fenner</code></a>)</li>
<li>Save reconnected connections during retries (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1033">#1033</a>)</li>
<li>Avoid panic on connection failure (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1035">#1035</a>)</li>
<li>add disable client setinfo feature and its default mode is off (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1036">#1036</a>
<a href="https://github.com/Ggiggle"><code>@​Ggiggle</code></a>)</li>
<li>Reconnect on parsing errors (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1051">#1051</a>)</li>
<li>preallocate buffer for evalsha in Script (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1044">#1044</a>
<a href="https://github.com/framlog"><code>@​framlog</code></a>)</li>
</ul>
<h4>Changes</h4>
<ul>
<li>Align more commands routings (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/938">#938</a>)</li>
<li>Fix HashMap conversion (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/977">#977</a>
<a href="https://github.com/mxbrt"><code>@​mxbrt</code></a>)</li>
<li>MultiplexedConnection: Remove unnecessary allocation in send (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/990">#990</a>)</li>
<li>Tests: Reduce cluster setup flakiness (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/999">#999</a>)</li>
<li>Remove the unwrap_or! macro (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1010">#1010</a>)</li>
<li>Remove allocation from command function (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1008">#1008</a>)</li>
<li>Catch panics from task::spawn in tests (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1015">#1015</a>)</li>
<li>Fix lint errors from new Rust version (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1016">#1016</a>)</li>
<li>Fix warnings that appear only with native-TLS (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1018">#1018</a>)</li>
<li>Hide the req_packed_commands from docs (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1020">#1020</a>)</li>
<li>Fix documentaion error (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1022">#1022</a>
<a
href="https://github.com/rcl-viveksharma"><code>@​rcl-viveksharma</code></a>)</li>
<li>Fixes minor grammar mistake in json.rs file (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1026">#1026</a>
<a href="https://github.com/RScrusoe"><code>@​RScrusoe</code></a>)</li>
<li>Enable ignored pipe test (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1027">#1027</a>)</li>
<li>Fix names of existing async cluster tests (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1028">#1028</a>)</li>
<li>Add lock file to keep MSRV constant (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1039">#1039</a>)</li>
<li>Fail CI if lock file isn't updated (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1042">#1042</a>)</li>
<li>impl Clone/Copy for SetOptions (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1046">#1046</a>
<a href="https://github.com/ahmadbky"><code>@​ahmadbky</code></a>)</li>
<li>docs: add &quot;connection-manager&quot; cfg attr (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1048">#1048</a>
<a href="https://github.com/DCNick3"><code>@​DCNick3</code></a>)</li>
<li>Remove the usage of aio::Connection in tests (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1049">#1049</a>)</li>
<li>Fix new clippy lints (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1052">#1052</a>)</li>
<li>Handle server errors in array response (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1056">#1056</a>)</li>
<li>Appease Clippy (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1061">#1061</a>)</li>
<li>make Pipeline handle returned bulks correctly (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1063">#1063</a>
<a href="https://github.com/framlog"><code>@​framlog</code></a>)</li>
<li>Update mio dependency due to vulnerability (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1064">#1064</a>)</li>
<li>Simplify Sink polling logic (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1065">#1065</a>)</li>
<li>Separate parsing errors from general response errors (<a
href="https://redirect.github.com/redis-rs/redis-rs/pull/1069">#1069</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c90a96e9bc"><code>c90a96e</code></a>
Release redis 0.25.0 / redis-test 0.4.0</li>
<li><a
href="38e41795a4"><code>38e4179</code></a>
Separate parsing errors from general response errors.</li>
<li><a
href="069a952780"><code>069a952</code></a>
Create a server error type.</li>
<li><a
href="b0955da868"><code>b0955da</code></a>
Handle server errors in array response.</li>
<li><a
href="4c9924ec3a"><code>4c9924e</code></a>
Fail CI if lock file isn't updated.</li>
<li><a
href="1a5032d327"><code>1a5032d</code></a>
Remove the usage of aio::Connection in tests.</li>
<li><a
href="97b5be1491"><code>97b5be1</code></a>
Simplify Sink polling logic.</li>
<li><a
href="afd0e0dbb3"><code>afd0e0d</code></a>
Update mio dependency due to vulnerability. (<a
href="https://redirect.github.com/redis-rs/redis-rs/issues/1064">#1064</a>)</li>
<li><a
href="3867f3f193"><code>3867f3f</code></a>
[fix] make <code>Pipeline</code> handle returned bulks correctly</li>
<li><a
href="78a37b50e8"><code>78a37b5</code></a>
Save reconnected connections during retries.</li>
<li>Additional commits viewable in <a
href="https://github.com/redis-rs/redis-rs/compare/redis-0.24.0...redis-0.25.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=redis&package-manager=cargo&previous-version=0.24.0&new-version=0.25.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-11 10:32:24 +00:00
..

relay

This crate houses a minimalistic STUN & TURN server.

Features

We aim to support the following feature set:

  • STUN binding requests
  • TURN allocate requests
  • TURN refresh requests
  • TURN channel bind requests
  • TURN channel data requests

Relaying of data through other means such as DATA frames is not supported.

Building

You can build the relay using: cargo build --release --bin firezone-relay

You should then find a binary in target/release/firezone-relay.

Running

The Firezone Relay supports Linux only. To run the Relay binary on your Linux host:

  1. Generate a new Relay token from the "Relays" section of the admin portal and save it in your secrets manager.
  2. Ensure the FIREZONE_TOKEN=<relay_token> environment variable is set securely in your Relay's shell environment. The Relay expects this variable at startup.
  3. Now, you can start the Firezone Relay with:
firezone-relay

To view more advanced configuration options pass the --help flag:

firezone-relay --help

Ports

The relay listens on port 3478. This is the standard port for STUN/TURN and not configurable. Additionally, the relay needs to have access to the port range 49152 - 65535 for the allocations.

Portal Connection

When given a token, the relay will connect to the Firezone portal and wait for an init message before commencing relay operations.

Design

The relay is designed in a sans-IO fashion, meaning the core components do not cause side effects but operate as pure, synchronous state machines. They take in data and emit commands: wake me at this point in time, send these bytes to this peer, etc.

This allows us to very easily unit-test all kinds of scenarios because all inputs are simple values.

The main server runs in a single task and spawns one additional task for each allocation. Incoming data that needs to be relayed is forwarded to the main task where it gets authenticated and relayed on success.