Commit Graph

5303 Commits

Author SHA1 Message Date
Reactor Scram
4ddec81f28 fix(gui-client/windows): allow GUI to run as admin again (#6308)
Closes #6305 too

I couldn't find the ticket for this so I'm not sure which customers are
affected.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-08-15 22:36:18 +00:00
Jamil
c67cbfad08 fix(portal): Fix helptext grammar for DNS resource (#6306)
Minor helptext fix for the DNS resource helptext.
2024-08-15 22:03:19 +00:00
Thomas Eizinger
d399e65246 build(deps): bump tokio-tungstenite to 0.23 (#5509)
With the upgrade to 0.23, `tokio-tungstenite` pulls in `rustls` 0.27
which supports multiple crypto providers. By default, this uses the
`aws-lc-crypto` provider. The previous default was `ring`.

This PR bumps the necessary versions and installs the `ring` crypto
provider at the beginning of each application, before connlib starts. We
try and do this as early as possible to make it obvious that it only
needs to happen once per process.

Resolves: #5380.
2024-08-15 06:02:17 +00:00
Patti
b2b663aba4 feat(website): Create customer testimonials section, add scrollbar styling (#6252)
Co-authored-by: Jamil Bou Kheir <jamilbk@users.noreply.github.com>
2024-08-14 22:29:18 -07:00
Thomas Eizinger
272e4b2bcd feat(snownet,relay): include sticky session ID in STUN requests (#6278)
For most cases, TURN identifies clients by their 3-tuple. This can make
it hard to correlate logs in case the client roams or its NAT session
gets reset, both of which cause the port to change.

To make problem analysis easier, we include the RFC-recommended
`SOFTWARE` attribute in all STUN requests created by `snownet`.
Typically, this includes a textual description of who sent the request
and a version number. See [0] for details. We don't track the version of
`snownet` individually and passing the actual client-version across this
many layers is deemed too complicated for now.

What we can add though is a parameter that includes a sticky session ID.
This session ID is computed based on the `Node`'s public key, meaning it
doesn't change until the user logs-out and in again.

On the relay, we now look for a `SOFTWARE` attribute in all STUN
requests and optionally include it in all spans if it is present.

[0]: https://datatracker.ietf.org/doc/html/rfc5389#section-15.10
2024-08-15 03:10:56 +00:00
Thomas Eizinger
7c70850217 feat(connlib): allow glob patterns for matching domain names (#5901)
Currently, `connlib` can only handle "simple" DNS wildcards where `*`
matches any number of subdomains, including zero and `?` matches a
single subdomain.

With this PR, we expand `connlib'`s capabilities to allow for a much
more complex matching of domains that more closely resembles glob
patterns:

- `**` matches any number of subdomains. This supersedes the previous
`*` operator.
- `*` matches a single subdomain. This supersedes the previous `?`
operator.
- `?` matches a single character. This wasn't possible before.
- Additionally, any of these can be combined. Previously, only `*` or
`?` was allowed and they were only accepted at the front of the domain
name pattern.

Resolves: #5056.

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
2024-08-15 01:30:53 +00:00
Jamil
b1b9b552c2 fix(portal): Clarify how synced users count against billing (#6285)
Fixes #6155 

One question we get with almost each new customer is "if I enable sync,
won't that count towards my bill?". This PR aims to answer that question
right when they create the provider.

I will also make sure to update Enterprise accounts in Stripe with
`monthly_active_users_acount` so that they can view this metric on the
Billing page.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2024-08-14 19:04:25 +00:00
dependabot[bot]
242ad55fc0 build(deps): Bump bytes from 1.6.0 to 1.7.1 in /rust (#6262)
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.6.0 to 1.7.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/bytes/releases">bytes's
releases</a>.</em></p>
<blockquote>
<h2>Bytes 1.7.1</h2>
<h1>1.7.1 (August 1, 2024)</h1>
<p>This release reverts the following change due to a regression:</p>
<ul>
<li>Reuse capacity when possible in <code>&lt;BytesMut as
Buf&gt;::advance</code> impl (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/698">#698</a>)</li>
</ul>
<p>The revert can be found at <a
href="https://redirect.github.com/tokio-rs/bytes/issues/726">#726</a>.</p>
<h2>Bytes 1.7.0</h2>
<h1>1.7.0 (July 31, 2024)</h1>
<h3>Added</h3>
<ul>
<li>Add conversion from <code>Bytes</code> to <code>BytesMut</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/695">#695</a>,
<a
href="https://redirect.github.com/tokio-rs/bytes/issues/710">#710</a>)</li>
<li>Add reclaim method without additional allocation (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/686">#686</a>)</li>
</ul>
<h3>Documented</h3>
<ul>
<li>Clarify how <code>BytesMut::zeroed</code> works (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/714">#714</a>)</li>
<li>Clarify the behavior of <code>Buf::chunk</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/717">#717</a>)</li>
</ul>
<h3>Changed</h3>
<ul>
<li>Change length condition of <code>BytesMut::truncate</code></li>
<li>Reuse capacity when possible in <code>&lt;BytesMut as
Buf&gt;::advance</code> impl (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/698">#698</a>)</li>
<li>Improve <code>must_use</code> suggestion of
<code>BytesMut::split</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/699">#699</a>)</li>
</ul>
<h3>Internal changes</h3>
<ul>
<li>Use <code>ManuallyDrop</code> instead of <code>mem::forget</code>
(<a
href="https://redirect.github.com/tokio-rs/bytes/issues/678">#678</a>)</li>
<li>Don't set <code>len</code> in <code>BytesMut::reserve</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/682">#682</a>)</li>
<li>Optimize <code>Bytes::copy_to_bytes</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/688">#688</a>)</li>
<li>Refactor <code>BytesMut::truncate</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/694">#694</a>)</li>
<li>Refactor <code>BytesMut::resize</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/696">#696</a>)</li>
<li>Reorder assertion in <code>Bytes::split_to</code>,
<code>Bytes::split_off</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/689">#689</a>,
<a
href="https://redirect.github.com/tokio-rs/bytes/issues/693">#693</a>)</li>
<li>Use <code>offset_from</code> in more places (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/705">#705</a>)</li>
<li>Correct the wrong usage of <code>IntoIter</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/707">#707</a>)</li>
</ul>
<h2>Bytes 1.6.1</h2>
<p>This release fixes a bug where <code>Bytes::is_unique</code> returns
incorrect values when the <code>Bytes</code> originates from a shared
<code>BytesMut</code>. (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/718">#718</a>)</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md">bytes's
changelog</a>.</em></p>
<blockquote>
<h1>1.7.1 (August 1, 2024)</h1>
<p>This release reverts the following change due to a regression:</p>
<ul>
<li>Reuse capacity when possible in <code>&lt;BytesMut as
Buf&gt;::advance</code> impl (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/698">#698</a>)</li>
</ul>
<p>The revert can be found at <a
href="https://redirect.github.com/tokio-rs/bytes/issues/726">#726</a>.</p>
<h1>1.7.0 (July 31, 2024)</h1>
<h3>Added</h3>
<ul>
<li>Add conversion from <code>Bytes</code> to <code>BytesMut</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/695">#695</a>,
<a
href="https://redirect.github.com/tokio-rs/bytes/issues/710">#710</a>)</li>
<li>Add reclaim method without additional allocation (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/686">#686</a>)</li>
</ul>
<h3>Documented</h3>
<ul>
<li>Clarify how <code>BytesMut::zeroed</code> works (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/714">#714</a>)</li>
<li>Clarify the behavior of <code>Buf::chunk</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/717">#717</a>)</li>
</ul>
<h3>Changed</h3>
<ul>
<li>Change length condition of <code>BytesMut::truncate</code></li>
<li>Reuse capacity when possible in <code>&lt;BytesMut as
Buf&gt;::advance</code> impl (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/698">#698</a>)</li>
<li>Improve <code>must_use</code> suggestion of
<code>BytesMut::split</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/699">#699</a>)</li>
</ul>
<h3>Internal changes</h3>
<ul>
<li>Use <code>ManuallyDrop</code> instead of <code>mem::forget</code>
(<a
href="https://redirect.github.com/tokio-rs/bytes/issues/678">#678</a>)</li>
<li>Don't set <code>len</code> in <code>BytesMut::reserve</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/682">#682</a>)</li>
<li>Optimize <code>Bytes::copy_to_bytes</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/688">#688</a>)</li>
<li>Refactor <code>BytesMut::truncate</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/694">#694</a>)</li>
<li>Refactor <code>BytesMut::resize</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/696">#696</a>)</li>
<li>Reorder assertion in <code>Bytes::split_to</code>,
<code>Bytes::split_off</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/689">#689</a>,
<a
href="https://redirect.github.com/tokio-rs/bytes/issues/693">#693</a>)</li>
<li>Use <code>offset_from</code> in more places (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/705">#705</a>)</li>
<li>Correct the wrong usage of <code>IntoIter</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/707">#707</a>)</li>
</ul>
<h1>1.6.1 (July 13, 2024)</h1>
<p>This release fixes a bug where <code>Bytes::is_unique</code> returns
incorrect values when
the <code>Bytes</code> originates from a shared <code>BytesMut</code>.
(<a
href="https://redirect.github.com/tokio-rs/bytes/issues/718">#718</a>)</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="dc4fb3e8f4"><code>dc4fb3e</code></a>
chore: prepare bytes v1.7.1 (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/727">#727</a>)</li>
<li><a
href="f488be48d0"><code>f488be4</code></a>
Revert &quot;Reuse capacity when possible in &lt;BytesMut as
Buf&gt;::advance impl&quot; (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/726">#726</a>)</li>
<li><a
href="03fdde9dcf"><code>03fdde9</code></a>
chore: prepare v1.7.0 (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/724">#724</a>)</li>
<li><a
href="f8c7b574c0"><code>f8c7b57</code></a>
Merge 'v1.6.1' into 'master' (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/721">#721</a>)</li>
<li><a
href="fd13c7dcdb"><code>fd13c7d</code></a>
chore: prepare bytes v1.6.1 (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/720">#720</a>)</li>
<li><a
href="6b4b0eda29"><code>6b4b0ed</code></a>
Fix <code>Bytes::is_unique</code> when created from shared
<code>BytesMut</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/718">#718</a>)</li>
<li><a
href="9965a04b56"><code>9965a04</code></a>
Remove unnecessary file (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/719">#719</a>)</li>
<li><a
href="3443ca5a0b"><code>3443ca5</code></a>
docs: clarify the behavior of <code>Buf::chunk</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/717">#717</a>)</li>
<li><a
href="8cc940779f"><code>8cc9407</code></a>
Allow reclaiming the current allocation (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/686">#686</a>)</li>
<li><a
href="7a5154ba8b"><code>7a5154b</code></a>
Clarify how <code>BytesMut::zeroed</code> works and advantages to manual
impl (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/714">#714</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/tokio-rs/bytes/compare/v1.6.0...v1.7.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=bytes&package-manager=cargo&previous-version=1.6.0&new-version=1.7.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-08-14 16:50:06 +00:00
Reactor Scram
79c9811a59 fix(gui-client/windows): delete IPC service logs when user clicks "clear logs" (#6280)
Closes #5453 

Tested once on the Windows aarch64 VM. Should always leave 4 files
behind, a `.log` and a `.jsonl` for the GUI and for the IPC service. The
"log directory" is a bit of a lie since it's consistently 2 directories
on both platforms now.

```[tasklist]
- [x] Update changelog
- [x] Make a note to remove the known issue from the website when the next release is cut after this PR merges
```
2024-08-14 15:08:31 +00:00
Reactor Scram
7151b0397a fix(gui-client): delete crash dumps when deleting logs (#6281)
This was a regression in a recent PR
2024-08-13 22:39:52 +00:00
Thomas Eizinger
55c97acfc3 feat(relay): record error code as label in response counter metric (#6274)
This will allow us to write queries and thus alerts for increased number
of error responses such as `Allocation Mismatch`.

When attaching labels to metrics, it is important to avoid cardinality
explosions. Thus, the possible label values should always be a fixed,
bounded set of values. The possible error codes could be quite a few but
in practise, we only use a handful and clients cannot influence, which
error codes we send. Thus, it is safe to create labels for these codes.

The same would not be true for IP addresses or ports for example.
2024-08-13 22:17:21 +00:00
Brian Manifold
4e9bd7334a fix(portal): Fix Resource show error on API created Resource (#6284)
Viewing a Resource created by an API client was crashing the view due to
the function creating the link to the actor not accounting for the API
client case.

Closes #6267
2024-08-13 22:07:00 +00:00
Jamil
296ca4ad4d ci: Bump Clients and Gateways to fix NAT / allocation issues (#6287)
Bump all Clients and Gateways due to #6265 being fixed.

---------

Co-authored-by: Not Applicable <ReactorScram@users.noreply.github.com>
2024-08-13 21:58:12 +00:00
Thomas Eizinger
585e2146ba test(connlib): drop DNS queries to CIDR resources for pending connections (#6273)
In #6259, we added a regression test for concurrent DNS queries. A case
that we overlooked is that when DNS servers are defined as CIDR
resources, the queries themselves will act as connection intents and
thus dropped until we have a connection.

In the tests, the connection is only established as part of `advance`.
Thus, if we get multiple concurrent DNS queries to the same server that
is defined as a CIDR resource, we need to drop all future queries.

Fixes: #6283.

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
2024-08-13 21:22:46 +00:00
dependabot[bot]
0b55087eff build(deps): Bump tauri-build from 1.5.1 to 1.5.3 in /rust (#6261)
Bumps [tauri-build](https://github.com/tauri-apps/tauri) from 1.5.1 to
1.5.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tauri-apps/tauri/releases">tauri-build's
releases</a>.</em></p>
<blockquote>
<h2>tauri-build v1.5.3</h2>
<!-- raw HTML omitted -->
<pre><code>Fetching advisory database from
`https://github.com/RustSec/advisory-db.git`
Loaded 630 security advisories (from /home/runner/.cargo/advisory-db)
    Updating crates.io index
    Scanning Cargo.lock for vulnerabilities (590 crate dependencies)
Crate:     atty
Version:   0.2.14
Warning:   unsound
Title:     Potential unaligned read
Date:      2021-07-04
ID:        RUSTSEC-2021-0145
URL:       https://rustsec.org/advisories/RUSTSEC-2021-0145
Dependency tree:
atty 0.2.14
└── clap 3.2.25
    └── tauri 1.7.0
        ├── tauri 1.7.0
        ├── restart 0.1.0
        └── app-updater 0.1.0
<p>warning: 1 allowed warning found
</code></pre></p>
<!-- raw HTML omitted -->
<h2>[1.5.3]</h2>
<h3>Dependencies</h3>
<ul>
<li>Upgraded to <code>tauri-utils@1.6.0</code></li>
<li>Upgraded to <code>tauri-codegen@1.4.4</code></li>
</ul>
<!-- raw HTML omitted -->
<pre><code>Updating crates.io index
Packaging tauri-build v1.5.3
(/home/runner/work/tauri/tauri/core/tauri-build)
Verifying tauri-build v1.5.3
(/home/runner/work/tauri/tauri/core/tauri-build)
    Updating crates.io index
 Downloading crates ...
  Downloaded tauri-winres v0.1.1
  Downloaded embed-resource v2.4.2
  Downloaded cargo_toml v0.15.3
   Compiling proc-macro2 v1.0.86
&lt;/tr&gt;&lt;/table&gt; 
</code></pre>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="cf331cdc3e"><code>cf331cd</code></a>
fix(core): lint</li>
<li><a
href="574076541a"><code>5740765</code></a>
fix(ci): downgrade crates for MSRV check</li>
<li><a
href="89f3048f52"><code>89f3048</code></a>
apply version updates (<a
href="https://redirect.github.com/tauri-apps/tauri/issues/9871">#9871</a>)</li>
<li><a
href="08f57efefd"><code>08f57ef</code></a>
fix(cli): parse <code>--profile=\&lt;profile&gt;</code> syntax (<a
href="https://redirect.github.com/tauri-apps/tauri/issues/10136">#10136</a>)</li>
<li><a
href="63da834ce4"><code>63da834</code></a>
ci: Fix msrv check (<a
href="https://redirect.github.com/tauri-apps/tauri/issues/10118">#10118</a>)</li>
<li><a
href="c2d3afa4fb"><code>c2d3afa</code></a>
prevent uncomment collision in 1.x invoke_key templating (fix <a
href="https://redirect.github.com/tauri-apps/tauri/issues/10084">#10084</a>)
(<a
href="https://redirect.github.com/tauri-apps/tauri/issues/10087">#10087</a>)</li>
<li><a
href="924387092e"><code>9243870</code></a>
feat: add dmg settings, cherry picked from <a
href="https://redirect.github.com/tauri-apps/tauri/issues/7964">#7964</a>
(<a
href="https://redirect.github.com/tauri-apps/tauri/issues/8334">#8334</a>)</li>
<li><a
href="d2786bf699"><code>d2786bf</code></a>
chore(template): template format error (<a
href="https://redirect.github.com/tauri-apps/tauri/issues/10018">#10018</a>)</li>
<li><a
href="674accad75"><code>674acca</code></a>
fix: missing depends for rpm package (<a
href="https://redirect.github.com/tauri-apps/tauri/issues/10015">#10015</a>)</li>
<li><a
href="09152d83e1"><code>09152d8</code></a>
ci(msrv-list): Downgrade os_pipe (<a
href="https://redirect.github.com/tauri-apps/tauri/issues/10014">#10014</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/tauri-apps/tauri/compare/tauri-build-v1.5.1...tauri-build-v1.5.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tauri-build&package-manager=cargo&previous-version=1.5.1&new-version=1.5.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-08-13 19:55:26 +00:00
Jamil
4f4f8f83d2 revert: "feat(portal): Add 'temp account' feature for launch HN" (#6275)
Reverts firezone/firezone#6153

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2024-08-13 18:31:40 +00:00
Thomas Eizinger
6e86a4dcba fix(snownet,relay): re-use channels to peers in cooldown period (#6276)
For efficiency reasons, TURN's data channels don't have any
authentication or integrity metadata. Instead, the operate using a short
2-byte channel number to identify the target peer of the data.

To avoid abuse, channel bindings are at most valid for 10 minutes before
they need to be refreshed. In case they expire, there is a 5 minute
cooldown period, before the same channel number can be bound to a
different peer and before the same peer can be bound to a different
channel.

We had a similar issue in the past (#5613) where channels got rebound
early. Whilst that was fixed and is no longer happening, a case that we
didn't consider is what happens if we want to bind a channel to a peer
that still has a channel bound but is currently cooling down (i.e. in
the 5 minute period after its expiry).

In that case, `snownet` would wrongly assume that there is no channel to
this peer and try to bind a new one. That would get rejected by the
relay with a bad request.

To fix this, we simply need to check whether we still have a channel to
this peer and if yes, return the same channel number. On the relay, we
need to ensure that we consider a channel as `bound` again when it is
being refreshed.

We ensure that this doesn't regress in two ways:

- We add a unit-test for the `ChannelBindings` struct
- We modify the `Idle` transition to idle for 6 instead of 5 minutes.
This ensures that a combination of 2 idle transitions puts the channel
bindings into the 10-15 minute time window where rebinding the peer to a
different channel fails.

Related: #6265.
2024-08-13 17:01:13 +00:00
Jamil
5055c2e47e fix(website): Fix footer responsiveness and increase fontsizes (#6282)
fixes #6144
2024-08-13 09:59:21 -07:00
Thomas Eizinger
a272776171 revert: emit candidates in reverse-priority order (#6246)
This ended up not fixing anything and the order is now guaranteed to be
deterministic due to an upstream change.

Related: https://github.com/algesten/str0m/pull/557.
Reverts: #6200.
2024-08-12 23:55:31 +00:00
Thomas Eizinger
cd84c634ff chore(connlib): don't duplicate log for optional fields (#6272)
Instead of conditionally composing the log message, we can `.map` the
`Option` to a `DisplayValue` and **omit** the `%` sigil.

Related: https://github.com/tokio-rs/tracing/issues/3054.
2024-08-12 23:00:18 +00:00
Thomas Eizinger
7642f37d56 refactor: thin out connlib-shared (#6256)
Most of `connlib-shared` exists only for historical reasons. The
`Tunnel` has since been decoupled from the `Callbacks` and most error
variants on `ConnlibError` are not actually used.

This allows us to move a few things around and trim down `ConnlibError`
to just the variants that actually cause a call to `on_disconnect`.

Moving everything related to `proptest`s to `firezone-tunnel` also
requires us to delete the specialisation for printing IDs in a shorter
format during the tests. That is a bit unfortunate but was always kind
of a hack. I'd rather make progress on getting rid of `connlib-shared`
though and perhaps re-introduce that feature once the messages are fully
moved into the tunnel.

Related: #4470.
2024-08-12 22:57:06 +00:00
Thomas Eizinger
a2e4378c9b test(connlib): add regression test for concurrent DNS queries (#6259)
When forwarding DNS queries, we need to temporarily store information
about them to correctly identify the response and mangle them back. This
algorithm needs to support concurrent queries to the same and different
DNS servers.

A critical bug was fixed in #6233 where we had wrongly assumed that DNS
query IDs are globally unique.

To ensure this behaviour doesn't regress, this PR modifies our test
suite to send up to 5 concurrent DNS queries into connlib. Currently,
the nature of `tunnel_test` is such that each `Transition` is a single
action that gets fully completed before we execute the next one. Thus,
the concurrency of DNS queries would never get tested because connlib's
internal data structure would at most ever contain 1 DNS query.

By sampling a set of up to 5 unique combinations of DNS server and query
ID, we make sure that concurrent DNS queries work.
2024-08-12 22:38:12 +00:00
Reactor Scram
aa9a815784 fix(gui-client): don't delete the log file we're currently writing to (#6226)
Closes #4764 

```[tasklist]
- [x] Update changelog draft
- [x] Manual test Linux
```
2024-08-12 19:27:57 +00:00
Andrew Dryga
c922ea29e9 fix(portal): Fix DNS wildcard support for Gateways (#6270) 2024-08-12 12:54:20 -06:00
Jamil
7fed443b74 fix(website): Fix FeatureCards responsiveness (#6266)
Setting `max-w-` on the containing element instead of static `w-` on the
items within is preferred. Fixes this issue:

<img width="479" alt="Screenshot 2024-08-12 at 9 35 34 AM"
src="https://github.com/user-attachments/assets/68aa3844-74c1-4256-883d-a3168313c85b">
2024-08-12 11:17:58 -07:00
Thomas Eizinger
eb91a052c3 chore(rust): group testing crates into a tests/ directory (#6257)
Resolves: #5695.

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-08-12 17:17:01 +00:00
Thomas Eizinger
fe0807af37 ci: fix flaky integration test (#6245)
My attempts at fixing the flaky integration test with #6200 failed.
Unfortunately, we need to go back to a fork of str0m to fix this. I am
in discussion with the other maintainers on whether or not we can land
this patch.

Diff to upstream `str0m`:
https://github.com/algesten/str0m/compare/main...firezone:str0m:main
Example of a flaky test run:
https://github.com/firezone/firezone/actions/runs/10328744448/job/28595705615?pr=6237

Related: https://github.com/algesten/str0m/pull/489.
2024-08-12 17:05:36 +00:00
Thomas Eizinger
0abbf6bba9 refactor(rust): inline http-health-check crate into bin-shared (#6258)
Now that we have the `bin-shared` crate, it is easy to move the
health-check functionality into there. That allows us to get rid of a
crate which makes navigating the workspace a bit easier.
2024-08-12 16:44:52 +00:00
Thomas Eizinger
c94ae7b95b chore(connlib): better logging of resource activation (#6254)
Currently, the logging for which resources get activated and
de-activated is spread between the `dns` and `client` module. It also
doesn't include the sites that the resource is defined in.

The name of a resource alone is not enough to unique identify it. To fix
both of these papercuts, we move the logging to the `client` module and
include the sites in the log message.

The log messages now read like this:

```
2024-08-12T02:26:01.477844Z  INFO firezone_tunnel::client: Activating resource name=IPerf3 address=10.0.32.101/32 sites=AWS Dev (Gateways track `main`)
2024-08-12T02:26:01.477904Z  INFO firezone_tunnel::client: Activating resource name=*.slack.com address=*.slack.com sites=Vultr Stable (Latest Release Gateways)
2024-08-12T02:26:01.477942Z  INFO firezone_tunnel::client: Activating resource name=*.slack-edge.com address=*.slack-edge.com sites=Vultr Stable (Latest Release Gateways)
2024-08-12T02:26:01.477984Z  INFO firezone_tunnel::client: Activating resource name=*.spotify.com address=*.spotify.com sites=AWS Dev (Gateways track `main`)
```
2024-08-12 16:42:38 +00:00
Jamil
c16d59f07f fix(website): Remove animations from SVGs (#6264) 2024-08-12 08:13:08 -07:00
Reactor Scram
e0d7bdcb43 fix(gui-client): opening a window twice brings it to the foreground (#6239)
Closes #6231

Tested manually in Linux and Windows aarch64 VMs, works fine

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-08-12 14:09:13 +00:00
Jamil
4e7a0560e3 chore(website): Bump deps (#6255)
Hoping to rule out deps bug for an intermittent mobile browser website
redirect issue.
2024-08-11 20:22:46 -07:00
Patti
376dc61880 feat(website): New landing page (#6178)
Signed-off-by: Patti <139997703+Patticatti@users.noreply.github.com>
Co-authored-by: Jamil Bou Kheir <jamilbk@users.noreply.github.com>
2024-08-12 02:41:37 +00:00
Jamil
e7f8a4e4bf ci: bump apple / android versions (#6251)
These were approved and published so the versions need bumping.
2024-08-10 13:04:26 -07:00
Jamil
7cc68196dd test: Fix flaky time condition unit test due to overflow (#6250)
Fixes the flaky time condition unit test by always using midnight as the
end time range so that the `flow.expires_at` is never calculated across
a day boundary into the future.

Supersedes #6244
2024-08-10 18:30:31 +00:00
Andrew Dryga
00b93f6b82 feat(portal): Wildcard dns with backwards compatibility (#6214)
If a new resource is created that will use format not supported by
previous client versions we temporarily show a warning:
<img width="683" alt="Screenshot 2024-08-07 at 2 28 57 PM"
src="https://github.com/user-attachments/assets/bbfdfc96-0c4b-4226-93c5-bc2b5fdb9d30">

It will also be excluded from `resources` list for older clients (below
1.2).

---------

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-08-10 18:25:24 +00:00
Thomas Eizinger
93d678aaea feat(relay): set OTEL metadata for metrics and traces (#6249)
I recently discovered that the metrics reporting to Google Cloud Metrics
for the relays is actually working. Unfortunately, they are all bucketed
together because we don't set the metadata correctly.

This PR aims to fix that be setting some useful default metadata for
traces and metrics and additionally, discoveres instance ID and name
from GCE metadata.

Related: #2033.
2024-08-10 16:32:01 +00:00
Thomas Eizinger
bed625a312 chore(rust): make logging more ergonomic (#6237)
Setting up a logger is something that pretty much every entrypoint needs
to do, be it a test, a shared library embedded in another app or a
standalone application. Thus, it makes sense to introduce a dedicated
crate that allows us to bundle all the things together, how we want to
do logging.

This allows us to introduce convenience functions like
`firezone_logging::test` which allow you to construct a logger for a
test as a one-liner.

Crucially though, introducing `firezone-logging` gives us a place to
store a default log directive that silences very noisy crates. When
looking into a problem, it is common to start by simply setting the
log-filter to `debug`. Without further action, this floods the output
with logs from crates like `netlink_proto` on Linux. It is very unlikely
that those are the logs that you want to see. Without a preset filter,
the only alternative here is to explicitly turn off the log filter for
`netlink_proto` by typing something like
`RUST_LOG=netlink_proto=off,debug`. Especially when debugging issues
with customers, this is annoying.

Log filters can be overridden, i.e. a 2nd filter that matches the exact
same scope overrides a previous one. Thus, with this design it is still
possible to activate certain logs at runtime, even if they have silenced
by default.

I'd expect `firezone-logging` to attract more functionality in the
future. For example, we want to support re-loading of log-filters on
other platforms. Additionally, where logs get stored could also be
defined in this crate.

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-08-10 05:17:03 +00:00
Gabi
db655dd171 feat(apple): permit resources to be disabled (#6215)
Work for #6074 equivalent to #6166 for MacOS

MacOs view:

<img width="547" alt="image"
src="https://github.com/user-attachments/assets/f465183e-247b-49b5-a916-3ecc5f0a02f4">


iOS(ipad) view:


![image](https://github.com/user-attachments/assets/e64da75a-c69f-4e6a-aeeb-739958c3b046)

Other than implementing the resource disabling, this PR also refactor
the IPC between the network extension and the app so that it's some form
of structured IPC instead of relying on it being deserializable to
string to match the message.

One big difference with Android is that we don't introduce the concept
of a `ResourceView` for swift, the main reason for this is that on iOS
the resources are bound to the view instead of just being a parameter
for creating the view. So if we modify the `disabled` property it'd
update the UI unnecessarily, also it'd update the `Store` value for the
resource and then we need to copy that over again to the view. Making it
easier to go out of sync.
2024-08-10 04:20:14 +00:00
Reactor Scram
a52f459da6 test(gui-client): add unit test for the elevation check (#6238)
This will always be elevated in CI, so just check that it doesn't crash.

This came up during debugging while I was offline, and I just want to
make CI check for regressions, since there's a lot of `unsafe` code in
the Windows impl
2024-08-10 04:18:05 +00:00
Thomas Eizinger
a87728b791 chore: remove connlib-shared dependency from bin-shared (#6229)
The `firezone-bin-shared` crate is meant to house non-tunnel related
things. That allows it to compile in parallel to everything else. It
currently only depends on `connlib-shared` to access the `DEFAULT_MTU`
constant. We can remove that by requiring the MTU as a ctor parameter of
`TunDeviceManager`.

A longer write-up of the intended dependency structure is in #4470.
2024-08-10 03:58:10 +00:00
Brian Manifold
0df2d34126 fix(portal): Update Resource definition in OpenAPI spec (#6234)
Update Resource definition in OpenAPI spec to include "connections" i.e.
which gateway groups/sites a new Resource would be connected to.

<img width="775" alt="Screenshot 2024-08-09 at 2 57 04 AM"
src="https://github.com/user-attachments/assets/502979b1-e928-4e36-91c0-ed7b62f7c4a8">
2024-08-09 22:45:20 +00:00
Thomas Eizinger
78bb2ac73d chore: add changelog entries for #6181 (#6236)
Add either new changelog entries for next version or modify existing
changelog entries to point out #6181.
2024-08-09 22:26:03 +00:00
Reactor Scram
68d934ee59 refactor(headless-client): remove unnecessary layering (#6211)
Refs #5754

The IPC service is still layered, but moving it around is more difficult
than moving the headless Client.
2024-08-09 14:10:21 +00:00
Thomas Eizinger
47a447c65a chore: prepare hotfix release for Tauri & headless clients (#6235) 2024-08-09 08:28:25 +00:00
Thomas Eizinger
4ae64f0257 fix(connlib): index forwarded DNS queries by ID + socket (#6233)
When forwarding DNS queries, we need to remember the original source
socket in order to send the response back. Previously, this mapping was
indexed by the DNS query ID. As it turns out, at least Windows doesn't
have a global DNS query ID counter and may reuse them across different
DNS servers. If that happens and two of these queries overlap, then we
match the wrong responses together.

In the best case, this produces bad DNS results on the client. In the
worst case, those queries were for DNS servers with different IP
versions in which case we triggered a panic in connlib further down the
stack where we created the IP packet for the response.

To fix this, we first and foremost remove the explicit `panic!` from the
`make::` functions in `ip-packet`. Originally, these functions were only
used in tests but we started to use them in production code too and
unfortunately forgot about this panic. By introducing a `Result`, all
call-sites are made aware that this can fail.

Second, we fix the actual indexing into the data structure for forwarded
DNS queries to also include the DNS server's socket. This ensures we
don't treat the DNS query IDs as globally unique.

Third, we replace the panicking path in
`try_handle_forwarded_dns_response` with a log statement, meaning if the
above assumption turns out wrong for some reason, we still don't panic
and simply don't handle the packet.
2024-08-09 07:01:57 +00:00
Jamil
67ae8ff380 ci: publish Gateway 1.1.4 (#6228)
Publishes the `ENABLE_MASQUERADE` removal.
2024-08-09 03:45:26 +00:00
Thomas Eizinger
bc1ab58c93 test(connlib): assign at least one gateway to each site (#6201)
I believe this is the cause of some flakiness in the proptests.
Sometimes, we would end up with a site that did not have any gateways
assigned.

Example of a failing test:
https://github.com/firezone/firezone/actions/runs/10280367072/job/28447560561?pr=6200.
2024-08-09 02:16:04 +00:00
Thomas Eizinger
da296038b9 fix(connlib): emit candidates in reverse-priority order (#6200)
I noticed we sometimes have a flaky integration test with an ICE timeout
in its logs. For example:
https://github.com/firezone/firezone/actions/runs/10278933741/job/28443578376

Analyzing this one more closely turned out to be caused by a race
condition between client and gateway, when they exchange their ICE
candidates.

We send ICE candidates in batches but because they are serialized to
strings early, their ordering actually depends on the so-called
"foundation" of the ICE candidates. that one is simply a hash of several
components. As a result, the ordering of these candidates can vary
between test runs.

We should try ICE candidates in order of their reverse-priority (i.e.
best first). By introducing a helper-collection, we can enforce this
ordering before sending ICE candidates across.
2024-08-09 01:29:38 +00:00
Jamil
a6ba9868dd ci: Revert bumps to 1.2 (#6227)
We need these at 1.1 until ready to release.
2024-08-08 18:34:39 -07:00