Commit Graph

5986 Commits

Author SHA1 Message Date
Thomas Eizinger
fd04812cde chore(gateway): proactive close telemetry session (#7361)
This is important for the "Release Health" statistics of Sentry.
2024-11-16 16:28:42 +00:00
Thomas Eizinger
9536b8116c fix: don't exit TUN thread on errors (#7354)
I noticed that in case there is an error when reading from the TUN
device, we currently exit that thread and we don't have a mechanism at
the moment to restart it. Discarding the thread also means we can no
longer send new instances of `Tun` into it.

Instead of exiting the thread, we now just log the error and continue.
In case the error was caused by the FD being closed, we discard the
instance of `Tun` and wait for a new one.
2024-11-16 06:19:41 +00:00
Brian Manifold
2d93100c41 fix(portal): Update Stripe event handler to only listen for certain update events (#7357)
Why:

* Recently we had an issue where a customer's payment info was
incorrectly entered, which caused the payment to not go through. When
something like this happens Stripe will send an update event with a
pending_update section (which we do not use currently). When the
customer fixes the payment info, and payment goes through we get another
update event with the correct subscription info, however, the previous
update (with the pending section) then gets expired and a
`pending_update_expired` event is sent to us. We had been inadvertantly
catching the event and updating the specified account with the info in
the event (which happened to be the previous state of the subscription)

Fixes: #7352
2024-11-15 20:52:50 +00:00
Thomas Eizinger
f34f596d8d chore(connlib): print GRO metadata in wire::net::recv log (#7353)
Previously, we printed only the size of each individual packet in the
`wire::net` logs. This makes it impossible to tell whether or not GRO
was used to receive this packet. The total number of bytes can still be
computed by calculating `num_packets * segment_size + trailing_bytes`.
Thus, the new log is strictly superior.
2024-11-15 16:11:03 +00:00
Thomas Eizinger
2b3469954a chore(headless-client): allow disabling telemetry (#7350)
I've started to set this in my local env to not spam Sentry with events
while I am developing.
2024-11-15 08:14:36 +00:00
Thomas Eizinger
0b22892a77 docs: refer to correct way how to disable gateway telemetry (#7351)
Shame on me for not actually testing this when I built it. `clap`
requires you to explicitly spell out `true` or `false`.
2024-11-15 08:13:29 +00:00
Thomas Eizinger
0cb96f5a18 chore(gui-client): publish version 1.3.13 (#7346) 2024-11-15 06:52:38 +00:00
Thomas Eizinger
4db3a457a9 chore(gateway): publish version 1.4.1 (#7347) 2024-11-15 05:40:12 +00:00
Thomas Eizinger
4fc7e62ba8 chore(headless-client): publish version 1.3.7 (#7348) 2024-11-15 05:39:39 +00:00
Thomas Eizinger
4e423dc51c fix(connlib): send all unwritten packets before reading new ones (#7342)
With the parallelisation of TUN and UDP operations, we lost
backpressure: Packets can now be read quicker from the UDP sockets than
they can be sent out the TUN device, causing packet loss in extremely
high-throughput situations.

To avoid this, we don't directly send packets into the channel to the
TUN device thread. This channel is bounded, meaning sending can fail if
reading UDP packets is faster than writing packets to the TUN device.

Due to GRO, we may read multiple UDP packets in one go, requiring us to
write multiple IP packets to the TUN device as part of a single
iteration in the event-loop. Thus, we cannot know, how much space we
need in the channel for outgoing IP packets.

By introducing a dedicated buffer, we can temporarily hold on to all of
these packets and on the next call to `poll`, we flush them out into the
channel. If the channel is full, we will suspend and only continue once
there is space in the channel. This behaviour restores backpressue
because we won't read UDP packets from the socket unless we have space
to write the corresponding packet to the TUN device.

UDP itself actually doesn't have any backpressure, instead the packets
will simply get dropped once the receive buffer overflows. The UDP
packets however carry encrypted IP packets, meaning whatever protocol
sits inside these packets will detect the packet loss and should
throttle their sending-pace accordingly.
2024-11-14 06:25:03 +00:00
Thomas Eizinger
e2117dd220 refactor(gui-client): don't double log errors (#7330)
Currently, some errors are double-logged when we show them to the user
because of the `tracing::error!` statements within the generation of the
user-friendly error message for the error dialog.

To get rid of these, we generalise the `show_error_dialog` function to
take just the message and move the generation of the message to a
function on the `Error` itself. This also allows us to split out a
separate error type that is only used for the elevation check, thereby
reducing the complexity of the other error enum.
2024-11-14 05:20:05 +00:00
Thomas Eizinger
8c5a5fa690 chore(rust): correctly disable ANSI escapes globally (#7336)
I think I finally understood and correctly traced, where the use of ANSI
escape codes came from. It turns out, the `with_ansi` switch on
`tracing_subscriber::fmt::Layer` is what you want to toggle. From there,
it trickles down to the `Writer` which we can then test for in our
`Format`.

Resolves: #7284.

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
2024-11-14 05:00:53 +00:00
Brian Manifold
b2fe21aaf5 docs(infra): Update staging README to include NAT instructions (#7338)
Instructions for how to enable/disable symmetric NAT on the AWS VM in
staging.
2024-11-14 04:41:56 +00:00
Thomas Eizinger
efeba55709 chore(snownet): fail TURN connection on unknown attribute (#7341)
A TURN server that doesn't understand certain attributes should return
"Unknown attributes" as part of its response. Whilst we aim to be as
spec-compliant as possible, Firezone doesn't officially support other
TURN servers than our own relay.

If we encounter a TURN server that sends us an "Unknown attribute", we
now immediately fail this allocation and clear it as we cannot make any
more assumptions about what the connected relay actually supports.
2024-11-14 02:43:17 +00:00
Thomas Eizinger
9712942caa chore(connlib): add logs and error handling on bad stride (#7339)
In order to narrow down #7332, we are now checking the stride length and
report oddities such as `string > len` as an error to the event-loop.
2024-11-14 02:34:17 +00:00
Thomas Eizinger
3cf5cbb989 chore(connlib): only send some tunnel errors to Sentry (#7340)
Errors from the tunnel can potentially happen on a per-packet basis. In
order to not flood Sentry, reduce the log-level down to `debug` and only
report 1% of all errors. We did the same thing for the gateway in #7299.
2024-11-14 02:32:37 +00:00
Thomas Eizinger
00c7c42113 fix(snownet): don't allow duplicate server-reflexive candidates (#7334)
In #7163, we introduced a shared cache of server-reflexive candidates
within a `snownet::Node`. What we unfortunately overlooked is that if a
node (i.e. a client or a gateway) is behind symmetric NAT, then we will
repeatedly create "new" server-reflexive candiates, thereby filling up
this cache.

This cache is used to initialise the agents with local candidates, which
manifests in us sending dozens if not hundreds of candidates to the
other party. Whilst not harmful in itself, it does create quite a lot of
spam. To fix this, we introduce a limit of only keeping around 1
server-reflexive candidate per IP version, i.e. only 1 IPv4 and IPv6
address.

At present, `connlib` only supports a single egress interface meaning
for now, we are fine with making this assumption.

In case we encounter a new candidate of the same kind and same IP
version, we evict the old one and replace it with the new one. Thus, for
subsequent connections, only the new candidate is used.
2024-11-14 00:14:29 +00:00
Jamil
5437c3e2df fix(infra): Block signups if expression matches (#7337) 2024-11-13 21:29:47 +00:00
Thomas Eizinger
96118dd151 ci: upload debug symbols to Sentry (#7331)
In order to display better stacktraces when Firezone crashes, Sentry
needs debug symbols for our binaries. Debug symbols on Sentry are
retained for 90 days after they have been last used [0]. We can thus
simply upload them every time we build a binary on `main`.

For the moment, this only uploads them for the GUI client. Debug symbols
for the Android and Apple clients will be done in separate PRs.


[0]:
https://docs.sentry.io/platforms/native/data-management/debug-files/#retention-policy

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-11-13 21:25:38 +00:00
Thomas Eizinger
3dd913f6df fix(snownet): emit correct event on invalidating srflx candidate (#7333)
This one has been lurking in the codebase for a while. Fortunately, it
is not very critical because invalidation of server-reflexive addresses
happens pretty rarely.
2024-11-13 20:12:20 +00:00
Thomas Eizinger
7e0d2ca59c chore: add telemetry event in case we see large datagrams (#7335)
If we see these, something fishy is going on (see #7332), so we should
definitely know about these by recording Sentry events. These can
potentially be per packet so we only send a telemetry event which gets
sampled at a rate of 1%.
2024-11-13 20:09:58 +00:00
Thomas Eizinger
48ba2869a8 chore(rust): ban the use of .unwrap except in tests (#7319)
Using the clippy lint `unwrap_used`, we can automatically lint against
all uses of `.unwrap()` on `Result` and `Option`. This turns up quite a
few results actually. In most cases, they are invariants that can't
actually be hit. For these, we change them to `Option`. In other cases,
they can actually be hit. For example, if the user supplies an invalid
log-filter.

Activating this lint ensures the compiler will yell at us every time we
use `.unwrap` to double-check whether we do indeed want to panic here.

Resolves: #7292.
2024-11-13 03:59:22 +00:00
Thomas Eizinger
b230cf79fd refactor(gui-client): more detailed tray menu update errors (#7328)
Just adding a bit more context to see which particular operation fails.
2024-11-13 00:22:23 +00:00
Jamil
6f7f6a4f34 style: Enforce code style across all supported languages using Prettier (#7322)
This ensure that we run prettier across all supported filetypes to check
for any formatting / style inconsistencies. Previously, it was only run
for files in the website/ directory using a deprecated pre-commit
plugin.

The benefit to keeping this in our pre-commit config is that devs can
optionally run these checks locally with `pre-commit run --config
.github/pre-commit-config.yaml`.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-11-13 00:19:15 +00:00
Thomas Eizinger
3e18fa8ca2 chore(telemetry): misc. clean-up (#7326)
Bundles together several minor improvements around telemetry:

- Removes the obsolete "Firezone" context: This is now included in the
user context as of #7310.
- Entirely encapsulates `sentry` within the `telemetry` module
- Concludes sessions that were not explicitly closed as "abnormal"
2024-11-13 00:16:44 +00:00
Thomas Eizinger
19dbff51f5 chore(gui-client): don't warn on sign-out while raising tunnel (#7327)
All warnings triggered events in Sentry. This particular warning is of
no concern, it simply means that the user clicked on "Sign out" while we
were trying to set up the tunnel.

Resolves: #7250.
2024-11-13 00:15:49 +00:00
Jamil
fa40d6e852 fix(infra): Adjust rule to total_latencies from backend_latencies (#7323)
This is the check that Oneleet is expecting.
2024-11-12 21:30:28 +00:00
Thomas Eizinger
0e20f7d086 chore(connlib): better error reporting for invalid IP packets (#7320)
Currently, we don't report very detailed errors when we fail to parse
certain IP packets. With this patch, we use `Result` in more places and
also extend the validation of IP packets to:

a) enforce a length of at most 1280 bytes. This should already be the
case due to our MTU but bad things may happen if that is off for some
reason
b) validate the entire IP packet instead of just its header
2024-11-12 19:46:32 +00:00
Jamil
f40528f8f0 chore(infra): Relax load balancer to app latency alert to 3s (#7317)
1000ms is a little too agressive here. The latency is measured from load
balancer, which are global, to our app servers, which are in us-east1.
2024-11-12 05:44:05 +00:00
Thomas Eizinger
19f51568c2 chore(rust): don't pass errors as values for debug logs (#7318)
Our logging library `tracing` supports structured logging. Structured
logging means we can include values within a `tracing::Event` without
having to immediately format it as a string. Processing these values -
such as errors - as their original type allows the various `tracing`
layers to capture and represent them as they see fit.

One of these layers is responsible for sending ERROR and WARN events to
Sentry, as part of which `std::error::Error` values get automatically
captured as so-called "sentry exceptions".

Unfortunately, there is a caveat: If an `std::error::Error` value is
included in an event that does not get mapped to an exception, the
`error` field is completely lost. See
https://github.com/getsentry/sentry-rust/issues/702 for details.

To work around this, we introduce a `err_with_sources` adapter that an
error and all its sources together into a string. For all
`tracing::debug!` statements, we then use this to report these errors.

It is really unfortunate that we have to do this and cannot use the same
mechanism, regardless of the log level. However, until this is fixed
upstream, this will do and gives us better information in the log
submitted to Sentry.
2024-11-12 04:00:02 +00:00
Thomas Eizinger
9e9dfd5e97 chore(gui-client): downgrade warning to debug (#7313)
With a retry-mechanism in place, there is no need to log a warning when
`connect_to_service` fails. Instead, we just log this as on DEBUG and
continue trying. If it fails after all attempts, the entire function
will bail out and we will receive a Sentry event from error handling
higher up the callstack.
2024-11-12 03:54:49 +00:00
Thomas Eizinger
d38304b21f build(rust): depend on our boringtun fork (#7120)
This switches our dependency on `boringtun` over to our fork at
https://github.com/firezone/boringtun. The idea of the fork is to
carefully only patch selective parts such that upstream things later is
still possible. The complete diff can be seen here:
https://github.com/cloudflare/boringtun/compare/master...firezone:boringtun:master

So far, the only patches in the fork are dependency bumps, linter fixes,
adjustments to log levels and the removal of panics when the destination
buffer is too small.
2024-11-12 03:40:36 +00:00
Thomas Eizinger
bf34b26c22 refactor(gui-client): remove unnecessary async block (#7312)
The `Server::new` function already returns a `Future`. Calling `.await`
on that within an `async` block is equivalent to just calling the `new`
function itself.
2024-11-12 03:37:45 +00:00
Thomas Eizinger
764af71f66 fix(website): remove duplicate tailwind rule (#7316)
My editor complained that the `hover:ring-2` class was applied twice for
these elements.
2024-11-12 03:22:07 +00:00
Thomas Eizinger
237865c37b test(connlib): drain all Transmits at the end of advance (#7315)
Within our test suite, we "spin" for several (simulated) seconds after
each state transition to allow for packets being sent between the
different nodes. The test suite simulates different latencies by
delaying the delivery of some of these packets.

`connlib` has several timers for sending packets, i.e. STUN bindings, WG
keep-alives etc. These timers never end so we cannot simply spin "until
we no longer want to send any packets". Currently, we simply hard-stop
after a few seconds and drop the remaining packets and move on to the
next state transition.

At present, this isn't an issue because only our ICE agent adheres to
the simulated time advancement. `boringtun` is still impure and thus we
usually don't get to see any of the WireGuard packets like keep-alives
and session timeouts etc in our tests. The STUN messages are pretty
resilient to retransmissions so the current packet drop doesn't matter.

In the process of adopting our boringtun fork
(https://github.com/firezone/boringtun) where we will eventually fix the
time impurity, dropping some of these packets caused problems.

To fix this, we now drain all remaining packets that are sitting in the
"yet-to-be-delivered" buffer. These packets are delivered to an "inbox"
that is per-host, meaning the host (i.e. client, gateway or relay) will
still perceive the incoming packet with the correct latency.

We extract this functionality from #7120 because it is generally useful.
2024-11-12 03:19:07 +00:00
Thomas Eizinger
a83729e439 chore(gateway): be more detailed in error reporting (#7314)
Instead of collapsing multiple of these errors into one, we emit a
dedicated error message for each case. This will allow us to distinguish
them within Sentry events.
2024-11-12 03:16:06 +00:00
Thomas Eizinger
b78e84090c refactor(gui-client): reduce warning to debug (#7311)
Windows has some funny behaviour where creating the deep-link server
sometimes fails and we have to try again. Currently, each of these
operations is logged as a warning when it would actually succeed later.
These create unnecessary Sentry alerts.

If we run out of attempts to create the deep-link server (currently 10),
the entire function fails which will be logged as an error further down.
The last 500 INFO and DEBUG logs will be captured as breadcrumbs
together with the event, meaning we still get to see those error
messages on why it failed to create the deep-link server.

Resolves: #7238.
2024-11-12 03:14:25 +00:00
Thomas Eizinger
ad4eea29ff chore(rust): don't panic in fallible functions (#7298)
"Just let it crash" is terrible advice for software that is shipped to
end users. Where possible, we should use proper error handling and only
fail the current function / task that is active, e.g. drop a particular
packet instead of failing all of connlib. We more or less already do
that.

Activating the clippy lint `unwrap_in_result` surfaced a few more places
where we panic despite being in a function that is fallible already.
These cases can easily be converted to not panic and return an error
instead.
2024-11-11 23:55:23 +00:00
Thomas Eizinger
0dc078876b refactor(gui-client): capture error sources when connect fails (#7303)
When `connlib` fails to establish a session, the GUI client currently
only captures the top-level error within `connect_to_firezone` because
it uses `.to_string()` for all errors. Unfortunately, that doesn't print
any of the sources of an error.

To conveniently capture all sources, we can use `anyhow` and its
alternate formatting using `format!("{e:#}")` (notice the `#`). Not all
errors within `connect_to_firezone` should be captured like this
however. Certain IO errors, in particular when trying to resolve the
domain of the portal, need to be captured separately because they may
resolve by themselves if we gain connectivity again. This is important,
otherwise we discard the users token when they boot-up a machine without
internet access yet Firezone is auto-starting.

To make this more ergonomic, we trim down `IpcServiceError` to two
variants: The IO variant we need to special-case and everything else.
This allows us to create `From` impls which "do the right thing" by
capturing more error information using `anyhow`'s alternate formatting.
2024-11-11 22:52:14 +00:00
dependabot[bot]
7e4e190cd6 build(deps): Bump test-strategy from 0.3.1 to 0.4.0 in /rust (#7308)
Bumps [test-strategy](https://github.com/frozenlib/test-strategy) from
0.3.1 to 0.4.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c683eb3cf6"><code>c683eb3</code></a>
Version 0.4.0.</li>
<li><a
href="17706bcd1c"><code>17706bc</code></a>
Update MSRV to 1.70.0.</li>
<li><a
href="90a5efbf00"><code>90a5efb</code></a>
Update dependencies.</li>
<li><a
href="cff2ede71f"><code>cff2ede</code></a>
Changed the strategy generated by <code>#[filter(...)]</code> to reduce
`Too many local ...</li>
<li><a
href="34cc6d2545"><code>34cc6d2</code></a>
Update expected compile error message.</li>
<li><a
href="a4427e2d98"><code>a4427e2</code></a>
Update CI settings.</li>
<li><a
href="ecb7dbae04"><code>ecb7dba</code></a>
Clippy.</li>
<li><a
href="637f29e9c8"><code>637f29e</code></a>
Made it so an error occurs when an unsupported attribute is specified
for enu...</li>
<li><a
href="6d66057bb0"><code>6d66057</code></a>
Use <code>test</code> instead of <code>check</code> with <code>cargo
hack --rust-version</code>.</li>
<li><a
href="cee2ebbfe6"><code>cee2ebb</code></a>
Fix CI settings.</li>
<li>Additional commits viewable in <a
href="https://github.com/frozenlib/test-strategy/compare/v0.3.1...v0.4.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=test-strategy&package-manager=cargo&previous-version=0.3.1&new-version=0.4.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>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-11-11 21:26:41 +00:00
dependabot[bot]
1aa9ae9885 build(deps): Bump tokio from 1.41.0 to 1.41.1 in /rust (#7307)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.41.0 to 1.41.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/tokio/releases">tokio's
releases</a>.</em></p>
<blockquote>
<h2>Tokio v1.41.1</h2>
<h1>1.41.1 (Nov 7th, 2024)</h1>
<h3>Fixed</h3>
<ul>
<li>metrics: fix bug with wrong number of buckets for the histogram (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6957">#6957</a>)</li>
<li>net: display <code>net</code> requirement for
<code>net::UdpSocket</code> in docs (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6938">#6938</a>)</li>
<li>net: fix typo in <code>TcpStream</code> internal comment (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6944">#6944</a>)</li>
</ul>
<p><a
href="https://redirect.github.com/tokio-rs/tokio/issues/6957">#6957</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6957">tokio-rs/tokio#6957</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6938">#6938</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6938">tokio-rs/tokio#6938</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6944">#6944</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6944">tokio-rs/tokio#6944</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="bb7ca7507b"><code>bb7ca75</code></a>
chore: prepare Tokio v1.41.1 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6959">#6959</a>)</li>
<li><a
href="4a34b77af5"><code>4a34b77</code></a>
metrics: fix bug with wrong number of buckets for the histogram (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6957">#6957</a>)</li>
<li><a
href="8897885425"><code>8897885</code></a>
docs: fix mismatched backticks in CONTRIBUTING.md (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6951">#6951</a>)</li>
<li><a
href="0dbdd196b6"><code>0dbdd19</code></a>
ci: update cargo-check-external-types to 0.1.13 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6949">#6949</a>)</li>
<li><a
href="94e55c092b"><code>94e55c0</code></a>
net: fix typo in <code>TcpStream</code> internal comment (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6944">#6944</a>)</li>
<li><a
href="4468f27c31"><code>4468f27</code></a>
metrics: fixed flaky <code>worker_steal_count</code> test (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6932">#6932</a>)</li>
<li><a
href="070a825999"><code>070a825</code></a>
metrics: removed race condition from global_queue_depth_multi_thread
test (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6">#6</a>...</li>
<li><a
href="946401c345"><code>946401c</code></a>
net: display <code>net</code> requirement for
<code>net::UdpSocket</code> in docs (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6938">#6938</a>)</li>
<li><a
href="0c01fd23b4"><code>0c01fd2</code></a>
ci: use patched version of cargo-check-external-types to fix CI failure
(<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6937">#6937</a>)</li>
<li><a
href="ebe241647e"><code>ebe2416</code></a>
ci: use cargo deny (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6931">#6931</a>)</li>
<li>See full diff in <a
href="https://github.com/tokio-rs/tokio/compare/tokio-1.41.0...tokio-1.41.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tokio&package-manager=cargo&previous-version=1.41.0&new-version=1.41.1)](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-11-11 21:06:55 +00:00
Thomas Eizinger
cd26ce6dfe refactor(gui-client): return error to TypeScript from commands (#7302)
Within the Tauri client, we invoke commands from TypeScript on the Rust
side. These commands can sometimes fail, which is why these commands
return a `Result`.

Most of our commands actually only send messages through a channel to an
event-loop. This can only fail if the other side of the channel is
closed, which should(?) only happen if the program is shutting down or
some part of it crashed. Regardless, these errors can directly be
forwarded to the TypeScript code where they will get caught and logged
to the browser console.

In the future, we can install Sentry's TypeScript client in the GUI code
to automatically report errors on the TypeScript side too.

Resolves: #7256.
2024-11-11 19:57:31 +00:00
Thomas Eizinger
a5e20064dc refactor(gui-client): downgrade temporary error (#7304)
If we only temporarily fail to connect to the portal, we don't need to
report this as a warning.

Resolves: #7251.
2024-11-11 19:51:42 +00:00
Thomas Eizinger
4e67c568da refactor: downgrade errors when we cannot bind sockets (#7305)
Most of the time, these errors are a result of a limited IP stack, for
example IPv6 not being available. Reporting these as errors to Sentry is
unnecessarily noisy.

If something else happens further down the line, the last 500 debug and
info logs will be sent along with the error report so we will still see
these in the breadcrumbs if an actual error happens later.

Resolves: #7245.
2024-11-11 19:51:10 +00:00
Thomas Eizinger
488c599d5b chore(telemetry): capture Firezone ID and account in user ctx (#7310)
Sentry has a feature called the "User context" which allows us to assign
events to individual users. This in turn will give us statistics in
Sentry, how many users are affected by a certain issue.

Unfortunately, Sentry's user context cannot be built-up step-by-step but
has to be set as a whole. To achieve this, we need to slightly refactor
`Telemetry` to not be `clone`d and instead passed around by mutable
reference.

Resolves: #7248.
Related: https://github.com/getsentry/sentry-rust/issues/706.
2024-11-11 19:50:14 +00:00
Thomas Eizinger
06a274c4e5 refactor(apple): make panics on decoding errors more descriptive (#7301)
The communication between the native Apple client and `connlib` uses
JSON encoding. The deserialisation of these should never fail because a
particular version of `connlib` is always bundled with the native
client. Thus, panicking here is justified.

In case it does ever happen, we improve the panic message with this
patch.
2024-11-11 04:18:07 +00:00
Thomas Eizinger
213dd34ff3 chore(apple): log all connect errors on the connlib-side (#7300)
We don't have Sentry yet in the native Apple client, meaning we don't
yet learn about errors returned from the `connect` call. Normally,
logging and returning an error is an anti-pattern. We are okay with that
in this case until we can report these errors in the native Apple
client.
2024-11-11 04:01:12 +00:00
Thomas Eizinger
62cb32b7a3 chore(gateway): report more tunnel errors to event-loop (#7299)
Currently, the Gateway's state machine functions for processing packets
use type-signature that only return `Option`. Any errors while
processing packets are logged internally. This makes it difficult to
consistently log these errors.

We refactor these functions to return `Result<Option<T>>` in most cases,
indicating that they may fail for various reasons and also sometimes
succeed without producing an output.

This allows us to consistently log these errors in the event-loop.
Logging them on WARN or ERROR would be too spammy though. In order to
still be alerted about some of these, we use the `telemetry_event!`
macro which samples them at a rate of 1%. This will alert us about cases
that happen often and allows us to handle them explicitly.

Once this is deployed to staging, I will monitor the alerts in Sentry to
ensure we won't get spammed with events from customers on the next
release.
2024-11-11 03:50:27 +00:00
Jamil
ce8d8709d6 chore(infra): Remove project owners that are no longer owners (#7297)
Now Terraform is receiving a 400 from the Google API because these users
don't exist... 🙃.

Hopefully the cycle was broken by the last PR and this one succeeds.
2024-11-10 10:05:32 -08:00
Jamil
b0c6b6d3c5 fix(infra): Restore project owners to prevent cycle. Will delete later (#7296)
Terraform is complaining about a cycle involved with deleting these
project owners from the prod config.


https://app.terraform.io/app/firezone/workspaces/production/runs/run-7vhn8Yv5pksywBtd

Will restore them to get prod to deploy now, and then investigate the
cycle more carefully afterward.
2024-11-10 08:52:41 -08:00