Commit Graph

42 Commits

Author SHA1 Message Date
Reactor Scram
9b7c5d4ebd feat(windows): use ProgramData to store device ID instead of per-user… (#3172)
Fulfills #3159.

This means the device ID is only tied to the Windows install instead of
the user account. I also fixed up the logs and errors for that module
real quick since I was already there.
2024-01-11 21:57:55 +00:00
Reactor Scram
b8aa9fcc9d feat(windows): When the tunnel is ready, show a notification (#3166)
This is handy since the systray icon is hidden by default:


![image](https://github.com/firezone/firezone/assets/13400041/7c434538-8baf-46ca-92db-1fea97e84f41)

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-01-11 18:16:06 +00:00
Jamil
4f37bfab93 refactor(connlib): Remove unused on_error callback (#3162)
Fixes #3161 
Fixes #2867
2024-01-11 12:42:41 +00:00
Reactor Scram
a63f178eff feat(windows): switch to the new auth flow per #2823 (#3147)
Also refactored to extract an auth state machine. The auth logic
previously was scattered throughout the GUI module, which would make it
hard to audit. Because of the refactoring I was able to add some simple
unit tests.
2024-01-10 23:36:17 +00:00
Reactor Scram
8fddde371e feat(windows): log Git version used to build the client (#3144)
Fulfills #3141 

It took a little longer than I expected but since I'll be leaving the
client running all the time even on my dev laptop, I want to easily see
what version I built, even if I've changed branches since building it.
2024-01-10 01:10:36 +00:00
Reactor Scram
33133d7448 feat(windows): new module to listen for network changes (#3137)
This isn't hooked up to the GUI yet, it's a debug subcommand.

I overheard that the other clients rebuild the tunnel when they change
networks, I think? And this might be useful for debugging the issue
where Chrome / other browsers don't flush their TCP connections when the
tunnel comes up. It's also reference code for how to use COM interfaces
in Rust. The official samples are a little sparse. So I wanted to get
this checked in.


![image](https://github.com/firezone/firezone/assets/13400041/9f9c576e-c56f-4d7c-93f4-6e92eace5914)
2024-01-09 20:58:54 +00:00
Reactor Scram
23f8d1f904 wip(windows): make sure app panics show up in the logs (#3085)
Related to this discussion
https://github.com/firezone/firezone/pull/2990#discussion_r1439629571

Add a dependency on the `tracing-panic` crate. This is about 100 lines
of code that adds a panic handle so app panics get a line number, file
name, etc. in the logs. No backtrace I think since we stripe symbols for
release builds. I _think_ the line numbers are baked into the panic
macro so those might still stay.

@conectado I should remove the debug command before closing it, right?
2024-01-08 19:17:17 +00:00
Reactor Scram
d8264cf664 feat(windows): implement export logs as zip (#3009)
This will be useful if I'm doing production-like testing in the Windows
Server VM.
2024-01-04 20:35:59 +00:00
Reactor Scram
3a4f2cf9c0 fix(windows): set MTU on tunnel interface (#2990) 2024-01-03 23:37:38 +00:00
Jamil
1251397651 fix(ios/android): Pass device name and os version as overrides over connect (#3036)
Fixes #3035 
Fixes #3037 

# Before

<img width="738" alt="Screenshot 2023-12-28 at 8 05 31 AM"
src="https://github.com/firezone/firezone/assets/167144/c7ab4d74-672c-4536-97fe-f75d8d158bfb">

<img width="546" alt="Screenshot 2023-12-28 at 6 12 30 PM"
src="https://github.com/firezone/firezone/assets/167144/1bd4ba98-d11d-4277-bd14-b0afcdf78119">

# After

<img width="742" alt="Screenshot 2023-12-28 at 10 48 31 AM"
src="https://github.com/firezone/firezone/assets/167144/96054f82-069f-47f7-862c-986455ef76c0">
<img width="744" alt="Screenshot 2023-12-28 at 6 29 37 PM"
src="https://github.com/firezone/firezone/assets/167144/4ffc19b6-7c87-4ccb-bcfe-cb0e76fe95b7">
2024-01-03 20:08:33 +00:00
Reactor Scram
ed3e76894a wip(windows): impl get_host_name (#3089)
Resolves #3082 
I can remove the debug subcommand before merging. I just wanted to
confirm it gets my laptop's hostname.

connlib already has an indirect dependency on `hostname` via Hickory, so
I just used that.


![image](https://github.com/firezone/firezone/assets/13400041/e1adada4-f3e9-47be-828e-3e1d1cb69e83)
2024-01-02 21:49:57 +00:00
Reactor Scram
3b1667cfe3 feat(windows): show whether files are still being counted (#3007)
I've also removed the 200 ms sleep I was using for debugging.

This does mean the GUI flashes through a bunch of messages when you
first open the tab. We could use a timer to hide those later on.
2024-01-02 20:30:12 +00:00
Reactor Scram
5c54a945ec fix(windows): app title in Task Manager (#3003)
Didn't realize shortDescription shows up as the name in Task Manager.
That "The " looks weird in there.
2023-12-22 22:19:47 +00:00
Reactor Scram
82604139ce refactor(windows): remove ResourceDisplay (#3002)
... and move its methods into ResourceDescription.

This was a TODO from some pull request in the last few days. I assume
the goal is to share this function between all clients if needed. It
doesn't reduce the number of lines of code, since I could have removed
ResourceDisplay and done this on-the-fly when building the systray menu,
as an alternative.
2023-12-22 22:18:53 +00:00
Reactor Scram
fc88c06398 refactor(windows): break apart 'run_controller' into smaller handlers… (#2988)
… to reduce merge conflicts and un-indent them
2023-12-22 21:42:34 +00:00
Reactor Scram
d624031d9f feat(windows): add DLL for aarch64 but don't run it in CI/CD (#2989) 2023-12-22 00:48:29 +00:00
Reactor Scram
09bfb72d3b refactor(windows): don't block connlib callbacks (#2960)
The code is not pretty but if I land this then I can make it pretty
later.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Gabi <gabrielalejandro7@gmail.com>
2023-12-21 21:03:24 +00:00
Gabi
5edfe80eb0 connlib: tune disconnect parameters (#2977)
Should fix #2946 (still testing, trying to reproduce the error reported
in the issue)
2023-12-21 19:37:07 +00:00
Reactor Scram
d25bbf5582 fix(windows): give the encrypted credential a unique name (#2972)
I found out `keyring-rs` wasn't doing "firezone/token" internally, so
our credential was just "token", which is too generic. I changed it to
use our domain so it's "dev.firezone.client/token".
2023-12-20 22:55:03 +00:00
Reactor Scram
6ebbe746e8 feat(windows): count log files (#2964)
There's a 200 ms delay between each file, for debugging. It's nice to
demo how it thinks, but it needs to go behind a fault injection flag or
be removed completely before merging.


![image](https://github.com/firezone/firezone/assets/13400041/af364170-0e76-45fa-83f2-521b3de679de)
2023-12-20 22:38:37 +00:00
Reactor Scram
7e6f2621b4 feat(windows): Handle routes and DNS (#2889)
Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-12-20 19:44:53 +00:00
Reactor Scram
f284e06014 refactor(windows): extract modules from gui module (#2961)
So everything in `gui` is controller logic.
2023-12-20 01:54:55 +00:00
Reactor Scram
61bff3b1ed fix(windows): copy default debug and release settings from Android (#2963)
and fix a couple other settings.
2023-12-20 01:43:58 +00:00
Reactor Scram
0beafbfb9e refactor(windows): fix up MSI installer package and try to build it in CI (#2938) 2023-12-20 01:42:03 +00:00
Reactor Scram
8951be1ad2 fix(windows): disconnect tunnel on sign-out (#2932) 2023-12-20 00:51:27 +00:00
Jamil
b28e99cdab chore(ci): Use 1.0.0 as version base (#2949)
Fixes #2948 

So it seems that it's easiest just to use an old-fashioned semver
string. This means we'll need to keep a version matrix in the docs of
which components are supported and for how long, but it's better than
having different version schemes for different Firezone components
altogether.
2023-12-19 14:19:16 +00:00
Reactor Scram
64f76f5edb feat(windows): Elevate with UAC automatically on startup (#2913)
Automatically write the wintun.dll file on startup and then detect
whether we need to elevate to admin privileges.

I check for privileges by making a test tunnel, so I did #2758 as part
of this, which bundles the DLL inside the exe, and then the exe deploys
it.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-12-18 23:54:45 +00:00
Reactor Scram
a40d550bb0 refactor(windows): remove unused code, redundant platform checks (#2937)
Removes local_webserver module and many redundant stubs for Unix
2023-12-18 22:53:18 +00:00
Reactor Scram
f19b8fc5de fix(windows): put the bundle version back in tauri.conf.json to fix CI (#2952)
PR #2949 will make this redundant and I'll remove it from
tauri.conf.json again
2023-12-18 13:17:48 -06:00
Reactor Scram
364d415b67 fix(windows): #2927 - Use Cargo.toml version instead of tauri.conf.json (#2936) 2023-12-17 17:12:25 +00:00
Reactor Scram
8fcc99ae14 windows: fix deep links (#2903)
Stacked on PR #2888

This will fix #2878 by setting some Windows security permissions to let
non-admin clients connect to a named pipe server owned by an admin
process.

It should also give us a path to fix 2808 (If I link it, Github assumes
this PR closes that issue?), since it'll be our own code instead of
tauri-plugin-deep-link, and we can just choose not to panic. I'm using
Tokio's `named_pipe` module where that panic happens, and Tokio is good
about just returning Results instead of panicking.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-12-15 19:17:55 +00:00
Reactor Scram
aa46089dd1 windows: use settings log_filter instead of env var (#2888)
Stacked on PR #2883

There will be more changes after this PR, these features are still
broken:
- Can't change filter at runtime yet, you have to restart the client app
- connlib and GUI are sending logs to the same connlib logs files, they
should be separated

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-12-13 23:57:52 +00:00
Reactor Scram
d1a7211f64 windows: Integrate wintun, run the VPN (#2883)
With this one, ICMP and TCP work, but the client doesn't set up routes
or handle DNS yet, so I've been using `netsh` to fake that.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-12-13 23:19:36 +00:00
Reactor Scram
cd3114cc1d windows: tell Windows that our release builds should always run as admin (#2838)
It'll show UAC when you first run the app. After that we can open and
close the VPN network adapter without showing more UAC dialogs since we
have sudo powers.
2023-12-12 17:49:32 +00:00
Reactor Scram
a339f5b437 feat(windows): generate device ID and persist it on disk (#2840)
Relating to #2697 and #2711

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2023-12-12 17:46:26 +00:00
Reactor Scram
5853b13794 windows: add module to install the wintun.dll by embedding it in the client's exe and then copying it out at runtime (#2843)
Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-12-12 16:28:48 +00:00
Reactor Scram
a8c0c5255f windows: add example / test binary to keep debugging code out of the main exe (#2822)
It doesn't run with `--example` because Tauri's build process doesn't
seem to be compatible with that.
But it does build the permissions test exe in CI. I might change that a
general test exe later so that I don't have to add more build targets.

It adds about 5 minutes to the CI, sccache only seems to speed up the
build for the 2nd exe a tiny bit.
2023-12-09 20:43:27 +00:00
Reactor Scram
7a9c1321dc windows: get actor_name from auth callback (#2820)
Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-12-08 16:39:31 +00:00
Gabi
8e34457340 Add support for DNS sudomains (#2735)
This PR changes the protocol and adds support for DNS subdomains, now
when a DNS resource is added all its subdomains are automatically
tunneled too. Later we will add support for `*.domain` or `?.domain` but
currently there is an Apple split tunnel implementation limitation which
is too labor-intensive to fix right away.

Fixes #2661 

Co-authored-by: Andrew Dryga <andrew@dryga.com>
2023-12-08 00:16:42 -05:00
Reactor Scram
6d9360c150 windows: fix advanced settings loading, catch deep link error (#2811)
Based / Blocked on #2795

Fixes #2807 where I accidentally bail out of the controller task if the
settings file is missing or isn't valid in any way.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-12-07 18:28:28 +00:00
Reactor Scram
391ec1e50d Windows changes (#2795)
Many of these commits are in #2757 too.

This has changes like:
- Local webserver PoC
- API token is received from `firezone://` app link, saved in Windows
cred manager, and reloaded on future runs
- connlib GUI integration PoC
- Placeholder for Export Logs feature (just need to actually write the
zip file, and enable/disable the GUI buttons correctly)

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-12-07 17:07:35 +00:00
Reactor Scram
189a35f692 feat(windows): Tauri boilerplate and CI changes (#2742)
Trying to get CI/CD to produce firezone-windows-client.exe. Can't
remember if I need both a PR and a draft release or just the draft
release for that.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-11-30 19:50:43 +00:00