Commit Graph

115 Commits

Author SHA1 Message Date
Reactor Scram
a822238205 fix(windows): keep the main loop running even if a request has an error (#3569)
Closes #3521 because now almost all of the `?` in the main loop will log
an error and not bail. This is nice for trivial things like copying a
resource when we're not signed in. (e.g. User opens the menu, the token
expires, user clicks something, it should just do nothing instead of
crashing)

Closes a long-standing TODO for moving more of the request handling code
inside `impl Controller`
2024-02-06 16:24:11 +00:00
Reactor Scram
9365a61513 fix(windows): Wrap deep link URLs in SecureUrl, don't log them (#3574)
Previously the whole URL was logged, which includes half of the secret
token. Now it just says "Got deep link"
2024-02-06 16:21:36 +00:00
Reactor Scram
5943a95b6f fix(windows): vt100 seems to panic in CI, just print a warning instead (#3573)
Fixes the Windows smoke test failing in CI currently.
The CI already has coloring enabled.
2024-02-05 22:56:32 +00:00
Gabi
8a31a532b6 fix(connlib): Enable ansi colors for the windows client debug console (#3552)
This adds colors to the debug console in the windows client


![image](https://github.com/firezone/firezone/assets/3310803/dfb5b119-9db3-40b8-acf9-3485a2268597)
2024-02-05 21:37:54 +00:00
dependabot[bot]
0c05d853bb build(deps): Bump minidumper from 0.8.0 to 0.8.1 in /rust (#3560)
Bumps [minidumper](https://github.com/EmbarkStudios/crash-handling) from
0.8.0 to 0.8.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/EmbarkStudios/crash-handling/releases">minidumper's
releases</a>.</em></p>
<blockquote>
<h2>minidumper-0.8.1</h2>
<h3>Changed</h3>
<ul>
<li><a
href="https://redirect.github.com/EmbarkStudios/crash-handling/pull/81">PR#81</a>
resolved <a
href="https://redirect.github.com/EmbarkStudios/crash-handling/issues/80">#80</a>
by updating <code>polling</code> to 0.3.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3b77c9b00d"><code>3b77c9b</code></a>
chore: Release</li>
<li><a
href="d34d00bc51"><code>d34d00b</code></a>
chore: Release</li>
<li><a
href="789c99498c"><code>789c994</code></a>
Update CHANGELOGs</li>
<li><a
href="addf1486f8"><code>addf148</code></a>
Update (<a
href="https://redirect.github.com/EmbarkStudios/crash-handling/issues/81">#81</a>)</li>
<li><a
href="16c2545f2a"><code>16c2545</code></a>
chore: Release</li>
<li><a
href="955629bab9"><code>955629b</code></a>
Update CHANGELOG</li>
<li><a
href="5e907ff389"><code>5e907ff</code></a>
Add Android support for the i686 and x86-64 targets (<a
href="https://redirect.github.com/EmbarkStudios/crash-handling/issues/76">#76</a>)</li>
<li><a
href="14bba1b81e"><code>14bba1b</code></a>
Fix using <code>crash-handler</code> under Miri (<a
href="https://redirect.github.com/EmbarkStudios/crash-handling/issues/75">#75</a>)</li>
<li>See full diff in <a
href="https://github.com/EmbarkStudios/crash-handling/compare/minidumper-0.8.0...minidumper-0.8.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=minidumper&package-manager=cargo&previous-version=0.8.0&new-version=0.8.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-05 21:37:27 +00:00
Reactor Scram
e0f54784b4 fix(windows): save actor name to disk and reload it on startup (#3546)
Closes #3519 

The actor name is saved in plain text in our AppData folder.

I did simple manual tests on my dev laptop:
- Restart the app, it reloads the actor name from disk
- Sign out of the app, the file is deleted from the disk

Caveats:
- If you un-install the app while signed in, the actor name will still
be there until something cleans up AppData. I don't think the MSI cleans
it up.
- If the token is present but the actor name is missing, I just treat it
as if the token was missing and make the app be signed-out, since this
will happen on dev systems until this PR has been merged for some time.
- If we try to delete the file and the file is NotFound, I just ignore
it.
2024-02-05 21:27:43 +00:00
Reactor Scram
ed2cae122e feat(windows): add smoke test subcommand (#3541)
Part of #3534
This PR creates the subcommand, which you can run locally, but it
doesn't run it in `ci.yml` yet. That's in #3542

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Gabi <gabrielalejandro7@gmail.com>
2024-02-05 18:49:28 +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
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
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
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
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
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
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
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
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
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
Reactor Scram
e7f3dedfe6 fix(windows): allow user to cancel sign-in flow (#3385)
Closes #3316 


![image](https://github.com/firezone/firezone/assets/13400041/51fe4cbb-cd2f-4ca0-aa15-8b40ea18fffd)

The cancel sign-in button uses the same code as a regular sign-out or
token expiration, which is idempotent.
2024-01-24 23:52:47 +00:00
Jamil
d469f6ad42 feat(ci): Test client gracefully handles portal and relay disconnects (#3376)
Test basic connectivity with the headless client after the portal API
restarts.

Based on top of #3364 to test that portal restarts don't cause a
cascading failure.
2024-01-24 21:04:02 +00:00
Jamil
e3994a60e6 refactor(windows): Add logo and version to About window (#3378)
Fixes #3354 
Fixes #3229

---------

Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-01-24 17:23:09 +00:00
Reactor Scram
aeb3299077 fix(windows): prevent a security issue (#3326)
- [x] Confirm that the PID of the pipe client matches the PID of the
subprocess we just spawned
- [x] (redundant?) Send a unique cookie to the child process' stdin and
require it to be echoed back over the named pipe. An attacker could not
intercept the token since the stdin belongs to the subprocess we just
spawned

I didn't realize, but named pipes and CLI args are both readable by
other process, so any other process could connect to our named pipe and
do a MITM.

I don't know how Chromium protects itself from this, so I did some
research and just made something up.

After this I'll probably break it up into submodules, `ipc.rs` is about
600 lines and probably more than half is just tests.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-01-24 16:28:09 +00:00
Reactor Scram
ac3ff0ebc2 fix(windows): work around possible keyring multi-threading bug for now (#3363)
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-01-24 00:23:23 +00:00
Jamil
086f7a85c6 refactor(windows): Windows UI polish (#3338)
- Add Tailwind and Flowbite for consistent UI

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-01-23 17:07:25 +00:00
dependabot[bot]
42a05e86ea build(deps): Bump uuid from 1.6.1 to 1.7.0 in /rust (#3339)
Bumps [uuid](https://github.com/uuid-rs/uuid) from 1.6.1 to 1.7.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/uuid-rs/uuid/releases">uuid's
releases</a>.</em></p>
<blockquote>
<h2>1.7.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Add missing test for invalid parse_str by <a
href="https://github.com/CXWorks"><code>@​CXWorks</code></a> in <a
href="https://redirect.github.com/uuid-rs/uuid/pull/723">uuid-rs/uuid#723</a></li>
<li>Upgrade borsh unstable dependency to v1.0 and make it stable by <a
href="https://github.com/bgeron"><code>@​bgeron</code></a> in <a
href="https://redirect.github.com/uuid-rs/uuid/pull/724">uuid-rs/uuid#724</a></li>
<li>Reduce the package size of uuid by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/uuid-rs/uuid/pull/726">uuid-rs/uuid#726</a></li>
<li>Make use of newer Cargo features for specifying dependencies by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/uuid-rs/uuid/pull/727">uuid-rs/uuid#727</a></li>
<li>Prepare for 1.7.0 release by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/uuid-rs/uuid/pull/728">uuid-rs/uuid#728</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/CXWorks"><code>@​CXWorks</code></a> made
their first contribution in <a
href="https://redirect.github.com/uuid-rs/uuid/pull/723">uuid-rs/uuid#723</a></li>
<li><a href="https://github.com/bgeron"><code>@​bgeron</code></a> made
their first contribution in <a
href="https://redirect.github.com/uuid-rs/uuid/pull/724">uuid-rs/uuid#724</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/uuid-rs/uuid/compare/1.6.1...1.7.0">https://github.com/uuid-rs/uuid/compare/1.6.1...1.7.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="cefc353334"><code>cefc353</code></a>
Merge pull request <a
href="https://redirect.github.com/uuid-rs/uuid/issues/728">#728</a> from
uuid-rs/cargo/1.7.0</li>
<li><a
href="3255b5414b"><code>3255b54</code></a>
prepare for 1.7.0 release</li>
<li><a
href="403bb17c1a"><code>403bb17</code></a>
Merge pull request <a
href="https://redirect.github.com/uuid-rs/uuid/issues/727">#727</a> from
uuid-rs/chore/cargo-cleanup</li>
<li><a
href="b7c6e26fea"><code>b7c6e26</code></a>
make use of newer Cargo features for specifying dependencies</li>
<li><a
href="ed13c73c7c"><code>ed13c73</code></a>
Merge pull request <a
href="https://redirect.github.com/uuid-rs/uuid/issues/726">#726</a> from
uuid-rs/chore/pkg-size</li>
<li><a
href="2e92a3d45f"><code>2e92a3d</code></a>
Merge pull request <a
href="https://redirect.github.com/uuid-rs/uuid/issues/724">#724</a> from
bgeron/borsh-1</li>
<li><a
href="38f01ffccf"><code>38f01ff</code></a>
rename workflow</li>
<li><a
href="eab4b85919"><code>eab4b85</code></a>
reduce the package size of uuid</li>
<li><a
href="421d752847"><code>421d752</code></a>
Make the borsh feature work by itself, without having to specify private
feat...</li>
<li><a
href="2534949aa3"><code>2534949</code></a>
Continue making feature borsh stable, as suggested by <a
href="https://github.com/KordAus"><code>@​KordAus</code></a></li>
<li>Additional commits viewable in <a
href="https://github.com/uuid-rs/uuid/compare/1.6.1...1.7.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=uuid&package-manager=cargo&previous-version=1.6.1&new-version=1.7.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-23 15:14:41 +00:00
Jamil
1623552b58 fix(connlib): Increase max partition time to handle client network partitions more gracefully (#3335)
Fixes #3334 
Fixes #3302

---------

Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-01-23 01:25:21 +00:00
Reactor Scram
4d5041bbca test(windows): make Windows kill child processes when the parent exits (#3311)
Probably needs some refactoring and prettifying before it comes out of
drafts.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-01-22 22:30:17 +00:00
Reactor Scram
215883caec test(windows): multi-process test for IPC (#3310)
I tested this by temporarily putting panics in `test_ipc_manager` and
`test_ipc_worker`.
It looks like, if a process crashes, Windows will clean up its named
pipe, and the process waiting on the other side of the named pipe will
get an error.
This is good but it's not air-tight - ~~We could still have a situation
where a worker process locks up, and the main process crashes, and the
worker process then leaks.~~ #3311 will fix that

For that case I'll try this
https://stackoverflow.com/questions/53208/how-do-i-automatically-destroy-child-processes-in-windows

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-01-22 21:48:28 +00:00
dependabot[bot]
7ded78e78c build(deps): Bump wintun from 0.3.2 to 0.4.0 in /rust (#3341)
Bumps [wintun](https://github.com/nulldotblack/wintun) from 0.3.2 to
0.4.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/nulldotblack/wintun/releases">wintun's
releases</a>.</em></p>
<blockquote>
<h2>v0.4.0</h2>
<h2>Added</h2>
<ul>
<li><code>Adapter::get_mtu</code>, <code>set_dns_servers</code>, and
<code>Adapter::get_active_network_interface_gateways</code>: <a
href="https://redirect.github.com/nulldotblack/wintun/pull/13">nulldotblack/wintun#13</a></li>
<li><code>Error::ShuttingDown</code>: <a
href="https://redirect.github.com/nulldotblack/wintun/pull/14">nulldotblack/wintun#14</a></li>
</ul>
<h3>Breaking Changes</h3>
<ul>
<li>Adding the <code>ShuttingDown</code> variant to
<code>wintun::Error</code> breaks exhastive matches on previous
versions. <code>wintun::Error</code> is now marked
<code>#[non_exhaustive]</code> to make future additions backwards
compatable</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/nulldotblack/wintun/blob/main/CHANGELOG.md">wintun's
changelog</a>.</em></p>
<blockquote>
<h2>[0.4.0] - 2024-01-12</h2>
<h2>Added</h2>
<ul>
<li><code>Adapter::get_mtu</code>, <code>set_dns_servers</code>, and
<code>Adapter::get_active_network_interface_gateways</code>: <a
href="https://redirect.github.com/nulldotblack/wintun/pull/13">nulldotblack/wintun#13</a></li>
<li><code>Error::ShuttingDown</code>: <a
href="https://redirect.github.com/nulldotblack/wintun/pull/14">nulldotblack/wintun#14</a></li>
</ul>
<h3>Breaking Changes</h3>
<ul>
<li>Adding the <code>ShuttingDown</code> variant to
<code>wintun::Error</code> breaks exhastive matches on previous
versions. <code>wintun::Error</code> is now marked
<code>#[non_exhaustive]</code> to make future additions backwards
compatable</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/nulldotblack/wintun/commits/v0.4.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=wintun&package-manager=cargo&previous-version=0.3.2&new-version=0.4.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>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-01-22 21:03:17 +00:00
Reactor Scram
3743e5199b feat(windows): detect network changes and log when connlib should stop / start / restart (#3262)
Closes #3000
2024-01-22 19:28:51 +00:00
Reactor Scram
a7dfd46be0 feat(windows): prototype module for IPC (#3304)
To work around #2975 I want to run connlib in a subprocess.
We're already using Tokio' `named_pipe` module for deep links, so I made
a generic request-response IPC system with it.

This can get merged in as its own PR, and the actual moving of the
connlib `Session` will be a later PR atop this.
2024-01-22 18:26:48 +00:00
Reactor Scram
2162a7c618 refactor(windows): move debug subcommands closer to their code and further from production subcommands (#3307) 2024-01-22 17:03:56 +00:00
Jamil
e342a07e32 Use INFO for phoenix-channel portal connection (#3328)
Will help debug connection issues to the portal
2024-01-19 22:08:55 -08:00