Commit Graph

3582 Commits

Author SHA1 Message Date
Reactor Scram
2f5bc2a90e docs(linux): document default DNS setup on Debian 12 and Ubuntu 20.04 (#3668)
Closes #3667
2024-02-16 18:20:45 +00:00
Reactor Scram
46228a1e62 feat(linux): Control DNS with systemd-resolved (#3643)
If `FIREZONE_DNS_CONTROL` is set to `systemd-resolved`, then shell out
to `resolvectl` to request all system DNS queries to go to Firezone's
sentinel DNS server(s).

```[tasklist]
- [ ] Figure out how to stop the runner from using the Docker bridge iface
```

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-02-16 17:17:02 +00:00
Thomas Eizinger
3bc466db9a ci: upgrade iperf (#3662)
Whilst debugging the performance tests in #3391, I found that we are
using a 4 year old version of `iperf` for the server. This, plus
restarting the server inbetween the performance runs resulted in flaky
tests. I am not sure how we arrived at #3303 but
[this](https://github.com/firezone/firezone/actions/runs/7926579022?pr=3391)
CI run succeeded with a big matrix using the newer iperf server and
without the restarts.
2024-02-16 15:08:45 +00:00
Gabi
10c9f622f3 fix(snownet): generate candidates only after we accept the ICE answer (#3658)
This is done to delay the candidate generation after the gateway has
already received the request.

Since we already know the candidates in most cases, an optimization in
the future to reduce the number of round-trips to the gateway we can add
the candidates to the request connection message.
2024-02-16 01:23:44 +00:00
Thomas Eizinger
19bcaa9539 refactor(connlib): move DNS resolution into tunnel (#3652)
Previously, this mapping was not stored within the tunnel so we had to
perform the resolution further up. This has changed and the tunnel
itself now knows about this mapping. Thus, we can easily move the actual
DNS resolution also into the tunnel, thereby reducing the API surface of
`Tunnel` because we don't need the `write_dns_lookup_response` function.

This is crucial because it is the last place where `Tunnel` is being
cloned in #3391. With this sorted out the way, we can remove all `Arc`s
and locks from `Tunnel` as part of #3391.
2024-02-16 00:29:31 +00:00
Reactor Scram
75e447f9d4 docs(linux): document test setups for exercising all the Linux code (#3660)
Trying to make sure I don't overlook anything. The possible combinations
of setups is like 100+, but these 6 will at least exercise everything
one time, and they're probably going to be the most common, right?

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-02-16 00:12:26 +00:00
Jamil
9054f70995 refactor(ci): simplify dns resources in ci (#3653)
Attempt at cleaning a couple things I missed in code review.

The old httpbin resource wasn't being used anyhow, so I just deduped
them and updated things in a couple other places that had drifted.

Hopefully this fixes the [flaky
CI](https://github.com/firezone/firezone/actions/runs/7918422653/job/21616835910)
2024-02-15 23:50:12 +00:00
dependabot[bot]
97eb506bb3 build(deps): Bump tokio from 1.35.1 to 1.36.0 in /rust (#3561)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.35.1 to 1.36.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.36.0</h2>
<h1>1.36.0 (February 2nd, 2024)</h1>
<h3>Added</h3>
<ul>
<li>io: add <code>tokio::io::Join</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6220">#6220</a>)</li>
<li>io: implement <code>AsyncWrite</code> for <code>Empty</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6235">#6235</a>)</li>
<li>net: add support for anonymous unix pipes (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6127">#6127</a>)</li>
<li>net: add <code>UnixSocket</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6290">#6290</a>)</li>
<li>net: expose keepalive option on <code>TcpSocket</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6311">#6311</a>)</li>
<li>sync: add <code>{Receiver,UnboundedReceiver}::poll_recv_many</code>
(<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6236">#6236</a>)</li>
<li>sync: add <code>Sender::{try_,}reserve_many</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6205">#6205</a>)</li>
<li>sync: add <code>watch::Receiver::mark_unchanged</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6252">#6252</a>)</li>
<li>task: add <code>JoinSet::try_join_next</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6280">#6280</a>)</li>
</ul>
<h3>Changed</h3>
<ul>
<li>io: make <code>copy</code> cooperative (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6265">#6265</a>)</li>
<li>io: make <code>repeat</code> and <code>sink</code> cooperative (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6254">#6254</a>)</li>
<li>io: simplify check for empty slice (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6293">#6293</a>)</li>
<li>process: use pidfd on Linux when available (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6152">#6152</a>)</li>
<li>sync: use AtomicBool in broadcast channel future (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6298">#6298</a>)</li>
</ul>
<h3>Documented</h3>
<ul>
<li>io: clarify <code>clear_ready</code> docs (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6304">#6304</a>)</li>
<li>net: document that <code>*Fd</code> traits on <code>TcpSocket</code>
are unix-only (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6294">#6294</a>)</li>
<li>sync: document FIFO behavior of <code>tokio::sync::Mutex</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6279">#6279</a>)</li>
<li>chore: typographic improvements (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6262">#6262</a>)</li>
<li>runtime: remove obsolete comment (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6303">#6303</a>)</li>
<li>task: fix typo (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6261">#6261</a>)</li>
</ul>
<p><a
href="https://redirect.github.com/tokio-rs/tokio/issues/6220">#6220</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6220">tokio-rs/tokio#6220</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6235">#6235</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6235">tokio-rs/tokio#6235</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6127">#6127</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6127">tokio-rs/tokio#6127</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6290">#6290</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6290">tokio-rs/tokio#6290</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6311">#6311</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6311">tokio-rs/tokio#6311</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6236">#6236</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6236">tokio-rs/tokio#6236</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6205">#6205</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6205">tokio-rs/tokio#6205</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6252">#6252</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6252">tokio-rs/tokio#6252</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6280">#6280</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6280">tokio-rs/tokio#6280</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6265">#6265</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6265">tokio-rs/tokio#6265</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6254">#6254</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6254">tokio-rs/tokio#6254</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6293">#6293</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6293">tokio-rs/tokio#6293</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6238">#6238</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6238">tokio-rs/tokio#6238</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6152">#6152</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6152">tokio-rs/tokio#6152</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6298">#6298</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6298">tokio-rs/tokio#6298</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6262">#6262</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6262">tokio-rs/tokio#6262</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6303">#6303</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6303">tokio-rs/tokio#6303</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6261">#6261</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6261">tokio-rs/tokio#6261</a></p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="eaf81ed324"><code>eaf81ed</code></a>
chore: prepare Tokio v1.36.0 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6312">#6312</a>)</li>
<li><a
href="53f9e5a357"><code>53f9e5a</code></a>
ci: make sure dictionary words are sorted and unique (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6316">#6316</a>)</li>
<li><a
href="9077762545"><code>9077762</code></a>
net: expose keepalive option on <code>TcpSocket</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6311">#6311</a>)</li>
<li><a
href="131e7b4e49"><code>131e7b4</code></a>
ci: add spellchecking (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6297">#6297</a>)</li>
<li><a
href="e53b92a993"><code>e53b92a</code></a>
io: clarify <code>clear_ready</code> docs (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6304">#6304</a>)</li>
<li><a
href="7536132065"><code>7536132</code></a>
sync: use AtomicBool in broadcast channel future (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6298">#6298</a>)</li>
<li><a
href="b6d0c9091d"><code>b6d0c90</code></a>
macros: fix trait_method breaking change detection (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6308">#6308</a>)</li>
<li><a
href="4846959e8a"><code>4846959</code></a>
runtime: remove obsolete comment (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6303">#6303</a>)</li>
<li><a
href="ec3038357f"><code>ec30383</code></a>
net: add <code>UnixSocket</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6290">#6290</a>)</li>
<li><a
href="f80bbec28f"><code>f80bbec</code></a>
io: simplify check for empty slice (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6293">#6293</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/tokio-rs/tokio/compare/tokio-1.35.1...tokio-1.36.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.35.1&new-version=1.36.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 <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-15 23:25:36 +00:00
Gabi
55e4fb100f fix(gateway): re-implement resource address resolution in eventloop (#3656)
Reimplements what #3654 reverted with a fix

---------

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-02-15 20:51:59 +00:00
Reactor Scram
0fbd40fcb2 feat(linux): Notify systemd when we've started (#3628)
Regardless of `FIREZONE_DNS_CONTROL`, always try to notify systemd that
we've started.

I had accidentally conflated the idea of running as a systemd service
with the idea of using systemd to control DNS. They're separate, but
I'll keep the service unit in here and always use `sd-notify` since it
should be harmless to use even in Alpine.

~~If `FIREZONE_DNS_CONTROL` is `systemd-resolved`, try to notify systemd
that we've finished startup and the tunnel is ready.~~

Also adds a CI test, including a systemd service file that is **not**
ready for general use.
Ready for review once it's green.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-02-15 20:12:37 +00:00
Reactor Scram
085351f455 revert: 3622 to fix failing DNS CI test (#3654)
Reverts #3622 I don't know why, but that change seemed to cause the
`/etc/resolv.conf` test to fail in CI and I was thinking of the "roll
back first" principle
https://cloud.google.com/blog/products/gcp/reliable-releases-and-rollbacks-cre-life-lessons

~~I also change one `ping` in CI to `until ping`. This was an earlier
attempt before I did the revert, and it seems safe to leave it in.~~
2024-02-15 19:26:34 +00:00
Jason Elie Bou Kheir
5f126fa8f2 feat(android): add Reset to Defaults button and add space to settings activity (#3651)
Fixes #3570 and #3650 


![keyboard_pixel_tablet](https://github.com/firezone/firezone/assets/5115126/37209c6d-79c3-4bc2-82be-89da8347e353)

![desktop_pixel_tablet](https://github.com/firezone/firezone/assets/5115126/4b279f58-dd6a-4cf6-bd42-e15dc5b4bd41)
2024-02-15 15:23:30 +00:00
Thomas Eizinger
c53553cd26 feat(snownet): timeout connections without a handshake after 20 seconds (#3633)
It was discovered by @conectado that this timeout needs to be longer
than 10 seconds.
2024-02-15 01:55:46 +00:00
Thomas Eizinger
a2099599ad ci: don't ping gateway before running perf (#3649)
Running perf byitself should be enough to establish a connection, we
don't need to explicitly do that before.

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-02-15 01:41:50 +00:00
Thomas Eizinger
23e89c7290 feat(snownet): attempt to make new allocation when refresh fails (#3631)
Initially, we thought that we need to replace the entire `Allocation` if
the credentials to the relay change. However, during testing it turned
out that the credentials will change every time the portal sends us new
credentials. Likely, the portal hashes some kind of nonce into the
password as well.

Consequently, throwing away the entire state of the `Allocation` is
wrong. Instead, we will simply try to refresh the allocation using the
new credentials. If the refresh fails, we will try to make a new
allocation. If that also fails unrecoverably, then we "suspend" the
allocation, i.e. the `Allocation` will not perform any further action by
itself.

In case we get a new `refresh` call (which happens every time we want to
use the `Allocation` for a connection), we restart things and try to
make a new one.
2024-02-15 01:41:10 +00:00
Thomas Eizinger
f42aa862a8 refactor(gateway): perform DNS resolution of resources in eventloop (#3622)
With #3391, constructing a new tunnel will no longer be `async` which
makes DNS resolution the only `async` component of
`set_peer_connection_request`. In general, adding resources as part of
setting up a connection is a duplicated of the logic within
`allow_access`.

We solve both of these problems at once by moving the DNS resolution out
of `connlib` into the `gateway` binary and perform it as part of the
eventloop during a connection setup.
2024-02-15 01:40:44 +00:00
Thomas Eizinger
890217a1ff feat(snownet): invalidate candidates (#3604)
Invalidating candidates should give `str0m` a hint that it may have to
switch to a different candidate pair.
2024-02-15 00:26:14 +00:00
Reactor Scram
00f6fcdd09 feat(linux): If FIREZONE_DNS_CONTROL is etc-resolv-conf, modify '/etc/resolv.conf' (#3639)
Only user-facing if users are using the Docker image for the Linux
client.

I split off a module for `/etc/resolv.conf` since the code and unit
tests are about 300 lines and aren't related to the rest of the
`tun_linux.rs` code.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-02-14 23:50:01 +00:00
Thomas Eizinger
29ef4d7769 chore(snownet): better logging (#3646)
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-02-14 21:31:27 +00:00
Brian Manifold
1939b9c3f9 Update Okta IDP adapter in portal (#3647)
Why:

* After reviewing the Okta docs closer, in order for an OAuth token to
have Okta API scopes attached to it, the Okta org authorization server
must be used, not a custom authorization server (which includes the
'default' authorization server). This means that the OAuth Authorization
URI that was previously being asked for in the Okta Adapter form won't
work for IDP sync to Firezone. This commit updates the form to accept
the Okta Account Domain (i.e. `<company>.okta.com`)
2024-02-14 18:42:39 +00:00
Thomas Eizinger
e47c1766bf ci: move tests to bash scripts (#3648)
This improves maintenance because we can now use a regular matrix for
the integration tests and one can locally use tools like shellcheck or a
`bash-lsp` during development.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-02-14 13:55:28 +00:00
Jamil
354ee3cb02 refactor(android): Clean up tunnel fd establishment (#3645)
Cleans up the VpnService establishment logic a little
2024-02-14 13:18:23 +00:00
Jamil
724a487a02 fix(android): prevent null pointer segfault on 32-bit platforms (#3619)
Without this alignment, accessing the `name` field reliably produces a
segfault:

```
Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1d in tid 13835 (Thread-7), pid 13757 (irezone.android)
```

Interestingly, this only happens in release builds on 32-bit platforms.
Logging the returned name fixes it too which hints at some kind of
optimisation issue. Adding a padding is the most reliable fix.

Fixes: #3637.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-02-14 06:22:46 +00:00
Reactor Scram
b42f623ad6 ci(linux): add CI setup script for NetworkManager (#3641)
No user-facing changes. Just making sure I can install NM in the runner.
2024-02-14 02:54:42 +00:00
Reactor Scram
1056af4020 feat(linux): Add FIREZONE_DNS_CONTROL env var to choose which DNS control method to use (#3629)
The Docker image for the client is opted in to this new feature. The
bare `linux-client-x64` exe is not. I don't know if users are using the
Docker images?

I wanted to use CLI args, but the DNS control code ("config" or
"control"? Or "SplitDNS"?) has to run at the end of `set_iface_config`,
which on Linux runs in a worker, so I couldn't figure out how to move it
into `on_set_interface_config` in the callbacks. Maybe there is a way,
but the env var results in a small diff.
2024-02-14 02:54:16 +00:00
Thomas Eizinger
8b2cf37722 fix(snownet): remove debug_assert! for timed-out connections (#3635) 2024-02-14 02:41:51 +00:00
Thomas Eizinger
37ee760849 feat(snownet): only emit ConnectionEstablished upon the first connection (#3634) 2024-02-14 02:39:35 +00:00
Thomas Eizinger
6b4f1a02a7 feat(snownet): remove wireguard keep-alives (#3630)
`str0m` sends its own STUN keep-alives and @conectado has already
removed the logic that uses the wireguard keep-alives to detect stale
connections in
8234529cdf
as part of the integration of `snownet`.

We don't need two keep-alive mechanisms at once.
2024-02-14 02:34:44 +00:00
Jamil
02171189a8 chore(connlib): Make request ioctl mutable (#3644)
Technically, the data held by the ioctl request is changing, so make
them mutable.
2024-02-14 02:23:51 +00:00
Jamil
cde1c50f95 refactor(android): Simplify tunnel implementation and fix tunnel lifecycle (#3583)
Fixes #3578 
Fixes #3551 

The issue turned out to be a bunk Repository. Upon unraveling that ball
of yarn, I decided to clean up the Tunnel implementation altogether. It
uses the existing tunnel in-memory store for pushing updates to a
connected SessionActivity.

This PR includes many bug fixes as well.
2024-02-13 21:10:51 +00:00
Jamil
eafa890519 chore(website): Update team (#3638) 2024-02-13 18:56:55 +00:00
dependabot[bot]
9d0af9a811 build(deps): Bump crash-handler from 0.6.0 to 0.6.1 in /rust (#3623)
Bumps [crash-handler](https://github.com/EmbarkStudios/crash-handling)
from 0.6.0 to 0.6.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/EmbarkStudios/crash-handling/releases">crash-handler's
releases</a>.</em></p>
<blockquote>
<h2>crash-handler-0.6.1</h2>
<h3>Added</h3>
<ul>
<li><a
href="https://redirect.github.com/EmbarkStudios/crash-handling/pull/81">PR#81</a>
resolved <a
href="https://redirect.github.com/EmbarkStudios/crash-handling/issues/79">#79</a>
by adding <code>make_single_crash_event</code>.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d34d00bc51"><code>d34d00b</code></a>
chore: Release</li>
<li><a
href="789c99498c"><code>789c994</code></a>
Update CHANGELOGs</li>
<li><a
href="addf1486f8"><code>addf148</code></a>
Update (<a
href="https://redirect.github.com/EmbarkStudios/crash-handling/issues/81">#81</a>)</li>
<li><a
href="16c2545f2a"><code>16c2545</code></a>
chore: Release</li>
<li><a
href="955629bab9"><code>955629b</code></a>
Update CHANGELOG</li>
<li><a
href="5e907ff389"><code>5e907ff</code></a>
Add Android support for the i686 and x86-64 targets (<a
href="https://redirect.github.com/EmbarkStudios/crash-handling/issues/76">#76</a>)</li>
<li><a
href="14bba1b81e"><code>14bba1b</code></a>
Fix using <code>crash-handler</code> under Miri (<a
href="https://redirect.github.com/EmbarkStudios/crash-handling/issues/75">#75</a>)</li>
<li><a
href="1db8fca031"><code>1db8fca</code></a>
chore: Release</li>
<li>See full diff in <a
href="https://github.com/EmbarkStudios/crash-handling/compare/crash-handler-0.6.0...crash-handler-0.6.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=crash-handler&package-manager=cargo&previous-version=0.6.0&new-version=0.6.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 <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-02-13 17:55:19 +00:00
Reactor Scram
bd5b5d9c5f ci(windows): test crash handling as part of smoke test (#3624)
If this passes I'll use it to approve #3623
2024-02-13 17:12:57 +00:00
Thomas Eizinger
6c2fdcfd0a chore: bump Rust version to 1.76 (#3632) 2024-02-13 17:01:22 +00:00
Brian Manifold
f18ec6e4d5 Add Okta directory sync (#3614)
Why:

* To allow syncing of users/groups/memberships from an IDP to Firezone,
a custom identify provider adapter needs to be created in the portal
codebase at this time. The custom IDP adapter created in this commit is
for Okta.

* This commit also includes some additional tests for the Microsoft
Entra IDP adapter. These tests were mistakenly overlooked when finishing
the Entra adapter.
2024-02-13 02:12:54 +00:00
Reactor Scram
830302af43 test(linux): Low-risk changes to prepare for Linux DNS support (#3625)
This splits off the easy parts from #3605.

- Add quotes around `PHOENIX_SECURE_COOKIES` because my local
`docker-compose` considers unquoted 'false' to be a schema error - Env
vars are strings or numbers, not bools, it says
- Create `test.httpbin.docker.local` container in a new subnet so it can
be used as a DNS resource without the existing CIDR resource picking it
up
- Add resources and policies to `seeds.exs` per #3342
- Fix warning about `CONNLIB_LOG_UPLOAD_INTERVAL_SECS` not being set
- Add `resolv-conf` dep and unit tests to `firezone-tunnel` and
`firezone-linux-client`
- Impl `on_disconnect` in the Linux client with `tracing::error!`
- Add comments

```[tasklist]
- [x] (failed) Confirm that the client container actually does stop faster this way
- [x] Wait for tests to pass
- [x] Mark as ready for review
```
2024-02-12 19:04:51 +00:00
dependabot[bot]
46efc84834 build(deps): Bump time from 0.3.32 to 0.3.34 in /rust (#3559)
Bumps [time](https://github.com/time-rs/time) from 0.3.32 to 0.3.34.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/time-rs/time/releases">time's
releases</a>.</em></p>
<blockquote>
<h2>v0.3.34</h2>
<p>See the <a
href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">changelog</a>
for details.</p>
<h2>v0.3.33</h2>
<p>See the <a
href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">changelog</a>
for details.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">time's
changelog</a>.</em></p>
<blockquote>
<h2>0.3.34 [2024-12-03]</h2>
<h3>Fixed</h3>
<p>Computing the local offset on Windows works again. It was broken in
some cases in v0.3.32 and
v0.3.33.</p>
<h2>0.3.33 [2024-02-03]</h2>
<h3>Fixed</h3>
<p>Builds targeting <code>wasm32-unknown-unknown</code> now work
again.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="f11f9b2a0c"><code>f11f9b2</code></a>
v0.3.34 release</li>
<li><a
href="ef7bfbd638"><code>ef7bfbd</code></a>
fix unsigned to signed conversion bug (<a
href="https://redirect.github.com/time-rs/time/issues/656">#656</a>)</li>
<li><a
href="76468cb651"><code>76468cb</code></a>
v0.3.33 release</li>
<li><a
href="6c2b602a41"><code>6c2b602</code></a>
Fix wasm32-unknown-unknown build (<a
href="https://redirect.github.com/time-rs/time/issues/655">#655</a>)</li>
<li>See full diff in <a
href="https://github.com/time-rs/time/compare/v0.3.32...v0.3.34">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=time&package-manager=cargo&previous-version=0.3.32&new-version=0.3.34)](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


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-12 18:11:41 +00:00
Andrew Dryga
beee8bd52e Add dynamic/managed groups and default Everyone one (#3346)
After this PR is merged a manual migration will be needed to upsert
Everyone group to existing accounts.

Closes #2588 

*This PR also improves UX around groups:*

1. Group selection now shows their source in dropdowns: 
<img width="669" alt="Screenshot 2024-02-08 at 18 30 25"
src="https://github.com/firezone/firezone/assets/1877644/accb5cf9-1c16-429b-a16f-e63bb0c7930f">

2. The same is done across other pages which will help in case there is
a duplicate group name (eg. manual and synced one):
<img width="766" alt="Screenshot 2024-02-08 at 18 31 59"
src="https://github.com/firezone/firezone/assets/1877644/f3133ceb-fc9d-4f7a-bfe2-63f81f379c9a">
<img width="1728" alt="Screenshot 2024-02-08 at 18 34 04"
src="https://github.com/firezone/firezone/assets/1877644/daa86c7e-8401-418d-b8e5-ddaff31a1834">
<img width="1728" alt="Screenshot 2024-02-08 at 18 34 22"
src="https://github.com/firezone/firezone/assets/1877644/5c885d06-0b0d-4385-a06e-8e9c09b85535">
<img width="576" alt="Screenshot 2024-02-08 at 18 34 31"
src="https://github.com/firezone/firezone/assets/1877644/86b2020e-7159-4800-a08e-cecf7b0b1798">


3. A bug was fixed and now we don't show synced groups whenever an actor
is created:
<img width="662" alt="Screenshot 2024-02-08 at 18 32 22"
src="https://github.com/firezone/firezone/assets/1877644/f69efe85-d7ac-412a-b267-9094a8dd9426">

4. We provide reason why groups are not editable:
<img width="591" alt="Screenshot 2024-02-08 at 18 33 29"
src="https://github.com/firezone/firezone/assets/1877644/1525d876-1aad-4a17-be38-6a39c4bc7908">
<img width="558" alt="Screenshot 2024-02-08 at 18 33 50"
src="https://github.com/firezone/firezone/assets/1877644/92615b97-19a6-4bf9-804d-d0d16c6c2dfe">
2024-02-09 22:07:42 +00:00
Reactor Scram
4c0b685978 chore(ci): update Node to 20 in the Windows CI jobs (#3611)
Fixes warnings for using pnpm for the Windows smoke test and release
build
2024-02-09 18:07:24 +00:00
Reactor Scram
ce79d020c1 ci(windows): add 'firezone' to the MSI names (#3610)
Since `windows-client-x64.msi` could be any other product.

I also split up the build steps similar to how the smoke test does.
2024-02-09 17:14:13 +00:00
Andrew Dryga
980246ae3b feat(portal): Broadcast resource sites (#3466)
Adds `client_address` field which should be passed down to clients to
nicely render copy-pasteable address. Client address MUST contain full
`address` field to prevent users from shooting themselves in the foot by
creating broken resources.

We also now broadcast a list of connected sites (gateway_groups) to the
client. When a `connection_request` response is sent a new field
`gateway_group_id` is added, this way the client can know which site
it's using, and if a resource is updated and `gateway_group_id` is
removed - it should restart the connection. The portal can not make such
a decision as it doesn't track active connections.

<img width="739" alt="Screenshot 2024-01-31 at 16 26 50"
src="https://github.com/firezone/firezone/assets/1877644/799bd354-40d5-4cc3-8ae9-9d228c5e466a">
<img width="678" alt="Screenshot 2024-01-31 at 16 27 01"
src="https://github.com/firezone/firezone/assets/1877644/782e47a5-43a8-4ba7-9245-61efbbe41f7f">
<img width="738" alt="Screenshot 2024-01-31 at 16 27 27"
src="https://github.com/firezone/firezone/assets/1877644/8c7a4edd-98d8-4e09-9e4f-09c2e5a890d0">
<img width="1728" alt="Screenshot 2024-01-31 at 16 27 49"
src="https://github.com/firezone/firezone/assets/1877644/ed8f7251-fb82-47df-9878-f7e7ae8cbcba">

This PR will be reabsed on `main` once #2240 is merged.
2024-02-09 08:36:37 -06:00
Jamil
62ad3c022b chore(ci): Fix CI deprecation and workflow warnings (#3612) 2024-02-09 07:25:34 +00:00
Reactor Scram
eb10f257b0 ci(windows): fix warning about CONNLIB_LOG_UPLOAD_INTERVAL_SECS (#3606)
It was bugging me a little. Before:

![image](https://github.com/firezone/firezone/assets/13400041/bc0a03cc-ef47-4b68-b33c-f671eddc78e9)

After (with jq pretty-printing)

![image](https://github.com/firezone/firezone/assets/13400041/faf7ebac-0dc0-4e93-8349-653e57e6eeda)
2024-02-08 16:00:00 +00:00
Roopesh Chander
ab6a729993 chore(apple): Add logs about accessing firezone-id in disk (#3607)
This PR adds some log messages to help debug why the firezone-id might
not get written to / read from disk (related to issue #3565).
2024-02-08 14:44:41 +00:00
Thomas Eizinger
45b1e3cda4 feat(connlib): remove duplication from logs (#3596)
Currently, we log messages from the portal several times via different
ways. For one, the message is included in the span via
`tracing::instrument`. Then it is also logged on `trace!` level twice
(this PR removes one of them). Plus, the fields of the
`request_connection` span are not printed in a very human-readable way
(bytes arrays). This makes the logs super noisy, see here for the latest
run on `main`:
https://github.com/firezone/firezone/actions/runs/7808301643/job/21298585685#step:13:13

Compare this with the logs from the run in this PR:
https://github.com/firezone/firezone/actions/runs/7813774334/job/21313812863?pr=3596#step:13:13

Some of these improvements were made as part of debugging #3391.
Extracting them here in a separate PR to reduce the diff of #3391.
2024-02-08 00:43:09 +00:00
Thomas Eizinger
22760e86c5 feat(snownet): refresh allocation upon each new connection (#3591)
Currently, a `REFRESH` for an allocation is only triggered after half
its lifetime (which defaults to 10 minutes). A refresh is the only way
for us to check whether an allocation is still active. If the relay
restarted or the allocation was somehow invalidated otherwise,
attempting to refresh it will fail.

By triggering a refresh for each allocation every time we get a new
connection, we immediately check whether that allocation (and thus its
candidates) are still valid. What to do with invalidated candidates is
left to a future iteration.
2024-02-08 00:43:06 +00:00
Thomas Eizinger
4f4f374a18 fix(snownet): replace Allocation if credentials to relay change (#3590)
When a relay restarts, its credentials change but the socket we use to
connect to it might not. Because we upsert `Allocation`s within a
`snownet::Node` based on the socket, such a change is currently not
picked up.

Instead, we now check whether an existing allocation uses the same
credentials and if it doesn't we throw the old one away and use the new
one instead.
2024-02-07 21:31:36 +00:00
Thomas Eizinger
459a79a528 refactor(snownet): introduce CandidateEvent (#3592)
Candidates, especially relay candidates can become invalid. For example,
a relay might be shut down, change its credentials or now be unreachable
due to network changes. In order to signal these changes in network
connections to a `snownet::Node`, we introduce a `CandidateEvent`.

Right now, `CandidateEvent` does not yet have an `Invalid` variant
because it would be dead code (it is not yet emitted by anything). This
PR is just the scaffolding to make that easier to introduce later.
2024-02-07 21:26:14 +00:00
Thomas Eizinger
5ebb4cfd57 feat(snownet): instrument the handle_input function with tracing (#3594)
This improves the logs because it adds a bunch of context to them that
we'd otherwise have to repeat everywhere.

Extracted from: #3391.
2024-02-07 19:54:32 +00:00
Thomas Eizinger
d550c9da89 refactor(connlib): remove unnecessary Serialize derive (#3595)
These messages are only deserialized, never serialized. The `derive` can
thus be removed.

Extracted from: #3391.
2024-02-07 19:54:25 +00:00