Commit Graph

746 Commits

Author SHA1 Message Date
Thomas Eizinger
2a46fce574 refactor(connlib): remove Result return values from callbacks (#4158)
Currently, an error returned by `Tunnel::poll_next_event` is only
logged. In other words, they are never fatal. This creates a tricky to
understand relationship on what kind of errors should be returned from
callbacks. Because connlib is used on multiple operating systems, it has
no idea how fatal a particular error is.

This PR removes all of these `Result` return values with the following
consequences:

- For Android, we now panic when a callback fails. This is a slight
change in behaviour. I believe that previously, any exception thrown by
a callback into Android was caught and returned as an error. Now, we
panic because in the FFI layer, we don't have any information on how
fatal the error is. For non-fatal errors, the Android app should simply
not throw an exception. The panics will cause the connlib task to be
shut down which triggers an `on_disconnect`.
- For Swift, there is no behaviour change. The FFI layer already did not
support `Result`s for those callbacks. I don't know how exceptions from
Swift are translated across the FFI layer but there is no change to what
we had before.
- For the Tauri client:
- I chose to log errors on ERROR level and continue gracefully for the
DNS resolvers.
- We panic in case the controller channel is full / closed. That should
really never happen in practice though unless we are currently shutting
down the app.

Resolves: #4064.
2024-03-20 02:09:20 +00:00
Gabi
fa387d0e59 fix(connlib): remove outdated assertion due to possibility of network changes (#4222)
found while working on #4163
2024-03-20 02:05:07 +00:00
dependabot[bot]
baa2831664 build(deps): Bump clap from 4.5.2 to 4.5.3 in /rust (#4191)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.2 to 4.5.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/releases">clap's
releases</a>.</em></p>
<blockquote>
<h2>v4.5.3</h2>
<h2>[4.5.3] - 2024-03-15</h2>
<h3>Internal</h3>
<ul>
<li><em>(derive)</em> Update <code>heck</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.5.3] - 2024-03-15</h2>
<h3>Internal</h3>
<ul>
<li><em>(derive)</em> Update <code>heck</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4e07b43858"><code>4e07b43</code></a>
chore: Release</li>
<li><a
href="8247c7ddf0"><code>8247c7d</code></a>
docs: Update changelog</li>
<li><a
href="677c52ce08"><code>677c52c</code></a>
chore: Update <code>heck</code> requirement (<a
href="https://redirect.github.com/clap-rs/clap/issues/5396">#5396</a>)</li>
<li>See full diff in <a
href="https://github.com/clap-rs/clap/compare/v4.5.2...v4.5.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.5.2&new-version=4.5.3)](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>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-03-19 22:49:06 +00:00
Reactor Scram
651ea3ae00 build(gui-client/linux): make sure debug symbols get uploaded for the Linux GUI client (#4217)
- Split up CI artifacts into "exe", "pkg", and "syms" so it's easy to
check they're being uploaded. This shouldn't affect published artifacts
- Set `strip = "none"` which seems to be necessary to get the debug
symbols in Linux, although they still end up in the exe and not the dwp
file 🤔 don't know why
- Test Linux stacktrace in CI

Stacktrace examples:
- On Linux we at least get function names, but we aren't getting line
numbers for some reason
https://github.com/firezone/firezone/actions/runs/8350493514/job/22857032124#step:10:268
- On Windows we also get line numbers, as before
https://github.com/firezone/firezone/actions/runs/8350493514/job/22857033367#step:11:351

I didn't test downloading the files and doing a stacktrace locally, but
I have batched that up for whenever I do a big manual test of the
CD-produced release artifacts:
https://github.com/firezone/firezone/issues/3887
2024-03-19 22:18:03 +00:00
Reactor Scram
74026d8b13 build(gui-client): disable AppImage bundling (#4216)
AppImages won't work with process splitting. (#3713)

As far as I can tell, they just produce one binary. Internally they use
FUSE or something to mount a squashfs image, but that image won't be
able to hook into systemd and run with root permissions and everything.
I don't think it's practical, and Tauri's AppImage bundling doesn't have
the features for it.

Even their deb bundler doesn't have any way to specify a path for a
daemon to be installed. The sidecar feature only seems intended for the
GUI app to call, not anything else on the system.

(There is such a thing as installing AppImages, but I don't think it's
worth pursuing - We should just do debs)
2024-03-19 17:26:25 +00:00
Reactor Scram
504ff3ffca ci(tauri-client): try to enable smoke tests for Ubuntu 22.04 (#3770)
Closes #3699 if successful

Ref #3972 

I don't understand why it started working. There's at least 3
possibilities:
- Some unrelated change in the last few weeks fixed it (Maybe bumping
Tauri to 1.6.1? https://github.com/firezone/firezone/pull/3881)
- It was a bug in the Github CI runner image that they fixed
- It's an awful race condition and adding `tracing::debug!` fixed it

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-03-19 15:41:37 +00:00
Reactor Scram
adea43e63b feat(gui-client): Tauri welcome screen (#4013)
Closes #3961 

No tests yet, might be tricky to test since it's all I/O. 
I cued it off the device ID being generated, so it will have a minor
merge conflict with #3920

```[tasklist]
### Before merging
- [ ] UI polish, or disable the welcome screen temporarily
```

<img width="664" alt="image"
src="https://github.com/firezone/firezone/assets/13400041/d5def59c-b075-4135-91e5-85f9f9212fa5">

---------

Co-authored-by: Jamil Bou Kheir <jamilbk@users.noreply.github.com>
2024-03-19 14:55:03 +00:00
Thomas Eizinger
05cfb336b4 feat(connlib): reduce packet drops (#4168)
Previously, we used `SocketState::send` without wrapping it in
`UdpSocket::try_io`. This meant that tokio had no chance of clearing the
readiness flag on the socket when we actually failed to send a packet,
resulting in many log messages like this:

```
Tunnel error: Resource temporarily unavailable (os error 11)
```

This PR refactors how we send UDP packets and when we read IP packet
from the device. Instead of just polling for send-readiness, we flush
all buffered packets and _then_ check for send-readiness. That will only
succeed if we managed to send all buffered packets and the socket still
has space for more packets.

Typically, this buffer only has 1-2 packets. That is because we
currently only ever read a single packet from the device. See #4139 for
how this might change. It may have more packets when our `Allocation`s
emit some (like multiple channel bindings in a row). Because we enforce
further send-readiness before continuing, this buffer cannot grow
unbounded.

Resolves: #3931.
2024-03-19 01:07:41 +00:00
Gabi
9f850bb92d fix(connlib): exclude sentinel dns range for resources ips (#4200)
In the future we will want to refactor this to a builder pattern to
prevent the number of parameters from growing and have them clearer but
this works simply for now.

Found while discussing #4174

---------

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-03-19 00:05:05 +00:00
Thomas Eizinger
4e48884513 refactor(connlib): move functionality onto ClientState (#4167)
With the move to SANS-IO, we will be able to write deterministic unit
tests for the tunnel logic. To actually do that, `ClientState` and
`GatewayState` need to encapsulate all the logic that we want to test.

This PR does some minor refactoring on the functions on `ClientTunnel`
and moves several of them onto `ClientState`. It doesn't touch
`add_resources` and `remove_resource` because those depend on #4156.
2024-03-18 23:54:20 +00:00
Thomas Eizinger
083fbd2844 refactor(connlib): only store ResourceId in Peer (#4156)
In order to track the allowed resources, we only need to track the ID,
not the entire resource. This avoids duplicating information about
resources.
2024-03-18 21:01:13 +00:00
dependabot[bot]
5408838189 build(deps): Bump anyhow from 1.0.80 to 1.0.81 in /rust (#4195)
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.80 to 1.0.81.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/anyhow/releases">anyhow's
releases</a>.</em></p>
<blockquote>
<h2>1.0.81</h2>
<ul>
<li>Make backtrace support available when using -Dwarnings (<a
href="https://redirect.github.com/dtolnay/anyhow/issues/354">#354</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4aad4edebd"><code>4aad4ed</code></a>
Release 1.0.81</li>
<li><a
href="8be90917c6"><code>8be9091</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/anyhow/issues/354">#354</a>
from dtolnay/deadcode</li>
<li><a
href="a2eb7dd5e1"><code>a2eb7dd</code></a>
Make compatible with -Dwarnings</li>
<li>See full diff in <a
href="https://github.com/dtolnay/anyhow/compare/1.0.80...1.0.81">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=anyhow&package-manager=cargo&previous-version=1.0.80&new-version=1.0.81)](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-18 18:49:36 +00:00
Reactor Scram
a10d76c525 chore(linux): revert /etc/resolv.conf on exit if we changed it to control DNS (#4148)
This isn't really user-facing, so I marked it down from `feat` to
`chore`. Closes #3817

- If we exit gracefully, `/etc/resolv.conf` is reverted
- We always keep the `.before-firezone` backup in case we lose power and
the revert transaction is corrupted or rolled back
- We use a magic header to detect whether the last run was a crash or
not. If Firezone crashes and the user wants to modify their default DNS,
they need to delete that header so that Firezone won't accidentally
revert its backup and trash their change.
- All error variants for this module replaced with `anyhow::Error` since
they were never matched by callers.

I ran `cargo mutants` locally and it helped me validate the unit tests
and it picked up a `match` branch that I forgot to delete.

```[tasklist]
- [x] (Failed: Integration tests didn't like it) ~~Add the system default resolvers below Firezone's sentinels~~
- [x] `tracing::info` "Last run crashed" if we have to revert the file at startup
```

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-03-18 16:29:25 +00:00
Reactor Scram
8bad6a39d0 chore: propose process splitting for Linux (#4153) 2024-03-18 16:24:19 +00:00
Andrew Dryga
114696c0ba chore(infra): Split terraform files into folders and add domain to production app (#4172) 2024-03-16 11:54:06 -06:00
Thomas Eizinger
de6bbbc10d chore(relay): fix flaky proptest (#4157)
This turned out to be a user error in how I was using proptest.

Related: https://github.com/proptest-rs/proptest/issues/72.
Resolves: #3965.
2024-03-16 01:09:39 +00:00
Reactor Scram
abf3402e50 chore(linux): document DNS control methods (#4147)
Internal (Not private, just un-interesting to most users) docs and
research to explain the DNS control methods.

I think Jamil was right, we should revert `/etc/resolv.conf` on exit in
case it's used on some minimal Debian kitten. We can keep that and the
`systemd-resolved` method around to support desktop Ubuntu. Everything
else is going to be "When someone needs it".
2024-03-15 18:43:43 +00:00
Thomas Eizinger
01bd019d2d refactor(connlib): move Node into {Client,Gateway}State (#4155)
This opens the door for unit testing `ClientState` with a
`GatewayState`, similarly as we have a test for a `ClientNode` and
`ServerNode` in `snownet`.

Before we can do that though, we need to move several functions from
`ClientTunnel` onto `ClientState`, i.e. essentially encapsulate
`ClientState` better. This is left to a future PR though to keep the
steps small.

Resolves: #3928.
2024-03-15 16:59:57 +00:00
dependabot[bot]
2dd8d0accd build(deps-dev): Bump follow-redirects from 1.15.5 to 1.15.6 in /rust/gui-client (#4149)
Bumps
[follow-redirects](https://github.com/follow-redirects/follow-redirects)
from 1.15.5 to 1.15.6.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="35a517c586"><code>35a517c</code></a>
Release version 1.15.6 of the npm package.</li>
<li><a
href="c4f847f851"><code>c4f847f</code></a>
Drop Proxy-Authorization across hosts.</li>
<li><a
href="8526b4a1b2"><code>8526b4a</code></a>
Use GitHub for disclosure.</li>
<li>See full diff in <a
href="https://github.com/follow-redirects/follow-redirects/compare/v1.15.5...v1.15.6">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=follow-redirects&package-manager=npm_and_yarn&previous-version=1.15.5&new-version=1.15.6)](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)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/firezone/firezone/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-03-15 15:37:15 +00:00
Thomas Eizinger
62e082d47a refactor(connlib): make {Client,Gateway}State SANS-IO (#4096)
Resolves: #3929.
2024-03-14 23:44:36 +00:00
Thomas Eizinger
d092e22840 feat(connlib): introduce Session::reconnect (#4116)
I ended up calling it `reconnect` because that is really what we are
doing:

- We reconnect to the portal.
- We "reconnect" to all relays, i.e. refresh the allocations.

I decided **not** to use an ICE restart. An ICE restart clears the local
as well as the remote credentials, meaning we would need to run another
instance of the signalling protocol. The current control plane does not
support this and it is also unnecessary in our situation. In the case of
an actual network change (e.g. WiFI to cellular), refreshing of the
allocations will turn up new candidates as that is how we discovered our
original ones in the first place. Because we constantly operate in ICE
trickle mode, those will be sent to the remote via the control plane and
we start testing them.

As those new paths become available, str0m will automatically nominate
them in case the current one runs into an ICE timeout. Here is a
screen-recording of the Linux CLI client where `Session::refresh` is
triggered via the SIGHUP signal:

[Screencast from 2024-03-14
11-16-47.webm](https://github.com/firezone/firezone/assets/5486389/7171d199-f2a2-4b22-92c8-243494d5d6d8)

Provides the infrastructure for: #4028.
2024-03-14 23:23:29 +00:00
Thomas Eizinger
0dfd26a014 feat(snownet): introduce connection span to capture str0m and boringtun logs (#4144)
These new spans help capture logs from within `str0m` and `boringtun`
with the context of our connection ID.

Resolves: #4140.
2024-03-14 20:38:34 +00:00
Reactor Scram
d6827c046a chore(gui-client): fix macOS clippy warning, clean up error types (#4146)
Fixes the compile warning in macOS for the `version-check` CI job.

Removes some error variants that were never matched on, folding them
into `anyhow::Error`s
2024-03-14 20:38:22 +00:00
Gabi
148bc8c7b2 fix(android): send Cidr format instead of IpNetwork format (#4134)
Fixes android on main and remove the need to parse and re-parse
addresses for android and swift.

---------

Signed-off-by: Gabi <gabrielalejandro7@gmail.com>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-03-14 18:57:35 +00:00
Thomas Eizinger
c62202ac90 fix(android): spawn dedicated thread for connlib (#4145)
Same as https://github.com/firezone/firezone/pull/4141 but for Android.
2024-03-14 05:57:13 +00:00
Gabi
91de68fd4b fix(apple): spawn new thread for runtime to prevent it from being taken down (#4141)
Using the current thread in apple was causing a crashloop, since
connlib's thread was taken down by the network extension after
`WrappedSession::connect` returned.

Now we force the runtime to create the thread to prevent it from being
taken down.
2024-03-14 05:49:28 +00:00
Gabi
05e5ca609c chore(apple): initiate logging subscriber as early as possible (#4143)
Also, return error with tracing subscriber initialization
2024-03-14 05:45:22 +00:00
Thomas Eizinger
53cc7d6fd5 refactor(connlib): don't start a runtime as part of Session (#4119)
Currently, each use of `Session` creates its own `Runtime`. That is
unnecessary because some platforms already have a tokio runtime running.
Instead of creating another one, we simply ask the caller to provide us
with a `Handle` to an existing tokio runtime. For Android and iOS we
spawn a new single-threaded runtime to satisfy this new requirement.
2024-03-14 00:06:29 +00:00
Jamil
63c546eb45 chore(docker): Fix docker image local builds (#4127)
Fixes an artifact leftover from the refactor.

Fixes #4122
2024-03-14 00:06:10 +00:00
Thomas Eizinger
9767bddcca feat(gateway): add HTTP health check (#4120)
This adds the same kind of HTTP health-check that is already present in
the relay to the gateway. The health-check returns 200 OK for as long as
the gateway is active. The gateway automatically shuts down on fatal
errors (like authentication failures with the portal).

To enable this, I've extracted a crate `http-health-check` that shares
this code between the relay and the gateway.

Resolves: #2465.

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-03-13 21:05:21 +00:00
Reactor Scram
4c77aae3d2 chore(windows): document Windows network_changes behavior (#4130)
Ref #3429 

It doesn't report DNS changes, but I added a proof of concept for how we
could do that.
2024-03-13 20:59:52 +00:00
Thomas Eizinger
6a7d8c8a3d refactor(snownet): introduce is_connected_to to simplify unit test (#4121)
Instead of tracking this state separately, we can expose a getter on a
`snownet::Node`.
2024-03-13 20:48:45 +00:00
Thomas Eizinger
bd94461d65 feat(connlib): reduce stack size usage (#3958)
With the use of `snownet`, we now have explicit control over how we read
and write messages to sockets. As such, we can make the remaining
stack-allocated buffer heap-allocated and remove the increased
stack-size on our tokio worker threads.
2024-03-13 20:47:22 +00:00
Thomas Eizinger
6ab7e51264 refactor(connlib): allow commands to be sent to eventloop (#4112)
This refactors `Session` to allow for commands to be sent to the
`Eventloop`. Currently, we only send a `Stop` command. With #3429, we
will add more commands like refreshing and updating the DNS servers.
2024-03-13 20:09:48 +00:00
Reactor Scram
52cde610e1 feat(linux): make deep link auth work (#4102)
Right now it only works on my dev VM, not on my test VMs, due to #4053
and #4103, but it passes tests and should be safe to merge.

There's one doc fix and one script fix which are unrelated and could be
their own PRs, but they'd be tiny, so I left them in here.

Ref #4106 and #3713 for the plan to fix all this by splitting the tunnel
process off so that the GUI runs as a normal user.
2024-03-13 18:11:04 +00:00
Thomas Eizinger
5744ed2a13 chore(connlib): remove unused event (#4110)
Seems to be a left-over from a previous design.
2024-03-13 03:25:21 +00:00
Thomas Eizinger
6b1c2c9369 chore(snownet): add basic unit test for a connection (#4097)
This is heavily inspired by how `str0m`'s `IceAgent` is tested. I left a
link for attribution. We can copy / move this later to write unit tests
for the `Tunnel`.
2024-03-12 22:26:10 +00:00
dependabot[bot]
3a245bdb65 build(deps): Bump @tauri-apps/cli from 1.5.10 to 1.5.11 in /rust/gui-client (#4078)
Bumps [@tauri-apps/cli](https://github.com/tauri-apps/tauri) from 1.5.10
to 1.5.11.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tauri-apps/tauri/releases"><code>@​tauri-apps/cli</code>'s
releases</a>.</em></p>
<blockquote>
<h2><code>@​tauri-apps/cli</code> v1.5.11</h2>
<h2>[1.5.11]</h2>
<h3>Bug Fixes</h3>
<ul>
<li><a
href="b15948b11c"><code>b15948b11</code></a>(<a
href="https://redirect.github.com/tauri-apps/tauri/pull/8903">#8903</a>)
Fix <code>.taurignore</code> failing to ignore in some cases.</li>
</ul>
<h3>Dependencies</h3>
<ul>
<li>Upgraded to <code>tauri-cli@1.5.11</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="b705f89a10"><code>b705f89</code></a>
Apply Version Updates From Current Changes (v1) (<a
href="https://redirect.github.com/tauri-apps/tauri/issues/9074">#9074</a>)</li>
<li><a
href="97a05145fb"><code>97a0514</code></a>
fix(cli): migrate to stable features of <code>log</code> crate (<a
href="https://redirect.github.com/tauri-apps/tauri/issues/9119">#9119</a>)</li>
<li><a
href="b15948b11c"><code>b15948b</code></a>
fix(cli): use <code>matched_path_or_any_parents</code> when checking if
a file is ignore...</li>
<li><a
href="5163861588"><code>5163861</code></a>
fix(bundler): escape potentially problematic strings in an XML (<a
href="https://redirect.github.com/tauri-apps/tauri/issues/9040">#9040</a>)</li>
<li><a
href="80a215a6f3"><code>80a215a</code></a>
Apply Version Updates From Current Changes (v1) (<a
href="https://redirect.github.com/tauri-apps/tauri/issues/9013">#9013</a>)</li>
<li><a
href="01ae1218dc"><code>01ae121</code></a>
ci: downgrade thread_local to 1.1.7 in msrv list (<a
href="https://redirect.github.com/tauri-apps/tauri/issues/9012">#9012</a>)</li>
<li><a
href="d42668ce17"><code>d42668c</code></a>
fix(runtime-wry): avoid panic during clipboard initialization on wayland
(<a
href="https://redirect.github.com/tauri-apps/tauri/issues/9003">#9003</a>)</li>
<li><a
href="1ab0db6352"><code>1ab0db6</code></a>
chore: port PR template from <code>dev</code> branch (<a
href="https://redirect.github.com/tauri-apps/tauri/issues/9004">#9004</a>)</li>
<li><a
href="e816a46b95"><code>e816a46</code></a>
chore: update lock files</li>
<li><a
href="a4b82d9dba"><code>a4b82d9</code></a>
chore: bump tauri-utils</li>
<li>See full diff in <a
href="https://github.com/tauri-apps/tauri/compare/@tauri-apps/cli-v1.5.10...@tauri-apps/cli-v1.5.11">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@tauri-apps/cli&package-manager=npm_and_yarn&previous-version=1.5.10&new-version=1.5.11)](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>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-03-12 20:53:09 +00:00
Jamil
574585d146 chore(ci): Add debug/ and perf/ prefix to some images (#4104)
Followup from #4100:


- Add `perf/relay` and `debug/relay` etc data plane images in
`firezone-staging`.
- The `perf` images are `debug` stage images and have tooling installed,
but use release binaries.
- The `debug` images are `debug` binaries inside `debug` images
- `firezone-prod` contains only release binaries -- these image names
haven't changed
2024-03-12 20:27:32 +00:00
Gabi
2e85ea1b3a refactor(connlib): use on_update_routes instead of on_add/on_remove_route (#3825)
Extracted from #3791 and #3750 

Co-authored-by: @jamilbk <jamilbk@users.noreply.github.com>
2024-03-12 19:49:32 +00:00
dependabot[bot]
9836c74ea5 build(deps): Bump the otel group in /rust with 3 updates (#3980)
Bumps the otel group in /rust with 3 updates:
[tracing-stackdriver](https://github.com/NAlexPear/tracing-stackdriver),
[tracing-opentelemetry](https://github.com/tokio-rs/tracing-opentelemetry)
and
[opentelemetry-otlp](https://github.com/open-telemetry/opentelemetry-rust).

Updates `tracing-stackdriver` from 0.8.0 to 0.9.0
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4a9fe0a37e"><code>4a9fe0a</code></a>
⬆ Bump version to 0.9.0</li>
<li>See full diff in <a
href="https://github.com/NAlexPear/tracing-stackdriver/compare/v0.8.0...v0.9.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `tracing-opentelemetry` from 0.21.0 to 0.22.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/tracing-opentelemetry/releases">tracing-opentelemetry's
releases</a>.</em></p>
<blockquote>
<h2>0.22.0</h2>
<h3>Breaking Changes</h3>
<ul>
<li>Upgrade to <code>v0.21.0</code> of <code>opentelemetry</code>
For list of breaking changes in OpenTelemetry, see the
<a
href="https://github.com/open-telemetry/opentelemetry-rust/blob/v0.21.0/opentelemetry/CHANGELOG.md">v0.21.0
changelog</a>.</li>
<li>Update MSRV to require Rust 1.65+, as <code>opentelemetry</code>
requires it now. (<a
href="https://redirect.github.com/tokio-rs/tracing-opentelemetry/issues/68">#68</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>WASM Support (<a
href="https://redirect.github.com/tokio-rs/tracing-opentelemetry/issues/57">#57</a>)</li>
<li>Fix potential deadlock (<a
href="https://redirect.github.com/tokio-rs/tracing-opentelemetry/issues/59">#59</a>)</li>
</ul>
<p>Thanks to <a
href="https://github.com/jesseditson"><code>@​jesseditson</code></a>, <a
href="https://github.com/AsmPrgmC3"><code>@​AsmPrgmC3</code></a>, and <a
href="https://github.com/rthomas"><code>@​rthomas</code></a> for
contributing to this release!</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/tracing-opentelemetry/blob/v0.1.x/CHANGELOG.md">tracing-opentelemetry's
changelog</a>.</em></p>
<blockquote>
<h1>0.22.0 (November 7, 2023)</h1>
<h3>Breaking Changes</h3>
<ul>
<li>Upgrade to <code>v0.21.0</code> of <code>opentelemetry</code>
For list of breaking changes in OpenTelemetry, see the
<a
href="https://github.com/open-telemetry/opentelemetry-rust/blob/v0.21.0/opentelemetry/CHANGELOG.md">v0.21.0
changelog</a>.</li>
<li>Update MSRV to require Rust 1.65+, as <code>opentelemetry</code>
requires it now. (<a
href="https://redirect.github.com/tokio-rs/tracing-opentelemetry/issues/68">#68</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>WASM Support (<a
href="https://redirect.github.com/tokio-rs/tracing-opentelemetry/issues/57">#57</a>)</li>
<li>Fix potential deadlock (<a
href="https://redirect.github.com/tokio-rs/tracing-opentelemetry/issues/59">#59</a>)</li>
</ul>
<p>Thanks to <a
href="https://github.com/jesseditson"><code>@​jesseditson</code></a>, <a
href="https://github.com/AsmPrgmC3"><code>@​AsmPrgmC3</code></a>, and <a
href="https://github.com/rthomas"><code>@​rthomas</code></a> for
contributing to this release!</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="62690b4ac9"><code>62690b4</code></a>
Prepare for v0.22.0 release (<a
href="https://redirect.github.com/tokio-rs/tracing-opentelemetry/issues/75">#75</a>)</li>
<li><a
href="2156c236db"><code>2156c23</code></a>
Update otel to version 0.21 (<a
href="https://redirect.github.com/tokio-rs/tracing-opentelemetry/issues/68">#68</a>)</li>
<li><a
href="cfc64f37b6"><code>cfc64f3</code></a>
build(deps): update tracing-log requirement from 0.1.3 to 0.2.0 (<a
href="https://redirect.github.com/tokio-rs/tracing-opentelemetry/issues/64">#64</a>)</li>
<li><a
href="70f3ed6f73"><code>70f3ed6</code></a>
build(deps): update pprof requirement from 0.12.1 to 0.13.0 (<a
href="https://redirect.github.com/tokio-rs/tracing-opentelemetry/issues/61">#61</a>)</li>
<li><a
href="bddef29233"><code>bddef29</code></a>
Add support for instrumented functions which return Result (<a
href="https://redirect.github.com/tokio-rs/tracing-opentelemetry/issues/28">#28</a>)</li>
<li><a
href="1c61ea6b56"><code>1c61ea6</code></a>
Fix potential deadlock (<a
href="https://redirect.github.com/tokio-rs/tracing-opentelemetry/issues/59">#59</a>)</li>
<li><a
href="5223a67887"><code>5223a67</code></a>
Update README example Cargo.toml (<a
href="https://redirect.github.com/tokio-rs/tracing-opentelemetry/issues/60">#60</a>)</li>
<li><a
href="a03ff2275b"><code>a03ff22</code></a>
Update criterion and pprof (<a
href="https://redirect.github.com/tokio-rs/tracing-opentelemetry/issues/42">#42</a>)</li>
<li><a
href="80ae3211db"><code>80ae321</code></a>
WASM Support (<a
href="https://redirect.github.com/tokio-rs/tracing-opentelemetry/issues/57">#57</a>)</li>
<li>See full diff in <a
href="https://github.com/tokio-rs/tracing-opentelemetry/compare/v0.21.0...v0.22.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `opentelemetry-otlp` from 0.13.0 to 0.15.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/open-telemetry/opentelemetry-rust/releases">opentelemetry-otlp's
releases</a>.</em></p>
<blockquote>
<h2>v0.15.0</h2>
<h3>Added</h3>
<ul>
<li>More resource detectors <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/573">#573</a></li>
</ul>
<h3>Changed</h3>
<ul>
<li>Expose the Error type to allow users to set custom error handlers <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/551">#551</a></li>
<li>Allow users to use different channels based on runtime in batch span
processor <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/560">#560</a></li>
<li>Move <code>Unit</code> into <code>metrics</code> module <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/564">#564</a></li>
<li>Update trace flags to match spec <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/565">#565</a></li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Fix debug loop, add notes for <code>#[tokio::test]</code> <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/552">#552</a></li>
<li><code>TraceState</code> cannot insert new key-value pairs <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/567">#567</a></li>
</ul>
<h2>v0.14.0</h2>
<h2>Added</h2>
<ul>
<li>Adding a dynamic dispatch to Aggregator Selector <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/497">#497</a></li>
<li>Add <code>global::force_flush_tracer_provider</code> <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/512">#512</a></li>
<li>Add config <code>max_attributes_per_event</code> and
<code>max_attributes_per_link</code> <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/521">#521</a></li>
<li>Add dropped attribute counts to events and links <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/529">#529</a></li>
</ul>
<h2>Changed</h2>
<ul>
<li>Remove unnecessary clone in <code>Key</code> type <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/491">#491</a></li>
<li>Remove <code>#[must_use]</code> from
<code>set_tracer_provider</code> <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/501">#501</a></li>
<li>Rename remaining usage of <code>default_sampler</code> to
<code>sampler</code> <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/509">#509</a></li>
<li>Use current span for SDK-less context propagation <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/510">#510</a></li>
<li>Always export span batch when limit reached <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/519">#519</a></li>
<li>Rename message events to events <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/530">#530</a></li>
<li>Update resource merge behaviour <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/537">#537</a></li>
<li>Ignore links with invalid context <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/538">#538</a></li>
</ul>
<h2>Removed</h2>
<ul>
<li>Remove remote span context <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/508">#508</a></li>
<li>Remove metrics quantiles <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/525">#525</a></li>
</ul>
<h1>Fixed</h1>
<ul>
<li>Allow users to use custom export kind selector <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/526">#526</a></li>
</ul>
<h2>Performance</h2>
<ul>
<li>Improve simple span processor performance <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/502">#502</a></li>
<li>Local span perf improvements <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/505">#505</a></li>
<li>Reduce string allocations where possible <a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/506">#506</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d7ba1ea4f7"><code>d7ba1ea</code></a>
Prepare for v0.15.0 release (<a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/572">#572</a>)</li>
<li><a
href="6834b64192"><code>6834b64</code></a>
feat: add more resource detectors (<a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/573">#573</a>)</li>
<li><a
href="efbc842c11"><code>efbc842</code></a>
semantic-conventions: update to v1.4.0 spec (<a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/570">#570</a>)</li>
<li><a
href="d70a537548"><code>d70a537</code></a>
Update example and optional dependencies (<a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/568">#568</a>)</li>
<li><a
href="a2dd6e7779"><code>a2dd6e7</code></a>
fix: TraceState cannot insert new key-value pairs. (<a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/567">#567</a>)</li>
<li><a
href="dc7d81fdfa"><code>dc7d81f</code></a>
Update trace flags to match spec (<a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/565">#565</a>)</li>
<li><a
href="635f10e15d"><code>635f10e</code></a>
Move unit into metrics module (<a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/564">#564</a>)</li>
<li><a
href="99e51c1980"><code>99e51c1</code></a>
Update lib and tracing module docs with examples (<a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/563">#563</a>)</li>
<li><a
href="1ca62d337e"><code>1ca62d3</code></a>
feat: allow users to use different channels based on runtime in batch
span pr...</li>
<li><a
href="fb576b0e71"><code>fb576b0</code></a>
move hyper prometheus example into something runnable (<a
href="https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/562">#562</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/open-telemetry/opentelemetry-rust/compare/v0.13.0...v0.15.0">compare
view</a></li>
</ul>
</details>
<br />


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 <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-03-12 19:16:35 +00:00
Gabi
270563bb93 chore(connlib): update quinn-udp (#4087)
quinn-rs/quinn#1758 was merged, meaning we don't need to maintain our
fork

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-03-12 17:22:48 +00:00
Thomas Eizinger
c67ba0b73b chore(snownet): remove repeated attribute (#4090) 2024-03-12 14:06:46 +00:00
Thomas Eizinger
48dc15f215 chore(snownet): extract constant for handshake timeout (#4091) 2024-03-12 14:06:28 +00:00
Thomas Eizinger
36848e31a9 fix(relay): actually expire channels which allows re-binding them (#4094)
Previously, the relay neither scheduled a `Wake` command nor did it
register a `TimedAction` to expire a channel binding. Such an action was
only scheduled after the first refresh.

This PR fixes this and adds a test that asserts we can re-bind the same
channel to a different peer after 15 minutes.

Resolves: #3979.
2024-03-12 10:13:47 +00:00
Thomas Eizinger
32e16ec927 feat(relay): improve logs for expiry and deletion of channel bindings (#4089)
Unfortunately, the current logs don't allow us to correlate, which
allocation and thus which client the expired channel binding relates to.
This PR fixes this by adding more fields to the relevant log messages.
2024-03-12 10:13:15 +00:00
Thomas Eizinger
066ed4c85d chore(snownet): log channel number and peer as part of failed channel binding (#4086)
Should help in debugging which channel we tried to bind without having
to sieve through the relay's logs for the transaction ID.
2024-03-12 10:12:50 +00:00
Thomas Eizinger
407d20d817 refactor(connlib): use phoenix-channel crate for clients (#3682)
Depends-On: #4048.
Depends-On: #4015.

Resolves: #2158.

---------

Co-authored-by: conectado <gabrielalejandro7@gmail.com>
2024-03-12 08:10:56 +00:00
Thomas Eizinger
879a9019b3 refactor(connlib): split Device creation from initialization (#4069)
This reduces the amount of boilerplate required in the `Tunnel`'s
eventloop. It also makes re-initialization of a `Device` much easier.
2024-03-11 21:04:18 +00:00
Thomas Eizinger
dde8b646f0 chore(connlib): remove redundant action from wire log (#4061)
The fields `to` and `from` already indicate that we are either reading
or writing.
2024-03-11 21:04:17 +00:00