Commit Graph

520 Commits

Author SHA1 Message Date
Thomas Eizinger
b73b0cf2b7 feat(snownet): return MutableIpPacket from decapsulate (#3555)
The user is already passing us a mutable buffer so we might as well give
them a `MutableIpPacket` to allow them to further mutate it.

Extracted out of #3391.
2024-02-05 10:55:23 +00:00
Thomas Eizinger
394e9e8cc3 chore(snownet): fix bad caching base after rename (#3557)
This is an oversight from
https://github.com/firezone/firezone/pull/3435.
2024-02-05 10:55:05 +00:00
Thomas Eizinger
e0af229901 feat(snownet): retry STUN bindings using exponential backoff (#3529)
Currently, we retry STUN bindings at a fixed interval if we don't
receive a response. This results in very noise logs if we attempt to
contact an IPv6 STUN server but don't have an IPv6 interface.
2024-02-05 05:50:50 +00:00
Thomas Eizinger
fa3775a125 deps: update to latest upstream version of str0m (#3554)
Necessary contributions have (once again) been merged so we can switch
back to the upstream repo again! :)
2024-02-05 03:40:41 +00:00
Thomas Eizinger
73b6d00f97 feat(snownet): automatically discover host candidates (#3528)
I had an idea that is quite a big deal. Instead of manually discovering
host candidates by iterating interfaces and adding all of them, we
automatically generate host candidates every time we receive traffic on
from a certain interface. Initially, you might think that this is a
catch-22: How do we generate traffic without having host candidates? The
answer is: relays!

When we initiate a new connection using `snownet`, we add a list of STUN
and TURN servers. We will immediately attempt to talk to both of them,
sending STUN bindings to the former and ALLOCATE requests to the latter.
As the replies come in, we know, which interface they have been received
on. That particular interface is an excellent `host` candidate because
we've already proven connectivity to a STUN or TURN server. In fact, for
hole-punching, we will need to send traffic via that same interface to
reach the gateway (otherwise the `srflx` candidate won't work anyway).

There is only one "edge"-case in which this doesn't work: When you want
to make a connection between a client and a gateway on the same subnet
yet without connectivity to a relay. At that point, I'd argue that your
network topology is broken anyway. If you can't talk to a relay, you
probably also cannot talk to the portal, meaning the signaling protocol
also doesn't work.
2024-02-05 03:40:33 +00:00
Reactor Scram
c3004426ec feat(windows): check Github for updates on startup (#3527)
Closes #2717 .

Known issue: If the notification times out and goes into the
notification center (the bell icon), then clicking the notification will
not open the link:


![image](https://github.com/firezone/firezone/assets/13400041/d2de84a5-da31-4a55-97b9-93e12847aa25)

Pass `--always-show-update-notification` to show the notification even
if our release is newer than Github's latest. (e.g. dev release)
Normally it only notifies if the latest release is newer than our
current release.


![image](https://github.com/firezone/firezone/assets/13400041/4597aaed-bc3c-4a43-9269-dff9a82873a8)

Clicking the notification (before it times out) opens the release URL:
https://github.com/firezone/firezone/releases/tag/1.0.0-pre.8

```[tasklist]
- [x] See if the println can be removed
- [x] Try to remove type annotation
- [x] Wording
- [x] Comment why it's necessary to route through Controller
- [x] User agent
```
2024-02-03 19:06:43 +00:00
Reactor Scram
637b94b61a fix(windows): show user-friendly error if a 2nd instance tries to start (#3548)
Closes #3538 


![image](https://github.com/firezone/firezone/assets/13400041/e8fc4cc6-f60f-4e1f-9fb6-90697e47a492)
2024-02-03 19:00:33 +00:00
Reactor Scram
079b4e7f9a fix(firezone-tunnel(windows)): don't panic if the sending ring buffer is full (#3544)
I never saw this replicate, but in theory it could happen. This PR just
drops packets while the ring buffer is full.

Closes #3518
2024-02-02 21:49:05 +00:00
Reactor Scram
6bb302b5d4 feat(windows): log have_internet changes and API base URL at INFO level (#3543)
API URL, e.g. `wss://api.firezone.dev/`

Closes #3536 


![image](https://github.com/firezone/firezone/assets/13400041/1ea4b481-0e2c-4a77-bf1d-7c7c46b4d68c)
2024-02-02 21:44:17 +00:00
Reactor Scram
8ae57e85fc fix(windows): fix counting / exporting / clearing log files (#3535)
Closes #3531

I refactored it so that all the log-related files pull their path from
one function, so hopefully they won't skew in the future. The path could
still be wrong though. A smoke test might be able to catch that: #3534
2024-02-02 17:28:01 +00:00
Reactor Scram
1e596ce5d9 feat(windows): add CLI flag to test a clickable update notification (#3526)
Looks a little odd in the Windows Server VM cause of the minimal desktop
environment, but it does open the browser, same as the "Sign In" button

![image](https://github.com/firezone/firezone/assets/13400041/772b755d-8291-44c4-9cb9-d0dca5c98f8e)

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-02-02 17:07:35 +00:00
Reactor Scram
b7294328e1 refactor(windows): simplify how CLI args are passed to the GUI (#3525) 2024-02-02 16:21:12 +00:00
dependabot[bot]
d04083b6a9 build(deps): Bump itertools from 0.12.0 to 0.12.1 in /rust (#3507)
Bumps [itertools](https://github.com/rust-itertools/itertools) from
0.12.0 to 0.12.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md">itertools's
changelog</a>.</em></p>
<blockquote>
<h2>0.12.1</h2>
<h3>Added</h3>
<ul>
<li>Documented iteration order guarantee for
<code>Itertools::[tuple_]combinations</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/822">#822</a>)</li>
<li>Documented possible panic in <code>iterate</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/842">#842</a>)</li>
<li>Implemented <code>Clone</code> and <code>Debug</code> for
<code>Diff</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/845">#845</a>)</li>
<li>Implemented <code>Debug</code> for <code>WithPosition</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/859">#859</a>)</li>
<li>Implemented <code>Eq</code> for <code>MinMaxResult</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/838">#838</a>)</li>
<li>Implemented <code>From&lt;EitherOrBoth&lt;A, B&gt;&gt;</code> for
<code>Option&lt;Either&lt;A, B&gt;&gt;</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/843">#843</a>)</li>
<li>Implemented <code>PeekingNext</code> for <code>RepeatN</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/855">#855</a>)</li>
</ul>
<h3>Changed</h3>
<ul>
<li>Made <code>CoalesceBy</code> lazy (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/801">#801</a>)</li>
<li>Optimized <code>Filter[Map]Ok::next</code>,
<code>Itertools::partition</code>, <code>Unique[By]::next[_back]</code>
(<a
href="https://redirect.github.com/rust-itertools/itertools/issues/818">#818</a>)</li>
<li>Optimized <code>Itertools::find_position</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/837">#837</a>)</li>
<li>Optimized <code>Positions::next[_back]</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/816">#816</a>)</li>
<li>Optimized <code>ZipLongest::fold</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/854">#854</a>)</li>
<li>Relaxed <code>Debug</code> bounds for <code>GroupingMapBy</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/860">#860</a>)</li>
<li>Specialized <code>ExactlyOneError::fold</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/826">#826</a>)</li>
<li>Specialized <code>Interleave[Shortest]::fold</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/849">#849</a>)</li>
<li>Specialized <code>MultiPeek::fold</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/820">#820</a>)</li>
<li>Specialized <code>PadUsing::[r]fold</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/825">#825</a>)</li>
<li>Specialized <code>PeekNth::fold</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/824">#824</a>)</li>
<li>Specialized <code>Positions::[r]fold</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/813">#813</a>)</li>
<li>Specialized <code>PutBackN::fold</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/823">#823</a>)</li>
<li>Specialized <code>RepeatN::[r]fold</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/821">#821</a>)</li>
<li>Specialized <code>TakeWhileInclusive::fold</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/851">#851</a>)</li>
<li>Specialized <code>ZipLongest::rfold</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/848">#848</a>)</li>
</ul>
<h3>Notable Internal Changes</h3>
<ul>
<li>Added test coverage in CI (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/847">#847</a>,
<a
href="https://redirect.github.com/rust-itertools/itertools/issues/856">#856</a>)</li>
<li>Added semver check in CI (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/784">#784</a>)</li>
<li>Enforced <code>clippy</code> in CI (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/740">#740</a>)</li>
<li>Enforced <code>rustdoc</code> in CI (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/840">#840</a>)</li>
<li>Improved specialization tests (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/807">#807</a>)</li>
<li>More specialization benchmarks (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/806">#806</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="98d3978c87"><code>98d3978</code></a>
Prepare v0.12.1 release</li>
<li><a
href="dffac1fde4"><code>dffac1f</code></a>
Bump obi1kenobi/cargo-semver-checks-action from 2.2 to 2.3</li>
<li><a
href="00998a4bbc"><code>00998a4</code></a>
<code>CoalesceBy</code>: missing field in <code>Debug</code></li>
<li><a
href="a0411d6c6f"><code>a0411d6</code></a>
<code>CombinationsWithReplacement</code>: use a boxed slice
internally</li>
<li><a
href="8dd75f155c"><code>8dd75f1</code></a>
<code>Permutations</code>: use boxed slices internally</li>
<li><a
href="b785403f5f"><code>b785403</code></a>
<code>ExactlyOneError</code>: implement Debug differently</li>
<li><a
href="7a1c22be5e"><code>7a1c22b</code></a>
<code>FlattenOk</code>: Debug with macro</li>
<li><a
href="94452e3eaf"><code>94452e3</code></a>
<code>GroupingMapBy</code>: fix Debug implementation</li>
<li><a
href="2e325a0bd4"><code>2e325a0</code></a>
<code>TakeWhileInclusive</code>: missing field in
<code>Debug</code></li>
<li><a
href="a48c5b474b"><code>a48c5b4</code></a>
<code>WithPosition</code>: implement Debug</li>
<li>Additional commits viewable in <a
href="https://github.com/rust-itertools/itertools/compare/v0.12.0...v0.12.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=itertools&package-manager=cargo&previous-version=0.12.0&new-version=0.12.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>
2024-02-02 06:29:34 +00:00
dependabot[bot]
f846078e55 build(deps): Bump libc from 0.2.152 to 0.2.153 in /rust (#3508)
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.152 to 0.2.153.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/libc/releases">libc's
releases</a>.</em></p>
<blockquote>
<h2>0.2.153</h2>
<h2>What's Changed</h2>
<ul>
<li>Add SOMAXCONN to vita on 0.2 (to fix std) by <a
href="https://github.com/pheki"><code>@​pheki</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3552">rust-lang/libc#3552</a></li>
<li>Fix CI for v0.2 by <a
href="https://github.com/JohnTitor"><code>@​JohnTitor</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3557">rust-lang/libc#3557</a></li>
<li>[Backport <a
href="https://redirect.github.com/rust-lang/libc/issues/3548">#3548</a>]
Add ioctl FS_IOC_{G,S}{ETVERSION,ETFLAGS} for LoongArch64 by <a
href="https://github.com/heiher"><code>@​heiher</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3570">rust-lang/libc#3570</a></li>
<li>Add MFD_NOEXEC_SEAL and MFD_EXEC by <a
href="https://github.com/rusty-snake"><code>@​rusty-snake</code></a> in
<a
href="https://redirect.github.com/rust-lang/libc/pull/3553">rust-lang/libc#3553</a></li>
<li>Backport of <a
href="https://redirect.github.com/rust-lang/libc/issues/3546">#3546</a>
and update crate version to 0.2.153 by <a
href="https://github.com/GuillaumeGomez"><code>@​GuillaumeGomez</code></a>
in <a
href="https://redirect.github.com/rust-lang/libc/pull/3554">rust-lang/libc#3554</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/rusty-snake"><code>@​rusty-snake</code></a>
made their first contribution in <a
href="https://redirect.github.com/rust-lang/libc/pull/3553">rust-lang/libc#3553</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/rust-lang/libc/compare/0.2.152...0.2.153">https://github.com/rust-lang/libc/compare/0.2.152...0.2.153</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ccf8a3e520"><code>ccf8a3e</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/libc/issues/3554">#3554</a>
from GuillaumeGomez/update-0.2</li>
<li><a
href="036fe2e41b"><code>036fe2e</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/libc/issues/3553">#3553</a>
from rusty-snake/mfd-exec</li>
<li><a
href="adaec1d02f"><code>adaec1d</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/libc/issues/3570">#3570</a>
from heiher/fs-ioctl</li>
<li><a
href="9a07431396"><code>9a07431</code></a>
Add ioctl FS_IOC_{G,S}{ETVERSION,ETFLAGS} for LoongArch64</li>
<li><a
href="3726d14766"><code>3726d14</code></a>
Update crate version to 0.2.153</li>
<li><a
href="d5d370016f"><code>d5d3700</code></a>
Ignore some android constants not found in tests</li>
<li><a
href="738f9014cc"><code>738f901</code></a>
Add missing constants for Android</li>
<li><a
href="8b68569939"><code>8b68569</code></a>
Add MFD_NOEXEC_SEAL and MFD_EXEC</li>
<li><a
href="b56e4b3490"><code>b56e4b3</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/libc/issues/3557">#3557</a>
from JohnTitor/fix-ci</li>
<li><a
href="941f82557a"><code>941f825</code></a>
Fix CI for v0.2</li>
<li>Additional commits viewable in <a
href="https://github.com/rust-lang/libc/compare/0.2.152...0.2.153">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=libc&package-manager=cargo&previous-version=0.2.152&new-version=0.2.153)](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-02 06:29:00 +00:00
dependabot[bot]
f34a7142cc build(deps): Bump time from 0.3.31 to 0.3.32 in /rust (#3509)
Bumps [time](https://github.com/time-rs/time) from 0.3.31 to 0.3.32.
<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.32</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.32 [2024-02-01]</h2>
<h3>Added</h3>
<ul>
<li>Methods to replace the day of the year.
<ul>
<li><code>Date::replace_ordinal</code></li>
<li><code>PrimitiveDateTime::replace_ordinal</code></li>
<li><code>OffsetDateTime::replace_ordinal</code></li>
</ul>
</li>
<li>Modules to treat an <code>OffsetDateTime</code> as a Unix timestamp
with subsecond precision for serde.
<ul>
<li><code>time::serde::timestamp::milliseconds</code></li>
<li><code>time::serde::timestamp::microseconds</code></li>
<li><code>time::serde::timestamp::nanoseconds</code></li>
</ul>
</li>
</ul>
<h3>Changed</h3>
<ul>
<li><code>Duration::time_fn</code> is deprecated.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ff3255fbf0"><code>ff3255f</code></a>
v0.3.32 release</li>
<li><a
href="d3dd5c9542"><code>d3dd5c9</code></a>
Deprecate <code>Duration::time_fn</code></li>
<li><a
href="8a0dc706be"><code>8a0dc70</code></a>
Remove markdown files in favor of org-wide config</li>
<li><a
href="980878b1d1"><code>980878b</code></a>
Build docs using org-wide workflow, change audit</li>
<li><a
href="4baf6b3cdd"><code>4baf6b3</code></a>
Remove documentation of deprecated feature flag</li>
<li><a
href="be932d86ca"><code>be932d8</code></a>
Adds support to serialize and deserialize timestamps with different
resolutio...</li>
<li><a
href="bb397df38e"><code>bb397df</code></a>
Commit Cargo.lock</li>
<li><a
href="26b7c5f6bd"><code>26b7c5f</code></a>
Update alignment for <code>Parsed</code> in miri</li>
<li><a
href="6747ebe5f9"><code>6747ebe</code></a>
Update CI</li>
<li><a
href="589ff6be84"><code>589ff6b</code></a>
Update copyright year</li>
<li>Additional commits viewable in <a
href="https://github.com/time-rs/time/compare/v0.3.31...v0.3.32">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.31&new-version=0.3.32)](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-02 06:28:22 +00:00
Reactor Scram
4104d679cd refactor(windows): Add context to errors, add SAFETY comments, update TODOs (#3517)
The only semantic changes are:
- Add context to Windows errors
- Refactor some `bail!`'s that could be `context`'s

The rest is updating comments:
- Add `SAFETY: TODO` for unmarked unsafe blocks
- Elaborate on existing SAFETY comments 
- Close completed TODOs
- Link in Github issues for open TODOs
- Mark invariants or inter-dependencies between files that aren't
captured by tests or types yet

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-02-01 21:09:32 +00:00
Reactor Scram
5b041e3122 fix(windows): install and load wintun.dll from a well-known path instead of setting the current directory (#3430)
closes #3425

```[tasklist]
- [x] Switch to connlib-shared for BUNDLE_ID and stuff
- [x] Break out small things into other PRs if possible
- [x] Fix merge conflicts
```

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Gabi <gabrielalejandro7@gmail.com>
2024-02-01 19:16:19 +00:00
dependabot[bot]
d7ee1ebe88 build(deps-dev): Bump @types/node from 18.19.8 to 20.11.15 in /rust/windows-client (#3502)
Bumps
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
from 18.19.8 to 20.11.15.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@types/node&package-manager=npm_and_yarn&previous-version=18.19.8&new-version=20.11.15)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

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


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-01 17:53:45 +00:00
Reactor Scram
9cb433dcc9 Reactorscram/fix webview2 crash (#3464)
Closes #3451 

I can't get it to log, because the file logger is destroyed when Tauri
bails. But it shows an error dialog and prints to stderr.
Unfortunately the error dialogs don't have selectable text, but oddly
you _can_ do Ctrl+C on them, to get this:

```
---------------------------
Firezone Error
---------------------------
Firezone cannot start because WebView2 is not installed. Follow the instructions at <https://www.firezone.dev/kb/user-guides/windows-client>.
---------------------------
OK   
---------------------------
```

I don't know where these numbers should go in the docs:

- 1 minute 30 seconds to install Firezone from MSI (including WebView2
download) on 80 Mbps wired Internet, with 2 CPU cores and 8 GB of RAM
allocated to the VM
- 2 minutes with 1 CPU core and 2 GB of RAM on the VM


![image](https://github.com/firezone/firezone/assets/13400041/8ebe6d62-e619-47a9-96ab-a43a0b0a53a8)
2024-02-01 17:13:37 +00:00
Andrew Dryga
a211f96109 feat(portal): Broadcast state changes to connected clients and gateways (#2240)
# Gateways
- [x] When Gateway Group is deleted all gateways should be disconnected
- [x] When Gateway Group is updated (eg. routing) broadcast to all
affected gateway to disconnect all the clients
- [x] When Gateway is deleted it should be disconnected
- [x] When Gateway Token is revoked all gateways that use it should be
disconnected

# Relays
- [x] When Relay Group is deleted all relays should be disconnected
- [x] When Relay is deleted it should be disconnected
- [x] When Relay Token is revoked all gateways that use it should be
disconnected

# Clients
- [x] Remove Delete Client button, show clients using the token on the
Actors page (#2669)
- [x] When client is deleted disconnect it
- [ ] ~When Gateway is offline broadcast to the Clients connected to it
it's status~
- [x] Persist `last_used_token_id` in Clients and show it in tokens UI

# Resources
- [x] When Resource is deleted it should be removed from all gateways
and clients
- [x] When Resource connection is removed it should be deleted from
removed gateway groups
- [x] When Resource is updated (eg. traffic filters) all it's
authorizations should removed

# Authentication
- [x] When Token is deleted related sessions are terminated
- [x] When an Actor is deleted or disabled it should be disconnected
from browser and client
- [x] When Identity is deleted it's sessions should be disconnected from
browser and client
- [x] ^ Ensure the same happens for identities during IdP sync
- [x] When IdP is disabled act like all actors for it are disabled?
- [x] When IdP is deleted act like all actors for it are deleted?

# Authorization
- [x] When Policy is created clients that gain access to a resource
should get an update
- [x] When Policy is deleted we need to all authorizations it's made
- [x] When Policy is disabled we need to all authorizations it's made
- [x] When Actor Group adds or removes a user, related policies should
be re-evaluated
- [x] ^ Ensure the same happens for identities during IdP sync

# Settings
- [x] Re-send init message to Client when DNS settings change

# Code
- [x] Crear way to see all available topics and messages, do not use
binary topics any more

---------

Co-authored-by: conectado <gabrielalejandro7@gmail.com>
2024-02-01 11:02:13 -06:00
Thomas Eizinger
71afc6d9ff fix(snownet): don't try to allocate a new channel if we already have one (#3476)
Currently, we always try to allocate a channel when the user calls
`bind_channel`. This is a problem if we try to re-connect to a peer. The
channel binding will still be active so `bind_channel` needs to be a
no-op.

Resolves: #3475.
2024-02-01 04:16:28 +00:00
Thomas Eizinger
49ceb8ae83 fix(snownet): don't use unbound channels for relaying (#3474)
Currently, the `bound` flag is not considered when attempting to relay
data. This isn't actively harmful because the relay will drop them but
it causes warnings in the logs. This PR adds a check to make sure we
only try to relay data via channels that are bound. Additionally, we now
handle failed channel bind requests by clearing the local state.
2024-02-01 02:40:01 +00:00
Thomas Eizinger
84b3ac50ca fix(relay): correctly separate channel state for different peers (#3472)
Currently, there is a bug in the relay where the channel state of
different peers overlaps because the data isn't indexed correctly by
both peers and clients.

This PR fixes this, introduces more debug assertions (this bug was
caught by one) and also adds some new-type wrappers to avoid conflating
peers with clients.
2024-02-01 01:53:54 +00:00
Reactor Scram
a5a6d81eb1 refactor(windows): change some anyhow errors into thiserror errors (#3461)
This is part of handling the WebView-not-installed error, #3451
2024-02-01 01:44:26 +00:00
Reactor Scram
e35dd53649 ci(windows): Upload Windows debug symbols (#3467)
Closes #3450 

I was able to get stacktraces from a crash generated inside my VM. It
picked out the correct line in gui.rs where the crash was triggered.


![image](https://github.com/firezone/firezone/assets/13400041/1fc521a1-059c-489b-b9b8-506570a4df0f)


![image](https://github.com/firezone/firezone/assets/13400041/17e4bdd9-cd2a-477a-821a-ab23e61eadf7)
2024-02-01 01:36:10 +00:00
Reactor Scram
e2efd725e3 feat(firezone-tunnel): sort resources alphabetically (#3465)
Closes #3217. I just now noticed that one was assigned to me


![image](https://github.com/firezone/firezone/assets/13400041/106ba400-fda8-49b9-ad81-b6ced8414ea4)

The sorting is naive, just sorts the UTF-8 encoded bytes, so lowercase
resources come after all uppercase resources, and it's probably very
wrong for anything outside Latin-1 and English locale. If the names are
identical, resource ID tie-breaks.
2024-02-01 01:14:30 +00:00
Reactor Scram
966432da5b refactor(windows): remove IPC code which is now unused (#3469) 2024-01-31 23:34:46 +00:00
Reactor Scram
5ef6e97f4d fix(windows): don't crash if the saved log filter is invalid (#3460)
Closes #3452
2024-01-31 23:01:05 +00:00
Reactor Scram
d9ac4fa443 fix(windows): CSS nit (#3463)
Before this change, some of the background was (252, 252, 252) (#fcfcfc,
bg-neutral-50) and some was #ffffff white


![image](https://github.com/firezone/firezone/assets/13400041/ebfd0488-2ee7-4790-85d2-dee86edbe272)

After this change, all the background is (248, 247, 247) (#f8f7f7,
bg-neutral-100)


![image](https://github.com/firezone/firezone/assets/13400041/22185728-aa1b-4f45-a888-74a8a4120a8d)

"Before" with exaggerated contrast: 

![image](https://github.com/firezone/firezone/assets/13400041/de63471b-48cd-4073-936b-bf5a0df888c8)
2024-01-31 20:49:17 +00:00
Jamil
2fba4406a6 fix(windows): Take the default button shade darker a notch (#3462)
<img width="688" alt="Screenshot 2024-01-31 at 11 16 11 AM"
src="https://github.com/firezone/firezone/assets/167144/891af931-9ff5-4975-8222-027e081e7ae6">
<img width="679" alt="Screenshot 2024-01-31 at 11 16 22 AM"
src="https://github.com/firezone/firezone/assets/167144/f84f886a-f7d9-428b-9199-3214a3002682">
2024-01-31 20:14:06 +00:00
Jamil
cd1f047575 fix(connlib): handle null-termination of TUN device path string correctly (#3449)
Credit to @Intuinewin from #3445

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-01-31 01:49:51 +00:00
Thomas Eizinger
ab7c947d0f fix(connection): only emit Transmit.src that correspond to local sockets (#3411)
It turns out that we need to do some post-processing of the
`Transmit.source` attribute from `str0m`. In its current state, `str0m`
may also set that to a server-reflexive address which is **not** a local
socket. There is a longer discussion around this here:
https://github.com/algesten/str0m/issues/453.

This depends on an unmerged PR in `str0m`:
https://github.com/algesten/str0m/pull/455.
2024-01-31 01:42:47 +00:00
Thomas Eizinger
3f8c6cb6eb feat(relay): allow channel bindings to IPv6 addresses (#3434)
Previously, we still had a hard-coded rule in the relay that would not
allow us to relay to an IPv6 peer. We can remove that and properly check
this based on the allocated addresses.

Resolves: #3405.
2024-01-31 00:36:54 +00:00
Thomas Eizinger
6a33516460 feat(connection): rebrand to snownet (#3435)
`firezone-connection` was a working title that I never really quite
liked. Here is a proposal to rebrand it to `snownet`. That is a lot more
concise and derived from the fact that we are established a network of
connections using ICE.
2024-01-31 00:54:00 +00:00
Reactor Scram
6c16d795e9 docs(windows): Update docs for Windows VM testing / resetting files Firezone creates (#3448) 2024-01-30 22:31:46 +00:00
Reactor Scram
f2f8464f02 fix(windows): use a well-known path for the crash handler socket (#3444)
I didn't notice that the socket is a Unix domain socket, and not a named
pipe, so it shows up in the normal Windows filesystem.

Since I'm trying to get rid of the `set_current_dir` call at startup,
this needs to use a well-known path instead of a relative path.
(https://github.com/firezone/firezone/pull/3430/files#diff-8ee58783aeb973dcbf764b93d3038dd0133d981cc0caae8c5429020eb002a52eL62)

So I stuck it in `%LOCALAPPDATA%/data/`.


![image](https://github.com/firezone/firezone/assets/13400041/85335b3f-064f-4c8d-be50-3f4e98b9302c)

I manually tested and made sure that the crash dump is written when we
pass `--crash-on-purpose`, so the client and server are able to reach
each other correctly.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-01-30 21:28:18 +00:00
Reactor Scram
9096eee396 feat(windows): enable crash handling on release builds (#3441)
Since #3263 closed, we could enable crash handling for release builds on
Windows, too.
This should get rid of a dead code warning in CI:


![image](https://github.com/firezone/firezone/assets/13400041/7a6cd0ed-5943-4fa5-a23f-1426aa438f51)

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-01-30 21:17:25 +00:00
Reactor Scram
aa25a46b72 refactor(windows): handle tray menu events in the main loop (#3446)
Closes #2983
2024-01-30 20:55:56 +00:00
Reactor Scram
9078b72e9b refactor(windows): use 'use' statements better in crash handling (#3442) 2024-01-30 20:43:43 +00:00
Thomas Eizinger
9f7080b669 feat(connection): allocate IPv6 address (#3436)
Resolve the two TODOs mentioned in the code. As part of #3399, we
correctly are handling different combinations of available sockets and
requested addresses in the relay more gracefully. In particular, we
return whatever addresses we could allocate and only fail if we couldn't
allocate any at all.

The `Allocation` struct will extract whatever allocated addresses are
present in the response. Thus, it is safe for us to **always** request
both, an IPv4 and IPv6 address. A relay that only operates on one of
them will just return that one address.

Resolves: #3406.
2024-01-30 17:28:17 +00:00
Thomas Eizinger
e02aa2eb1f chore(relay): update docs in regards to spec-compliance (#3437) 2024-01-30 17:27:38 +00:00
Reactor Scram
f23e77e412 refactor(windows): set absolute paths for logs and wintun.dll (#3428)
This is part of fixing #3425 

Until now I changed the app's working directory into our %LOCALAPPDATA%
folder and then used relative paths.

But this causes two problems:
- Passing `.\wintun.dll` when loading the DLL can cause Windows to
search for the DLL. We don't want it to search, we want to put the DLL
in one place and make sure it uses that, since that's the version we'll
be updating
- It means I've been using the app's current working dir as de-facto
global mutable state

The reason I could not fix it sooner is that it needed the bundle ID to
be available before Tauri starts.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Gabi <gabrielalejandro7@gmail.com>
2024-01-30 16:34:37 +00:00
Thomas Eizinger
2bad4c617f feat(phoenix-channel): reconnect on missed heartbeat from portal (#3410)
In case the portal does not reply to our heartbeat when we are about to
send the next one, we try to reconnect. For now, this affects only the
relay and the gateway but will be used in the clients in the future too.

Resolves: #2916.
2024-01-30 03:14:26 +00:00
Reactor Scram
471729c73d fix(windows): Show "Signing in..." menu during auto-sign-in (#3431)
closes #3403 

Given the token is saved on disk, when we start Firezone, then the menu
will show "Signing in..." while connlib connects.
2024-01-30 01:01:44 +00:00
dependabot[bot]
3948470539 build(deps): Bump serde from 1.0.195 to 1.0.196 in /rust (#3421)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.195 to
1.0.196.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/serde-rs/serde/releases">serde's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.196</h2>
<ul>
<li>Improve formatting of &quot;invalid type&quot; error messages
involving floats (<a
href="https://redirect.github.com/serde-rs/serde/issues/2682">#2682</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ede9762a58"><code>ede9762</code></a>
Release 1.0.196</li>
<li><a
href="d438c2d67b"><code>d438c2d</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2682">#2682</a>
from dtolnay/decimalpoint</li>
<li><a
href="bef110b92a"><code>bef110b</code></a>
Format Unexpected::Float with decimal point</li>
<li><a
href="b971ef11d1"><code>b971ef1</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2681">#2681</a>
from dtolnay/workspacedeps</li>
<li><a
href="29d9f69399"><code>29d9f69</code></a>
Fix workspace.dependencies default-features future compat warning</li>
<li><a
href="aecb4083bd"><code>aecb408</code></a>
Sort workspace dependencies</li>
<li><a
href="1c675ab3a3"><code>1c675ab</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2678">#2678</a>
from rodoufu/workspaceDependencies</li>
<li><a
href="dd619630a3"><code>dd61963</code></a>
Adding workspace dependencies</li>
<li><a
href="111803ab07"><code>111803a</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2673">#2673</a>
from Sky9x/msrv-badge</li>
<li><a
href="0024f74f34"><code>0024f74</code></a>
Use shields.io's MSRV badges</li>
<li>See full diff in <a
href="https://github.com/serde-rs/serde/compare/v1.0.195...v1.0.196">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde&package-manager=cargo&previous-version=1.0.195&new-version=1.0.196)](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-01-29 21:36:28 +00:00
Reactor Scram
3d8ed7f10e fix(windows): move crash dumps into logs dir so they get exported in the zip, closes #3263 (#3426)
![image](https://github.com/firezone/firezone/assets/13400041/0fffa284-4c37-4b35-a0cf-841442246c66)


![image](https://github.com/firezone/firezone/assets/13400041/2d275cba-5d1f-4289-9214-05804f4477c6)

Screenshots taken on 33737b3a38f7
I also refactored some of the related code.
2024-01-29 19:02:16 +00:00
dependabot[bot]
0a01d6c03f build(deps): Bump keyring from 2.3.1 to 2.3.2 in /rust (#3419)
Bumps [keyring](https://github.com/hwchen/keyring-rs) from 2.3.1 to
2.3.2.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/hwchen/keyring-rs/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=keyring&package-manager=cargo&previous-version=2.3.1&new-version=2.3.2)](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-01-29 18:52:44 +00:00
Thomas Eizinger
c9834ee8ee feat(relay): print stats every 10s (#3408)
In #3400, a discussion started on what the correct log level would be
for the production relay. Currently, the relay logs some stats about
each packet on debug, i.e. where it came from, where it is going to and
how big it is. This isn't very useful in production though and will fill
up our log disk quickly.

This PR introduces a stats timer like we already have it in other
components. We print the number of allocations, how many channels we
have and how much data we relayed over all these channels since we last
printed. The interval is currently set to 10 seconds.

Here is what this output could look like (captured locally using
`relay/run_smoke_test.sh`, although slightly tweaked, printing ever 2s,
using release mode and larger packets on the clients):

```
2024-01-26T05:01:02.445555Z  INFO relay: Seeding RNG from '0'
2024-01-26T05:01:02.445580Z  WARN relay: No portal token supplied, starting standalone mode
2024-01-26T05:01:02.445827Z  INFO relay: Listening for incoming traffic on UDP port 3478
2024-01-26T05:01:02.447035Z  INFO Eventloop::poll: relay: num_allocations=0 num_channels=0 throughput=0.00 B/s
2024-01-26T05:01:02.649194Z  INFO Eventloop::poll:handle_client_input{sender=127.0.0.1:39092 transaction_id="8f20177512495fcb563c60de" allocation=AID-1}: relay: Created new allocation first_relay_address=127.0.0.1 lifetime=600s
2024-01-26T05:01:02.650744Z  INFO Eventloop::poll:handle_client_input{sender=127.0.0.1:39092 transaction_id="6445943a353d5e8c262a821f" allocation=AID-1 peer=127.0.0.1:41094 channel=16384}: relay: Successfully bound channel
2024-01-26T05:01:04.446317Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=631.54 MB/s
2024-01-26T05:01:06.446319Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=698.73 MB/s
2024-01-26T05:01:08.446325Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=708.98 MB/s
2024-01-26T05:01:10.446324Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=690.79 MB/s
2024-01-26T05:01:12.446316Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=715.53 MB/s
2024-01-26T05:01:14.446315Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=706.90 MB/s
2024-01-26T05:01:16.446313Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=712.03 MB/s
2024-01-26T05:01:18.446319Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=717.54 MB/s
2024-01-26T05:01:20.446316Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=690.74 MB/s
2024-01-26T05:01:22.446313Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=705.08 MB/s
2024-01-26T05:01:24.446311Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=700.41 MB/s
2024-01-26T05:01:26.446319Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=717.57 MB/s
2024-01-26T05:01:28.446320Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=688.82 MB/s
2024-01-26T05:01:30.446329Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=696.35 MB/s
2024-01-26T05:01:32.446317Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=724.03 MB/s
2024-01-26T05:01:34.446320Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=713.46 MB/s
2024-01-26T05:01:36.446314Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=716.13 MB/s
2024-01-26T05:01:38.446327Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=687.16 MB/s
2024-01-26T05:01:40.446315Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=708.20 MB/s
2024-01-26T05:01:42.446314Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=689.36 MB/s
2024-01-26T05:01:44.446314Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=698.62 MB/s
2024-01-26T05:01:46.446315Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=696.21 MB/s
2024-01-26T05:01:48.446378Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=696.36 MB/s
2024-01-26T05:01:50.446314Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=709.47 MB/s
2024-01-26T05:01:52.446319Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=714.48 MB/s
2024-01-26T05:01:54.446323Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=690.71 MB/s
2024-01-26T05:01:56.446313Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=692.70 MB/s
2024-01-26T05:01:58.446321Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=687.87 MB/s
2024-01-26T05:02:00.446316Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=682.11 MB/s
2024-01-26T05:02:02.446312Z  INFO Eventloop::poll: relay: num_allocations=1 num_channels=1 throughput=700.07 MB/s
```
2024-01-29 18:52:15 +00:00
Reactor Scram
b521fbcf90 feat(windows): UI notification for reauth (#3329) (#3416)
```[tasklist]
- [x] Smoke-test MSI from CI
- [x] Move out of drafts
- [x] Phrasing
```
2024-01-29 16:31:30 +00:00
dependabot[bot]
5b2ef7a326 build(deps): Bump winreg from 0.51.0 to 0.52.0 in /rust (#3420)
Bumps [winreg](https://github.com/gentoo90/winreg-rs) from 0.51.0 to
0.52.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/gentoo90/winreg-rs/releases">winreg's
releases</a>.</em></p>
<blockquote>
<h2>0.52.0 (windows-rs)</h2>
<ul>
<li>Breaking change: <code>.commit()</code> and <code>.rollback()</code>
now consume the transaction (<a
href="https://redirect.github.com/gentoo90/winreg-rs/issues/62">#62</a>)</li>
<li>Add <code>RegKey::rename_subkey()</code> method (<a
href="https://redirect.github.com/gentoo90/winreg-rs/issues/58">#58</a>)</li>
<li>Make serialization modules public (<a
href="https://redirect.github.com/gentoo90/winreg-rs/issues/59">#59</a>)</li>
<li>Fix UB in <code>FromRegValue</code> for <code>u32</code> and
<code>u64</code> (<a
href="https://redirect.github.com/gentoo90/winreg-rs/issues/61">#61</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/gentoo90/winreg-rs/blob/master/CHANGELOG.md">winreg's
changelog</a>.</em></p>
<blockquote>
<h2>0.52.0</h2>
<ul>
<li>Breaking change: <code>.commit()</code> and <code>.rollback()</code>
now consume the transaction (<a
href="https://redirect.github.com/gentoo90/winreg-rs/issues/62">#62</a>)</li>
<li>Add <code>RegKey::rename_subkey()</code> method (<a
href="https://redirect.github.com/gentoo90/winreg-rs/issues/58">#58</a>)</li>
<li>Make serialization modules public (<a
href="https://redirect.github.com/gentoo90/winreg-rs/issues/59">#59</a>)</li>
<li>Fix UB in <code>FromRegValue</code> for <code>u32</code> and
<code>u64</code> (<a
href="https://redirect.github.com/gentoo90/winreg-rs/issues/61">#61</a>)</li>
</ul>
<h2>0.14.0</h2>
<ul>
<li>Breaking change: increase MSRV to 1.34</li>
<li>Fix UB in <code>FromRegValue</code> for <code>u32</code> and
<code>u64</code> (<a
href="https://redirect.github.com/gentoo90/winreg-rs/issues/61">#61</a>)</li>
</ul>
<h2>0.13.0</h2>
<ul>
<li>Breaking change: <code>.commit()</code> and <code>.rollback()</code>
now consume the transaction (<a
href="https://redirect.github.com/gentoo90/winreg-rs/issues/62">#62</a>)</li>
<li>Add <code>RegKey::rename_subkey()</code> method (<a
href="https://redirect.github.com/gentoo90/winreg-rs/issues/58">#58</a>)</li>
<li>Make serialization modules public (<a
href="https://redirect.github.com/gentoo90/winreg-rs/issues/59">#59</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="1c56127adf"><code>1c56127</code></a>
Merge branch 'winapi'. Bump version to 0.52.0</li>
<li><a
href="4b0ba3e243"><code>4b0ba3e</code></a>
Bump version to 0.14.0</li>
<li><a
href="7634148bca"><code>7634148</code></a>
Fix UB in <code>FromRegValue</code> for <code>u32</code> and
<code>u64</code></li>
<li><a
href="9aea2ad818"><code>9aea2ad</code></a>
Bump version to 0.13.0</li>
<li><a
href="53125816b2"><code>5312581</code></a>
Fix build with rust 1.31</li>
<li><a
href="ecda4989e9"><code>ecda498</code></a>
Make serialization modules public.</li>
<li><a
href="0fd5bb8823"><code>0fd5bb8</code></a>
<code>.commit()</code> and <code>.rollback()</code> now consume the
transaction</li>
<li><a
href="fa2f1c851a"><code>fa2f1c8</code></a>
Add <code>RegKey::rename_subkey()</code> method</li>
<li>See full diff in <a
href="https://github.com/gentoo90/winreg-rs/compare/v0.51.0...v0.52.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=winreg&package-manager=cargo&previous-version=0.51.0&new-version=0.52.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-01-29 16:19:30 +00:00