Commit Graph

4761 Commits

Author SHA1 Message Date
Reactor Scram
97cfb90cae docs(gui-client/windows): add new known issue (#5443)
It's actually bailing out, not crashing, but I think "crash" is more
understandable to users.
2024-06-19 18:00:14 +00:00
Thomas Eizinger
42eb997ea8 revert(connlib): don't return old IPs for DNS resource (#5435) (#5437)
This turns out to break things because we can no longer associate a
working but outdated IP with the DNS resource. Putting this up here in
case we want to merge a fix before we decide on a different one.

Reverts: #5435.
2024-06-19 17:20:17 +00:00
Jamil
8d74f2ae8e fix(portal): Fix Enum.find_value to extract actor name in confirmation dialog (#5430)
Fixes #4884 
Fixes #5425
2024-06-19 16:47:11 +00:00
Reactor Scram
559a54d061 refactor(gui-client): clean up a few things around IPC (#5428)
Extracted from https://github.com/firezone/firezone/pull/5426
- Replace `new` and `new_for_test` for IPC servers with `enum ServiceId`
- Rename `debug_command_setup` to `setup_stdout_logging`

It turned out there is no clever way to hide other platforms from
`cargo-mutants`, I thought I had such a way
2024-06-19 15:18:43 +00:00
Thomas Eizinger
daa82899f5 fix(connlib): don't return old IPs for DNS resource (#5435)
Whenever we resolve a domain name to real IPs, we assign one proxy IP
per resolved IP. In case the DNS records for that domain actually
changed, we only appended the new proxy IPs to the list we assigned to
that domain.

If a domain no longer resolves to a certain IP, we should clear the
assigned proxy IP and stop returning in DNS responses. To achieve this,
we first remove all proxy IPs from our mapping of IP -> domain and then
add all _current_ proxy IPs back to the map.
2024-06-19 03:48:47 +00:00
Gabi
95f13c89c6 fix(connlib): don't treat pending connections as errors (#5433)
When a user sends the first packet to a resource, we generate a
"connection intent" and consult the portal, which gateway to use for
this resource. This process is throttled to only generate a new intent
every 2s.

Once we know, which gateway to use for a certain resource, we initiate a
connection via snownet. This involves an OFFER-ANSWER handshake with the
gateway. A connection for which we have sent an offer and have not yet
received an answer is what we call a "pending connection".

In case the connection setup takes longer than 2s, we will generate
another connection intent which can point to the same gateway that we
are currently setting up a connection with.

Currently, encountering a "pending connection" during another connection
setup is treated as an error which results in some state being
cleaned-up / removed. This is where the bug surfaces: If we remove the
state for a resource as a result of a 2nd connection intent and then
receive the response of the first one, we will be left with no state
that knows about this resource.

We fix this by refactoring `create_or_reuse_connection` to be atomic in
regards to its state changes: All checks that fail the function are
moved to the top which means there is no state to clean up in case of an
error. Additionally, we model the case of a "pending connection" using
an `Option` to not flood the logs with "pending connection" warnings as
those are expected during normal operation.

Fixes: #5385
2024-06-19 02:04:09 +00:00
Gabi
2ea6a5d07e feat(gateway): NAT & mangling for DNS resources (#5354)
As part of #4994, the IP translation and mangling of packets to and from
DNS resources is moved to the gateway. This PR represents the
"gateway-half" of the required changes.

Eventually, the client will send a list of proxy IPs that it assigned
for a certain DNS resource. The gateway assigns each proxy IP to a real
IP and mangles outgoing and incoming traffic accordingly. There are a
number of things that we need to take care of as part of that:

- We need to implement NAT to correctly route traffic. Our NAT table
maps from source port* and destination IP to an assigned port* and real
IP. We say port* because that is only true for UDP and TCP. For ICMP, we
use the identifier.
- We need to translate between IPv4 and IPv6 in case a DNS resource e.g.
only resolves to IPv6 addresses but the client gave out an IPv4 proxy
address to the application. This translation is was added in #5364 and
is now being used here.

This PR is backwards-compatible because currently, clients don't send
any IPs to the gateway. No proxy IPs means we cannot do any translation
and thus, packets are simply routed through as is which is what the
current clients expect.

---------

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-06-19 01:15:27 +00:00
dependabot[bot]
7953169e3b build(deps): Bump curve25519-dalek from 4.1.2 to 4.1.3 in /rust in the cargo group (#5432)
Bumps the cargo group in /rust with 1 update:
[curve25519-dalek](https://github.com/dalek-cryptography/curve25519-dalek).

Updates `curve25519-dalek` from 4.1.2 to 4.1.3
<details>
<summary>Commits</summary>
<ul>
<li><a
href="5312a0311e"><code>5312a03</code></a>
curve: Bump version to 4.1.3 (<a
href="https://redirect.github.com/dalek-cryptography/curve25519-dalek/issues/660">#660</a>)</li>
<li><a
href="b4f9e4df92"><code>b4f9e4d</code></a>
SECURITY: fix timing variability in backend/serial/u32/scalar.rs (<a
href="https://redirect.github.com/dalek-cryptography/curve25519-dalek/issues/661">#661</a>)</li>
<li><a
href="415892acf1"><code>415892a</code></a>
SECURITY: fix timing variability in backend/serial/u64/scalar.rs (<a
href="https://redirect.github.com/dalek-cryptography/curve25519-dalek/issues/659">#659</a>)</li>
<li><a
href="56bf398d0c"><code>56bf398</code></a>
Updates license field to valid SPDX format (<a
href="https://redirect.github.com/dalek-cryptography/curve25519-dalek/issues/647">#647</a>)</li>
<li><a
href="9252fa5c0d"><code>9252fa5</code></a>
Mitigate check-cfg until MSRV 1.77 (<a
href="https://redirect.github.com/dalek-cryptography/curve25519-dalek/issues/652">#652</a>)</li>
<li><a
href="1efe6a93b1"><code>1efe6a9</code></a>
Fix a minor typo in signing.rs (<a
href="https://redirect.github.com/dalek-cryptography/curve25519-dalek/issues/649">#649</a>)</li>
<li><a
href="cc3421a22f"><code>cc3421a</code></a>
Indicate that the rand_core feature is required (<a
href="https://redirect.github.com/dalek-cryptography/curve25519-dalek/issues/641">#641</a>)</li>
<li><a
href="858c4ca8ae"><code>858c4ca</code></a>
Address new nightly clippy unnecessary qualifications (<a
href="https://redirect.github.com/dalek-cryptography/curve25519-dalek/issues/639">#639</a>)</li>
<li><a
href="31ccb67050"><code>31ccb67</code></a>
Remove platforms in favor using CARGO_CFG_TARGET_POINTER_WIDTH (<a
href="https://redirect.github.com/dalek-cryptography/curve25519-dalek/issues/636">#636</a>)</li>
<li><a
href="19c7f4a5d5"><code>19c7f4a</code></a>
Fix new nightly redundant import lint warns (<a
href="https://redirect.github.com/dalek-cryptography/curve25519-dalek/issues/638">#638</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/dalek-cryptography/curve25519-dalek/compare/curve25519-4.1.2...curve25519-4.1.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=curve25519-dalek&package-manager=cargo&previous-version=4.1.2&new-version=4.1.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 <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-06-18 22:38:40 +00:00
Thomas Eizinger
c4e608bd14 fix(gateway): ensure DNS resolution times out before connection (#5419)
When we attempt to establish a connection to a gateway for a DNS
resource, the gateway must resolve the requested domain name before it
can accept the connection. Currently, this timeout is set to 60s which
is much longer than the client's connection timeout.

DNS resolution is typically a very fast protocol so reducing this
timeout to 5s should be safe. In addition, we add a compile-time
assertion that this timeout must be less than the client's connection
timeout.

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-06-18 22:08:49 +00:00
Thomas Eizinger
42e6e9593a chore: update Nix scripts to at least build GUI client (#5423)
I tried to run the GUI client on my system but I think my glibc version
is too recent (2.38) and thus, it crashes after clicking on "Login".

These changes to the Nix script are necessary to at least build the
client.
2024-06-18 22:02:53 +00:00
Jamil
13b26fecf4 ci: Bump GUI client to 1.0.9 (#5431) 2024-06-18 14:48:17 -07:00
Jamil
de38a3537d ci: Use offline evergreen installer (#5429)
May help to alleviate some flakiness regarding the `setup-tauri` action,
and speed up CI runs since the whole installer will be cached, not just
the bootstrapper stub.


https://github.com/firezone/firezone/actions/runs/9570220149/job/26384496768
2024-06-18 20:59:54 +00:00
Jamil
11d76c4941 docs: Add JumpCloud SSO + sync docs (#5390)
Adds a step-by-step guide for setting up the new JumpCloud connector and
optionally directory sync.

Fixes #4950
2024-06-18 19:38:03 +00:00
Jamil
76699b558a feat(website): Add conditional access details to docs and /pricing (#5386)
Followup from the conditional access policies feature.
2024-06-18 12:56:56 -07:00
Andrew Dryga
37f078c379 fix(portal): Verify email in constant time and sign it's value to prevent text injection (#5418)
You still can generate a link that will inject a text as long as it has
`@` in it - there is no good ways to validate emails other than just
check for that. The only *reliable* ways to fix that is to either remove
that text (making users more confused) or only show it if identity was
found (leaking the fact of it's existence).
2024-06-18 13:42:52 -06:00
Reactor Scram
615f2d5284 fix(gui-client): remove emojis from tray menu (#5427) 2024-06-18 18:04:57 +00:00
Reactor Scram
01cbb82cb6 docs(user-guides): update Android Client guide and fix iOS Client guide (#5408)
Closes #4998 

```[tasklist]
### Before merging
- [x] (failed) Figure out how to reconnect Firezone in Android
- [ ] How should the instructions for ChromeOS go? I assume it's a little different from Android
- [ ] Grep for TODOs in all user guides
```

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-06-18 17:44:27 +00:00
Jamil
b64cfdced3 ci: Address missed PR feedback regarding retrying failing elixir unit tests (#5421)
fixes #5420
2024-06-18 16:35:54 +00:00
Jamil
a45acc04db fix(connlib): set default firezone_tunnel log level from trace to debug for development and some ci (#5411)
"Encapsulated packet" is now spamming dev clients, so this level is
changed to `debug` by default in dev builds.

```
2024-06-17 14:04:15.419  6911-7520  connlib                 dev.firezone.android                 V  firezone_tunnel::client: s0_name: encapsulates0_target=firezone_tunnel::clients0_file=connlib/tunnel/src/client.rss0_line=441s0_dst=fd00:2021:1111:8000::2Encapsulated packet
2024-06-17 14:04:15.419  6911-7520  connlib                 dev.firezone.android                 V  firezone_tunnel::client: s0_name: encapsulates0_target=firezone_tunnel::clients0_file=connlib/tunnel/src/client.rss0_line=441s0_dst=fd00:2021:1111:8000::2Encapsulated packet
2024-06-17 14:04:15.420  6911-7520  connlib                 dev.firezone.android                 V  firezone_tunnel::client: s0_name: encapsulates0_target=firezone_tunnel::clients0_file=connlib/tunnel/src/client.rss0_line=441s0_dst=fd00:2021:1111:8000::2Encapsulated packet
2024-06-17 14:04:15.420  6911-7520  connlib                 dev.firezone.android                 V  firezone_tunnel::client: s0_name: encapsulates0_target=firezone_tunnel::clients0_file=connlib/tunnel/src/client.rss0_line=441s0_dst=fd00:2021:1111:8000::2Encapsulated packet
2024-06-17 14:04:15.420  6911-7520  connlib                 dev.firezone.android                 V  firezone_tunnel::client: s0_name: encapsulates0_target=firezone_tunnel::clients0_file=connlib/tunnel/src/client.rss0_line=441s0_dst=fd00:2021:1111:8000::2Encapsulated packet
2024-06-17 14:04:15.420  6911-7520  connlib                 dev.firezone.android                 V  firezone_tunnel::client: s0_name: encapsulates0_target=firezone_tunnel::clients0_file=connlib/tunnel/src/client.rss0_line=441s0_dst=fd00:2021:1111:8000::2Encapsulated packet
2024-06-17 14:04:15.421  6911-7520  connlib                 dev.firezone.android                 V  firezone_tunnel::client: s0_name: encapsulates0_target=firezone_tunnel::clients0_file=connlib/tunnel/src/client.rss0_line=441s0_dst=fd00:2021:1111:8000::2Encapsulated packet
2024-06-17 14:04:15.421  6911-7520  connlib                 dev.firezone.android                 V  firezone_tunnel::client: s0_name: encapsulates0_target=firezone_tunnel::clients0_file=connlib/tunnel/src/client.rss0_line=441s0_dst=fd00:2021:1111:8000::2Encapsulated packet
2024-06-17 14:04:15.422  6911-7520  connlib                 dev.firezone.android                 V  firezone_tunnel::client: s0_name: encapsulates0_target=firezone_tunnel::clients0_file=connlib/tunnel/src/client.rss0_line=441s0_dst=fd00:2021:1111:8000::2Encapsulated packet
2024-06-17 14:04:15.422  6911-7520  connlib                 dev.firezone.android                 V  firezone_tunnel::client: s0_name: encapsulates0_target=firezone_tunnel::clients0_file=connlib/tunnel/src/client.rss0_line=441s0_dst=fd00:2021:1111:8000::2Encapsulated packet
2024-06-17 14:04:15.422  6911-7520  connlib                 dev.firezone.android                 V  firezone_tunnel::client: s0_name: encapsulates0_target=firezone_tunnel::clients0_file=connlib/tunnel/src/client.rss0_line=441s0_dst=fd00:2021:1111:8000::2Encapsulated packet
2024-06-17 14:04:15.423  6911-7520  connlib                 dev.firezone.android                 V  firezone_tunnel::client: s0_name: encapsulates0_target=firezone_tunnel::clients0_file=connlib/tunnel/src/client.rss0_line=441s0_dst=fd00:2021:1111:8000::2Encapsulated packet
```
2024-06-18 04:48:52 +00:00
Jamil
bfbf570191 ci: Increase default assert_receive timeout to 500ms from 100ms (#5417)
We seem to be hitting `assert_receive`-style much more frequently after
"upgrading" to Enterprise Cloud (our credits expired, I was able to
renew them).

This updates the global timeout to 500ms for `assert_receive` to reduce
the likelihood `assert_push` and friends will time out on slow GH
runners.

E.g.


https://github.com/firezone/firezone/actions/runs/9556532328/job/26341986456

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2024-06-17 18:35:11 -07:00
Jamil
1974ef9332 fix(infra): Copy artifacts from github.sha to edge in prod when deploying (#5416)
This will allow us to run prod smoke tests using the `SHA` from `main`
when deploying, without having to release/publish the Gateway first.


Fixes this issue seen in logs:

```
{
  "insertId": "tz43hng1m3lbbe",
  "jsonPayload": {
    "message": "Jun 17 22:36:57 gateway-cn9m firezone-gateway-init[3413]: curl: (22) The requested URL returned error: 404"
  },
  "resource": {
    "type": "gce_instance",
    "labels": {
      "project_id": "firezone-prod",
      "zone": "us-east1-d",
      "instance_id": "8536982484474988766"
    }
  },
  "timestamp": "2024-06-17T22:36:57.601613147Z",
  "labels": {
    "compute.googleapis.com/resource_name": "gateway-cn9m"
  },
  "logName": "projects/firezone-prod/logs/syslog",
  "receiveTimestamp": "2024-06-17T22:36:57.745513999Z"
},
{
  "insertId": "tz43hng1m3lbbd",
  "jsonPayload": {
    "message": "Jun 17 22:36:57 gateway-cn9m firezone-gateway-init[3411]: Downloading 6c310610f3 version from https://storage.googleapis.com/firezone-prod-artifacts/firezone-gateway..."
  },
  "resource": {
    "type": "gce_instance",
    "labels": {
      "project_id": "firezone-prod",
      "zone": "us-east1-d",
      "instance_id": "8536982484474988766"
    }
  },
  "timestamp": "2024-06-17T22:36:57.501343894Z",
  "labels": {
    "compute.googleapis.com/resource_name": "gateway-cn9m"
  },
  "logName": "projects/firezone-prod/logs/syslog",
  "receiveTimestamp": "2024-06-17T22:36:57.745513999Z"
}
```
2024-06-17 18:29:06 -07:00
Andrew
521670e7b5 Enable Andrew's SMS notifications on production, disable mobile apps 2024-06-17 18:19:34 -06:00
Andrew
67c1425917 Try to fix file permissions issues for Tzdata 2024-06-17 18:10:18 -06:00
Jamil
cde8b11d36 Revert "fix(infra): Don't override gateway install version from TF_VAR_image_tag; default to latest" (#5415)
Reverts firezone/firezone#5414
2024-06-17 16:52:46 -07:00
Jamil
92d95b44fa fix(infra): Don't override gateway install version from TF_VAR_image_tag; default to latest (#5414)
Since we've decoupled the Gateway version and portal version, this fixes
an issue deploying to production where we override the Gateway binary
download version with the `TF_VAR_image_tag`, which no longer points to
a valid released binary.

Now, it will fallback to `latest`, which will download the latest
version of the published Gateway to use with the production deploy,
which is what we will expect our customers to be running as well.
2024-06-17 16:25:42 -07:00
Jamil
6c310610f3 chore(ci): version-check move to ubuntu (#5410) 2024-06-17 13:57:32 -07:00
Jamil
21585cb2b0 ci: bump Gateway / headless to 1.0.8 (#5409) 2024-06-17 13:36:37 -07:00
Reactor Scram
e76301067b chore(headless-client/windows): fix cargo test -p firezone-headless-client on Windows (#5406)
This is a funny one. `cargo test -p firezone-headless-client -p
firezone-gui-client` actually passes, because the GUI client uses the
pipes feature, and Cargo apparently just does one build for both
packages. But if you build the headless Client by itself, it fails to
build.

I think this caused `cargo-mutants` to consider all its headless Client
mutants to be unviable, and so it didn't show coverage for that package.
2024-06-17 19:15:16 +00:00
Jamil
a3970c2f0a chore: Revert hardcoding gateway artifact URL (#5407)
This was needed to work around an issue with installing systemd Gateways
from our Terraform examples. Now that the publish workflow is fixed this
is no longer necessary.
2024-06-17 12:04:11 -07:00
Jamil
c1d68340a7 fix(portal): Fix all website links in product (#5401)
Adds a dedicated `anchor` attr to the `website_link` component because
the order of components in a URL must be `/path?params#anchor`.
2024-06-17 17:59:43 +00:00
Jamil
cd8bf1344b docs: Remove known issue related to Window TUN adapter (#5384)
Issue has been fixed.
2024-06-17 17:58:30 +00:00
Jamil
bcccd1cae6 ci: Auth to GCP before copying artifacts (#5405) 2024-06-17 10:43:04 -07:00
Reactor Scram
a9a0a6c450 refactor(headless-client): rewrite the IPC service main loop so we can time the Client startup (#5376)
Part of a yak shave to profile startup time for reducing it on Windows
#5026

Median of 3 runs:

- Windows 11 aarch64 Parallels VM - 4.8 s
- Windows 11 x86_64 laptop - 3.1 s (I thought it used to be slower)
- Windows Server 2022 VM - 22.2 s

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-06-17 16:57:43 +00:00
Jamil
1930e62404 ci: Fix typo in publish workflow (#5404)
Should be an `_` not `-` 🙃
2024-06-17 09:30:46 -07:00
Jamil
5eb6cbc15f ci: Bump versions and fix publish workflow (again) (#5402)
- Bump gui client version
- Fix issue discovered during publishing gui client
2024-06-17 08:44:13 -07:00
Jamil
ee45b39ec4 ci: Fix dupe id (#5400) 2024-06-17 08:17:26 -07:00
Jamil
7c20243733 fix(ci): Copy artifacts to prod on publish, not deploy (#5388)
Fixes hopefully the last remaining issue from #4397 


Fixes #5370
2024-06-17 07:30:53 -07:00
Jamil
27e6672a5d fix(portal): Make Conditions label color match other labels (#5389)
Very minor thing I noticed today.
2024-06-17 14:05:05 +00:00
Jamil
eda1df56c2 ci: Bump Android/Apple cur versions to 1.0.4/1.0.5 (#5397) 2024-06-17 06:55:33 -07:00
Thomas Eizinger
44bb24178e ci: run compatibility tests between latest client and HEAD gateway (#5369)
Currently, our CI tests that the latest released client and gateway are
compatible with the current portal. To allow for smooth upgrades of
deployed infrastructure, we also need to test that any changes we are
making to the gateway are compatible with the latest release of the
client. This allows customers to upgrade their gateways ahead of time
before we publish updates of the clients.

This PR adds a matrix to the compatibility tests to ensure just that.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-06-16 22:32:20 +00:00
Reactor Scram
1cf10f0c3f chore(rust): bump to Rust 1.79 (#5356)
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-06-16 22:06:18 +00:00
Gabi
b783c1b8cc fix(connlib): sending unallowed packets after reconnection (#5381)
## The problem

To find the correct peer for a given resource we keep a map of
`resource_id -> gateway_id` in the client state called
`resources_gateways`.

For CIDR resource connlib when sees a packet it does the following
steps:
1. Find the packet's corresponding resource
2. Find the resource corresponding gateway
3. Find the peer corresponding to the gateway, if none, request
access/connection

The problem was that when roaming, we didn't cleanup the map between
`resource_id -> gateway_id` so if after disconnecting with a gateway we
created a new connection due to a another resource, in step 3, connlib
would find a connected gateway and not request access.

This would cause the client to send unallowed packets to the gateway.

## Steps to reproduce

1. Open the client
2. Ping a CIDR resource on a gateway
3. roam and wait until disconnection
4. Ping a different resource on the same gateway
5. Ping the same CIDR resource as in step 2

This will result in no reply for step 5

## The fix

Cleanup the `resource -> gateway` map after disconnecting with a
gateway.

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-06-16 21:55:59 +00:00
Jamil
2cc890f644 fix(ci): apt-get update before install (#5387) 2024-06-16 14:40:59 -07:00
Jamil
d139ced687 fix(website): Use custom middleware for versioned redirects (#5382)
Because of https://github.com/vercel/next.js/issues/66891, we need
custom middleware to populate the version in multiple places of the
`destination` URL for redirect artifact permalinks.
2024-06-14 19:03:32 -07:00
Gabi
847c61bc99 fix(connlib): revert "build(deps): Bump tokio-tungstenite from 0.21.0 to 0.23.0 in /rust" (#5379)
Reverts firezone/firezone#5290

This updates caused panics in macos, and [turns out it might cause
gateways and relays to
panic](https://github.com/firezone/firezone/pull/5290#issuecomment-2168642981)
2024-06-14 19:58:12 -03:00
Reactor Scram
6e5b351277 fix(gui-client): let the GUI set the log filter for the IPC service (#5292)
Closes #5042 

Smoke test plan:
- Install on a before-Firezone VM
- Confirm logs default to `str0m=warn,info`
- Set log filter to `debug` in GUI
- Restart IPC service
- Confirm logs are `debug`
- Clear settings back to default
- Restart IPC service
- Confirm logs are `str0m=warn,info`

Directions to apply new log level:
1. Put the new log filter in
2. Click "Apply"
3. Quit Firezone Client
4. Right-click on the Start Menu and click "Terminal (Admin)" to open a
Powershell prompt
5. Run `Restart-Service -Name FirezoneClientIpcService` (on Linux, `sudo
systemctl restart firezone-client-ipc.service`)
6. Re-open Firezone Client

```[tasklist]
- [x] Log the log filter maybe
- [x] Use `atomicwrites` to write the file
- [x] (cancelled) ~~Make the GUI write the file on boot if it's not there (saves a step when upgrading from older versions)~~
- [x] Windows smoke test
- [x] Fix permissions on `/var/lib/dev.firezone.client/config`
- [x] Fix Linux IPC service not loading the log filter file
- [x] Linux smoke test
- [ ] Make sure it's okay that users in `firezone-client` can change the device ID
- [ ] Update user guides to include restarting the computer or IPC service after updating the log level?
```

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-06-14 21:35:11 +00:00
Gabi
8cc28499e9 chore(connlib): implement IP translation according to RFC6145 (#5364)
As part of #4994, we need to translate IP packets between IPv4 and IPv6.
This PR introduces the `ConvertiblePacket` abstraction that implements
this.
2024-06-14 21:33:07 +00:00
Reactor Scram
23bcf877a8 fix(gui-client): un-initialize wintun correctly (#5357)
Closes #4765 

It turns out that if I don't join the worker thread explicitly it messes
up wintun a lot. I wonder if I should report that as a bug or what. It's
kind of our fault for keeping a handle to the `Session` alive in the
thread.

```[tasklist]
- [x] Move the debug command from `gui-client` to `headless-client`
- [x] Move the initialization out of `firezone-tunnel`, revert the `pub` changes, use `anyhow::Context`
```

---------

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-06-14 20:21:52 +00:00
Thomas Eizinger
e3890bc0c1 chore(connlib): update docs of CompositeStrategy (#5373) 2024-06-14 19:49:33 +00:00
dependabot[bot]
121d457edf build(deps): Bump tokio-tungstenite from 0.21.0 to 0.23.0 in /rust (#5290)
Bumps [tokio-tungstenite](https://github.com/snapview/tokio-tungstenite)
from 0.21.0 to 0.23.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/snapview/tokio-tungstenite/blob/master/CHANGELOG.md">tokio-tungstenite's
changelog</a>.</em></p>
<blockquote>
<h1>0.23.0</h1>
<ul>
<li>Update <code>tungstenite</code> to <code>0.23.0</code>.</li>
<li>Disable default features on TLS crates.</li>
</ul>
<h1>0.22.0</h1>
<ul>
<li>Update TLS dependencies.</li>
<li><del>Update <code>tungstenite</code> to match
<code>0.22.0</code>.</del></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/snapview/tokio-tungstenite/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tokio-tungstenite&package-manager=cargo&previous-version=0.21.0&new-version=0.23.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: Gabi <gabrielalejandro7@gmail.com>
2024-06-14 19:06:49 +00:00