Commit Graph

6120 Commits

Author SHA1 Message Date
Thomas Eizinger
62dfe65679 chore(connlib): improve error messages for failed translations (#7540) 2024-12-18 04:47:26 +00:00
Thomas Eizinger
40ff26ce1a chore: remove commented out import (#7539) 2024-12-17 21:00:20 +00:00
Thomas Eizinger
f3c4d461ea ci(kotlin): remove permanently disabled job (#7538)
There is no reason to keep this around if we are not running it. We can
always look it up in Git's history.
2024-12-17 17:59:50 +00:00
Thomas Eizinger
8a1b6f26b4 fix(connlib): don't log warnings for unreachable errors (#7537)
When a Gateway or Client is running in an environment without IPv4 or
IPv6 connectivity, our initial probes for sending packets to the relays
will fail with network unreachable. That isn't a very big concern and
happens a lot in the wild. There is no need to report these as telemetry
events.

Resolves: #7514.
2024-12-17 17:59:20 +00:00
Thomas Eizinger
98be884c3a fix(telemetry): dispose previous session when starting new one (#7542)
For persistent applications like the IPC service, it is possible that
telemetry gets initialised with different parameters depending on what
the user logs in with. Currently, only the first one is persisted and
all consecutive ones are ignored, leading to events that may be wrongly
tagged for a certain user / environment.

To fix this, we only skip the init if we are still in the same
environment. Otherwise, the close the previous session and initialise a
new one.

Fixes: #7525.
2024-12-17 16:22:38 +00:00
Brian Manifold
1f457d2127 fix(portal): Fixing a few edge cases for identity email (#7532) 2024-12-16 23:11:25 +00:00
Thomas Eizinger
aa8c53a20d refactor(rust): use a buffer pool for network packets (#7489)
In order to achieve concurrency within `connlib`, we needed to create a
way for IP packets to own the piece of memory they are sitting in. This
allows us to concurrently read IP packets and them batch-process them
(as opposed to have a dedicated buffer and reference it). At the moment,
those IP packets are defined on the stack. With a size of ~1300 bytes
that isn't very large but still causes _some_ amount of copying.

We can avoid this copying by relying on a buffer pool:

1. When reading a new IP packet, we request a new buffer from the pool.
2. When the IP packet gets dropped, the buffer gets returned to the
pool.

This allows us to reuse an allocation for a packet once it finished
processing, resulting in less CPU time spent on copying around memory.

This causes us to make more _individual_ heap-allocations in the
beginning: Each packet is being processed by `connlib` is allocated on
the heap somewhere. At some point during the lifetime of the tunnel,
this will settle in an ideal state where we have allocated enough slots
to cover new packets whilst also reusing memory from packets that
finished processing already.

The actual `IpPacket` data type is now just a pointer. As a result, the
channels to and from the TUN thread (where we were holding multiple of
these packets) are now significantly smaller, leading to roughly the
same memory usage overall.

In my local testing on Linux, the client still only uses about ~15MB of
RAM even with multiple concurrent speedtests running.
2024-12-16 01:02:17 +00:00
Thomas Eizinger
8cecdc6906 fix(gui-client): ignore ConnectResult in wrong state (#7499)
Similar to #7497, when we receive a `ConnectResult`, we can simply
silently bail out of the function and not change our state instead of
printing a loud warning.
2024-12-16 01:02:05 +00:00
Jamil
d8dda14759 docs: Appease codespell in elixir/README.md (#7528) 2024-12-15 17:01:54 -08:00
Jamil
fe164389c1 docs: Add instructions for connecting to Cloud SQL as the firezone user (#7527)
This is needed to perform index surgery.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2024-12-15 16:39:29 -08:00
Jamil
9fdfbea818 chore: fix elixir formatting (#7524) 2024-12-15 10:50:48 -08:00
Jamil
938448a43b fix(portal): Update existing auth_identities migration to include provider_identifier in the index (#7523)
#7522 won't successfully complete on production because of the migration
in this PR. So, instead, we need to modify this migration, and then
manually apply the same operation to staging.
2024-12-15 10:08:25 -08:00
Jamil
d3f38a22ae fix(portal): Add provider_identifier to identities email unique index (#7522)
It's possible for two of the same emails to exist within the same
provider, so we need to add `provider_identifier` to the unique index to
enforce uniqueness properly.

Refs https://firezonehq.slack.com/archives/C04HRQTFY0Z/p1734131256450379
2024-12-15 09:37:22 -08:00
Thomas Eizinger
1b04b0eb2b fix(windows): don't warn on deleting non-existing route (#7507)
Similarly as Linux (#7502), we don't want to log an error if we cannot
delete a route that doesn't exist.
2024-12-13 21:09:09 +00:00
Thomas Eizinger
0861ccaf06 chore(connlib): improve logging on missing flow (#7508)
Normally, there always be exactly on pending flow per resource. It
appears though that it can sometimes happen that we first request a flow
for a resource but by the time it is authorised, we've already cleared
its local state.

Regardless, this isn't a concerning error and not worth logging on WARN
(which happens one layer up).
2024-12-13 18:03:53 +00:00
Thomas Eizinger
3c2c01c44c chore(gui-client): don't warn when tray menu updates fail (#7510)
Windows appears to randomly fail to update the tray menu. There is
nothing we can do about that. Hence, we downgrade these errors to debug
and make the functions infallible, reducing the complexity for the
caller.
2024-12-13 17:55:00 +00:00
Thomas Eizinger
61d6eceb29 chore(connlib): downgrade warning about missing DNS servers (#7509)
There is nothing we can do if the user doesn't have any DNS servers
defined. The default log level is INFO so a user reading the logs will
still come across this message in case they are trying to debug what is
happening.

Long term, problems like these would probably warrant some kind of
notification channel from `connlib` to the GUI where we can display
messages to the user.
2024-12-13 17:53:36 +00:00
Thomas Eizinger
7a33146997 chore(connlib): downgrade warning when disconnecting from relay (#7512)
There are several reasons why we can disconnect from a relay at runtime:

- STUN is blocked
- We have invalid credentials
- The TURN server is not protocol-conform

The first two are very much possible in production and there is nothing
we can do about them. When relays reboot, their credentials change and
if the Internet connection of a user / gateway gets cut, we may
disconnect from the relay because the messages get lost.

The last one should never happen if we are connected to our own relays.
Firezone can be self-hosted so ultimately, we don't have control over
what we are talking to. That error however is more of a safe-guard for
`connlib` itself to disconnect from the server as soon as it detects
that it is behaving weirdly.

None of these reasons are worth reporting to Sentry as a problem because
they aren't really fixable as such. It is more important that the user
sees them in the logs if they decide to dig into them which they will
still do on INFO level.
2024-12-13 17:52:59 +00:00
Brian Manifold
f114bc95cd refactor(portal): Add email as separate column on auth_identities table (#7472)
Why:

* Currently, when using the API, a user has no way of easily identifying
what identities they are pulling back as the response only includes the
`provider_identifier` which for most of our AuthProviders is an ID for
the IdP and not an email address. Along with that, when adding users to
an OIDC provider within Firezone, there is no check for whether or not
an identity has already been added with a given email address. By
creating a separate email column on the `auth_identities` table, it will
be very straight forward to know whether an email address exists for a
given identity, return it in an API response and allow the admin of a
Firezone account to track users (Identities) by email rather than IdP
identifier.

Fixes #7392
2024-12-13 17:26:47 +00:00
Thomas Eizinger
b63061994d chore(headless-client): release version 1.4.0 (#7495)
Headless Client 1.4.0 has been released
(https://github.com/firezone/firezone/releases/tag/headless-client-1.4.0).
This PR updates the changelog and version numbers accordingly.
2024-12-13 07:10:11 +00:00
Thomas Eizinger
b5f25da5ac fix(gui-client): remove error about unexpected TunnelReady (#7497)
The communication between the GUI client, the IPC service and `connlib`
are asynchronous. As such, it may happen that the state machines run out
of sync. Receiving a `TunnelReady` despite not being in the right state
for that is no concern and can be handled gracefully.
2024-12-13 05:52:34 +00:00
Thomas Eizinger
7309428cae chore(gateway): release version 1.4.2 (#7494)
Gateway 1.4.2 has been released
(https://github.com/firezone/firezone/releases/tag/gateway-1.4.2). This
PR updates the changelog and version numbers accordingly.
2024-12-13 05:49:19 +00:00
Thomas Eizinger
48857d3bc8 chore(relay): downgrade allocation mismatch warn on CHANNEL_BIND (#7505)
This code-path is handled gracefully in `connlib`, no need to issue a
warning here.
2024-12-13 05:41:28 +00:00
Thomas Eizinger
73625e4669 chore(relay): don't log all AUTH errors on WARN (#7506)
Not all authentication errors are warnings that we need to be alerted
about.
2024-12-13 05:37:15 +00:00
Thomas Eizinger
5d5e5ab0b1 fix(gui-client): make tray menu refresh infallible (#7498)
In most cases, the caller of this function already handled the case of
it failing gracefully by logging. From Sentry alerts, we can see that if
this fails, there isn't much we can do about it and most likely, the
next refresh will work again (this has only happened a single time).

Logging this on `debug` is good enough in case something doesn't work
and we need to reproduce it or something really bad happens we need see
it in the breadcrumbs of another Sentry event.
2024-12-13 04:54:41 +00:00
Thomas Eizinger
f30cc3226d fix(gateway): don't return error when client disconnected (#7504)
When a client disconnects, we clear up the connection on the gateway.
There might still be packets arriving from resources that we then cannot
route. This isn't worth returning an error.
2024-12-13 04:54:07 +00:00
Thomas Eizinger
b5d6c27680 fix(linux): don't print error when removing non-existent route (#7502)
We are already handling one case where we are trying to remove a route
that doesn't exist. `ESRCH` is another variant of this error that
manifests as "No such process". According to the Internet, this just
means the route doesn't exist so we can bail out early here.
2024-12-13 04:53:22 +00:00
Thomas Eizinger
30376cd79a fix(gateway): polish error handling in main (#7500)
Currently, the Gateway logs all errors that happen when the event-loop
exits on ERROR level. This creates Sentry alerts for things like
"Unauthorized" errors or "404 Not found".

That isn't useful to us. To mitigate this, we polish the code a bit to
only log an ERROR when we actually fail to setup something during
startup (like the TUN device). In all other cases, we now log a more
user-friendly message on INFO but still exit with the appropriate exit
code (0 on CTRL+C, 1 on any other error).
2024-12-13 04:51:58 +00:00
Thomas Eizinger
db2dd4a618 ci: pass SENTRY_AUTH_TOKEN explicit as input (#7503)
Secrets are not accessible within actions.
2024-12-13 04:47:47 +00:00
Thomas Eizinger
951edd802a fix(gui-client): lower log level when update check fails (#7501) 2024-12-13 04:43:16 +00:00
Thomas Eizinger
f0c2bfa6eb chore(gui-client): release version 1.4.0 (#7496)
GUI Client 1.4.0 has been released
(https://github.com/firezone/firezone/releases/tag/gui-client-1.4.0).
This PR updates the changelog and versions accordingly.
2024-12-13 04:41:49 +00:00
Brian Manifold
9711cf56c1 fix(portal): Fix update API endpoint for resources (#7493)
Why:

* The API endpoint for updating Resources was using
`Resources.fetch_resource_by_id_or_persistent_id`, however that function
was fetching all Resources, which included deleted Resources. In order
to prevent an API user from attempting to update a Resource that is
deleted, a new function was added to fetch active Resources only.

Fixes: #7492
2024-12-12 22:51:28 +00:00
Thomas Eizinger
67161afd2c build(deps): switch to quinn-udp release (#7491)
The less Git-dependencies the better.
2024-12-12 16:49:43 +00:00
Thomas Eizinger
da04924da1 chore(relay): downgrade log on missing allocation for REFRESH (#7490)
Attempting to refresh an allocation is the only idempotent way in TURN
to test whether one has an active allocation. As such, logging this on
WARN is too aggressive.

Resolves: #7481.
2024-12-12 16:48:02 +00:00
Thomas Eizinger
7a478634a8 feat(connlib): buffer packets during connection and NAT setup (#7477)
At present, `connlib` will always drop all IP packets until a connection
is established and the DNS resource NAT is created. This causes an
unnecessary delay until the connection is working because we need to
wait for retransmission timers of the host's network stack to resend
those packets.

With the new idempotent control protocol, it is now much easier to
buffer these packets and send them to the gateway once the connection is
established.

The buffer sizes are chosen somewhat conservatively to ensure we don't
consume a lot of memory. The hypothesis here is that every protocol -
even if the transport layer is unreliable like UDP - will start with a
handshake involving only one or at most a few packets and waiting for a
reply before sending more. Thus, as long as we can set up a connection
quicker than the re-transmit timer in the host's network stack,
buffering those packets should result in no packet loss. Typically,
setting up a new connection takes at most 500ms which should be fast
enough to not trigger any re-transmits.

Resolves: #3246.
2024-12-12 11:40:38 +00:00
Jamil
a7b8253766 chore(apple/xcode): Cache rust build more intelligently using build phase (#7488)
Xcode has decent support for skipping certain build phases when input
files haven't changed. This only happens for build phases within a
single target, and not for entire Target dependencies.

Before, we defined `Connlib` as its own bonafide build target, and then
added it as a target dependency for the network extension targets. This
causes Xcode to always run our `build-rust.sh` script, which takes
around 30s on my M1 even when `rust/` hasn't changed.

Instead, we can remove the `Connlib` target, and add a "Run script"
phase to the network extension targets themselves. By configuring the
input file list, Xcode will skip this phase if `rust/**/*.rs`,
`rust/**/*.toml` and `rust/Cargo.lock` haven't changed.

This makes it **much** faster to iterate on Swift code -- Xcode is
_very_ fast when building pure Swift (sometimes under < 1s).



<img width="1016" alt="Screenshot 2024-12-11 at 6 10 45 PM"
src="https://github.com/user-attachments/assets/29b5f073-3d58-4c07-9592-f9209033c966"
/>
2024-12-12 03:46:58 +00:00
Jamil
253e1a6972 fix(tauri): Bump nanoid re: CVE-2024-55565 (#7487)
Fixes https://github.com/firezone/firezone/security/dependabot/136
2024-12-12 00:52:58 +00:00
Jamil
d775487508 fix(tauri): Bump cross-spawn re: CVE-2024-21538 (#7486)
Fixes https://github.com/firezone/firezone/security/dependabot/129
2024-12-12 00:49:56 +00:00
dependabot[bot]
d0aef8f1d8 build(deps): Bump nanoid from 3.3.7 to 3.3.8 in /website in the npm_and_yarn group (#7485)
Bumps the npm_and_yarn group in /website with 1 update:
[nanoid](https://github.com/ai/nanoid).

Updates `nanoid` from 3.3.7 to 3.3.8
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/ai/nanoid/blob/main/CHANGELOG.md">nanoid's
changelog</a>.</em></p>
<blockquote>
<h2>3.3.8</h2>
<ul>
<li>Fixed a way to break Nano ID by passing non-integer size (by <a
href="https://github.com/myndzi"><code>@​myndzi</code></a>).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3044cd5e73"><code>3044cd5</code></a>
Release 3.3.8 version</li>
<li><a
href="4fe34959c3"><code>4fe3495</code></a>
Update size limit</li>
<li><a
href="d643045f40"><code>d643045</code></a>
Fix pool pollution, infinite loop (<a
href="https://redirect.github.com/ai/nanoid/issues/510">#510</a>)</li>
<li>See full diff in <a
href="https://github.com/ai/nanoid/compare/3.3.7...3.3.8">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=nanoid&package-manager=npm_and_yarn&previous-version=3.3.7&new-version=3.3.8)](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 <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
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>
2024-12-11 22:47:35 +00:00
Thomas Eizinger
e507197480 docs(gateway): add changelog entry for #7479 (#7484)
The issue is now fixed and `git pull` from `github.com` as a resource
now works as expected.
2024-12-11 22:47:06 +00:00
dependabot[bot]
6de324af05 build(deps): Bump tokio from 1.41.1 to 1.42.0 in /rust (#7469)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.41.1 to 1.42.0.
<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.42.0</h2>
<h1>1.42.0 (Dec 3rd, 2024)</h1>
<h3>Added</h3>
<ul>
<li>io: add <code>AsyncFd::{try_io, try_io_mut}</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6967">#6967</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>io: avoid <code>ptr-&gt;ref-&gt;ptr</code> roundtrip in
RegistrationSet (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6929">#6929</a>)</li>
<li>runtime: do not defer <code>yield_now</code> inside
<code>block_in_place</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6999">#6999</a>)</li>
</ul>
<h3>Changes</h3>
<ul>
<li>io: simplify io readiness logic (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6966">#6966</a>)</li>
</ul>
<h3>Documented</h3>
<ul>
<li>net: fix docs for <code>tokio::net::unix::{pid_t, gid_t,
uid_t}</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6791">#6791</a>)</li>
<li>time: fix a typo in <code>Instant</code> docs (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6982">#6982</a>)</li>
</ul>
<p><a
href="https://redirect.github.com/tokio-rs/tokio/issues/6791">#6791</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6791">tokio-rs/tokio#6791</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6929">#6929</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6929">tokio-rs/tokio#6929</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6966">#6966</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6966">tokio-rs/tokio#6966</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6967">#6967</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6967">tokio-rs/tokio#6967</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6982">#6982</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6982">tokio-rs/tokio#6982</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6999">#6999</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6999">tokio-rs/tokio#6999</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="bb9d57017e"><code>bb9d570</code></a>
chore: prepare Tokio v1.42.0 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7005">#7005</a>)</li>
<li><a
href="af9c683d52"><code>af9c683</code></a>
tests: fix typo in build test instructions (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7004">#7004</a>)</li>
<li><a
href="4bc5a1a058"><code>4bc5a1a</code></a>
ci: allow Unicode-3.0 license for unicode-ident (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7006">#7006</a>)</li>
<li><a
href="f8948ea021"><code>f8948ea</code></a>
runtime: do not defer <code>yield_now</code> inside
<code>block_in_place</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6999">#6999</a>)</li>
<li><a
href="bce9780dd3"><code>bce9780</code></a>
time: use <code>array::from_fn</code> instead of manually creating array
(<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7000">#7000</a>)</li>
<li><a
href="38151f30cb"><code>38151f3</code></a>
readme: unlist 1.32.x as LTS release (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6997">#6997</a>)</li>
<li><a
href="5dda72d338"><code>5dda72d</code></a>
ci: pin valgrind to rustc 1.82 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6998">#6998</a>)</li>
<li><a
href="c07257f99f"><code>c07257f</code></a>
io: simplify io readiness logic (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6966">#6966</a>)</li>
<li><a
href="d08578fc9a"><code>d08578f</code></a>
time: fix a typo in <code>Instant</code> docs (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6982">#6982</a>)</li>
<li><a
href="4047d7962a"><code>4047d79</code></a>
miri: add annotations for tests with miri ignore (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6981">#6981</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/tokio-rs/tokio/compare/tokio-1.41.1...tokio-1.42.0">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.1&new-version=1.42.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-12-11 21:05:44 +00:00
Thomas Eizinger
87c3e4dd86 fix(telemetry): disable for unofficial environments (#7482)
On the one hand, learning about in which edgecases our software fails is
useful and thus having telemetry also active for self-hosted users is
beneficial. On the other hand, we have neither control nor a contact to
those self-hosted and whatever they are doing might spam our Sentry
account with errors that we can't do anything about.

To mitigate this, we disable telemetry for self-hosted users with the
next release.

Once we have more resources, we can consider enabling this again.
2024-12-11 19:03:48 +00:00
Thomas Eizinger
a0efc4cfdc fix(connlib): don't fail NAT64 on invalid IPv4 DSCP value (#7479)
As per the RFC, the IPv6 traffic class should be 1-to-1 translated to
the IPv4 DSCP value. However, it appears that not all values here are
valid. In particular, when attempting to reach GitHub over IPv6, we
receive an IPv6 packet that has a traffic class value of 72 which is
out-of-range for the IPv4 DSCP value, resulting in the following error
on the Gateway:

```
Failed to translate packet: NAT64 failed: Error '72' is too big to be a 'IPv4 DSCP (Differentiated Services Code Point)' (maximum allowed value is '63')
```

The bigger scope of this issue is that this causes the ICMP packets
returned to the client to be dropped which means that `ssh` spawned by
`git` doesn't learn that the IPv6 address assigned by Firezone is not
actually routable.

Related: #7476.
2024-12-11 19:03:37 +00:00
Thomas Eizinger
9b8e4d1764 chore(telemetry): remove outdated comments (#7483)
We are no longer using `ArcSwap` here.
2024-12-11 19:02:30 +00:00
Thomas Eizinger
7e38d3caee chore(connlib): downgrade warning about failed flow (#7480) 2024-12-11 19:01:37 +00:00
Thomas Eizinger
83464c6412 ci: allow unmaintained gtk crates (#7478)
Tauri still depends on GTK3 which is now officially unmaintained
(https://github.com/rustsec/advisory-db/pull/2164). I've asked the Tauri
team for a position on it
(https://github.com/tauri-apps/tauri/issues/11942). In the meantime,
we'll have to allow the use of these unmaintained crates to unblock CI.
2024-12-11 15:40:07 +00:00
Thomas Eizinger
81f71cba62 fix(telemetry): use package@version notation for releases (#7466)
In order for Sentry to parse our releases as semver, they need to be in
the form of `package@version` [0]. Without this, the feature of "Mark
this issue as resolved in the _next_ version" doesn't work properly
because Sentry compares the versions as to when it first saw them vs
parsing the semver string itself. We test versions prior to releasing
them, meaning Sentry learns about a 1.4.0 version before it is actually
released. This causes false-positive "regressions" even though they are
fixed in a later (as per semver) release.

This create some redundancy with the different DSNs that we are already
using. I think it would make sense to consider merging the two projects
we have for the GUI client for example. That is really just one project
that happens to run as two binaries.

For all other projects, I think the separation still makes sense because
we e.g. may add Sentry to the "host" applications of Android and
MacOS/iOS as well. For those, we would reuse the DSN and thus funnel the
issues into the same Sentry project.

As per Sentry's docs, releases are organisation-wide and therefore need
a package identifier to be grouped correctly.

[0]:
https://docs.sentry.io/platforms/javascript/configuration/releases/#bind-the-version
2024-12-09 05:04:45 +00:00
Jamil
ac608d560a refactor(apple): Migrate firezone-id file to keychain (#7464)
Unlike the App extension which runs as the user, the system extension
introduced in macOS client 1.4.0 runs as `root` and thus cannot read the
App Group container directory for the GUI process. However, both
processes can read and write to the shared Keychain, which is how we
pass the token between the two processes already.

This PR does two things:

1. Tries to read an existing `firezone-id` from the pre-1.4.0 App Group
container upon app launch. This needs to be done from the GUI process.
If found, it stores it in the Keychain.
1. Refactors the `firezone-id` to be stored in the Keychain instead of a
plaintext file going forward.

The Keychain API is also cleaned up and abstracted to be more ergonomic
to use for both Token and Firezone ID storage purposes.
2024-12-09 03:17:46 +00:00
Jamil
45bfe0f2a3 chore(infra): Deny connections from US-sanctioned countries with HTTP 403 (#7462)
Implementing the remainder of the legally required block. Will be
applied on Dec 9th, as we notified customers.
2024-12-06 20:26:30 +00:00
Jamil
0cdfd1fd4f fix(apple/macos): Install system extension on app launch (#7459)
- Installs the system extension on app launch instead of each time we
start the tunnel, as [recommended by
Apple](https://developer.apple.com/documentation/systemextensions/installing-system-extensions-and-drivers).
This will typically happen when the app is installed for the first time,
or upgraded / downgraded.
- Changes the completion handler functionality for observing the system
extension status to an observed property on the class. This allows us to
update the MenuBar based on the status of the installation, preventing
the user from attempting to sign in unless the system extension has been
installed.

~~This PR exposes a new, subtle issue - since we don't reinstall the
system extension on each startTunnel, the process stays running. This is
expected. However, now the logging handle needs to be maintained across
connlib sessions, similar to the Android tunnel lifetime.~~ Fixed in
#7460

Expect one or two more PRs to handle further edge cases with improved UX
as more testing with the release build and upgrade/downgrade workflows
are attempted.
2024-12-06 05:51:22 +00:00